Ver Fonte

Fixed play button visibility

Vadik Sirekanyan há 2 anos atrás
pai
commit
bca189928d

+ 8 - 4
app/src/main/java/org/sirekanyan/outline/ui/AboutDialog.kt

@@ -32,6 +32,8 @@ import org.sirekanyan.outline.BuildConfig
 import org.sirekanyan.outline.R
 import org.sirekanyan.outline.R
 import org.sirekanyan.outline.ext.logDebug
 import org.sirekanyan.outline.ext.logDebug
 import org.sirekanyan.outline.ext.showToast
 import org.sirekanyan.outline.ext.showToast
+import org.sirekanyan.outline.isDebugBuild
+import org.sirekanyan.outline.isPlayFlavor
 import org.sirekanyan.outline.ui.icons.IconOpenInNew
 import org.sirekanyan.outline.ui.icons.IconOpenInNew
 import org.sirekanyan.outline.ui.icons.IconPlayStore
 import org.sirekanyan.outline.ui.icons.IconPlayStore
 
 
@@ -79,10 +81,12 @@ fun AboutDialogContent(onDismiss: () -> Unit) {
                     context.showToast("Email is copied")
                     context.showToast("Email is copied")
                 }
                 }
             }
             }
-            val playUri = "https://play.google.com/store/apps/details?id=${context.packageName}"
-            AboutItem(IconPlayStore, "Rate on Play Store") {
-                context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(playUri)))
-                onDismiss()
+            if (isPlayFlavor() || isDebugBuild()) {
+                val playUri = "https://play.google.com/store/apps/details?id=${context.packageName}"
+                AboutItem(IconPlayStore, "Rate on Play Store") {
+                    context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(playUri)))
+                    onDismiss()
+                }
             }
             }
         },
         },
     )
     )

+ 17 - 20
app/src/main/java/org/sirekanyan/outline/ui/DrawerContent.kt

@@ -49,7 +49,6 @@ import org.sirekanyan.outline.SelectedPage
 import org.sirekanyan.outline.app
 import org.sirekanyan.outline.app
 import org.sirekanyan.outline.ext.rememberFlowAsState
 import org.sirekanyan.outline.ext.rememberFlowAsState
 import org.sirekanyan.outline.isDebugBuild
 import org.sirekanyan.outline.isDebugBuild
-import org.sirekanyan.outline.isPlayFlavor
 
 
 @Composable
 @Composable
 fun DrawerContent(state: MainState) {
 fun DrawerContent(state: MainState) {
@@ -128,28 +127,26 @@ private fun DrawerSheetContent(state: MainState, insets: PaddingValues) {
                 },
                 },
             )
             )
         }
         }
-        if (isPlayFlavor() || isDebugBuild()) {
-            Divider(Modifier.padding(vertical = 8.dp))
-            val context = LocalContext.current
-            if (isDebugBuild()) {
-                val debugDao = remember { context.app().debugDao }
-                val scope = rememberCoroutineScope()
-                DrawerItem(
-                    icon = Icons.Default.Warning,
-                    label = "Reset database",
-                    onClick = {
-                        scope.launch(IO) {
-                            debugDao.reset()
-                        }
-                    },
-                )
-            }
+        Divider(Modifier.padding(vertical = 8.dp))
+        val context = LocalContext.current
+        if (isDebugBuild()) {
+            val debugDao = remember { context.app().debugDao }
+            val scope = rememberCoroutineScope()
             DrawerItem(
             DrawerItem(
-                icon = Icons.Default.Info,
-                label = "About",
-                onClick = { state.dialog = AboutDialog },
+                icon = Icons.Default.Warning,
+                label = "Reset database",
+                onClick = {
+                    scope.launch(IO) {
+                        debugDao.reset()
+                    }
+                },
             )
             )
         }
         }
+        DrawerItem(
+            icon = Icons.Default.Info,
+            label = "About",
+            onClick = { state.dialog = AboutDialog },
+        )
     }
     }
 }
 }