Browse Source

Fix theme status bar for light and dark theme

sduduzog 7 năm trước cách đây
mục cha
commit
86f84187fb
24 tập tin đã thay đổi với 131 bổ sung528 xóa
  1. 6 2
      app/build.gradle
  2. 6 1
      app/src/main/java/com/sduduzog/slimlauncher/MainActivity.kt
  3. 18 25
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/StatusBarThemeFragment.kt
  4. 0 47
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/ClockSetupFragment.kt
  5. 0 48
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/DialerSetupFragment.kt
  6. 0 44
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/HomeSetupFragment.kt
  7. 1 10
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SetupFragment.kt
  8. 16 2
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SplashFragment.kt
  9. 0 72
      app/src/main/res/layout/clock_setup_fragment.xml
  10. 0 147
      app/src/main/res/layout/dialer_setup_fragment.xml
  11. 36 15
      app/src/main/res/layout/main_content.xml
  12. 2 4
      app/src/main/res/layout/main_list_item.xml
  13. 2 1
      app/src/main/res/layout/setup_fragment.xml
  14. 16 15
      app/src/main/res/layout/splash_fragment.xml
  15. 12 10
      app/src/main/res/layout/theme_setup_fragment.xml
  16. 0 16
      app/src/main/res/values-hdpi/dimens.xml
  17. 0 13
      app/src/main/res/values-v21/styles.xml
  18. 0 12
      app/src/main/res/values-v23/styles.xml
  19. 0 10
      app/src/main/res/values-xhdpi/dimens.xml
  20. 0 10
      app/src/main/res/values-xxhdpi/dimens.xml
  21. 0 8
      app/src/main/res/values-xxxhdpi/dimens.xml
  22. 1 1
      app/src/main/res/values/attrs.xml
  23. 15 11
      app/src/main/res/values/dimens.xml
  24. 0 4
      app/src/main/res/values/styles.xml

+ 6 - 2
app/build.gradle

@@ -10,10 +10,10 @@ android {
     compileSdkVersion 28
     defaultConfig {
         applicationId "com.sduduzog.slimlauncher"
-        minSdkVersion 14
+        minSdkVersion 16
         targetSdkVersion 28
         versionCode 21
-        versionName "2.1.2"
+        versionName "2.1.3"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         vectorDrawables.useSupportLibrary = true
     }
@@ -54,6 +54,10 @@ dependencies {
     kapt "androidx.room:room-compiler:2.1.0-alpha03"
     kapt "androidx.lifecycle:lifecycle-compiler:2.0.0"
 
+    //3rd party libs
+    implementation 'com.intuit.sdp:sdp-android:1.0.6'
+    implementation 'com.intuit.ssp:ssp-android:1.0.6'
+
     // Test libs
     testImplementation 'junit:junit:4.12'
     testImplementation 'org.mockito:mockito-core:2.19.0'

+ 6 - 1
app/src/main/java/com/sduduzog/slimlauncher/MainActivity.kt

@@ -3,6 +3,7 @@ package com.sduduzog.slimlauncher
 import android.content.SharedPreferences
 import android.content.pm.PackageManager
 import android.content.res.Resources
+import android.os.Build
 import android.os.Bundle
 import android.view.View
 import androidx.appcompat.app.AppCompatActivity
@@ -75,7 +76,11 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
 //        window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN)
 //        window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
 //        }
-        val flags = window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+        val flags = window.decorView.systemUiVisibility or if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+             View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+        } else {
+            0
+        }
         window.decorView.systemUiVisibility = flags
     }
 

+ 18 - 25
app/src/main/java/com/sduduzog/slimlauncher/ui/main/StatusBarThemeFragment.kt

@@ -1,47 +1,40 @@
 package com.sduduzog.slimlauncher.ui.main
 
-import android.content.Context
-import android.graphics.Color
 import android.os.Build
 import android.util.TypedValue
 import android.view.View
-import android.view.Window
 import androidx.appcompat.app.AppCompatActivity
 import androidx.fragment.app.Fragment
 import com.sduduzog.slimlauncher.R
 
