Skip to content

Master - koin (do not merge) #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 84 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9e97602
test
Jun 9, 2020
2c17a81
encrypted google api keys
Jun 9, 2020
57c6409
Added details to Readme and included gradle.properties as secret file
Jun 9, 2020
125460b
added secrets Readme and updated .gitignore
Jun 9, 2020
49373a1
Initial commit
amaury901130 May 3, 2019
a4df0a2
Viewmodel comunication with views
amaury901130 Jul 15, 2020
596736d
Fix comment
amaury901130 Jul 15, 2020
0d74489
Change delegate name to listener
amaury901130 Jul 15, 2020
898360c
Merge pull request #32 from rootstrap/enhacement/view_model_delegations
amaury901130 Jul 22, 2020
f2ff083
Adding permissions manager
amaury901130 Aug 11, 2020
2989c57
Update app/src/main/java/com/rootstrap/android/util/permissions/Permi…
amaury901130 Aug 13, 2020
c2071d4
Fix comments
amaury901130 Aug 13, 2020
f6505b1
Merge pull request #34 from rootstrap/feature/permission_manager
amaury901130 Aug 13, 2020
b64b5e9
update apicall with coroutines
amaury901130 Dec 16, 2020
5279a4f
Update network layer with coroutine
amaury901130 Dec 16, 2020
aee5c38
fix comments
amaury901130 Dec 17, 2020
8de6f63
fix comments
amaury901130 Dec 18, 2020
62f5ff2
Merge pull request #36 from rootstrap/feature/corutines_network_layer
amaury901130 Dec 18, 2020
cb1cbb9
refactor view models
amaury901130 Dec 18, 2020
4c49343
Merge pull request #38 from rootstrap/fix/viewmodels
amaury901130 Dec 18, 2020
e84ea9b
updated kotlin plug in version
aguskoll Jan 18, 2021
294c370
update libraries
aguskoll Jan 21, 2021
59d51c3
added GitHub workflows for CI and automated release for Dev and Staging
sebalopez Jan 25, 2021
a009a15
dialog refactor and base fragment implementation
aguskoll Feb 4, 2021
68ba8f9
libraries updates
aguskoll Feb 4, 2021
97e2ffd
code clean up
aguskoll Feb 4, 2021
30683b0
kotlin scope functions
aguskoll Feb 4, 2021
072bbf6
refactor when by if statement
aguskoll Feb 4, 2021
0f097a1
kotlin scope function
aguskoll Feb 4, 2021
980742a
Merge pull request #40 from rootstrap/enhancement/libraries-updates
agustinkoll-rootstrap Feb 17, 2021
406e223
Replace ViewModel's listener with LiveData and Observers (#41)
lmiotti Feb 25, 2021
88e8da8
Hilt (#42)
lmiotti Mar 1, 2021
3463dbf
Add KotlinJsonAdapterFactory to Moshi
marcossalto Mar 2, 2021
3d4da68
Pull request template.
amaury901130 Mar 3, 2021
4919fec
Merge branch 'master' into feature/github-actions
sebalopez Mar 3, 2021
4dabba2
Merge pull request #43 from rootstrap/feature/kotlin_json_adapter_fac…
marcossalto Mar 3, 2021
d62a5b3
secure preferences
amaury901130 Mar 10, 2021
b08e311
add pref tests
amaury901130 Mar 10, 2021
c536fa8
Delete misc.xml
amaury901130 Mar 12, 2021
2d54119
Delete runConfigurations.xml
amaury901130 Mar 12, 2021
e8b0d5c
Merge pull request #39 from rootstrap/feature/github-actions
devops-rs Apr 13, 2021
f0b6e77
Merge pull request #48 from rootstrap/enhacement/security
amaury901130 Jul 12, 2021
e0a8ec6
Update Kotlin, Hilt, and all the dependencies. Fix upgrading issues
hrodrick Oct 21, 2021
9242d49
Update Lifecycle and Room to AndroidX. Fix manifest merger targetting…
Nov 3, 2021
afd21b7
Merge pull request #51 from hrodrick/feature/update-project
hrodrick Nov 11, 2021
e5642b4
Update README.md
guillepijuan Dec 11, 2021
4480c94
Add clean architecture
marcossalto Dec 13, 2021
93f55ca
Update gradle
marcossalto Dec 13, 2021
b97e6ea
sign in and sign up vm test
aguskoll Jan 5, 2022
a83ba67
main classes moved to a package
aguskoll Jan 5, 2022
06e469e
not required changes
aguskoll Jan 5, 2022
0530e7b
not required changes2
aguskoll Jan 5, 2022
32ba4da
not required changes3
aguskoll Jan 5, 2022
6cff9c8
Add clean architecture
marcossalto Jan 7, 2022
6ec91eb
view models refactor
aguskoll Jan 10, 2022
6422aa2
get api refactor
aguskoll Jan 10, 2022
1fa4dd6
removed unused inject and added dependencies
aguskoll Jan 10, 2022
73f57c2
Add Koin scopes
marcossalto Jan 10, 2022
53751e9
Merge branch 'feature/clean_architecture_koin' of https://github.com/…
marcossalto Jan 10, 2022
8b06b7f
Merge pull request #57 from rootstrap/unit_test
agustinkoll-rootstrap Jan 11, 2022
4e4e265
moved analytics into data and activities into packages
aguskoll Jan 11, 2022
a60e5be
removed scope view model
aguskoll Jan 11, 2022
d733a6f
unit test fixed
aguskoll Jan 11, 2022
7030a85
removed unused var
aguskoll Jan 11, 2022
35d88d1
removed view package
aguskoll Jan 12, 2022
fdc2e4d
removed comment
aguskoll Feb 2, 2022
925539e
removed comment
aguskoll Feb 2, 2022
2cb48de
Merge branch 'master-koin' into feature/clean_architecture_koin
aguskoll Feb 2, 2022
b89a416
removed fastlane dev flavor
aguskoll Feb 2, 2022
3bd8c71
removed fastlane dev flavor
aguskoll Feb 2, 2022
31bd88c
Merge pull request #58 from rootstrap/feature/clean_architecture_koin
agustinkoll-rootstrap Feb 25, 2022
4cb1f4b
Merge pull request #1 from rootstrap/master
hrodrick Feb 25, 2022
b258ec0
Merge pull request #2 from rootstrap/master-koin
hrodrick Feb 25, 2022
f647fab
Migrated Groovy (*.gradle) to Kotlin (*.gradle.kts)
marcossalto Mar 2, 2022
5249975
Removed increment_version_code from fastlane
marcossalto Mar 2, 2022
971bb71
Renamed gradle file path
marcossalto Mar 2, 2022
e0d2f79
Replaced constant VERSION_CODE by a number due to fastlane incompatib…
marcossalto Mar 2, 2022
6d08b7a
Fixed minor changes from code review
marcossalto Mar 14, 2022
300c07c
Merge pull request #61 from rootstrap/feature/migrate_gradle_groovy_t…
marcossalto Mar 15, 2022
cb0f2bd
Added utility extensions useful for every project
Feb 25, 2022
ec49c7c
Fix kotlin doc typo
Feb 25, 2022
2f345a7
Mention new extension utilities in README.md
hrodrick Apr 21, 2022
9b71ae8
Add Kdocs and constant for italics skew factor
Apr 21, 2022
79b5be3
Merge pull request #60 from hrodrick/feature/utility-extensions
hrodrick Apr 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .circleci/config.yml

This file was deleted.

24 changes: 23 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,26 @@
# Comma-separated list of rules to disable (Since 0.34.0)
# Note that rules in any ruleset other than the standard ruleset will need to be prefixed
# by the ruleset identifier.
disabled_rules=import-ordering,experimental:annotation
disabled_rules=no-wildcard-imports,import-ordering,experimental:annotation
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL

ij_kotlin_line_comment_at_first_column = false
ij_kotlin_line_comment_add_space = true

# These options can keep to use single name import
ij_kotlin_name_count_to_use_star_import = 2147483647
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647

ij_kotlin_keep_blank_lines_in_declarations = 1
ij_kotlin_keep_blank_lines_in_code = 1
ij_kotlin_keep_blank_lines_before_right_brace = 0

# optional but recommended
ij_kotlin_align_multiline_parameters = false

# optional but recommended
ij_continuation_indent_size = 4

# Android specific rules
ij_kotlin_import_nested_classes = false
ij_kotlin_imports_layout = *,^
83 changes: 83 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Continuous Integration

on:
push:
pull_request:

env:
LANG: en_US.UTF-8
# Notifications
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_URL }}
SLACK_CHANNEL: '#dev-builds'

