Skip to content
This repository was archived by the owner on Jan 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
45 changes: 27 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,24 @@ def applicationName = "S-Boom"

android {

compileSdkVersion 30
compileSdkVersion 31

defaultConfig {
applicationId "ru.frogogo.sboom"

minSdkVersion 23
targetSdkVersion 30

versionCode 8
versionName "1.0.0"
versionCode 10
versionName "1.0.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", applicationName + "-v" + versionCode + "(" + versionName + ")-" + getDate())

buildConfigField 'int', 'API_VERSION', '1'
buildConfigField 'boolean', 'DEBUG_STUFF', 'true'
buildConfigField "java.util.Date", "BUILD_TIME", "new java.util.Date(" + System.currentTimeMillis() + "L)"
buildConfigField 'String', 'PHONE_PREFIX', '"+7"'
}

signingConfigs {
Expand Down Expand Up @@ -72,6 +73,14 @@ android {

buildConfigField 'String', 'BASE_URL', '"https://sboom.herokuapp.com"'
}
zboom {
dimension 'server'

applicationId "ru.frogogo.zboom.demo"

buildConfigField 'String', 'BASE_URL', '"https://zboom-eu-staging.herokuapp.com"'
buildConfigField 'String', 'PHONE_PREFIX', '"+"'
}
}