-abstract class StatusBarThemeFragment : Fragment(){
-
-    private fun setLightStatusBar(window: Window, view: View) {
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
-            val flags = window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
-            view.systemUiVisibility = flags
-            window.statusBarColor = Color.WHITE
-        }
-    }
-
-    private fun clearLightStatusBar(window: Window, context: Context) {
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
-            val value = TypedValue()
-            context.theme.resolveAttribute(R.attr.colorPrimary, value, true)
-            window.statusBarColor = value.data
-        }
-    }
+abstract class StatusBarThemeFragment : Fragment() {
 
 
     /**
      * @return [android.view.View] of the [androidx.fragment.app.Fragment] extending this class to apply flags to
      */
-    abstract fun getFragmentView() : View
+    abstract fun getFragmentView(): View
+
 
     override fun onResume() {
         super.onResume()
+        // When the Fragment resumes, check the theme and set the status bar color accordingly.
         val settings = context!!.getSharedPreferences(getString(R.string.prefs_settings), AppCompatActivity.MODE_PRIVATE)
         val active = settings.getInt(getString(R.string.prefs_settings_key_theme), 0)
-        if (active == 0) {
-            setLightStatusBar(activity!!.window, getFragmentView())
-        } else {
-            clearLightStatusBar(activity!!.window, context!!)
+
+
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+            when (active) {
+                0, 3, 5 -> {
+                    val flags = activity!!.window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
+                    getFragmentView().systemUiVisibility = flags
+                }
+
+            }
+            val value = TypedValue()
+            context!!.theme.resolveAttribute(R.attr.colorPrimary, value, true)
+            activity!!.window.statusBarColor = value.data
         }
     }
+
 }

+ 0 - 47
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/ClockSetupFragment.kt

@@ -1,47 +0,0 @@
-package com.sduduzog.slimlauncher.ui.main.setup
-
-
-import android.content.Context.MODE_PRIVATE
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.core.content.edit
-import com.sduduzog.slimlauncher.R
-import kotlinx.android.synthetic.main.clock_setup_fragment.*
-
-
-class ClockSetupFragment : PagerHelperFragment() {
-
-    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
-                              savedInstanceState: Bundle?): View? {
-        // Inflate the layout for this fragment
-        return inflater.inflate(R.layout.clock_setup_fragment, container, false)
-    }
-
-    override fun onActivityCreated(savedInstanceState: Bundle?) {
-        super.onActivityCreated(savedInstanceState)
-
-        val settings = activity!!.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
-        clock_setup_switch.setOnCheckedChangeListener { _, b ->
-            settings.edit {
-                putBoolean(getString(R.string.prefs_settings_key_clock_type), b)
-            }
-            if (b) {
-                clock_setup_image.setImageResource(R.drawable.clock_zoomed2)
-            } else {
-                clock_setup_image.setImageResource(R.drawable.clock_zoomed)
-            }
-        }
-
-        clock_setup_button.setOnClickListener {
-            listener?.onPage(3) // Move to next section
-        }
-    }
-
-    companion object {
-
-        @JvmStatic
-        fun newInstance() = ClockSetupFragment()
-    }
-}

+ 0 - 48
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/DialerSetupFragment.kt

@@ -1,48 +0,0 @@
-package com.sduduzog.slimlauncher.ui.main.setup
-
-
-import android.content.Context.MODE_PRIVATE
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.core.content.edit
-import com.sduduzog.slimlauncher.R
-import kotlinx.android.synthetic.main.dialer_setup_fragment.*
-
-
-class DialerSetupFragment : PagerHelperFragment() {
-
-    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
-                              savedInstanceState: Bundle?): View? {
-        // Inflate the layout for this fragment
-        return inflater.inflate(R.layout.dialer_setup_fragment, container, false)
-    }
-
-    override fun onActivityCreated(savedInstanceState: Bundle?) {
-        super.onActivityCreated(savedInstanceState)
-        setup_dialer_switch.setOnCheckedChangeListener { _, b ->
-            if (b) {
-                setup_dialer_text.text = getString(R.string.setup_dialer_note2)
-            } else {
-                setup_dialer_text.text = getString(R.string.setup_note_dialer)
-            }
-
-            val settings = context!!.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
-
-            settings.edit {
-                putBoolean(getString(R.string.prefs_settings_key_app_dialer), b)
-            }
-        }
-
-        setup_button_next.setOnClickListener {
-            listener?.onPage(4) // Move to next section
-        }
-    }
-
-    companion object {
-
-        @JvmStatic
-        fun newInstance() = DialerSetupFragment()
-    }
-}

