فهرست منبع

Merge branch 'release'

Beautus 7 سال پیش
والد
کامیت
d40bf671db
57فایلهای تغییر یافته به همراه579 افزوده شده و 1158 حذف شده
  1. 0 1
      README.md
  2. 12 8
      app/build.gradle
  3. 1 1
      app/release/output.json
  4. 1 38
      app/src/androidTest/java/com/sduduzog/slimlauncher/SetupFragmentTest.kt
  5. 11 1
      app/src/main/AndroidManifest.xml
  6. 47 24
      app/src/main/java/com/sduduzog/slimlauncher/MainActivity.kt
  7. 5 0
      app/src/main/java/com/sduduzog/slimlauncher/SlimAdminReceiver.kt
  8. 8 9
      app/src/main/java/com/sduduzog/slimlauncher/data/DataRepository.kt
  9. 0 82
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/DialerFragment.kt
  10. 8 1
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeAppsAdapter.kt
  11. 122 52
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainFragment.kt
  12. 41 0
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/MakeSlimAdminDialog.kt
  13. 40 0
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/StatusBarThemeFragment.kt
  14. 1 1
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/notes/NoteFragment.kt
  15. 7 5
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/settings/SettingsFragment.kt
  16. 7 0
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/settings/SettingsListAdapter.kt
  17. 0 47
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/ClockSetupFragment.kt
  18. 0 48
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/DialerSetupFragment.kt
  19. 0 44
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/HomeSetupFragment.kt
  20. 5 11
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SetupFragment.kt
  21. 14 27
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SplashFragment.kt
  22. 9 0
      app/src/main/res/drawable-v21/ic_call.xml
  23. 1 1
      app/src/main/res/drawable-v21/ic_drag_handle.xml
  24. 9 0
      app/src/main/res/drawable-v21/ic_expand.xml
  25. 12 0
      app/src/main/res/drawable-v21/ic_photo_camera.xml
  26. BIN
      app/src/main/res/drawable/clock_zoomed.webp
  27. BIN
      app/src/main/res/drawable/clock_zoomed2.webp
  28. 1 1
      app/src/main/res/drawable/ic_call.xml
  29. 1 1
      app/src/main/res/drawable/ic_drag_handle.xml
  30. 1 1
      app/src/main/res/drawable/ic_expand.xml
  31. 3 0
      app/src/main/res/drawable/ic_my_phone.xml
  32. 2 2
      app/src/main/res/drawable/ic_photo_camera.xml
  33. BIN
      app/src/main/res/drawable/nav_options.webp
  34. BIN
      app/src/main/res/drawable/nav_options2.webp
  35. BIN
      app/src/main/res/drawable/nav_options3.webp
  36. BIN
      app/src/main/res/drawable/screenshot.webp
  37. 0 72
      app/src/main/res/layout/clock_setup_fragment.xml
  38. 0 277
      app/src/main/res/layout/dialer_fragment.xml
  39. 0 147
      app/src/main/res/layout/dialer_setup_fragment.xml
  40. 0 67
      app/src/main/res/layout/home_setup_fragment.xml
  41. 4 2
      app/src/main/res/layout/main_bottom_sheet.xml
  42. 37 13
      app/src/main/res/layout/main_content.xml
  43. 2 4
      app/src/main/res/layout/main_list_item.xml
  44. 1 1
      app/src/main/res/layout/notes_list_fragment.xml
  45. 42 39
      app/src/main/res/layout/settings_fragment.xml
  46. 7 3
      app/src/main/res/layout/settings_list_item.xml
  47. 52 55
      app/src/main/res/layout/splash_fragment.xml
  48. 18 10
      app/src/main/res/layout/theme_setup_fragment.xml
  49. 2 8
      app/src/main/res/navigation/nav_graph.xml
  50. 0 13
      app/src/main/res/values-v23/styles.xml
  51. 4 0
      app/src/main/res/values/attrs.xml
  52. 2 2
      app/src/main/res/values/colors.xml
  53. 17 0
      app/src/main/res/values/dimens.xml
  54. 16 27
      app/src/main/res/values/strings.xml
  55. 0 7
      app/src/main/res/values/styles.xml
  56. 6 0
      app/src/main/res/xml/admin.xml
  57. 0 5
      app/src/test/java/com/sduduzog/slimlauncher/ExampleUnitTest.java

+ 0 - 1
README.md

@@ -2,7 +2,6 @@
 
 > _All you need is less._
 
-</style>
 <img id="app-logo" src="docs/assets/ic_launcher-web.png">
 
 ## Now available on Google Play[![Google Play badge](docs/assets/google-play-badge.png)](https://play.google.com/store/apps/details?id=com.sduduzog.slimlauncher)

+ 12 - 8
app/build.gradle