buildTypes {
Expand Down Expand Up @@ -120,19 +129,19 @@ kapt {

dependencies {
// AndroidX
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.core:core-ktx:1.7.0'
// AppCompat https://developer.android.com/jetpack/androidx/releases/appcompat
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.4.0'
// Fragment https://developer.android.com/jetpack/androidx/releases/fragment
implementation 'androidx.fragment:fragment-ktx:1.3.6'
implementation 'androidx.fragment:fragment-ktx:1.4.0'
// ConstraintLayout https://developer.android.com/jetpack/androidx/releases/constraintlayout
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
// ViewPager2 https://developer.android.com/jetpack/androidx/releases/viewpager2
implementation "androidx.viewpager2:viewpager2:1.0.0"
// SwipeRefresh https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
// WorkManager https://developer.android.com/jetpack/androidx/releases/work
implementation 'androidx.work:work-runtime-ktx:2.6.0'
implementation 'androidx.work:work-runtime-ktx:2.7.1'

// Google Play Services https://developers.google.com/android/guides/setup
implementation 'com.google.android.gms:play-services-auth:19.2.0'
Expand All @@ -148,14 +157,14 @@ dependencies {
implementation "androidx.navigation:navigation-ui-ktx:$navVersion"

// ViewModel and LiveData https://developer.android.com/jetpack/androidx/releases/lifecycle
def lifecycleVersion = '2.3.1'
def lifecycleVersion = '2.4.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"

// Adapter Delegates https://github.com/sockeqwe/AdapterDelegates
def adapterDelegatesVersion = '4.3.0'
def adapterDelegatesVersion = '4.3.1'
implementation "com.hannesdorfmann:adapterdelegates4:$adapterDelegatesVersion"
implementation "com.hannesdorfmann:adapterdelegates4-kotlin-dsl-viewbinding:$adapterDelegatesVersion"

Expand All @@ -169,7 +178,7 @@ dependencies {
implementation "com.github.hadilq.liveevent:liveevent:1.2.0"

// WhatIf https://github.com/skydoves/WhatIf
implementation 'com.github.skydoves:whatif:1.1.0'
implementation 'com.github.skydoves:whatif:1.1.1'

// Coroutines https://github.com/Kotlin/kotlinx.coroutines
def coroutinesVersion = '1.5.2'
Expand All @@ -183,10 +192,10 @@ dependencies {
implementation 'com.redmadrobot:input-mask-android:6.0.0'

// Coil https://github.com/coil-kt/coil/
implementation 'io.coil-kt:coil:1.3.2'
implementation 'io.coil-kt:coil:1.4.0'

// Koin https://github.com/InsertKoinIO/koin
def koinVersion = '3.1.2'
def koinVersion = '3.1.4'
implementation "io.insert-koin:koin-android:$koinVersion"
implementation "io.insert-koin:koin-androidx-workmanager:$koinVersion"

Expand All @@ -197,7 +206,7 @@ dependencies {
implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion"

// OkHttp https://github.com/square/okhttp/
def okHttpVersion = '4.9.1'
def okHttpVersion = '4.9.3'
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$okHttpVersion"

Expand All @@ -216,7 +225,7 @@ dependencies {
implementation 'com.github.ajalt:timberkt:1.5.1'

// Firebase https://firebase.google.com/support/release-notes/android
implementation platform('com.google.firebase:firebase-bom:28.4.0')
implementation platform('com.google.firebase:firebase-bom:29.0.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-perf-ktx'
Expand Down Expand Up @@ -247,10 +256,10 @@ dependencies {
testImplementation 'org.amshove.kluent:kluent:1.68'

// Robolectric http://robolectric.org/getting-started/
testImplementation 'org.robolectric:robolectric:4.6.1'
testImplementation 'org.robolectric:robolectric:4.7.3'

// Junit 5 https://github.com/junit-team/junit5
def junit5Version = "5.7.2"
def junit5Version = "5.8.2"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5Version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5Version"
Expand All @@ -263,7 +272,7 @@ dependencies {
testImplementation 'androidx.arch.core:core-testing:2.1.0'

// MockK https://github.com/mockk/mockk
testImplementation 'io.mockk:mockk:1.12.0'
testImplementation 'io.mockk:mockk:1.12.1'

// Add field to BuildConfig
android.defaultConfig.buildConfigField 'String', 'RETROFIT_VERSION', "\"$retrofitVersion\""
Expand Down
45 changes: 45 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,51 @@
{
"client_id": "99713790578-110snv82qvlm88eteflcf05sueu4o1cr.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "99713790578-lied9f35g5i1er1k538ef5g1444mhum6.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "ru.frogogo.WhiteLabel-iOS.sboom",
"app_store_id": "1565327032"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:99713790578:android:3348cc8c23709ab5f388eb",
"android_client_info": {
"package_name": "ru.frogogo.zboom.demo"
}
},
"oauth_client": [
{
"client_id": "99713790578-110snv82qvlm88eteflcf05sueu4o1cr.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBmggdVETxVr4BYmlXjfQkeeaKkR7iV2pI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "99713790578-110snv82qvlm88eteflcf05sueu4o1cr.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "99713790578-lied9f35g5i1er1k538ef5g1444mhum6.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "ru.frogogo.WhiteLabel-iOS.sboom",
"app_store_id": "1565327032"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ open class BaseDelegationAdapter(
}

override fun setItems(items: MutableList<RecyclerViewItem>) {
this.setItems(items, null)
this.setItems(items, commitCallback = null)
}

fun setItems(items: MutableList<RecyclerViewItem>, commitCallback: (() -> Unit)?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package ru.frogogo.whitelabel.data.model.api.home

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import java.math.BigDecimal

@JsonClass(generateAdapter = true)
data class HomeProgress(
@Json(name = "current")
val current: Int,
val current: BigDecimal,
@Json(name = "target")
val target: Int,
val target: BigDecimal,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ru.frogogo.whitelabel.data.model.api.home
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import ru.frogogo.whitelabel.data.model.api.Photo
import java.math.BigDecimal

@JsonClass(generateAdapter = true)
data class HomePromotion(
Expand All @@ -13,7 +14,7 @@ data class HomePromotion(
@Json(name = "steps")
val steps: List<String>,
@Json(name = "price")
val price: Int,
val price: BigDecimal,
@Json(name = "discounted_price")
val discountedPrice: Int,
val discountedPrice: BigDecimal,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ru.frogogo.whitelabel.data.model.api.item

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import java.math.BigDecimal

@JsonClass(generateAdapter = true)
data class Item(
Expand All @@ -12,9 +13,9 @@ data class Item(
@Json(name = "image_url")
val imageUrl: String,
@Json(name = "price")
val price: Int,
val price: BigDecimal,
@Json(name = "discounted_price")
val discountedPrice: Int,
val discountedPrice: BigDecimal,
@Json(name = "specs")
val specs: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ru.frogogo.whitelabel.data.model.api.item

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import java.math.BigDecimal

@JsonClass(generateAdapter = true)
data class ItemInfo(
Expand All @@ -12,9 +13,9 @@ data class ItemInfo(
@Json(name = "image_url")
val imageUrl: String,
@Json(name = "price")
val price: Int,
val price: BigDecimal,
@Json(name = "discounted_price")
val discountedPrice: Int,
val discountedPrice: BigDecimal,
@Json(name = "specs")
val specs: String?,
@Json(name = "description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ru.frogogo.whitelabel.data.model.api.receipt
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import ru.frogogo.whitelabel.dictionary.ReceiptState
import java.math.BigDecimal
import java.util.Date

@JsonClass(generateAdapter = true)
Expand All @@ -12,7 +13,7 @@ data class Receipt(
@Json(name = "number")
val number: Int,
@Json(name = "sum")
val sum: Int,
val sum: BigDecimal,
@Json(name = "state")
val state: ReceiptState,
@Json(name = "timestamp")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package ru.frogogo.whitelabel.data.model.ui.home

import ru.frogogo.whitelabel.core.recycler.RecyclerViewItem
import java.math.BigDecimal

data class HomeProgressUiModel(
val current: Int,
val target: Int,
val current: BigDecimal,
val target: BigDecimal,
) : RecyclerViewItem {

override fun getId(): Any = "item_coupon_progress"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import android.os.Parcelable
import androidx.annotation.Keep
import kotlinx.parcelize.Parcelize
import ru.frogogo.whitelabel.data.model.ui.PhotoUiModel
import java.math.BigDecimal

@Keep
@Parcelize
data class HomePromotionUiModel(
val name: String,
val photo: PhotoUiModel,
val steps: List<String>,
val price: Int,
val priceDiscounted: Int,
val price: BigDecimal,
val priceDiscounted: BigDecimal,
) : Parcelable
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package ru.frogogo.whitelabel.data.model.ui.item

import java.math.BigDecimal

data class ItemInfoUiModel(
val id: Int,
val name: String,
val imageUrl: String,
val price: Int,
val discountedPrice: Int,
val price: BigDecimal,
val discountedPrice: BigDecimal,
val specs: String?,
val description: String,
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package ru.frogogo.whitelabel.data.model.ui.item

import ru.frogogo.whitelabel.core.recycler.RecyclerViewItem
import java.math.BigDecimal

data class ItemUiModel(
val id: Int,
val name: String,
val imageUrl: String,
val price: Int,
val discountedPrice: Int,
val price: BigDecimal,
val discountedPrice: BigDecimal,
val specs: String?,
) : RecyclerViewItem {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.annotation.Keep
import kotlinx.parcelize.Parcelize
import ru.frogogo.whitelabel.core.recycler.RecyclerViewItem
import ru.frogogo.whitelabel.dictionary.ReceiptState
import java.math.BigDecimal
import java.util.Date

@Keep
Expand All @@ -13,7 +14,7 @@ data class ReceiptUiModel(
val id: Int,
val number: Int,
val date: Date,
val value: Int,
val value: BigDecimal,
val state: ReceiptState,
val shopName: String,
val rejectReason: ReceiptRejectReasonUiModel?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface UserPreferences {

// Data
var user: User?
var receivedCouponsCount: Int

fun clearData()

Expand Down
Loading
Loading