+ 0 - 44
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/HomeSetupFragment.kt

@@ -1,44 +0,0 @@
-package com.sduduzog.slimlauncher.ui.main.setup
-
-
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.lifecycle.ViewModelProviders
-import com.sduduzog.slimlauncher.R
-import com.sduduzog.slimlauncher.data.App
-import com.sduduzog.slimlauncher.ui.main.MainViewModel
-import kotlinx.android.synthetic.main.home_setup_fragment.*
-
-
-class HomeSetupFragment : PagerHelperFragment(), ChooseAppsDialog.Companion.OnChooseAppsListener {
-
-    private lateinit var viewModel: MainViewModel
-
-    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
-                              savedInstanceState: Bundle?): View? {
-        // Inflate the layout for this fragment
-        return inflater.inflate(R.layout.home_setup_fragment, container, false)
-    }
-
-    override fun onActivityCreated(savedInstanceState: Bundle?) {
-        super.onActivityCreated(savedInstanceState)
-        viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
-        setup_choose_button.setOnClickListener {
-            ChooseAppsDialog.getInstance(this).show(childFragmentManager, "HomeSetupFragment")
-        }
-    }
-
-    override fun onChooseApps(apps: List<App>) {
-        viewModel.clearHomeApps()
-        viewModel.addToHomeScreen(apps)
-        listener?.onPage(2) // Move to next section
-    }
-
-    companion object {
-
-        @JvmStatic
-        fun newInstance() = HomeSetupFragment()
-    }
-}

+ 1 - 10
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SetupFragment.kt