@@ -10,10 +10,10 @@ android {
     compileSdkVersion 28
     defaultConfig {
         applicationId "com.sduduzog.slimlauncher"
-        minSdkVersion 21
+        minSdkVersion 16
         targetSdkVersion 28
-        versionCode 21
-        versionName "2.1.2"
+        versionCode 26
+        versionName "2.2.4"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         vectorDrawables.useSupportLibrary = true
     }
@@ -39,21 +39,25 @@ dependencies {
 
     // Support Libraries
     implementation 'androidx.appcompat:appcompat:1.0.2'
-    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
     implementation 'androidx.cardview:cardview:1.0.0'
     implementation 'androidx.recyclerview:recyclerview:1.0.0'
+    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
 
     // Google Libraries
     implementation 'com.google.android.material:material:1.0.0'
 
     // Arch Components
-    implementation 'androidx.core:core-ktx:1.0.1'
+    implementation 'androidx.core:core-ktx:1.1.0-alpha03'
     implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
     implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha09'
     implementation 'androidx.room:room-runtime:2.1.0-alpha03'
     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'
@@ -64,7 +68,7 @@ dependencies {
     androidTestImplementation 'androidx.test:runner:1.1.1'
     androidTestImplementation 'androidx.test:rules:1.1.1'
     androidTestImplementation "androidx.arch.core:core-testing:2.0.0"
-    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
-    androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.2'
-    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.1'
+
 }

+ 1 - 1
app/release/output.json

@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":20,"versionName":"2.1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":23,"versionName":"2.2.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

+ 1 - 38
app/src/androidTest/java/com/sduduzog/slimlauncher/SetupFragmentTest.kt

@@ -41,15 +41,9 @@ class SetupFragmentTest {
     @Test
     fun isAlertDialogShown() {
         val appCompatButton = onView(
-                allOf(withId(R.id.setup_splash_button_start),
-                        withText(R.string.setup_button_start), isDisplayed()))
+                allOf(withText(R.string.setup_button_start), isDisplayed()))
         appCompatButton.perform(click())
 
-        val chooseAppsButton = onView(allOf(withText(R.string.setup_choose_apps)))
-
-        chooseAppsButton.check(matches(isDisplayed()))
-
-        chooseAppsButton.perform(click())
 
         val frameLayout = onView(
                 allOf(withId(android.R.id.content), isDisplayed()))
@@ -66,46 +60,15 @@ class SetupFragmentTest {
         button.check(matches(isDisplayed()))
     }
 
-    @Test
-    fun pressingStartShouldNavigateToChoosingHomeScreenApps() {
-        val startButton = onView(allOf(withText(R.string.setup_button_start), isDisplayed()))
-        startButton.perform(click())
-
-        val chooseAppsButton = onView(allOf(withText(R.string.setup_choose_apps)))
-
-        chooseAppsButton.check(matches(isDisplayed()))
-
-        chooseAppsButton.perform(click())
-
-        val frameLayout = onView(
-                allOf(withId(android.R.id.content), isDisplayed()))
-        frameLayout.check(matches(isDisplayed()))
-
-        val alertDialogTitle = onView(
-                allOf(withText(R.string.choose_apps_title)))
-
-
-        alertDialogTitle.check(matches(isDisplayed()))
-    }
-
     @Test
     fun noAppsSelected() {
         val startButton = onView(allOf(withText(R.string.setup_button_start)))
         startButton.perform(click())
 
-        val chooseAppsButton = onView(allOf(withText(R.string.setup_choose_apps)))
-        chooseAppsButton.check(matches(isDisplayed()))
-
-        chooseAppsButton.perform(click())
-
         val appCompatButton2 = onView(
                 allOf(withText("DONE")))
         appCompatButton2.perform(ViewActions.scrollTo(), click())
 
-        val viewGroup = onView(
-                allOf(withId(R.id.home_setup_fragment), isDisplayed()))
-        viewGroup.check(matches(isDisplayed()))
-
         onView(withText(R.string.no_app_selected_toast_msg)).inRoot(
                 RootMatchers.withDecorView(Matchers.not(Matchers.`is`(mActivityTestRule.activity.window.decorView))))
                 .check(matches(isDisplayed()))

+ 11 - 1
app/src/main/AndroidManifest.xml

@@ -4,7 +4,6 @@
     package="com.sduduzog.slimlauncher">
 
     <uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
-    <uses-permission android:name="android.permission.CALL_PHONE" />
 
     <application
         android:allowBackup="false"
@@ -29,6 +28,17 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
+        <receiver
+            android:name=".SlimAdminReceiver"
+            android:permission="android.permission.BIND_DEVICE_ADMIN">
+            <meta-data
+                android:name="android.app.device_admin"
+                android:resource="@xml/admin"/>
+
+            <intent-filter>
+                <action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
+            </intent-filter>
+        </receiver>
     </application>
 
 </manifest>

+ 47 - 24
app/src/main/java/com/sduduzog/slimlauncher/MainActivity.kt

@@ -1,9 +1,11 @@
 package com.sduduzog.slimlauncher
 
+import android.content.Intent
 import android.content.SharedPreferences
-import android.content.pm.PackageManager
 import android.content.res.Resources
 import android.os.Bundle
+import android.view.View
+import android.widget.Toast
 import androidx.appcompat.app.AppCompatActivity
 import androidx.lifecycle.ViewModelProviders
 import androidx.navigation.NavController
@@ -14,15 +16,7 @@ import com.sduduzog.slimlauncher.ui.main.MainViewModel
 
 class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceChangeListener, NavController.OnDestinationChangedListener {
 
-    // TODO: Hide and show status bar (possibly bottom nav too) in preferences
-    // TODO: Click on date, opens calendar app
-    // TODO: Support more devices, screen densities
-
-    // TODO: Setup Wizard redesign to include,
-    // TODO: Have different text sizes, and typefaces
     // TODO: Move some apps to bottom sheet.
-    // TODO: Clickable apps while in preferences, intuitiveness
-    // TODO: Lock screen on double tap
 
     private lateinit var settings: SharedPreferences
     private val label = "main_fragment"
@@ -57,7 +51,6 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
         settings = getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
         settings.registerOnSharedPreferenceChangeListener(this)
         navigator = findNavController(this, R.id.nav_host_fragment)
-//        navigator.addOnNavigatedListener(this) : removed. a breaking change
         navigator.addOnDestinationChangedListener(this)
         viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
     }
@@ -67,10 +60,25 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
         viewModel.refreshApps()
     }
 
+    override fun onResume() {
+        super.onResume()
+        overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
+        toggleStatusBar()
+    }
+
+    override fun onWindowFocusChanged(hasFocus: Boolean) {
+        super.onWindowFocusChanged(hasFocus)
+        if (hasFocus) toggleStatusBar()
+    }
+
+
     override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, s: String?) {
         if (s.equals(getString(R.string.prefs_settings_key_theme), true)) {
             recreate()
         }
+        if (s.equals(getString(R.string.prefs_settings_key_hide_status_bar), true)) {
+            toggleStatusBar()
+        }
     }
 
     override fun getTheme(): Resources.Theme {
@@ -95,23 +103,38 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
         currentLabel = destination.label.toString()
     }
 
-    override fun onRequestPermissionsResult(requestCode: Int,
-                                            permissions: Array<String>, grantResults: IntArray) {
-        when (requestCode) {
-            REQUEST_PHONE_CALL -> {
-                // If request is cancelled, the result arrays are empty.
-                if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
-                    navigator.navigate(R.id.action_mainFragment_to_dialerFragment)
-                } else {
-                    // Do nothing
-                }
-                return
+    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+        if (requestCode == REQUEST_CODE_ENABLE_ADMIN) {
+            if (resultCode == RESULT_OK) {
+                Toast.makeText(applicationContext, "Registered As Admin", Toast.LENGTH_SHORT).show()
+            } else {
+                Toast.makeText(applicationContext, "Failed to register as Admin", Toast.LENGTH_SHORT).show()
             }
-        }// other 'case' lines to check for other
-        // permissions this app might request
+        }
+    }
+
+    private fun showSystemUI() {
+        window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+                or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
+    }
+
+    private fun hideSystemUI() {
+        window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+                or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                or View.SYSTEM_UI_FLAG_FULLSCREEN)
+    }
+
+    private fun toggleStatusBar() {
+        val isHidden = settings.getBoolean(getString(R.string.prefs_settings_key_hide_status_bar), false)
+        if (isHidden) {
+            hideSystemUI()
+        } else {
+            showSystemUI()
+        }
     }
 
     companion object {
+
         fun resolveTheme(i: Int): Int {
             when (i) {
                 1 -> {
@@ -133,7 +156,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
             return R.style.AppTheme
         }
 
-        const val REQUEST_PHONE_CALL = 1
+        const val REQUEST_CODE_ENABLE_ADMIN = 1
     }
 
     interface OnBackPressedListener {

+ 5 - 0
app/src/main/java/com/sduduzog/slimlauncher/SlimAdminReceiver.kt

@@ -0,0 +1,5 @@
+package com.sduduzog.slimlauncher
+
+import android.app.admin.DeviceAdminReceiver
+
+class SlimAdminReceiver : DeviceAdminReceiver()

+ 8 - 9
app/src/main/java/com/sduduzog/slimlauncher/data/DataRepository.kt

@@ -5,7 +5,9 @@ import android.content.Intent
 import android.content.pm.PackageManager
 import android.content.pm.ResolveInfo
 import android.os.AsyncTask
+import android.util.Log
 import androidx.lifecycle.LiveData
+import com.sduduzog.slimlauncher.BuildConfig
 import java.util.*
 
 class DataRepository(application: Application) {
@@ -101,19 +103,16 @@ class DataRepository(application: Application) {
     private class RefreshAppsAsyncTask internal constructor(private val mAsyncTaskDao: AppDao) : AsyncTask<PackageManager, Void, Void>() {
 
         override fun doInBackground(vararg params: PackageManager): Void? {
+            mAsyncTaskDao.deleteAll() // Need to find a less expensive way of doing this
             val pm = params[0]
             val main = Intent(Intent.ACTION_MAIN, null)
-
             main.addCategory(Intent.CATEGORY_LAUNCHER)
-
-            val launchables = pm.queryIntentActivities(main, 0)
-            Collections.sort(launchables,
-                    ResolveInfo.DisplayNameComparator(pm))
-            mAsyncTaskDao.deleteAll() // Need to find a less expensive way of doing this
-            for (i in launchables.indices) {
-                val item = launchables[i]
+            val activitiesList = pm.queryIntentActivities(main, 0)
+            Collections.sort(activitiesList, ResolveInfo.DisplayNameComparator(pm))
+            for (i in activitiesList.indices) {
+                val item = activitiesList[i]
                 val activity = item.activityInfo
-                val app = App(launchables[i].loadLabel(pm).toString(), activity.applicationInfo.packageName, activity.name)
+                val app = App(activitiesList[i].loadLabel(pm).toString(), activity.applicationInfo.packageName, activity.name)
                 mAsyncTaskDao.insert(app)
             }
             return null

+ 0 - 82
app/src/main/java/com/sduduzog/slimlauncher/ui/main/DialerFragment.kt

@@ -1,82 +0,0 @@
-package com.sduduzog.slimlauncher.ui.main
-
-
-import android.content.Intent
-import android.net.Uri
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.fragment.app.Fragment
-import com.sduduzog.slimlauncher.R
-import kotlinx.android.synthetic.main.dialer_fragment.*
-
-
-class DialerFragment : Fragment(), View.OnClickListener {
-
-    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
-                              savedInstanceState: Bundle?): View? {
-        // Inflate the layout for this fragment
-        return inflater.inflate(R.layout.dialer_fragment, container, false)
-    }
-
-    override fun onActivityCreated(savedInstanceState: Bundle?) {
-        super.onActivityCreated(savedInstanceState)
-        editText2.showSoftInputOnFocus = false
-        setupDialer()
-        chevron.setOnClickListener {
-            val index = editText2.selectionStart
-            if (index != 0) {
-                editText2.text.delete(editText2.selectionStart - 1, editText2.selectionEnd)
-            }
-            if (index == 1) chevron.visibility = View.INVISIBLE
-        }
-        chevron.setOnLongClickListener {
-            editText2.text.clear()
-            chevron.visibility = View.INVISIBLE
-            true
-        }
-
-        fab_dialer.setOnClickListener {
-            val number = editText2.text.toString()
-            if (number.isEmpty()) return@setOnClickListener
-            try {
-                val i = Intent(Intent.ACTION_CALL)
-                i.data = Uri.parse("tel:${Uri.encode(number)}")
-                startActivity(i)
-            } catch (e: Exception) {
-                // Do nothing
-            }
-        }
-    }
-
-    override fun onPause() {
-        super.onPause()
-        editText2.text.clear()
-    }
-
-    private fun setupDialer() {
-        dial_one.setOnClickListener(this)
-        dial_two.setOnClickListener(this)
-        dial_three.setOnClickListener(this)
-        dial_four.setOnClickListener(this)
-        dial_five.setOnClickListener(this)
-        dial_six.setOnClickListener(this)
-        dial_seven.setOnClickListener(this)
-        dial_eight.setOnClickListener(this)
-        dial_nine.setOnClickListener(this)
-        dial_star.setOnClickListener(this)
-        dial_zero.setOnClickListener(this)
-        dial_hash.setOnClickListener(this)
-    }
-
-    override fun onClick(view: View) {
-        val value = view.tag as String
-
-        val index = editText2.selectionEnd
-
-        chevron.visibility = View.VISIBLE
-
-        editText2.text.insert(index, value)
-    }
-}

+ 8 - 1
app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeAppsAdapter.kt

@@ -8,12 +8,14 @@ import android.view.View
 import android.view.ViewGroup
 import android.widget.TextView
 import android.widget.Toast
+import androidx.core.app.ActivityOptionsCompat
 import androidx.lifecycle.Observer
 import androidx.lifecycle.ViewModelProviders
 import androidx.recyclerview.widget.RecyclerView
 import com.sduduzog.slimlauncher.R
 import com.sduduzog.slimlauncher.data.HomeApp
 
+
 class HomeAppsAdapter(private var fragment: MainFragment)
     : RecyclerView.Adapter<HomeAppsAdapter.ViewHolder>() {
 
@@ -46,7 +48,12 @@ class HomeAppsAdapter(private var fragment: MainFragment)
             intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
             intent.component = name
             try {
-                fragment.startActivity(intent)
+                val left = 0
+                val top = 0
+                val width = it.measuredWidth
+                val height = it.measuredHeight
+                val opts = ActivityOptionsCompat.makeClipRevealAnimation(it, left, top, width, height)
+                fragment.startActivity(intent, opts.toBundle())
             } catch (e: ActivityNotFoundException) {
                 Toast.makeText(fragment.context, "${item.appName} seems to be uninstalled, removing from list", Toast.LENGTH_LONG).show()
                 viewModel.deleteApp(item)

+ 122 - 52
app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainFragment.kt

@@ -1,35 +1,36 @@
 package com.sduduzog.slimlauncher.ui.main
 
+import android.annotation.SuppressLint
+import android.app.admin.DevicePolicyManager
 import android.content.*
-import android.content.pm.PackageManager
 import android.net.Uri
+import android.os.Build
 import android.os.Bundle
 import android.provider.AlarmClock
 import android.provider.MediaStore
 import android.provider.Settings
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
+import android.view.*
 import android.widget.FrameLayout
-import androidx.core.app.ActivityCompat
-import androidx.core.content.ContextCompat
-import androidx.fragment.app.Fragment
+import androidx.core.app.ActivityOptionsCompat
 import androidx.navigation.Navigation
 import com.google.android.material.bottomsheet.BottomSheetBehavior
 import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_COLLAPSED
 import com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_HALF_EXPANDED
 import com.sduduzog.slimlauncher.MainActivity
 import com.sduduzog.slimlauncher.R
+import com.sduduzog.slimlauncher.SlimAdminReceiver
 import kotlinx.android.synthetic.main.main_bottom_sheet.*
 import kotlinx.android.synthetic.main.main_content.*
+import kotlinx.android.synthetic.main.main_fragment.*
 import java.text.SimpleDateFormat
 import java.util.*
 
 
-class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
+class MainFragment : StatusBarThemeFragment(), MainActivity.OnBackPressedListener {
 
     private lateinit var receiver: BroadcastReceiver
     private lateinit var sheetBehavior: BottomSheetBehavior<FrameLayout>
+    private val homeClickListener = HomeDoubleClickListener()
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                               savedInstanceState: Bundle?): View {
@@ -53,6 +54,9 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
         doBounceAnimation(ivExpand)
     }
 
+    override fun getFragmentView(): View {
+        return main
+    }
 
     override fun onResume() {
         super.onResume()
@@ -87,39 +91,67 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
     }
 
     private fun setEventListeners() {
+
+        main.setOnClickListener(homeClickListener)
+        mainAppsList.setOnTouchListener(homeClickListener)
+
         clockTextView.setOnClickListener {
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+                try {
+                    val intent = Intent(AlarmClock.ACTION_SHOW_ALARMS)
+                    intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+                    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, we've failed :(
+                }
+            }
+        }
+
+        dateTextView.setOnClickListener {
             try {
-                val intent = Intent(AlarmClock.ACTION_SHOW_ALARMS)
+                val intent = Intent(Intent.ACTION_MAIN)
+                intent.addCategory(Intent.CATEGORY_APP_CALENDAR)
                 intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
-                startActivity(intent)
-            } finally {
-                // Do nothing
+                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, we've failed :(
             }
         }
 
-
-        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 {
-            if (isChecked) {
-                getCallingPermission()
-            } else {
-                try {
-                    val intent = Intent(Intent.ACTION_DIAL)
-                    startActivity(intent)
-                } catch (e: Exception) {
-                    // Do nothing
-                }
+            try {
+                val intent = Intent(Intent.ACTION_DIAL)
+                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: Exception) {
+                // Do nothing
             }
         }
         ivCall.setOnLongClickListener {
-            if (isChecked) {
-                try {
-                    val intent = Intent(Intent.ACTION_DIAL, null)
-                    startActivity(intent)
-                } 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
         }
@@ -130,7 +162,12 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
         ivCamera.setOnClickListener {
             try {
                 val intent = Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA)
-                startActivity(intent)
+                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: Exception) {
                 // Do nothing
             }
@@ -146,7 +183,9 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
                 val multi = 3 * p1
                 optionsView.alpha = multi
                 optionsView.cardElevation = p1 * 8
-                optionsView.elevation = p1 * 8
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+                    optionsView.elevation = p1 * 8
+                }
             }
 
             override fun onStateChanged(bottomSheet: View, newState: Int) {
@@ -161,19 +200,23 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
 
         rateAppText.setOnClickListener {
             val uri = Uri.parse("market://details?id=" + context?.packageName)
-            val goToMarket = Intent(Intent.ACTION_VIEW, uri)
-            goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or
+            val intent = Intent(Intent.ACTION_VIEW, uri)
+            intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or
                     Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
-            goToMarket.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT)
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT)
+            }
             try {
-                startActivity(goToMarket)
+                startActivity(intent)
             } catch (e: ActivityNotFoundException) {
                 startActivity(Intent(Intent.ACTION_VIEW,
                         Uri.parse("http://play.google.com/store/apps/details?id=" + context?.packageName)))
             }
         }
         changeLauncherText.setOnClickListener {
-            startActivity(Intent(Settings.ACTION_HOME_SETTINGS))
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+                startActivity(Intent(Settings.ACTION_HOME_SETTINGS))
+            }
         }
         aboutText.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_mainFragment_to_aboutFragment))
 
@@ -181,7 +224,9 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
             startActivity(Intent(Settings.ACTION_SETTINGS))
         }
         changeLauncherText.setOnClickListener {
-            startActivity(Intent(Settings.ACTION_HOME_SETTINGS))
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+                startActivity(Intent(Settings.ACTION_HOME_SETTINGS))
+            }
         }
     }
 
@@ -189,10 +234,11 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
         targetView.animate()
                 .setStartDelay(500)
                 .translationYBy(-20f).withEndAction {
-            targetView.animate()
-                    .setStartDelay(0)
-                    .translationYBy(20f).duration = 100
-        }.duration = 100
+                    targetView.animate()
+                            .setStartDelay(0)
+                            .translationYBy(20f).duration = 100
+                }.duration = 100
+
     }
 
     fun updateUi() {
@@ -214,13 +260,6 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
         dateTextView.text = fWatchDate.format(date)
     }
 
