Add GitHub and F-droid flavors (#59)
This commit is contained in:
parent
f2571f133e
commit
81fdcb498d
|
@ -29,6 +29,16 @@ android {
|
||||||
useSupportLibrary true
|
useSupportLibrary true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flavorDimensions "channel"
|
||||||
|
productFlavors {
|
||||||
|
fdroid {
|
||||||
|
dimension "channel"
|
||||||
|
}
|
||||||
|
github {
|
||||||
|
dimension "channel"
|
||||||
|
}
|
||||||
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
keyAlias keyProps["keyAlias"]
|
keyAlias keyProps["keyAlias"]
|
||||||
|
|
|
@ -73,9 +73,11 @@ class App : Application(), Configuration.Provider {
|
||||||
applicationScope.launch(dispatcherDefault) {
|
applicationScope.launch(dispatcherDefault) {
|
||||||
accountInit()
|
accountInit()
|
||||||
workerInit()
|
workerInit()
|
||||||
|
if (BuildConfig.FLAVOR != "fdroid") {
|
||||||
checkUpdate()
|
checkUpdate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun dataStoreInit() {
|
private fun dataStoreInit() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ import androidx.compose.ui.unit.Dp
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.navigation.NavHostController
|
import androidx.navigation.NavHostController
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import me.ash.reader.R
|
import me.ash.reader.R
|
||||||
import me.ash.reader.ui.component.CurlyCornerShape
|
import me.ash.reader.ui.component.CurlyCornerShape
|
||||||
import me.ash.reader.ui.component.FeedbackIconButton
|
import me.ash.reader.ui.component.FeedbackIconButton
|
||||||
|
@ -118,11 +117,10 @@ fun TipsAndSupport(
|
||||||
onTap = {
|
onTap = {
|
||||||
if (System.currentTimeMillis() - clickTime > 2000) {
|
if (System.currentTimeMillis() - clickTime > 2000) {
|
||||||
clickTime = System.currentTimeMillis()
|
clickTime = System.currentTimeMillis()
|
||||||
context.showToast(context.getString(R.string.checking_updates))
|
|
||||||
scope.launch {
|
|
||||||
updateViewModel.dispatch(
|
updateViewModel.dispatch(
|
||||||
UpdateViewAction.CheckUpdate(
|
UpdateViewAction.CheckUpdate(
|
||||||
{
|
{
|
||||||
|
context.showToast(context.getString(R.string.checking_updates))
|
||||||
context.dataStore.put(
|
context.dataStore.put(
|
||||||
DataStoreKeys.SkipVersionNumber,
|
DataStoreKeys.SkipVersionNumber,
|
||||||
""
|
""
|
||||||
|
@ -137,7 +135,6 @@ fun TipsAndSupport(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
clickTime = System.currentTimeMillis()
|
clickTime = System.currentTimeMillis()
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import androidx.lifecycle.viewModelScope
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.*
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import me.ash.reader.BuildConfig
|
||||||
import me.ash.reader.data.repository.AppRepository
|
import me.ash.reader.data.repository.AppRepository
|
||||||
import me.ash.reader.data.source.Download
|
import me.ash.reader.data.source.Download
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -32,6 +33,7 @@ class UpdateViewModel @Inject constructor(
|
||||||
preProcessor: suspend () -> Unit = {},
|
preProcessor: suspend () -> Unit = {},
|
||||||
postProcessor: suspend (Boolean) -> Unit = {}
|
postProcessor: suspend (Boolean) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
|
if (BuildConfig.FLAVOR != "fdroid") {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
preProcessor()
|
preProcessor()
|
||||||
appRepository.checkUpdate().let {
|
appRepository.checkUpdate().let {
|
||||||
|
@ -42,6 +44,7 @@ class UpdateViewModel @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun changeUpdateDialogVisible(visible: Boolean) {
|
private fun changeUpdateDialogVisible(visible: Boolean) {
|
||||||
_viewState.update {
|
_viewState.update {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user