@@ -45,16 +45,7 @@ class SetupFragment : StatusBarThemeFragment() {
 
         override fun getItem(position: Int): Fragment {
             return when (position) {
-                1 -> HomeSetupFragment.newInstance().apply {
-                    this.listener = onPagerListener
-                }
-                2 -> ClockSetupFragment.newInstance().apply {
-                    this.listener = onPagerListener
-                }
-                3 -> DialerSetupFragment.newInstance().apply {
-                    this.listener = onPagerListener
-                }
-                4 -> ThemeSetupFragment.newInstance().apply {
+                1 -> ThemeSetupFragment.newInstance().apply {
                     this.listener = onPagerListener
                 }
                 else -> SplashFragment.newInstance().apply {

+ 16 - 2
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SplashFragment.kt

@@ -6,11 +6,17 @@ import android.os.Bundle
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import androidx.lifecycle.ViewModelProviders
 import androidx.navigation.Navigation
 import com.sduduzog.slimlauncher.R
+import com.sduduzog.slimlauncher.data.App
+import com.sduduzog.slimlauncher.ui.main.MainViewModel
+import kotlinx.android.synthetic.main.home_setup_fragment.*
 import kotlinx.android.synthetic.main.splash_fragment.*
 
-class SplashFragment : PagerHelperFragment() {
+class SplashFragment : PagerHelperFragment(), ChooseAppsDialog.Companion.OnChooseAppsListener {
+
+    private lateinit var viewModel: MainViewModel
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                               savedInstanceState: Bundle?): View? {
@@ -20,8 +26,9 @@ class SplashFragment : PagerHelperFragment() {
 
     override fun onActivityCreated(savedInstanceState: Bundle?) {
         super.onActivityCreated(savedInstanceState)
+        viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
         setup_splash_button_start.setOnClickListener {
-            listener?.onPage(1) // Move to next item in pager
+                ChooseAppsDialog.getInstance(this).show(childFragmentManager, "HomeSetupFragment")
         }
         val settings = activity!!.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
         if (!settings.getBoolean(getString(R.string.prefs_settings_key_fresh_install_setup), true)) {
@@ -29,6 +36,13 @@ class SplashFragment : PagerHelperFragment() {
         }
     }
 
+        override fun onChooseApps(apps: List<App>) {
+            viewModel.clearHomeApps()
+            viewModel.addToHomeScreen(apps)
+            listener?.onPage(1) // Move to next section
+        }
+
+
     companion object {
         @JvmStatic
         fun newInstance() = SplashFragment()

+ 0 - 72
app/src/main/res/layout/clock_setup_fragment.xml

@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/clock_setup_fragment"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context=".ui.main.setup.ClockSetupFragment">
-
-    <TextView
-        android:id="@+id/textView14"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:text="@string/setup_clock_type"
-        android:textAppearance="@style/TextAppearance.AppCompat.Headline"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
-    <ImageView
-        android:id="@+id/clock_setup_image"
-        android:layout_width="200dp"
-        android:layout_height="120dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="32dp"
-        android:layout_marginEnd="16dp"
-        android:contentDescription="@string/setup_home_screenshot"
-        android:src="@drawable/clock_zoomed"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/textView14"
-        app:layout_constraintTop_toBottomOf="@+id/textView14" />
-
-    <TextView
-        android:id="@+id/textView17"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="32dp"
-        android:layout_marginTop="32dp"
-        android:layout_marginEnd="32dp"
-        android:gravity="center"
-        android:text="@string/setup_clock_type_text_description"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/clock_setup_image" />
-
-    <Switch
-        android:id="@+id/clock_setup_switch"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="32dp"
-        android:layout_marginEnd="8dp"
-        android:padding="8dp"
-        android:switchPadding="32dp"
-        android:text="@string/settings_text_use_24_hour_clock"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView17" />
-
-    <Button
-        android:id="@+id/clock_setup_button"
-        style="@style/Widget.AppCompat.Button.Borderless"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="16dp"
-        android:layout_marginBottom="16dp"
-        android:text="@string/setup_button_next"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>

+ 0 - 147
app/src/main/res/layout/dialer_setup_fragment.xml

@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/dialer_setup_fragment"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context=".ui.main.setup.DialerSetupFragment">
-
-    <!-- TODO: Update blank fragment layout -->
-    <TextView
-        android:id="@+id/textView19"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:text="@string/setup_we_re_almost_done"
-        android:textAppearance="@style/TextAppearance.AppCompat.Headline"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
-    <TextView
-        android:id="@+id/textView26"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginTop="24dp"
-        android:layout_marginEnd="16dp"
-        android:text="@string/setup_expand_note"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView19" />
-
-    <ImageView
-        android:id="@+id/imageView2"
-        android:layout_width="200dp"
-        android:layout_height="69dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="8dp"
-        android:background="?android:attr/statusBarColor"
-        android:contentDescription="@string/screenshot_nav"
-        android:padding="1dp"
-        android:src="@drawable/nav_options"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView26" />
-
-    <View
-        android:id="@+id/divider5"
-        android:layout_width="0dp"
-        android:layout_height="1dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="16dp"
-        android:layout_marginEnd="8dp"
-        android:background="?android:attr/listDivider"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/imageView2" />
-
-    <TextView
-        android:id="@+id/setup_dialer_text"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="8dp"
-        android:text="@string/setup_note_dialer"
-        app:layout_constraintEnd_toStartOf="@+id/setup_dialer_switch"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/divider5" />
-
-    <Switch
-        android:id="@+id/setup_dialer_switch"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="24dp"
-        app:layout_constraintBottom_toBottomOf="@+id/setup_dialer_text"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/setup_dialer_text" />
-
-    <ImageView
-        android:id="@+id/imageView4"
-        android:layout_width="200dp"
-        android:layout_height="69dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="16dp"
-        android:layout_marginEnd="8dp"
-        android:background="?android:attr/statusBarColor"
-        android:contentDescription="@string/screenshot_nav"
-        android:padding="1dp"
-        android:src="@drawable/nav_options2"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/setup_dialer_text" />
-
-    <View
-        android:id="@+id/divider6"
-        android:layout_width="0dp"
-        android:layout_height="1dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="24dp"
-        android:layout_marginEnd="8dp"
-        android:background="?android:attr/listDivider"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/imageView4" />
-
-    <TextView
-        android:id="@+id/textView29"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="16dp"
-        android:text="@string/setup_note_camera"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/divider6" />
-
-    <ImageView
-        android:id="@+id/imageView5"
-        android:layout_width="200dp"
-        android:layout_height="69dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="8dp"
-        android:background="?android:attr/statusBarColor"
-        android:contentDescription="@string/screenshot_nav"
-        android:padding="1dp"
-        android:src="@drawable/nav_options3"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView29" />
-
-    <Button
-        android:id="@+id/setup_button_next"
-        style="@style/Widget.AppCompat.Button.Borderless"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="16dp"
-        android:layout_marginBottom="16dp"
-        android:text="@string/setup_button_next"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>

+ 36 - 15
app/src/main/res/layout/main_content.xml

@@ -5,52 +5,73 @@
     android:id="@+id/main_content"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="?android:colorBackground"
     tools:showIn="@layout/main_fragment">
 
     <TextView
         android:id="@+id/clockTextView"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="16dp"
         android:text="@string/main_placeholder_clock"
-        android:textSize="48sp"
+        android:layout_marginTop="@dimen/_64sdp"
+        android:textSize="@dimen/_38sdp"
+        app:layout_constraintBottom_toTopOf="@+id/dateTextView"
         app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.5"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintVertical_chainStyle="spread" />
+
+    <TextView
+        android:id="@+id/clockAmPm"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
+        android:textSize="@dimen/_13sdp"
+        app:layout_constraintStart_toEndOf="@+id/clockTextView"
+        app:layout_constraintTop_toTopOf="@+id/clockTextView" />
 
     <TextView
         android:id="@+id/dateTextView"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:text="@string/main_placeholder_date"
+        android:textSize="@dimen/_12sdp"
+        app:layout_constraintBottom_toTopOf="@+id/guideline"
         app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintHorizontal_bias="0.5"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/clockTextView" />
+        app:layout_constraintTop_toBottomOf="@+id/clockTextView"
+        app:layout_constraintVertical_bias="1.0" />
 
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/mainAppsList"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_marginStart="16dp"
-        android:layout_marginTop="8dp"
         android:layout_marginEnd="16dp"
-        android:layout_marginBottom="8dp"
         app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
-        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintBottom_toTopOf="@+id/guideline2"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/dateTextView"
-        app:layout_constraintVertical_bias="0.35000002"
+        app:layout_constraintTop_toTopOf="@+id/guideline"
+        app:layout_constraintVertical_bias="0.5"
         tools:itemCount="5"
         tools:listitem="@layout/main_list_item" />
 
-    <TextView
-        android:id="@+id/clockAmPm"
+    <androidx.constraintlayout.widget.Guideline
+        android:id="@+id/guideline"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="16dp"
-        android:textSize="18sp"
-        app:layout_constraintStart_toEndOf="@+id/clockTextView"
-        app:layout_constraintTop_toTopOf="@+id/clockTextView" />
+        android:orientation="horizontal"
+        app:layout_constraintGuide_begin="@dimen/_135sdp" />
+
+    <androidx.constraintlayout.widget.Guideline
+        android:id="@+id/guideline2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        app:layout_constraintGuide_end="@dimen/main_bottom_guide_end" />
+
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 4
app/src/main/res/layout/main_list_item.xml

@@ -8,10 +8,8 @@
         android:id="@+id/main_label"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="16dp"
-        android:layout_marginBottom="8dp"
-        android:textSize="42sp"
+        android:layout_margin="@dimen/_10sdp"
+        android:textSize="@dimen/_26ssp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />

+ 2 - 1
app/src/main/res/layout/setup_fragment.xml

@@ -1,6 +1,7 @@
 <androidx.viewpager.widget.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/setup_view_pager"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:background="?android:colorBackground">
 
 </androidx.viewpager.widget.ViewPager>

+ 16 - 15
app/src/main/res/layout/splash_fragment.xml

@@ -5,15 +5,16 @@
     android:id="@+id/splash_fragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="?android:colorBackground"
     tools:context=".ui.main.setup.SplashFragment">
 
     <ImageView
         android:id="@+id/imageView3"
-        android:layout_width="@dimen/splash_ic_box_size"
-        android:layout_height="@dimen/splash_ic_box_size"
+        android:layout_width="@dimen/_60sdp"
+        android:layout_height="@dimen/_60sdp"
         android:layout_marginStart="8dp"
         android:layout_marginLeft="8dp"
-        android:layout_marginTop="@dimen/splash_ic_box_marginTop"
+        android:layout_marginTop="@dimen/_50sdp"
         android:layout_marginEnd="8dp"
         android:layout_marginRight="8dp"
         android:contentDescription="@string/app_name"
@@ -41,34 +42,34 @@
         android:layout_height="wrap_content"
         android:layout_marginStart="8dp"
         android:layout_marginLeft="8dp"
-        android:layout_marginTop="@dimen/splash_welcome_margin"
+        android:layout_marginTop="@dimen/_16sdp"
         android:layout_marginEnd="8dp"
         android:layout_marginRight="8dp"
         android:text="@string/setup_welcome"
-        android:textSize="@dimen/splash_welcome_font_size"
+        android:textSize="@dimen/_24sdp"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/imageView3" />
 
     <TextView
         android:id="@+id/textView15"
-        android:layout_width="@dimen/splash_welcome_text_width"
+        android:layout_width="@dimen/_140sdp"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/splash_welcome_text_marginLeft"
-        android:layout_marginLeft="@dimen/splash_welcome_text_marginLeft"
-        android:layout_marginTop="@dimen/splash_welcome_text_marginTop"
+        android:layout_marginStart="@dimen/_110sdp"
+        android:layout_marginLeft="@dimen/_110sdp"
+        android:layout_marginTop="@dimen/_94sdp"
         android:text="@string/setup_welcome2"
-        android:textSize="@dimen/splash_welcome_text_font_size"
+        android:textSize="@dimen/_14sdp"
         app:layout_constraintStart_toStartOf="@+id/imageView6"
         app:layout_constraintTop_toTopOf="@+id/imageView6" />
 
     <ImageView
         android:id="@+id/imageView6"
-        android:layout_width="@dimen/splash_phone_width"
-        android:layout_height="@dimen/splash_phone_height"
-        android:layout_marginStart="@dimen/splash_phone_marginLeft"
-        android:layout_marginLeft="@dimen/splash_phone_marginLeft"
-        android:layout_marginTop="@dimen/splash_welcome_margin"
+        android:layout_width="@dimen/_160sdp"
+        android:layout_height="@dimen/_134sdp"
+        android:layout_marginStart="@dimen/_4sdp"
+        android:layout_marginLeft="@dimen/_4sdp"
+        android:layout_marginTop="@dimen/_16sdp"
         android:contentDescription="@string/content_description_my_phone"
         android:scaleType="centerCrop"
         app:layout_constraintStart_toStartOf="parent"

+ 12 - 10
app/src/main/res/layout/theme_setup_fragment.xml

@@ -7,7 +7,6 @@
     android:layout_height="match_parent"
     tools:context=".ui.main.setup.ThemeSetupFragment">
 
-    <!-- TODO: Update blank fragment layout -->
     <TextView
         android:id="@+id/textView18"
         android:layout_width="wrap_content"
@@ -27,13 +26,14 @@
         android:layout_marginTop="32dp"
         android:clickable="true"
         android:focusable="true"
-        android:src="@drawable/ic_text_fields"
+        app:srcCompat="@drawable/ic_text_fields"
         app:backgroundTint="@color/colorWhite"
         app:fabSize="normal"
         app:layout_constraintEnd_toStartOf="@+id/setup_fab_dark"
         app:layout_constraintHorizontal_bias="0.5"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView18" />
+        app:layout_constraintTop_toBottomOf="@+id/textView18"
+        android:layout_marginLeft="8dp" />
 
     <com.google.android.material.floatingactionbutton.FloatingActionButton
         android:id="@+id/setup_fab_dark"
@@ -41,7 +41,7 @@
         android:layout_height="wrap_content"
         android:clickable="true"
         android:focusable="true"
-        android:src="@drawable/ic_text_fields"
+        app:srcCompat="@drawable/ic_text_fields"
         android:tint="@color/inverseTextColor"
         app:backgroundTint="@color/primaryDarkColor"
         app:fabSize="normal"
@@ -57,14 +57,15 @@
         android:layout_marginEnd="8dp"
         android:clickable="true"
         android:focusable="true"
-        android:src="@drawable/ic_text_fields"
+        app:srcCompat="@drawable/ic_text_fields"
         android:tint="@color/inverseTextColor"
         app:backgroundTint="@color/colorBlueGrey"
         app:fabSize="normal"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintHorizontal_bias="0.5"
         app:layout_constraintStart_toEndOf="@+id/setup_fab_dark"
-        app:layout_constraintTop_toTopOf="@+id/setup_fab_dark" />
+        app:layout_constraintTop_toTopOf="@+id/setup_fab_dark"
+        android:layout_marginRight="8dp" />
 
     <com.google.android.material.floatingactionbutton.FloatingActionButton
         android:id="@+id/setup_fab_teal"
@@ -73,7 +74,7 @@
         android:layout_marginTop="32dp"
         android:clickable="true"
         android:focusable="true"
-        android:src="@drawable/ic_text_fields"
+        app:srcCompat="@drawable/ic_text_fields"
         app:backgroundTint="@color/colorTeal"
         app:fabSize="normal"
         app:layout_constraintEnd_toStartOf="@+id/setup_fab_candy"
@@ -87,7 +88,7 @@
         android:layout_height="wrap_content"
         android:clickable="true"
         android:focusable="true"
-        android:src="@drawable/ic_text_fields"
+        app:srcCompat="@drawable/ic_text_fields"
         android:tint="@color/inverseTextColor"
         app:backgroundTint="@color/colorCandy"
         app:fabSize="normal"
@@ -102,7 +103,7 @@
         android:layout_height="wrap_content"
         android:clickable="true"
         android:focusable="true"
-        android:src="@drawable/ic_text_fields"
+        app:srcCompat="@drawable/ic_text_fields"
         app:backgroundTint="@color/colorPink"
         app:fabSize="normal"
         app:layout_constraintEnd_toEndOf="parent"
@@ -175,6 +176,7 @@
         android:layout_marginBottom="16dp"
         android:text="@string/setup_button_finish"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent" />
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginRight="16dp" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 0 - 16
app/src/main/res/values-hdpi/dimens.xml

@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <dimen name="splash_ic_box_size">60dp</dimen>
-    <dimen name="splash_ic_box_marginTop">64dp</dimen>
-
-    <dimen name="splash_welcome_font_size">24sp</dimen>
-    <dimen name="splash_welcome_margin">32dp</dimen>
-    <dimen name="splash_welcome_text_font_size">16sp</dimen>
-    <dimen name="splash_welcome_text_width">164dp</dimen>
-    <dimen name="splash_welcome_text_marginTop">90dp</dimen>
-    <dimen name="splash_welcome_text_marginLeft">110dp</dimen>
-
-    <dimen name="splash_phone_width">160dp</dimen>
-    <dimen name="splash_phone_height">113dp</dimen>
-    <dimen name="splash_phone_marginLeft">8dp</dimen>
-</resources>

+ 0 - 13
app/src/main/res/values-v21/styles.xml

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
-        <item name="colorAccent">@color/colorAccent</item>
-        <item name="android:colorForeground">@android:color/black</item>
-        <!--<item name="android:statusBarColor">@color/colorWhiteDark</item>-->
-        <item name="colorPrimary">@color/colorWhite</item>
-        <item name="colorPrimaryDark">@color/colorWhiteDark</item>
-        <item name="android:colorBackground">@color/colorWhite</item>
-        <item name="android:statusBarColor">?android:attr/colorPrimaryDark</item>
-    </style>
-</resources>

+ 0 - 12
app/src/main/res/values-v23/styles.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
-        <!--<item name="android:statusBarColor">?android:attr/colorPrimary</item>-->
-        <!--<item name="android:windowLightStatusBar">true</item>-->
-    </style>
-
-    <style name="AppDarkTheme" parent="@style/Theme.AppCompat.NoActionBar">
-        <!--<item name="android:statusBarColor">?android:attr/colorPrimary</item>-->
-        <!--<item name="android:windowLightStatusBar">false</item>-->
-    </style>
-</resources>

+ 0 - 10
app/src/main/res/values-xhdpi/dimens.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <dimen name="splash_ic_box_size">80dp</dimen>
-    <dimen name="splash_ic_box_marginTop">82dp</dimen>
-
-
-    <dimen name="splash_phone_marginLeft">16dp</dimen>
-    <dimen name="splash_welcome_text_width">187dp</dimen>
-</resources>

+ 0 - 10
app/src/main/res/values-xxhdpi/dimens.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <dimen name="margin_4">4dp</dimen>
-
-    <dimen name="splash_welcome_font_size">32sp</dimen>
-    <dimen name="splash_welcome_text_font_size">18sp</dimen>
-
-    <!--<dimen name="splash_phone_marginLeft">80dp</dimen>-->
-</resources>

+ 0 - 8
app/src/main/res/values-xxxhdpi/dimens.xml

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <dimen name="splash_ic_box_size">90dp</dimen>
-
-    <dimen name="splash_welcome_margin">48dp</dimen>
-    <dimen name="splash_phone_marginLeft">36dp</dimen>
-</resources>

+ 1 - 1
app/src/main/res/values-sw480dp/dimens.xml → app/src/main/res/values/attrs.xml

@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <!--<dimen name="splash_phone_marginLeft">20dp</dimen>-->
+    <attr name="customColor" format="reference"/>
 </resources>

+ 15 - 11
app/src/main/res/values/dimens.xml

@@ -1,17 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <dimen name="splash_ic_box_size">30dp</dimen>
-    <dimen name="splash_ic_box_marginTop">32dp</dimen>
+    <!--<dimen name="splash_ic_box_size">30dp</dimen>-->
+    <!--<dimen name="splash_ic_box_marginTop">32dp</dimen>-->
 
-    <dimen name="splash_welcome_margin">32dp</dimen>
+    <!--<dimen name="splash_welcome_margin">32dp</dimen>-->
 
-    <dimen name="splash_welcome_font_size">24sp</dimen>
-    <dimen name="splash_welcome_text_font_size">16sp</dimen>
-    <dimen name="splash_welcome_text_width">164dp</dimen>
-    <dimen name="splash_welcome_text_marginTop">90dp</dimen>
-    <dimen name="splash_welcome_text_marginLeft">110dp</dimen>
+    <!--<dimen name="splash_welcome_font_size">24sp</dimen>-->
+    <!--<dimen name="splash_welcome_text_font_size">16sp</dimen>-->
+    <!--<dimen name="splash_welcome_text_width">164dp</dimen>-->
+    <!--<dimen name="splash_welcome_text_marginTop">90dp</dimen>-->
+    <!--<dimen name="splash_welcome_text_marginLeft">110dp</dimen>-->
 
-    <dimen name="splash_phone_width">160dp</dimen>
-    <dimen name="splash_phone_height">113dp</dimen>
-    <dimen name="splash_phone_marginLeft">8dp</dimen>
+    <!--<dimen name="splash_phone_width">160dp</dimen>-->
+    <!--<dimen name="splash_phone_height">113dp</dimen>-->
+    <!--<dimen name="splash_phone_marginLeft">8dp</dimen>-->
+
+    <!--<dimen name="main_clock_marginTop">16dp</dimen>-->
+    <!--<dimen name="main_top_guide_begin">150dp</dimen>-->
+    <dimen name="main_bottom_guide_end">56dp</dimen>
 </resources>

+ 0 - 4
app/src/main/res/values/styles.xml

@@ -4,7 +4,6 @@
     <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
         <item name="colorAccent">@color/colorAccent</item>
         <item name="android:colorForeground">@android:color/black</item>
-        <!--<item name="android:statusBarColor">@color/colorWhiteDark</item>-->
         <item name="colorPrimary">@color/colorWhite</item>
         <item name="colorPrimaryDark">@color/colorWhiteDark</item>
         <item name="android:colorBackground">@color/colorWhite</item>
@@ -15,7 +14,6 @@
         <item name="colorPrimary">@color/primaryDarkColor</item>
         <item name="colorPrimaryDark">@color/primaryColor</item>
         <item name="android:colorBackground">@color/primaryDarkColor</item>
-        <!--<item name="android:statusBarColor">?android:attr/colorPrimaryDark</item>-->
         <item name="android:colorForeground">@color/inverseTextColor</item>
     </style>
 
@@ -23,7 +21,6 @@
         <item name="colorPrimary">@color/colorBlueGrey</item>
         <item name="colorPrimaryDark">@color/colorBlueGreyDark</item>
         <item name="android:colorBackground">@color/colorBlueGrey</item>
-        <!--<item name="android:statusBarColor">?attr/colorPrimaryDark</item>-->
         <item name="cardBackgroundColor">@color/colorBlueGreyDark</item>
         <item name="colorAccent">@color/inverseAccentColor</item>
     </style>
@@ -32,7 +29,6 @@
         <item name="colorPrimary">@color/colorCandy</item>
         <item name="colorPrimaryDark">@color/colorCandyDark</item>
         <item name="android:colorBackground">@color/colorCandy</item>
-        <!--<item name="android:statusBarColor">@color/colorCandyDark</item>-->
     </style>
 
     <style name="AppPinkTheme" parent="AppTheme">