mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-1379 App | Tech | Auto-update integration fixes (#51)
This commit is contained in:
parent
7018d7dec9
commit
5a6bee6305
3 changed files with 18 additions and 5 deletions
|
@ -30,4 +30,5 @@ class DefaultFeatureToggles @Inject constructor(
|
|||
|
||||
override val isNewOnBoardingEnabled: Boolean = false
|
||||
|
||||
override val isAutoUpdateEnabled: Boolean = false
|
||||
}
|
|
@ -19,6 +19,7 @@ import com.anytypeio.anytype.app.DefaultAppActionManager
|
|||
import com.anytypeio.anytype.core_models.ThemeMode
|
||||
import com.anytypeio.anytype.core_models.Wallpaper
|
||||
import com.anytypeio.anytype.core_utils.ext.toast
|
||||
import com.anytypeio.anytype.core_utils.tools.FeatureToggles
|
||||
import com.anytypeio.anytype.di.common.componentManager
|
||||
import com.anytypeio.anytype.domain.base.BaseUseCase
|
||||
import com.anytypeio.anytype.domain.theme.GetTheme
|
||||
|
@ -60,6 +61,9 @@ class MainActivity : AppCompatActivity(R.layout.activity_main), AppNavigation.Pr
|
|||
@Inject
|
||||
lateinit var mdnsProvider: MDNSProvider
|
||||
|
||||
@Inject
|
||||
lateinit var featureToggles: FeatureToggles
|
||||
|
||||
val container: FragmentContainerView get() = findViewById(R.id.fragment)
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
@ -110,11 +114,13 @@ class MainActivity : AppCompatActivity(R.layout.activity_main), AppNavigation.Pr
|
|||
}
|
||||
|
||||
private fun startAppUpdater() {
|
||||
AppUpdater(this)
|
||||
.setUpdateFrom(UpdateFrom.JSON)
|
||||
.setUpdateJSON("https://fra1.digitaloceanspaces.com/anytype-release/latest-android.json")
|
||||
.setButtonDoNotShowAgain("")
|
||||
.start()
|
||||
if (featureToggles.isAutoUpdateEnabled) {
|
||||
AppUpdater(this)
|
||||
.setUpdateFrom(UpdateFrom.JSON)
|
||||
.setUpdateJSON(AUTO_UPDATE_URL)
|
||||
.setButtonDoNotShowAgain("")
|
||||
.start()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupWindowInsets() {
|
||||
|
@ -205,4 +211,8 @@ class MainActivity : AppCompatActivity(R.layout.activity_main), AppNavigation.Pr
|
|||
fun release() {
|
||||
componentManager().mainEntryComponent.release()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val AUTO_UPDATE_URL = "https://fra1.digitaloceanspaces.com/anytype-release/latest-android.json"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.anytypeio.anytype.core_utils.tools
|
|||
|
||||
interface FeatureToggles {
|
||||
|
||||
val isAutoUpdateEnabled: Boolean
|
||||
|
||||
val isLogFromMiddlewareLibrary: Boolean
|
||||
|
||||
val isLogMiddlewareInteraction: Boolean
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue