Skip to content

Commit

Permalink
2.0.7(20) (#20)
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
  • Loading branch information
Turskyi authored Dec 30, 2022
1 parent fc7535a commit b453dd0
Show file tree
Hide file tree
Showing 32 changed files with 423 additions and 294 deletions.
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ buildscript {
min_sdk_version = 21
target_sdk_version = 33
// last version is here [https://play.google.com/console/u/0/developers/6867856033872987263/app/4972072127034375090/releases/overview]
version_code = 19
version_name = "2.0.6"
version_code = 20
version_name = "2.0.7"
}
repositories {
google()
Expand Down Expand Up @@ -59,7 +59,9 @@ subprojects {
implementation "com.google.firebase:firebase-storage-ktx"

// authentication (to get current user etc.)
implementation "com.google.firebase:firebase-auth"
implementation('com.google.firebase:firebase-auth-ktx') {
exclude module: "browser"
}

// avoids "Service not registered" exception
implementation "com.google.android.gms:play-services-basement:$play_services_basement_version"
Expand Down Expand Up @@ -97,6 +99,6 @@ ext {
SIGNING_KEY_RELEASE_KEY_PASSWORD = getParam("SIGNING_KEY_RELEASE_KEY_PASSWORD")
}

task clean(type: Delete) {
tasks.register('clean') {
delete rootProject.buildDir
}
8 changes: 8 additions & 0 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ plugins {
}

android {
//noinspection GroovyAssignabilityCheck
//noinspection GrDeprecatedAPIUsage
compileSdkVersion rootProject.compile_sdk_version
//noinspection GroovyAssignabilityCheck
//noinspection GrDeprecatedAPIUsage
buildToolsVersion rootProject.build_tools_version

//noinspection GroovyAssignabilityCheck
defaultConfig {
minSdkVersion rootProject.min_sdk_version
targetSdkVersion rootProject.target_sdk_version
Expand All @@ -18,13 +23,16 @@ android {
consumerProguardFiles "consumer-rules.pro"
}

//noinspection GroovyAssignabilityCheck
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
//noinspection GroovyAssignabilityCheck
//noinspection GroovyMissingReturnStatement
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ import kotlinx.coroutines.flow.map
import org.koin.core.component.KoinComponent
import java.io.IOException

class DataStoreDatabaseSourceImpl(application: Application) : KoinComponent,
class DataStoreDatabaseSourceImpl(private val application: Application) : KoinComponent,
DataStoreDatabaseSource {

companion object {
// constants for datastore
private const val KEY_AUTHORIZATION = "authorization"
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(
name = "user_preferences",
)
}

private val Context.dataStore by preferencesDataStore("user_preferences")
private val dataStore: DataStore<Preferences> = application.dataStore

override val preferencesFlow: Flow<AuthorizationPreferences> = dataStore.data
override val preferencesFlow: Flow<AuthorizationPreferences> = application.dataStore.data
.catch { exception: Throwable ->
if (exception is IOException) {
emit(emptyPreferences())
Expand All @@ -40,7 +40,7 @@ class DataStoreDatabaseSourceImpl(application: Application) : KoinComponent,
}

override suspend fun updateAuthorization(authorization: Authorization) {
dataStore.edit { preferences: MutablePreferences ->
application.dataStore.edit { preferences: MutablePreferences ->
preferences[PreferencesKeys.AUTHORIZATION] = authorization.name
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("unused", "unused")
@file:Suppress("unused")

package io.github.turskyi.data.datasources.local.entities

Expand Down
Loading

0 comments on commit b453dd0

Please sign in to comment.