jobs:

ci:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Fastlane and required plugins
run: |
sudo gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
bundle install --path vendor/bundle
# Runs build with Gradle
- name: Build with Fastlane
run: bundle exec fastlane debug
- name: Send notification of build result
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: '${{github.repository}} Dev build status is ${{ job.status }}'
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if: always()


release:
if: ${{ github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
timeout-minutes: 45
env:
# S3
FOLDER: android-base
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
KEYS_BUCKET: ${{ secrets.AWS_S3_KEYS_BUCKET }}
# Android Release
JSON_KEYFILE: google-api.json
RELEASE_STORE_FILE: key.keystore
RELEASE_STORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_STORE_PASSWORD }}
RELEASE_KEY_ALIAS: debug
RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}
# Notifications
SLACK_URL: ${{ secrets.SLACK_URL }}
SLACK_CHANNEL: '#dev-builds'
steps:
- name: Checkout
uses: actions/checkout@v2
# Downloads certificate, private key and Firebase file
- name: Download code signing items
run: |
aws s3 cp s3://$KEYS_BUCKET/$FOLDER/ . --recursive
mv ./android/$RELEASE_STORE_FILE ./app/$RELEASE_STORE_FILE
- name: Install Fastlane and required plugins
run: |
sudo gem install bundler
bundle install --path vendor/bundle
# Build with Gradle and submit to Play Store
- name: Submit Development build with Fastlane
if: ${{ github.ref == 'refs/heads/develop' }}
run: bundle exec fastlane deploy_dev
- name: Submit Staging build with Fastlane
if: ${{ github.ref == 'refs/heads/master' }}
run: bundle exec fastlane deploy_staging
- name: Send notification of build result
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: '${{github.repository}} ${{github.ref}} build submission status is ${{ job.status }}'
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if: always()

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
/.idea/assetWizardSettings.xml
/.idea/gradle.xml
/.idea/*
/secure/*
/app/prod/release/*
/fastlane/report.xml
.DS_Store
/build
/captures
.externalNativeBuild
.gitsecret/keys/random_seed
fastlane/report.xml
!*.secret
/secure/key.keystore
/secure/google-api.json
Binary file added .gitsecret/keys/pubring.kbx
Binary file not shown.
Binary file added .gitsecret/keys/pubring.kbx~
Binary file not shown.
Binary file added .gitsecret/keys/trustdb.gpg
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitsecret/paths/mapping.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
secure/google-api.json:e494b2376306f39ea643ebe13156e4b885cddb64755a3a3fe4dd5f2807cb9a70
secure/key.keystore:6c70718b97803ac753020362b214a40762dc4ed95c4665648f86758c20ddbae9
gradle.properties:2a428ac440037c87d1001976c703d0ea412dee852aae78d9827f1307c4604545
8 changes: 6 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions .idea/misc.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ DEPENDENCIES
fastlane-plugin-increment_version_code

BUNDLED WITH
1.17.2
2.1.2
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,58 @@ to handle the server side authentication, in case you need to modify them:
## Usage
- You can use this open source project as a template of your new Android projects.

## Key File encryption

Build signing requires a developer-owned keystore. Location and credentials for it are specified in `gradle.properties`. Likewise submission to Google Play requires a Developer API key in .json format (`google-api.json`).
It is recommended that these files remains outside the source repo

We suggest using [git secret](https://git-secret.io/) as a simple and secure solution for keeping these sensitive files in the repo. See [Config](./secure/Readme.md) for detailed instructions.


## Build and Release with Fastlane

We provide configuration files for automating build, test and submission of the application using [Fastlane](https://docs.fastlane.tools/)

### Requirements

* Ensure JDK 1.8 is installed
* Ensure proper version of Android SDK command line tools is installed
* Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew cask install fastlane`

### Usage
Lanes for each deployment target example are provided with some basic behavior:
- Each target has two options: `debug_x` and `deploy_x`.
- Each option will:
- Increment the build number.
- Run `gradlew clean`
- Run `gradlew androidDependencies`
- Build the app (`gradle assemble`) for the target flavor.
- The `deploy` lanes will additionaly submit the APK to the corresponding track in the Play Store.

Check `fastlane/Appfile` and `fastlane/Fastfile` for more information.

## CI/CD configuration with Bitrise (updated on Dec 12th 2021)

We are going to start using a tool called Bitrise to configure the CI/CD pipelines for mobiles apps.

--> For Android apps you can find how to do it in this link: https://www.notion.so/rootstrap/Android-CI-CD-26d4abd4f2454224be8f617110147366

## Continuous Integration with GitHub Actions (DEPRECATED)

We provide an example workflow [cicd.yml](.github/workflows/cicd.yml) including two jobs for running under [GitHub Actions](https://docs.github.com/en/actions), which can be modified according to the specifics of each project:

* `ci`
* runs upon every push and PR
* installs Fastlane and runs `debug_dev` lane
* `release`
* runs upon every push to `develop` or `master`
* downloads keystore and Google api key from S3 (credentials need to be present in repo Secrets)
* installs Fastlane and runs `deploy_*` lane depending on branch (`Dev` if in `develop`, `Stsaging` if in `master`) - This could be easily modified to release `Prod` instead

## Analytics
- Add analytics manager:
1. Firebase
Expand All @@ -63,6 +115,20 @@ in order to track the login event.
- For MixPanel, you have to replace the API key:
`<string name="mixpanel_api_key">mixpanel_api_key</string>`


## Utility extensions
We have a bunch of pre-made extensions usually used on every project to accelerate feature development.
you can access them in the util.extensions package. They include but are not limited to :

- `Fragment.collectOnLifeCycle(...)` extension to reduce the boiler plate code and indentation when
collecting flows from a fragment.
- `ProgressBar.progressTo(...)` extension to animate progress updates in one line with ease
and with good support for older android versions.
- `TextView.setClickableKeyword(...)` extension to add clickable functions to words or prhases inside a
Textview, allowing to also change their color, font (for example, to bold the keyword), and underline
- `TextView.setColoredKeyword(...) ` extension to change the color of a word or prhase in a Textview.


## Code Quality Standards
In order to meet the required code quality standards, this project uses [Ktlint](https://github.com/pinterest/ktlint) and [Detekt](https://github.com/arturbosch/detekt)

Expand All @@ -78,3 +144,4 @@ NOTE: Remove the free LICENSE file for private projects or replace it with the c
**Android Base** is maintained by [Rootstrap](http://www.rootstrap.com) with the help of our [contributors](https://github.com/rootstrap/android-base/contributors).

[<img src="https://s3-us-west-1.amazonaws.com/rootstrap.com/img/rs.png" width="100"/>](http://www.rootstrap.com)

Loading