-    private fun getCallingPermission() {
-        if (ContextCompat.checkSelfPermission(activity!!, android.Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) {
-            ActivityCompat.requestPermissions(activity!!, arrayOf(android.Manifest.permission.CALL_PHONE), REQUEST_PHONE_CALL)
-        } else {
-            Navigation.findNavController(main_content).navigate(R.id.action_mainFragment_to_dialerFragment)
-        }
-    }
 
     inner class ClockReceiver : BroadcastReceiver() {
         override fun onReceive(ctx: Context?, intent: Intent?) {
@@ -228,7 +267,38 @@ class MainFragment : Fragment(), MainActivity.OnBackPressedListener {
         }
     }
 
-    companion object {
-        const val REQUEST_PHONE_CALL = 1
+    inner class HomeDoubleClickListener : View.OnTouchListener, DoubleClickListener() {
+
+        private val gestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() {
+            override fun onDoubleTap(e: MotionEvent?): Boolean {
+                performLock()
+                return super.onDoubleTap(e)
+            }
+        })
+
+        @SuppressLint("ClickableViewAccessibility")
+        override fun onTouch(p0: View?, p1: MotionEvent?): Boolean {
+            return gestureDetector.onTouchEvent(p1)
+        }
+
+        override fun onDoubleClick(v: View) {
+            performLock()
+        }
+
+        override fun onSingleClick(v: View) {
+
+        }
+
+        private fun performLock() {
+            val mComponentName = ComponentName(context!!, SlimAdminReceiver::class.java)
+            val mDevicePolicyManager = activity!!.getSystemService(
+                    Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager
+            val isAdmin = mDevicePolicyManager.isAdminActive(mComponentName)
+            if (isAdmin) {
+                mDevicePolicyManager.lockNow()
+            } else {
+                MakeSlimAdminDialog().show(childFragmentManager, "Admin Dialog")
+            }
+        }
     }
 }

+ 41 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/main/MakeSlimAdminDialog.kt

@@ -0,0 +1,41 @@
+@file:Suppress("unused")
+
+package com.sduduzog.slimlauncher.ui.main
+
+import android.app.AlertDialog
+import android.app.Dialog
+import android.app.admin.DevicePolicyManager
+import android.content.ComponentName
+import android.content.Intent
+import android.os.Bundle
+import androidx.fragment.app.DialogFragment
+import com.sduduzog.slimlauncher.MainActivity.Companion.REQUEST_CODE_ENABLE_ADMIN
+import com.sduduzog.slimlauncher.R
+import com.sduduzog.slimlauncher.SlimAdminReceiver
+
+
+class MakeSlimAdminDialog : DialogFragment() {
+
+    private var mComponentName: ComponentName? = null
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        mComponentName = ComponentName(context!!, SlimAdminReceiver::class.java)
+    }
+
+    override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
+
+        val builder = AlertDialog.Builder(context!!)
+
+        builder.setTitle(getString(R.string.main_admin_title))
+        builder.setMessage(getString(R.string.main_admin_message))
+        builder.setNegativeButton("no, thanks") { _, _ -> }
+        builder.setPositiveButton("activate") { _, _ ->
+            val intent = Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN)
+            intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mComponentName)
+            intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, getString(R.string.main_admin_message))
+            startActivityForResult(intent, REQUEST_CODE_ENABLE_ADMIN)
+        }
+        return builder.create()
+    }
+}

