Procházet zdrojové kódy

tweak teal theme, turn on double tap to lock

sduduzog před 7 roky
rodič
revize
995ffd7bc7

+ 2 - 2
app/build.gradle

@@ -12,8 +12,8 @@ android {
         applicationId "com.sduduzog.slimlauncher"
         minSdkVersion 16
         targetSdkVersion 28
-        versionCode 23
-        versionName "2.2.1"
+        versionCode 24
+        versionName "2.2.2"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         vectorDrawables.useSupportLibrary = true
     }

+ 10 - 14
app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainFragment.kt

@@ -126,8 +126,6 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
             }
         }
 
-        val settings = context!!.getSharedPreferences(getString(R.string.prefs_settings), Context.MODE_PRIVATE)
-        val isChecked = settings.getBoolean(getString(R.string.prefs_settings_key_app_dialer), false)
         ivCall.setOnClickListener {
             try {
                 val intent = Intent(Intent.ACTION_DIAL)
@@ -142,18 +140,16 @@ class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListene
             }
         }
         ivCall.setOnLongClickListener {
-            if (isChecked) {
-                try {
-                    val intent = Intent(Intent.ACTION_DIAL, null)
-                    val left = 0
-                    val top = 0
-                    val width = it.measuredWidth
-                    val height = it.measuredHeight
-                    val opts = ActivityOptionsCompat.makeClipRevealAnimation(it, left, top, width, height)
-                    startActivity(intent, opts.toBundle())
-                } catch (e: ActivityNotFoundException) {
-                    // Do nothing
-                }
+            try {
+                val intent = Intent(Intent.ACTION_DIAL, null)
+                val left = 0
+                val top = 0
+                val width = it.measuredWidth
+                val height = it.measuredHeight
+                val opts = ActivityOptionsCompat.makeClipRevealAnimation(it, left, top, width, height)
+                startActivity(intent, opts.toBundle())
+            } catch (e: ActivityNotFoundException) {
+                // Do nothing
             }
             true
         }

+ 0 - 7
app/src/main/java/com/sduduzog/slimlauncher/ui/main/settings/SettingsFragment.kt

@@ -90,13 +90,6 @@ class SettingsFragment : StatusBarThemeFragment() {
             }
         }
 
-        dialerSwitch.isChecked = settings.getBoolean(getString(R.string.prefs_settings_key_app_dialer), false)
-        dialerSwitch.setOnCheckedChangeListener { _, b ->
-            settings.edit {
-                putBoolean(getString(R.string.prefs_settings_key_app_dialer), b)
-            }
-        }
-
         statusBarSwitch.isChecked = settings.getBoolean(getString(R.string.prefs_settings_key_hide_status_bar), false)
         statusBarSwitch.setOnCheckedChangeListener { _, b ->
             settings.edit {

+ 1 - 1
app/src/main/java/com/sduduzog/slimlauncher/ui/main/settings/SettingsListAdapter.kt

@@ -60,7 +60,7 @@ class SettingsListAdapter(private val fragment: Fragment) : RecyclerView.Adapter
             }
 
             holder.itemView.setOnClickListener {
-                val snackbar = Snackbar.make(it, "You're still in preferences, silly. Go back to the main screen to start this app", Snackbar.LENGTH_LONG)
+                val snackbar = Snackbar.make(it, "You're still in preferences, silly. Go back to the home screen to start this app", Snackbar.LENGTH_LONG)
                 snackbar.show()
             }
 

+ 7 - 40
app/src/main/res/layout/settings_fragment.xml

@@ -104,52 +104,18 @@
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="@+id/textView2" />
 
-    <TextView
-        android:id="@+id/textView9"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginTop="16dp"
-        android:text="@string/settings_use_slim_s_built_in_dialer"
-        android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="18sp"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView4"
-        android:layout_marginLeft="16dp" />
-
-    <TextView
-        android:id="@+id/textView10"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/settings_faster_shortcut_to_your_calls"
-        app:layout_constraintStart_toStartOf="@+id/textView9"
-        app:layout_constraintTop_toBottomOf="@+id/textView9" />
-
-    <Switch
-        android:id="@+id/dialerSwitch"
-        android:layout_width="wrap_content"
-        android:layout_height="48dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="24dp"
-        android:layout_marginRight="24dp"
-        android:layout_marginBottom="8dp"
-        android:padding="4dp"
-        app:layout_constraintBottom_toBottomOf="@+id/textView10"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/textView9" />
-
     <TextView
         android:id="@+id/changeThemeText"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginStart="16dp"
+        android:layout_marginLeft="16dp"
         android:layout_marginTop="16dp"
         android:text="@string/main_options_change_theme"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="18sp"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView10"
-        android:layout_marginLeft="16dp" />
+        app:layout_constraintTop_toBottomOf="@+id/textView4" />
 
     <TextView
         android:id="@+id/textView7"
@@ -194,6 +160,7 @@
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/divider2"
+        tools:itemCount="5"
         tools:listitem="@layout/settings_list_item" />
 
     <androidx.appcompat.widget.AppCompatCheckBox
@@ -203,11 +170,11 @@
         android:layout_height="wrap_content"
         android:layout_marginTop="8dp"
         android:layout_marginEnd="24dp"
+        android:layout_marginRight="24dp"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:visibility="gone"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/textView2"
-        android:layout_marginRight="24dp" />
+        app:layout_constraintTop_toTopOf="@+id/textView2" />
 
     <Button
         android:id="@+id/buttonChangeTheme"
@@ -216,11 +183,11 @@
         android:layout_height="wrap_content"
         android:layout_marginTop="8dp"
         android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
         android:layout_marginBottom="8dp"
         android:text="@string/settings_button_change_theme"
         app:layout_constraintBottom_toBottomOf="@+id/textView7"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/changeThemeText"
-        android:layout_marginRight="16dp" />
+        app:layout_constraintTop_toTopOf="@+id/changeThemeText" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 2
app/src/main/res/values/strings.xml

@@ -16,7 +16,6 @@
     <string name="prefs_settings_key_theme">key_theme</string>
     <string name="prefs_settings_key_clock_type">clock_type</string>
     <string name="prefs_settings_key_hide_status_bar">hide_status_bar</string>
-    <string name="prefs_settings_key_app_dialer">app_dialer</string>
     <string name="prefs_settings_key_fresh_install_setup">key_fresh_install_setup</string>
 
     <!--main package strings-->
@@ -52,7 +51,7 @@
     <string name="settings_button_change_theme">Change</string>
     <string name="about_title">Slim launcher</string>
     <string name="about_text">
-    Slim v2.2.1 \u00a9 2019\n\nSource : <a href="https://github.com/sduduzog/slim-launcher">https://github.com/sduduzog/slim-launcher</a>\n\n<a href="mailto:gumedesduduzo@gmail.com">gumedesduduzo@gmail.com</a>\n\nBecome a tester <a href="https://play.google.com/apps/testing/com.sduduzog.slimlauncher">Click here</a>
+    Slim v2.2.2 \u00a9 2019\n\nSource : <a href="https://github.com/sduduzog/slim-launcher">https://github.com/sduduzog/slim-launcher</a>\n\n<a href="mailto:gumedesduduzo@gmail.com">gumedesduduzo@gmail.com</a>\n\nBecome a tester <a href="https://play.google.com/apps/testing/com.sduduzog.slimlauncher">Click here</a>
     </string>
     <string name="theme_chooser_dialog_title">Change theme</string>
     <string name="main_call_icon">call icon</string>