Преглед на файлове

Removed hidden dev mode

Vadik Sirekanyan преди 7 години
родител
ревизия
b3f95001d0

+ 1 - 19
app/src/main/java/com/sirekanyan/knigopis/feature/MainActivity.kt

@@ -47,8 +47,6 @@ import retrofit2.HttpException
 
 private const val ULOGIN_REQUEST_CODE = 0
 private const val BOOK_REQUEST_CODE = 1
-private const val VERSION_CLICK_COUNT_OFF = 1
-private const val VERSION_CLICK_COUNT_ON = 12
 private const val CURRENT_TAB_KEY = "current_tab"
 
 class MainActivity : BaseActivity(), Router {
@@ -202,23 +200,7 @@ class MainActivity : BaseActivity(), Router {
                 }
                 R.id.option_about -> {
                     val dialogView = View.inflate(this, R.layout.about, null)
-                    val versionView = dialogView.aboutAppVersion
-                    versionView.text = BuildConfig.VERSION_NAME
-                    var count = 0
-                    val enabled = config.isDevMode
-                    val max = if (enabled) {
-                        VERSION_CLICK_COUNT_OFF
-                    } else {
-                        VERSION_CLICK_COUNT_ON
-                    }
-                    versionView.setOnClickListener {
-                        if (++count == max) {
-                            enabled.not().let {
-                                if (it) toast(R.string.common_info_dev)
-                                config.isDevMode = it
-                            }
-                        }
-                    }
+                    dialogView.aboutAppVersion.text = BuildConfig.VERSION_NAME
                     AlertDialog.Builder(this).setView(dialogView).show()
                     true
                 }

+ 0 - 9
app/src/main/java/com/sirekanyan/knigopis/repository/Configuration.kt

@@ -5,14 +5,11 @@ import android.content.Context
 var isDarkConfiguration = false
 
 private const val PREFS_NAME = "knigopis-dev"
-private const val DEV_MODE_KEY = "dev-mode"
 private const val DARK_THEME_KEY = "dark-theme"
 private const val SORT_MODE_KEY = "sort-mode"
 
 interface Configuration {
 
-    var isDevMode: Boolean
-
     var isDarkTheme: Boolean
 
     var sortingMode: Int
@@ -27,12 +24,6 @@ class ConfigurationImpl(context: Context) : Configuration {
         isDarkConfiguration = isDarkTheme
     }
 
-    override var isDevMode: Boolean
-        get() = prefs.getBoolean(DEV_MODE_KEY, false)
-        set(enabled) {
-            prefs.edit().putBoolean(DEV_MODE_KEY, enabled).apply()
-        }
-
     override var isDarkTheme: Boolean
         get() = prefs.getBoolean(DARK_THEME_KEY, false)
         set(enabled) {