+ 40 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/main/StatusBarThemeFragment.kt

@@ -0,0 +1,40 @@
+package com.sduduzog.slimlauncher.ui.main
+
+import android.os.Build
+import android.util.TypedValue
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import androidx.fragment.app.Fragment
+import com.sduduzog.slimlauncher.R
+
+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
+
+
+    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 (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
+        }
+    }
+
+}

+ 1 - 1
app/src/main/java/com/sduduzog/slimlauncher/ui/main/notes/NoteFragment.kt

@@ -28,7 +28,7 @@ class NoteFragment : Fragment(), Observer {
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         arguments.let {
-            note = if (it!!.containsKey("note")) {
+            note = if (it !=null && it.containsKey("note")) {
                 it.get("note") as Note
             } else {
                 Note("", -1L)

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

@@ -8,15 +8,15 @@ import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import androidx.core.content.edit
-import androidx.fragment.app.Fragment
 import androidx.recyclerview.widget.ItemTouchHelper
 import androidx.recyclerview.widget.RecyclerView
 import com.sduduzog.slimlauncher.R
 import com.sduduzog.slimlauncher.ui.main.OnItemActionListener
+import com.sduduzog.slimlauncher.ui.main.StatusBarThemeFragment
 import kotlinx.android.synthetic.main.settings_fragment.*
 
 
-class SettingsFragment : Fragment() {
+class SettingsFragment : StatusBarThemeFragment() {
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                               savedInstanceState: Bundle?): View? {
@@ -79,6 +79,8 @@ class SettingsFragment : Fragment() {
         initComponents()
     }
 
+    override fun getFragmentView(): View = settings_fragment
+
     private fun initComponents() {
         val settings = context!!.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
         clockSwitch.isChecked = settings.getBoolean(getString(R.string.prefs_settings_key_clock_type), false)
@@ -88,10 +90,10 @@ class SettingsFragment : Fragment() {
             }
         }
 
-        dialerSwitch.isChecked = settings.getBoolean(getString(R.string.prefs_settings_key_app_dialer), false)
-        dialerSwitch.setOnCheckedChangeListener { _, b ->
+        statusBarSwitch.isChecked = settings.getBoolean(getString(R.string.prefs_settings_key_hide_status_bar), false)
+        statusBarSwitch.setOnCheckedChangeListener { _, b ->
             settings.edit {
-                putBoolean(getString(R.string.prefs_settings_key_app_dialer), b)
+                putBoolean(getString(R.string.prefs_settings_key_hide_status_bar), b)
             }
         }
     }

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

@@ -15,6 +15,7 @@ import androidx.lifecycle.ViewModelProviders
 import androidx.navigation.Navigation
 import androidx.recyclerview.widget.ItemTouchHelper
 import androidx.recyclerview.widget.RecyclerView
+import com.google.android.material.snackbar.Snackbar
 import com.sduduzog.slimlauncher.R
 import com.sduduzog.slimlauncher.data.HomeApp
 import com.sduduzog.slimlauncher.ui.main.MainViewModel
@@ -57,6 +58,12 @@ class SettingsListAdapter(private val fragment: Fragment) : RecyclerView.Adapter
                 }
                 false
             }
+
+            holder.itemView.setOnClickListener {
+                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()
+            }
+
             holder.itemView.setOnLongClickListener {
                 RenameAppDialog.rename(app, viewModel).show(fragment.childFragmentManager, "SettingsListAdapter")
                 renamedOnIndex = position

+ 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()
-    }
-}

+ 5 - 11
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SetupFragment.kt

@@ -9,10 +9,11 @@ import androidx.fragment.app.Fragment
 import androidx.fragment.app.FragmentManager
 import androidx.fragment.app.FragmentPagerAdapter
 import com.sduduzog.slimlauncher.R
+import com.sduduzog.slimlauncher.ui.main.StatusBarThemeFragment
 import kotlinx.android.synthetic.main.setup_fragment.*
 
 
-class SetupFragment : Fragment() {
+class SetupFragment : StatusBarThemeFragment() {
 
     private lateinit var onPagerListener: OnPagerListener
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
@@ -38,20 +39,13 @@ class SetupFragment : Fragment() {
         }
     }
 
+    override fun getFragmentView(): View = setup_view_pager
+
     inner class SectionsPagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {
 
         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 {

+ 14 - 27
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SplashFragment.kt

@@ -6,11 +6,16 @@ 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.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,40 +25,22 @@ 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)) {
             Navigation.findNavController(splash_fragment).navigate(R.id.action_setupFragment_to_mainFragment2)
         }
-        animateViews()
     }
 
-    private fun animateViews() {
-        setup_splash_button_start.alpha = 0f
-        setup_splash_button_start.translationX = -100f
-        welcome_text.alpha = 0f
-        welcome_text.translationY = 100f
-        welcome_title.alpha = 0f
-        welcome_title.translationY = 50f
-        cvIcon.alpha = 0f
-        cvIcon.scaleX = 0.5f
-        cvIcon.scaleY = 0.5f
-        cvIcon.animate().alpha(1f)
-                .scaleX(1f)
-                .scaleY(1f)
-                .duration = 2000
-        welcome_title.animate().alpha(1f)
-                .translationYBy(-50f)
-                .setStartDelay(1500).duration = 1000
-        welcome_text.animate().alpha(1f)
-                .translationYBy(-100f)
-                .setStartDelay(2000).duration = 1000
-        setup_splash_button_start.animate().alpha(1f)
-                .translationXBy(100f)
-                .setStartDelay(2500).duration = 1000
-    }
+        override fun onChooseApps(apps: List<App>) {
+            viewModel.clearHomeApps()
+            viewModel.addToHomeScreen(apps)
+            listener?.onPage(1) // Move to next section
+        }
+
 
     companion object {
         @JvmStatic

+ 9 - 0
app/src/main/res/drawable-v21/ic_call.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="?android:colorForeground"
+        android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z" />
+</vector>

+ 1 - 1
app/src/main/res/drawable/ic_chevron_left.xml → app/src/main/res/drawable-v21/ic_drag_handle.xml

@@ -5,5 +5,5 @@
     android:viewportHeight="24.0">
     <path
         android:fillColor="?android:colorForeground"
-        android:pathData="M15.41,7.41L14,6l-6,6 6,6 1.41,-1.41L10.83,12z" />
+        android:pathData="M20,9H4v2h16V9zM4,15h16v-2H4v2z" />
 </vector>

+ 9 - 0
app/src/main/res/drawable-v21/ic_expand.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="?android:colorForeground"
+        android:pathData="M12,8l-6,6 1.41,1.41L12,10.83l4.59,4.58L18,14z" />
+</vector>

+ 12 - 0
app/src/main/res/drawable-v21/ic_photo_camera.xml

@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="?android:colorForeground"
+        android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
+    <path
+        android:fillColor="?android:colorForeground"
+        android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
+</vector>

BIN
app/src/main/res/drawable/clock_zoomed.webp


BIN
app/src/main/res/drawable/clock_zoomed2.webp


+ 1 - 1
app/src/main/res/drawable/ic_call.xml

@@ -4,6 +4,6 @@
     android:viewportWidth="24.0"
     android:viewportHeight="24.0">
     <path
-        android:fillColor="?android:colorForeground"
+        android:fillColor="@color/colorAccent"
         android:pathData="M6.62,10.79c1.44,2.83 3.76,5.14 6.59,6.59l2.2,-2.2c0.27,-0.27 0.67,-0.36 1.02,-0.24 1.12,0.37 2.33,0.57 3.57,0.57 0.55,0 1,0.45 1,1V20c0,0.55 -0.45,1 -1,1 -9.39,0 -17,-7.61 -17,-17 0,-0.55 0.45,-1 1,-1h3.5c0.55,0 1,0.45 1,1 0,1.25 0.2,2.45 0.57,3.57 0.11,0.35 0.03,0.74 -0.25,1.02l-2.2,2.2z" />
 </vector>

+ 1 - 1
app/src/main/res/drawable/ic_drag_handle.xml

@@ -4,6 +4,6 @@
     android:viewportWidth="24.0"
     android:viewportHeight="24.0">
     <path
-        android:fillColor="?android:colorForeground"
+        android:fillColor="?attr/colorAccent"
         android:pathData="M20,9H4v2h16V9zM4,15h16v-2H4v2z" />
 </vector>

+ 1 - 1
app/src/main/res/drawable/ic_expand.xml

@@ -4,6 +4,6 @@
     android:viewportWidth="24.0"
     android:viewportHeight="24.0">
     <path
-        android:fillColor="?android:colorForeground"
+        android:fillColor="@color/colorAccent"
         android:pathData="M12,8l-6,6 1.41,1.41L12,10.83l4.59,4.58L18,14z" />
 </vector>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 0
app/src/main/res/drawable/ic_my_phone.xml


+ 2 - 2
app/src/main/res/drawable/ic_photo_camera.xml

@@ -4,9 +4,9 @@
     android:viewportWidth="24.0"
     android:viewportHeight="24.0">
     <path
-        android:fillColor="?android:colorForeground"
+        android:fillColor="@color/colorAccent"
         android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
     <path
-        android:fillColor="?android:colorForeground"
+        android:fillColor="@color/colorAccent"
         android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
 </vector>

BIN
app/src/main/res/drawable/nav_options.webp


BIN
app/src/main/res/drawable/nav_options2.webp


BIN
app/src/main/res/drawable/nav_options3.webp


BIN
app/src/main/res/drawable/screenshot.webp


+ 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 - 277
app/src/main/res/layout/dialer_fragment.xml

@@ -1,277 +0,0 @@
-<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"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="com.sduduzog.slimlauncher.ui.main.DialerFragment">
-
-    <TableLayout
-        android:id="@+id/dialer_keys"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginEnd="8dp"
-        android:layout_marginBottom="32dp"
-        android:orientation="horizontal"
-        app:layout_constraintBottom_toTopOf="@+id/fab_dialer"
-        app:layout_constraintDimensionRatio="h,5:4"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent">
-
-        <TableRow
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
-
-            android:gravity="center">
-
-
-            <TextView
-                android:id="@+id/dial_one"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="1"
-                android:text="1"
-                android:textSize="30sp" />
-
-            <TextView
-                android:id="@+id/dial_two"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="2"
-                android:text="2"
-                android:textSize="30sp" />
-
-            <TextView
-                android:id="@+id/dial_three"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="3"
-                android:text="3"
-                android:textSize="30sp" />
-        </TableRow>
-
-        <TableRow
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
-            android:gravity="center">
-
-
-            <TextView
-                android:id="@+id/dial_four"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="4"
-                android:text="4"
-                android:textSize="30sp" />
-
-            <TextView
-                android:id="@+id/dial_five"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="5"
-                android:text="5"
-                android:textSize="30sp" />
-
-            <TextView
-                android:id="@+id/dial_six"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="6"
-                android:text="6"
-                android:textSize="30sp" />
-        </TableRow>
-
-        <TableRow
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
-            android:gravity="center">
-
-
-            <TextView
-                android:id="@+id/dial_seven"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="7"
-                android:text="7"
-                android:textSize="30sp" />
-
-            <TextView
-                android:id="@+id/dial_eight"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="8"
-                android:text="8"
-                android:textSize="30sp" />
-
-            <TextView
-                android:id="@+id/dial_nine"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="9"
-                android:text="9"
-                android:textSize="30sp" />
-        </TableRow>
-
-        <TableRow
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_weight="1"
-            android:gravity="center">
-
-
-            <TextView
-                android:id="@+id/dial_star"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="*"
-                android:text="*"
-                android:textSize="30sp" />
-
-            <TextView
-                android:id="@+id/dial_zero"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="0"
-                android:text="0"
-                android:textSize="30sp" />
-
-            <TextView
-                android:id="@+id/dial_hash"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1"
-                android:background="?attr/selectableItemBackgroundBorderless"
-                android:clickable="true"
-                android:focusable="true"
-                android:gravity="center"
-                android:tag="#"
-                android:text="#"
-                android:textSize="30sp" />
-        </TableRow>
-
-    </TableLayout>
-
-    <com.google.android.material.floatingactionbutton.FloatingActionButton
-        android:id="@+id/fab_dialer"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginBottom="32dp"
-        android:clickable="true"
-        android:focusable="true"
-        android:src="@drawable/ic_call"
-        android:tint="?android:attr/colorForeground"
-        app:backgroundTint="?android:attr/colorBackground"
-        app:backgroundTintMode="src_in"
-        app:elevation="0dp"
-        app:fabCustomSize="75dp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="@+id/dialer_keys"
-        app:layout_constraintStart_toStartOf="@+id/dialer_keys"
-        app:rippleColor="?android:attr/statusBarColor" />
-
-    <EditText
-        android:id="@+id/editText2"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginEnd="16dp"
-        android:layout_marginBottom="5dp"
-        android:background="@android:color/transparent"
-        android:ems="10"
-        android:gravity="center"
-        android:inputType="textPersonName"
-        android:padding="16dp"
-        android:textSize="32sp"
-        app:layout_constraintBottom_toTopOf="@+id/divider"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        tools:ignore="Autofill,LabelFor" />
-
-    <View
-        android:id="@+id/divider"
-        android:layout_width="0dp"
-        android:layout_height="1dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginEnd="8dp"
-        android:layout_marginBottom="8dp"
-        android:background="?android:attr/listDivider"
-        app:layout_constraintBottom_toTopOf="@+id/dialer_keys"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent" />
-
-    <ImageView
-        android:id="@+id/chevron"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="8dp"
-        android:background="?attr/selectableItemBackgroundBorderless"
-        android:clickable="true"
-        android:contentDescription="@string/dialer_chevron"
-        android:focusable="true"
-        android:padding="8dp"
-        android:src="@drawable/ic_chevron_left"
-        android:visibility="invisible"
-        app:layout_constraintBottom_toBottomOf="@+id/editText2"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/editText2" />
-
-</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>

+ 0 - 67
app/src/main/res/layout/home_setup_fragment.xml

@@ -1,67 +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/home_setup_fragment"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context=".ui.main.setup.HomeSetupFragment">
-
-    <!-- TODO: Update blank fragment layout -->
-
-    <TextView
-        android:id="@+id/textView15"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginTop="32dp"
-        android:layout_marginEnd="8dp"
-        android:text="@string/setup_your_home_screen"
-        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/textView16"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="16dp"
-        android:layout_marginEnd="8dp"
-        android:gravity="end"
-        android:text="@string/setup_screen_description"
-        android:textSize="18sp"
-        app:layout_constraintBottom_toBottomOf="@+id/imageView"
-        app:layout_constraintEnd_toStartOf="@+id/imageView"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/imageView" />
-
-    <ImageView
-        android:id="@+id/imageView"
-        android:layout_width="120dp"
-        android:layout_height="211dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="32dp"
-        android:layout_marginBottom="8dp"
-        android:background="?attr/colorPrimaryDark"
-        android:contentDescription="@string/setup_home_screenshot"
-        android:padding="1dp"
-        android:scaleType="centerInside"
-        android:src="@drawable/screenshot"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView15"
-        app:layout_constraintVertical_bias="0.16000003" />
-
-    <Button
-        android:id="@+id/setup_choose_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_choose_apps"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -112,7 +112,8 @@
             android:padding="16dp"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"
-            app:srcCompat="@drawable/ic_call" />
+            app:srcCompat="@drawable/ic_call"
+            android:layout_marginLeft="8dp" />
 
         <ImageView
             android:id="@+id/ivExpand"
@@ -138,7 +139,8 @@
             android:padding="16dp"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintTop_toTopOf="parent"
-            app:srcCompat="@drawable/ic_photo_camera" />
+            app:srcCompat="@drawable/ic_photo_camera"
+            android:layout_marginRight="8dp" />
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 

+ 37 - 13
app/src/main/res/layout/main_content.xml

@@ -11,21 +11,37 @@
         android:id="@+id/clockTextView"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
         android:text="@string/main_placeholder_clock"
-        android:textSize="64sp"
+        android:layout_marginTop="@dimen/_64sdp"
+        android:textSize="@dimen/_40ssp"
+        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"
@@ -33,21 +49,29 @@
         android:layout_height="wrap_content"
         android:layout_marginStart="16dp"
         android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
         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="parent"
-        app:layout_constraintVertical_bias="0.6"
+        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/_140sdp" />
+
+    <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" />

+ 1 - 1
app/src/main/res/layout/notes_list_fragment.xml

@@ -31,7 +31,7 @@
         android:layout_height="wrap_content"
         android:layout_gravity="bottom|end"
         android:layout_margin="16dp"
-        android:src="@drawable/ic_edit"
+        app:srcCompat="@drawable/ic_edit"
         app:layout_anchorGravity="bottom|end" />
 
 </androidx.coordinatorlayout.widget.CoordinatorLayout>

+ 42 - 39
app/src/main/res/layout/settings_fragment.xml

@@ -2,7 +2,7 @@
 <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/frameLayout"
+    android:id="@+id/settings_fragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     tools:context=".ui.main.settings.SettingsFragment">
@@ -12,7 +12,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginStart="16dp"
-        android:layout_marginTop="8dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginTop="24dp"
         android:alpha="0.5"
         android:text="@string/settings_title"
         app:layout_constraintStart_toStartOf="parent"
@@ -31,81 +32,90 @@
         app:layout_constraintTop_toBottomOf="@+id/textView3" />
 
     <TextView
-        android:id="@+id/textView2"
+        android:id="@+id/textView14"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginStart="16dp"
-        android:text="@string/settings_text_use_24_hour_clock"
+        android:layout_marginLeft="16dp"
+        android:text="@string/settings_hide_status_bar"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="18sp"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/divider4" />
 
     <TextView
-        android:id="@+id/textView4"
+        android:id="@+id/textView16"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_marginEnd="8dp"
-        android:text="@string/settings_text_tap_to_check_between_24_hour_or_12_hour"
-        app:layout_constraintEnd_toStartOf="@+id/clockSwitch"
-        app:layout_constraintStart_toStartOf="@+id/textView2"
-        app:layout_constraintTop_toBottomOf="@+id/textView2" />
+        android:layout_marginRight="8dp"
+        android:text="@string/settings_status_bar_when_switched"
+        app:layout_constraintEnd_toStartOf="@+id/statusBarSwitch"
+        app:layout_constraintStart_toStartOf="@+id/textView14"
+        app:layout_constraintTop_toBottomOf="@+id/textView14" />
 
     <Switch
-        android:id="@+id/clockSwitch"
+        android:id="@+id/statusBarSwitch"
         android:layout_width="wrap_content"
-        android:layout_height="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/textView4"
+        app:layout_constraintBottom_toBottomOf="@+id/textView16"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/textView2" />
+        app:layout_constraintTop_toTopOf="@+id/textView14" />
 
     <TextView
-        android:id="@+id/textView9"
+        android:id="@+id/textView2"
         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/settings_use_slim_s_built_in_dialer"
+        android:text="@string/settings_text_use_24_hour_clock"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="18sp"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView4" />
+        app:layout_constraintTop_toBottomOf="@+id/textView16" />
 
     <TextView
-        android:id="@+id/textView10"
-        android:layout_width="wrap_content"
+        android:id="@+id/textView4"
+        android:layout_width="0dp"
         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" />
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:text="@string/settings_text_tap_to_check_between_24_hour_or_12_hour"
+        app:layout_constraintEnd_toStartOf="@+id/clockSwitch"
+        app:layout_constraintStart_toStartOf="@+id/textView2"
+        app:layout_constraintTop_toBottomOf="@+id/textView2" />
 
     <Switch
-        android:id="@+id/dialerSwitch"
+        android:id="@+id/clockSwitch"
         android:layout_width="wrap_content"
-        android:layout_height="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_constraintBottom_toBottomOf="@+id/textView4"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/textView9" />
+        app:layout_constraintTop_toTopOf="@+id/textView2" />
 
     <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" />
+        app:layout_constraintTop_toBottomOf="@+id/textView4" />
 
     <TextView
         android:id="@+id/textView7"
@@ -120,7 +130,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginStart="16dp"
-        android:layout_marginTop="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginTop="8dp"
         android:alpha="0.5"
         android:text="@string/settings_text_home_screen_apps"
         app:layout_constraintStart_toStartOf="parent"
@@ -137,17 +148,6 @@
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/textView8" />
 
-    <TextView
-        android:id="@+id/textView6"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="8dp"
-        android:text="@string/settings_list_item_subtext"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@+id/textView8"
-        app:layout_constraintTop_toBottomOf="@+id/divider2" />
-
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/settingsAppList"
         android:layout_width="0dp"
@@ -159,7 +159,8 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView6"
+        app:layout_constraintTop_toBottomOf="@+id/divider2"
+        tools:itemCount="5"
         tools:listitem="@layout/settings_list_item" />
 
     <androidx.appcompat.widget.AppCompatCheckBox
@@ -169,6 +170,7 @@
         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"
@@ -181,6 +183,7 @@
         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"

+ 7 - 3
app/src/main/res/layout/settings_list_item.xml

@@ -30,7 +30,9 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_marginLeft="16dp"
+        android:layout_marginRight="8dp" />
 
     <Button
         android:id="@+id/item_button"
@@ -43,7 +45,8 @@
         android:text="@string/settings_list_item_button_set_app"
         app:layout_constraintBottom_toBottomOf="@+id/item_text"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="@+id/item_text" />
+        app:layout_constraintTop_toTopOf="@+id/item_text"
+        android:layout_marginRight="8dp" />
 
     <ImageView
         android:id="@+id/item_dragger"
@@ -58,6 +61,7 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent"
-        app:srcCompat="@drawable/ic_drag_handle" />
+        app:srcCompat="@drawable/ic_drag_handle"
+        android:layout_marginRight="8dp" />
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 52 - 55
app/src/main/res/layout/splash_fragment.xml

@@ -7,65 +7,21 @@
     android:layout_height="match_parent"
     tools:context=".ui.main.setup.SplashFragment">
 
-    <!-- TODO: Update blank fragment layout -->
-
-    <androidx.cardview.widget.CardView
-        android:id="@+id/cvIcon"
-        android:layout_width="100dp"
-        android:layout_height="100dp"
-        android:layout_marginStart="32dp"
-        android:layout_marginTop="64dp"
-        android:layout_marginEnd="32dp"
-        app:cardBackgroundColor="@android:color/black"
-        app:cardCornerRadius="50dp"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent">
-
-        <androidx.constraintlayout.widget.ConstraintLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
-
-            <ImageView
-                android:id="@+id/imageView3"
-                android:layout_width="85dp"
-                android:layout_height="50dp"
-                android:contentDescription="@string/app_name"
-                android:scaleType="centerCrop"
-                android:src="@mipmap/ic_launcher"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toTopOf="parent" />
-        </androidx.constraintlayout.widget.ConstraintLayout>
-    </androidx.cardview.widget.CardView>
-
-    <TextView
-        android:id="@+id/welcome_title"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+    <ImageView
+        android:id="@+id/imageView3"
+        android:layout_width="@dimen/_60sdp"
+        android:layout_height="@dimen/_60sdp"
         android:layout_marginStart="8dp"
-        android:layout_marginTop="64dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginTop="@dimen/_50sdp"
         android:layout_marginEnd="8dp"
-        android:text="@string/setup_text_welcome"
-        android:textSize="36sp"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/cvIcon" />
-
-    <TextView
-        android:id="@+id/welcome_text"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginStart="32dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginEnd="32dp"
-        android:gravity="center"
-        android:text="@string/setup_text_lets_get_you_set_up"
-        android:textSize="18sp"
+        android:layout_marginRight="8dp"
+        android:contentDescription="@string/app_name"
+        android:scaleType="fitCenter"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/welcome_title" />
+        app:layout_constraintTop_toTopOf="parent"
+        app:srcCompat="@mipmap/ic_launcher" />
 
     <Button
         android:id="@+id/setup_splash_button_start"
@@ -73,8 +29,49 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
         android:layout_marginBottom="16dp"
         android:text="@string/setup_button_start"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent" />
+
+    <TextView
+        android:id="@+id/textView13"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginTop="@dimen/_16sdp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:text="@string/setup_welcome"
+        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/_140sdp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="@dimen/_110sdp"
+        android:layout_marginLeft="@dimen/_110sdp"
+        android:layout_marginTop="@dimen/_94sdp"
+        android:text="@string/setup_welcome2"
+        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/_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"
+        app:layout_constraintTop_toBottomOf="@+id/textView13"
+        app:srcCompat="@drawable/ic_my_phone" />
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 18 - 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,15 @@
         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:contentDescription="@string/setup_text_default"
+        android:layout_marginLeft="8dp" />
 
     <com.google.android.material.floatingactionbutton.FloatingActionButton
         android:id="@+id/setup_fab_dark"
@@ -41,7 +42,8 @@
         android:layout_height="wrap_content"
         android:clickable="true"
         android:focusable="true"
-        android:src="@drawable/ic_text_fields"
+        app:srcCompat="@drawable/ic_text_fields"
+        android:contentDescription="@string/setup_text_dark"
         android:tint="@color/inverseTextColor"
         app:backgroundTint="@color/primaryDarkColor"
         app:fabSize="normal"
@@ -56,15 +58,17 @@
         android:layout_height="wrap_content"
         android:layout_marginEnd="8dp"
         android:clickable="true"
+        android:contentDescription="@string/setup_text_jupiter"
         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 +77,8 @@
         android:layout_marginTop="32dp"
         android:clickable="true"
         android:focusable="true"
-        android:src="@drawable/ic_text_fields"
+        android:contentDescription="@string/setup_text_teal"
+        app:srcCompat="@drawable/ic_text_fields"
         app:backgroundTint="@color/colorTeal"
         app:fabSize="normal"
         app:layout_constraintEnd_toStartOf="@+id/setup_fab_candy"
@@ -86,8 +91,9 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:clickable="true"
+        android:contentDescription="@string/setup_text_candy"
         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,10 +108,11 @@
         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"
+        android:contentDescription="@string/setup_text_pastel"
         app:layout_constraintHorizontal_bias="0.5"
         app:layout_constraintStart_toEndOf="@+id/setup_fab_candy"
         app:layout_constraintTop_toTopOf="@+id/setup_fab_candy" />
@@ -175,6 +182,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>

+ 2 - 8
app/src/main/res/navigation/nav_graph.xml

@@ -13,9 +13,7 @@
         <action
             android:id="@+id/action_mainFragment_to_notesListFragment"
             app:destination="@id/notesListFragment" />
-        <action
-            android:id="@+id/action_mainFragment_to_dialerFragment"
-            app:destination="@id/dialerFragment" />
+
         <action
             android:id="@+id/action_mainFragment_to_settingsFragment"
             app:destination="@id/settingsFragment" />
@@ -65,9 +63,5 @@
         android:name="com.sduduzog.slimlauncher.ui.main.notes.NoteFragment"
         android:label="note_fragment"
         tools:layout="@layout/note_fragment" />
-    <fragment
-        android:id="@+id/dialerFragment"
-        android:name="com.sduduzog.slimlauncher.ui.main.DialerFragment"
-        android:label="dialer_fragment"
-        tools:layout="@layout/dialer_fragment" />
+
 </navigation>

+ 0 - 13
app/src/main/res/values-v23/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>
-        <item name="android:windowLightStatusBar">true</item>
-    </style>
-</resources>

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

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

+ 2 - 2
app/src/main/res/values/colors.xml

@@ -14,8 +14,8 @@
     <color name="colorPink">#fce4ec</color>
     <color name="colorPinkDark">#F8BBD0</color>
 
-    <color name="colorTeal">#e0f2f1</color>
-    <color name="colorTealDark">#B2DFDB</color>
+    <color name="colorTeal">#B2DFDB</color>
+    <color name="colorTealDark">#80CBC4</color>
 
     <color name="inverseTextColor">#e0e0e0</color>
     <color name="inverseAccentColor">#607d8b</color>

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

@@ -1,4 +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_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_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>

+ 16 - 27
app/src/main/res/values/strings.xml

@@ -15,11 +15,14 @@
     <string name="prefs_settings">settings</string>
     <string name="prefs_settings_key_theme">key_theme</string>
     <string name="prefs_settings_key_clock_type">clock_type</string>
-    <string name="prefs_settings_key_app_dialer">app_dialer</string>
+    <string name="prefs_settings_key_hide_status_bar">hide_status_bar</string>
     <string name="prefs_settings_key_fresh_install_setup">key_fresh_install_setup</string>
 
     <!--main package strings-->
 
+    <string name="setup_welcome">Welcome!</string>
+    <string name="setup_welcome2">This is what your home screen will look like. But better! Let\'s get you setup.</string>
+
     <string name="main_slim_options">Slim options</string>
     <string name="main_options_change_theme">Change theme</string>
     <string name="main_options_home_screen_apps">Preferences</string>
@@ -38,25 +41,23 @@
     <string name="settings_text_tap_to_change_app_theme">Choose from a variety of themes</string>
     <string name="settings_text_home_screen_apps">Home screen apps</string>
     <string name="settings_title">Preferences</string>
+    <string name="settings_use_slim_s_built_in_dialer">Use Slim\'s built-in dialer</string>
+    <string name="settings_faster_shortcut_to_your_calls">Faster shortcut to your calls</string>
+    <string name="settings_status_bar_when_switched">When switched on, you can still drag down from the top to reveal it</string>
+    <string name="settings_hide_status_bar">Hide status bar</string>
 
     <string name="settings_list_item_button_set_app">Set app</string>
     <string name="settings_list_item_text">Slot empty</string>
-    <string name="settings_list_item_subtext">Swipe left/right to remove an app. Drag handlebars to reorder. Long press to rename</string>
     <string name="settings_button_change_theme">Change</string>
     <string name="about_title">Slim launcher</string>
     <string name="about_text">
-    Slim v2.1.2 \u00a9 2018\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.4 \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>
     <string name="main_photo_camera_icon">photo camera icon</string>
     <string name="setup_button_start">start</string>
-    <string name="setup_text_welcome">Welcome!</string>
-    <string name="setup_text_lets_get_you_set_up">
-    "Lets get you set up!\n Just a few tweaks and your new home screen will be ready for you."
-    </string>
 
-    <string name="setup_button_next">next</string>
     <string name="setup_button_finish">Finish</string>
 
     <string name="no_app_selected_toast_msg">Choose at least one app</string>
@@ -65,7 +66,6 @@
 
     <string name="notes_date_placeholder">Edited at %s</string>
 
-    <string name="dialer_chevron">deleter</string>
     <string name="settings_item_icon_drag_handler">Dragger</string>
 
     <string name="setup_choose_theme">Choose Theme</string>
@@ -75,23 +75,12 @@
     <string name="setup_text_teal">Teal</string>
     <string name="setup_text_candy">Candy</string>
     <string name="setup_text_pastel">Pastel</string>
-    <string name="setup_we_re_almost_done">We\'re almost done!</string>
-    <string name="setup_expand_note">1. To open Slim options, click the arrow or swipe upwards from it.</string>
-    <string name="setup_note_camera">3. Press the camera icon to launch the default camera app</string>
-    <string name="setup_note_dialer">2. Press the dialer icon to open the default dialer</string>
-    <string name="screenshot_nav">Nav screenshot</string>
-    <string name="setup_dialer_note2">2. Press the dialer icon to open the built-in dialer(experimental). Press and hold, open the default</string>
-    <string name="setup_your_home_screen">Your home screen</string>
-    <string name="setup_screen_description">
-        "This is what your home screen will look like.\n\n"
-        "You should pick five of the apps you use the most.\n\n"
-        "You can later change them in Preferences."
-    </string>
-    <string name="setup_choose_apps">Choose apps</string>
-    <string name="setup_home_screenshot">Screenshot</string>
-    <string name="setup_clock_type_text_description">This is also changeable in preferences. Whether you prefer a 12hr clock type or a 24hr clock type</string>
-    <string name="setup_clock_type">Clock Type</string>
-    <string name="settings_use_slim_s_built_in_dialer">Use Slim\'s built-in dialer</string>
-    <string name="settings_faster_shortcut_to_your_calls">Faster shortcut to your calls</string>
+
+
+    <!-- Content Description For Image Resources-->
+    <string name="content_description_my_phone">My phone</string>
+    <string name="main_admin_title">Allow Slim to lock your device</string>
+    <string name="main_admin_message">Double tapping on the free space on your home screen locks your device instantly.</string>
+
 
 </resources>

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

@@ -4,11 +4,9 @@
     <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>
 
     <style name="AppDarkTheme" parent="@style/Theme.AppCompat.NoActionBar">
@@ -16,16 +14,13 @@
         <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>
-        <item name="android:statusBarColor">?android:attr/colorPrimary</item>
     </style>
 
     <style name="AppGreyTheme" parent="@style/AppDarkTheme">
         <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>
@@ -34,8 +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">?android:attr/colorPrimary</item>
-        <!--<item name="android:statusBarColor">@color/colorCandyDark</item>-->
     </style>
 
     <style name="AppPinkTheme" parent="AppTheme">

+ 6 - 0
app/src/main/res/xml/admin.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<device-admin>
+    <uses-policies>
+        <force-lock />
+    </uses-policies>
+</device-admin>

+ 0 - 5
app/src/test/java/com/sduduzog/slimlauncher/ExampleUnitTest.java

@@ -1,5 +0,0 @@
-package com.sduduzog.slimlauncher;
-
-public class ExampleUnitTest {
-
-}

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است