forked from quran/quran_android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add infra for per flavor preference upgrades (quran#1570)
Add the ability for each flavor to have their own set of preference upgrades. This is important because the version codes of the flavors are often different, and so a single answer may not work for all flavors of the app.
- Loading branch information
Showing
11 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
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
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
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,20 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-kapt' | ||
|
||
android { | ||
compileSdkVersion deps.android.build.compileSdkVersion | ||
defaultConfig { | ||
minSdkVersion deps.android.build.minSdkVersion | ||
targetSdkVersion deps.android.build.targetSdkVersion | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation project(":common:data") | ||
|
||
kapt deps.dagger.apt | ||
implementation deps.dagger.runtime | ||
|
||
implementation "androidx.annotation:annotation:${androidxAnnotationVersion}" | ||
} |
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 @@ | ||
<manifest package="com.quran.labs.androidquran.common.upgrade"/> |
6 changes: 5 additions & 1 deletion
6
...om/quran/data/upgrade/LocalDataUpgrade.kt → .../quran/common/upgrade/LocalDataUpgrade.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
17 changes: 17 additions & 0 deletions
17
common/upgrade/src/main/java/com/quran/common/upgrade/PreferencesUpgrade.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,17 @@ | ||
package com.quran.common.upgrade | ||
|
||
import android.content.Context | ||
|
||
/** | ||
* Upgrade preferences between one version of the app and another. | ||
*/ | ||
fun interface PreferencesUpgrade { | ||
|
||
/** | ||
* Upgrades from one given version to another. [to] is expected to be | ||
* the current version code of the app. | ||
* | ||
* @return a boolean as to whether the upgrade succeeded or not. | ||
*/ | ||
fun upgrade(context: Context, from: Int, to: Int): Boolean | ||
} |
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
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