-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2.0.0 - New Desing, improve and fix errors
- Loading branch information
Showing
75 changed files
with
2,039 additions
and
406 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
plugins { | ||
id("com.android.application") | ||
id("kotlin-android") | ||
id("kotlin-android-extensions") | ||
id("kotlin-kapt") | ||
} | ||
|
||
android { | ||
compileSdkVersion(30) | ||
defaultConfig { | ||
applicationId = "com.jeluchu.wastickersonline" | ||
minSdkVersion(21) | ||
targetSdkVersion(30) | ||
versionCode = 1 | ||
versionName = "2.0.0" | ||
vectorDrawables.useSupportLibrary = true | ||
val contentProviderAuthority = "$applicationId.provider.StickerContentProvider" | ||
manifestPlaceholders = mapOf("contentProviderAuthority" to contentProviderAuthority) | ||
buildConfigField("String", "CONTENT_PROVIDER_AUTHORITY", "\"${contentProviderAuthority}\"") | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_1_8.toString() | ||
} | ||
buildTypes { | ||
getByName("debug") { | ||
isDebuggable = true | ||
isMinifyEnabled = false | ||
isShrinkResources = false | ||
isZipAlignEnabled = false | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
} | ||
getByName("release") { | ||
isDebuggable = false | ||
isMinifyEnabled = true | ||
isShrinkResources = true | ||
isZipAlignEnabled = true | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
// GOOGLE LIBRARY ------------------------------------------------------------------------------ | ||
implementation("androidx.appcompat:appcompat:1.2.0") | ||
implementation("androidx.constraintlayout:constraintlayout:2.0.4") | ||
implementation("com.google.android.material:material:1.2.1") | ||
implementation("androidx.preference:preference-ktx:1.1.1") | ||
|
||
// KOTLIN LIBRARY ------------------------------------------------------------------------------ | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10") | ||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.4.10") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1") | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1") | ||
implementation("androidx.core:core-ktx:1.3.2") | ||
|
||
// KOIN LIBRARY -------------------------------------------------------------------------------- | ||
implementation("org.koin:koin-androidx-scope:2.1.6") | ||
implementation("org.koin:koin-androidx-viewmodel:2.1.6") | ||
implementation("org.koin:koin-android-ext:2.1.6") | ||
|
||
// LIFECYCLE LIBRARY --------------------------------------------------------------------------- | ||
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") | ||
implementation("androidx.lifecycle:lifecycle-common-java8:2.2.0") | ||
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0") | ||
|
||
// ROOM LIBRARY -------------------------------------------------------------------------------- | ||
implementation("androidx.room:room-runtime:2.2.5") | ||
implementation("androidx.browser:browser:1.2.0") | ||
kapt("androidx.room:room-compiler:2.2.5") | ||
|
||
// RETROFIT ------------------------------------------------------------------------------------ | ||
implementation("com.squareup.retrofit2:retrofit:2.9.0") | ||
implementation("com.squareup.retrofit2:converter-gson:2.9.0") | ||
implementation("com.google.code.gson:gson:2.8.6") | ||
implementation("com.squareup.okhttp3:logging-interceptor:4.9.0") | ||
|
||
// MULTIMEDIA ---------------------------------------------------------------------------------- | ||
implementation("io.coil-kt:coil:1.0.0") | ||
|
||
} | ||
|
||
repositories { mavenCentral() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
app/src/main/java/com/jeluchu/wastickersonline/WaStickersOnline.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
package com.jeluchu.wastickersonline | ||
|
||
import android.app.Application | ||
import com.jeluchu.wastickersonline.core.extensions.hawk.initHawk | ||
import com.jeluchu.wastickersonline.core.extensions.koin.initKoin | ||
import com.orhanobut.hawk.Hawk | ||
import com.jeluchu.wastickersonline.core.extensions.sharedprefs.initSharedPrefs | ||
|
||
class WaStickersOnline : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
initKoin() | ||
initSharedPrefs() | ||
initHawk() | ||
|
||
Hawk.init(this).build() | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
app/src/main/java/com/jeluchu/wastickersonline/core/database/AppDatabase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.jeluchu.wastickersonline.core.database | ||
|
||
import android.content.Context | ||
import androidx.room.Database | ||
import androidx.room.Room | ||
import androidx.room.RoomDatabase | ||
import androidx.room.TypeConverters | ||
import com.jeluchu.wastickersonline.core.utils.room.ListStringConverter | ||
import com.jeluchu.wastickersonline.features.sticker.models.StickerPackEntity | ||
import com.jeluchu.wastickersonline.features.sticker.repository.local.StickersDAO | ||
|
||
@Database( | ||
entities = [ | ||
StickerPackEntity::class, | ||
], version = 1, exportSchema = false) | ||
@TypeConverters(value = [ListStringConverter::class]) | ||
abstract class AppDatabase : RoomDatabase() { | ||
|
||
abstract fun stickerEntityDao(): StickersDAO | ||
|
||
companion object { | ||
@Volatile | ||
private var INSTANCE: AppDatabase? = null | ||
|
||
fun getAppDatabase(context: Context): AppDatabase { | ||
|
||
return INSTANCE ?: synchronized(this) { | ||
val instance = | ||
Room.databaseBuilder( | ||
context.applicationContext, | ||
AppDatabase::class.java, | ||
"waStickersDB") | ||
.allowMainThreadQueries() | ||
.fallbackToDestructiveMigration() | ||
.build() | ||
INSTANCE = instance | ||
instance | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/jeluchu/wastickersonline/core/di/Database.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.jeluchu.wastickersonline.core.di | ||
|
||
import com.jeluchu.wastickersonline.features.sticker.repository.local.StickerLocal | ||
import org.koin.dsl.module | ||
|
||
val databaseModule = module { | ||
factory { StickerLocal(get()) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/jeluchu/wastickersonline/core/exception/Failure.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.jeluchu.wastickersonline.core.exception | ||
|
||
sealed class Failure { | ||
class NetworkConnection: Failure() | ||
class NetworkConnection : Failure() | ||
class ServerError : Failure() | ||
data class CustomError(val errorCode: Int, val errorMessage: String?) : Failure() | ||
} |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/jeluchu/wastickersonline/core/extensions/dateAndTime/DateExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.jeluchu.wastickersonline.core.extensions.dateAndTime | ||
|
||
import java.util.* | ||
|
||
fun isFetchSixHours(lastFetchTime: Long): Boolean = Date().time - lastFetchTime >= 6*60*60*1000 |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/jeluchu/wastickersonline/core/extensions/hawk/HawkExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.jeluchu.wastickersonline.core.extensions.hawk | ||
|
||
import android.content.Context | ||
import com.jeluchu.wastickersonline.core.utils.hawk.Hawk | ||
|
||
fun Context.initHawk() = Hawk.init(this).build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.