Skip to content

Commit

Permalink
Update API level to target Android 14 (API level 34). (#26)
Browse files Browse the repository at this point in the history
* changed home background

* add datastore to save if user signed in

* add ExpandableSearchBar.kt to TravellersActivity.kt

* fix fab on travellers activity

* Fix uploading photo to firestore and set sdk_version = 32

* update CI/CD

* update CI/CD

* update gradle and README.md

* update gradle and dependencies

* remove deprecated on back pressed and replaced with a new approach

* remove deprecated on back pressed and replaced with a new approach

* replaced deprecated getParcelable and getPackageInfo methods

* upgraded koin and okhttp version

* upgraded firebase_bom_version

* Fix updating the the number of visited countries

* upgrade koin version

* add org.gradle.unsafe.configuration-cache-problems=warn

* increment version to 2.0.8(21)

* increment java version to 17 in ci/cd

* Update dependencies

* Add onion architecture pattern to README.md

* Add link on the original documentation of the onion architecture in the README.md

* Add link to app center build

* Move di component to presentation component and allow admin to see all users

* increment version to 2.1.0 (23)

* ✨ chore(README): update build status badge and add Google Play badge
- Update build status badge in README.md
- Add Google Play badge to README.md
- Update build.gradle to version 2.1.1
- Update Gradle wrapper distributionUrl to version 8.2-all.zip
- Refactor FirestoreDatabaseSourceImpl.kt for better readability
- Update GitHub Actions workflow to ignore master branch for pushes

Signed-off-by: Dmytro Turskyi <dmytro.turskyi@gmail.com>

* 🚀 chore(android_ci): Update JDK version to 17 and fix capitalization in workflow steps

Updated the JDK version to 17 in the workflow setup and corrected capitalization in the steps for generating and uploading the release APK. Also added the serviceCredentialsFile for Firebase App Distribution.

Signed-off-by: Dmytro Turskyi <dmytro.turskyi@gmail.com>

* Attempt to fix CI

Signed-off-by: Dmytro Turskyi <dmytro.turskyi@gmail.com>

* Attempt to fix ci

Signed-off-by: Dmytro Turskyi <dmytro.turskyi@gmail.com>

---------

Signed-off-by: Dmytro Turskyi <dmytro.turskyi@gmail.com>
  • Loading branch information
Turskyi authored Jul 20, 2024
1 parent 1010ca2 commit 4a98a93
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 42 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/android_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build & upload to Firebase App Distribution

on:
push:
branches:
- dev
branches-ignore:
- master

jobs:
build:
Expand All @@ -12,19 +12,17 @@ jobs:

steps:
- uses: actions/checkout@v2.3.3

- name: Set up JDK environment(JDK 11)
uses: actions/setup-java@v1.4.3
- name: Set up JDK environment (JDK 17)
uses: actions/setup-java@v2
with:
java-version: 17

java-version: '17'
distribution: 'temurin' # Eclipse Temurin https://adoptium.net/
- name: Generate Release APK
run: ./gradlew assembleRelease

- name: upload artifact to Firebase App Distribution
- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_ANDROID_APPID}}
appId: ${{ secrets.FIREBASE_ANDROID_APPID }}
token: ${{secrets.FIREBASE_TOKEN}}
groups: testers
releaseNotes: "Travelling Pro App Build"
Expand Down
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua)
[![Build status](https://build.appcenter.ms/v0.1/apps/add3e42d-20e7-466d-9300-e42abf3e6b76/branches/master/badge)](https://appcenter.ms)
[![Build & upload to Firebase App Distribution](https://github.com/Turskyi/travelling_pro/actions/workflows/android_ci.yml/badge.svg?event=push)](https://github.com/Turskyi/travelling_pro/actions/workflows/android_ci.yml)
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Turskyi/travelling_pro">

# Travelling Pro [![Build status](https://build.appcenter.ms/v0.1/apps/add3e42d-20e7-466d-9300-e42abf3e6b76/branches/master/badge)](https://appcenter.ms)
# Travelling Pro

An Android mobile application to help collect all countries that you have visited and see how many
countries visited other members of the app.
Expand Down Expand Up @@ -79,17 +82,23 @@ release app bundle to **Google Play** after every push to **master** branch;

• Screenshots:
<!--suppress CheckImageSize -->
<img src="screenshots/device-2020-06-05-085243.png" width="200" >
<img src="screenshots/device-2020-06-05-085456.png" width="200" >
<img src="screenshots/device-2020-06-05-090524.png" width="200" >
<img src="screenshots/device-2020-06-28-164528.png" width="300" >
<img src="screenshots/device-2020-10-18-103522.png" width="200" >
<img src="screenshots/device-2020-10-18-103111.png" width="200" >
<img src="screenshots/device-2020-06-05-090129.png" width="200" >
<img src="screenshots/device-2020-06-05-091508.png" width="200" >
<img src="screenshots/device-2020-06-05-094730.png" width="300" >
<img src="screenshots/device-2020-06-28-162902.png" width="400" >
<img src="screenshots/device-2020-06-05-085243.png" width="200" alt="screenshot">
<img src="screenshots/device-2020-06-05-085456.png" width="200" alt="screenshot">
<img src="screenshots/device-2020-06-05-090524.png" width="200" alt="screenshot">
<img src="screenshots/device-2020-06-28-164528.png" width="300" alt="screenshot">
<img src="screenshots/device-2020-10-18-103522.png" width="200" alt="screenshot">
<img src="screenshots/device-2020-10-18-103111.png" width="200" alt="screenshot">
<img src="screenshots/device-2020-06-05-090129.png" width="200" alt="screenshot">
<img src="screenshots/device-2020-06-05-091508.png" width="200" alt="screenshot">
<img src="screenshots/device-2020-06-05-094730.png" width="300" alt="screenshot">
<img src="screenshots/device-2020-06-28-162902.png" width="400" alt="screenshot">

**Code Readability:** code is easily readable with no unnecessary blank lines, no unused variables
or methods, and no commented-out code, all variables, methods, and resource IDs are descriptively
named such that another developer reading the code can easily understand their function.

## Download

<a href="https://play.google.com/store/apps/details?id=io.github.turskyi.travellingpro" target="_blank">
<img src="https://play.google.com/intl/en_gb/badges/static/images/badges/en_badge_web_generic.png" width=240 alt="google play badge"/>
</a>
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
buildscript {
ext {
// sdk versions
compile_sdk_version = 33
compile_sdk_version = 34
skd_preview = "UpsideDownCake"
build_tools_version = "30.0.3"
min_sdk_version = 21
target_sdk_version = 33
target_sdk_version = 34
// last version is here [https://play.google.com/console/u/0/developers/6867856033872987263/app/4972072127034375090/releases/overview]
version_code = 23
version_name = "2.1.0"
version_code = 24
version_name = "2.1.1"
}
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'com.android.tools.build:gradle:8.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21"
// Google Services plugin (used with firebase)
classpath "com.google.gms:google-services:$google_services_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1011,21 +1011,29 @@ class FirestoreDatabaseSourceImpl(
visitedCountriesRef.get()
.addOnSuccessListener { queryDocumentSnapshots: QuerySnapshot ->
val countOfVisitedCountries: Int = queryDocumentSnapshots.size()
// getting total number of all users
usersRef.get().addOnSuccessListener { snapshots: QuerySnapshot ->
val userCount: Int = snapshots.size()
// getting number of users with bigger counter
usersRef.whereGreaterThan(KEY_COUNTER, countOfVisitedCountries).get()
.addOnSuccessListener { documents: QuerySnapshot ->
val countOfTopTravellers: Int = documents.size()
/* getting percent of travellers who visited more countries
* than current user */
onSuccess(countOfTopTravellers * 100 / userCount)
}.addOnFailureListener { exception: java.lang.Exception ->
onError.invoke(exception)
}
}.addOnFailureListener { exception: java.lang.Exception ->
onError.invoke(exception)
if (countOfVisitedCountries == 0) {
onSuccess(100)
} else {
// getting total number of all users
usersRef.get().addOnSuccessListener { snapshots: QuerySnapshot ->
val userCount: Int = snapshots.size()
// getting number of users with bigger counter
usersRef.whereGreaterThan(KEY_COUNTER, countOfVisitedCountries).get()
.addOnSuccessListener { documents: QuerySnapshot ->
if (userCount == 0) {
onSuccess(100)
} else {
val countOfTopTravellers: Int = documents.size()
/* getting percent of travellers who visited more countries
* than current user */
onSuccess(countOfTopTravellers * 100 / userCount)
}
}.addOnFailureListener { exception: java.lang.Exception ->
onError.invoke(exception)
}
}.addOnFailureListener { exception: java.lang.Exception ->
onError.invoke(exception)
}
}
}.addOnFailureListener { exception: java.lang.Exception ->
onError.invoke(exception)
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip

0 comments on commit 4a98a93

Please sign in to comment.