Преглед изворни кода

Squashed commit of the following:

commit 1fee0ec871ac702be0e24f6915ab0654bc982aea
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Mon Oct 29 04:49:08 2018 -0500

    Revert "Attempts to fix weird markdown standard"

    This reverts commit 9654c8fc9b42a421d02cc43665d8a664dbc229b0.

commit 9654c8fc9b42a421d02cc43665d8a664dbc229b0
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Mon Oct 29 04:41:31 2018 -0500

    Attempts to fix weird markdown standard

    - Attempts to fix '[list-item-indent] Incorrect list-item indent: add 2 spaces' warning
    - remark-stringify uses 'tab-size' (named 'tab' there) by default to ensure markdown is seen the same way across vendors. This can be configured with the listItemIndent option. This rule’s 'space' option is named '1' there.

commit aa914f30943aaf7267806dd6e9a9fca012331431
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Mon Oct 29 04:35:52 2018 -0500

    Updates ReadMe formatting

commit 7a5430ab74f2a387005e3b512af6541dd9789c45
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Sun Oct 28 08:49:46 2018 -0500

    Removes unnecessary exception handling

    - Attempts to fix the below warning shown in the code. Realized there's no need for an exception handling in the first place.
    - If you expect to face an exception, handle the specific exception
    - TooGenericExceptionCaught
      - This rule reports catch blocks for exceptions that have a type that is too generic. It should be preferred to catch specific exceptions to the case that is currently handled. If the scope of the caught exception is too broad it can lead to unintended exceptions being caught.

commit 8df7a468df19785c9ee848744d382ebee8d892aa
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Sun Oct 28 08:44:30 2018 -0500

    Addresses *UnsafeCallOnNullableType* warnings by using elvis operator wherever applicable

commit 111582adfe0931426416a1cf716ee1ffcc1d2fb2
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Sun Oct 28 08:23:32 2018 -0500

    Upgrades the plugin versions

commit 8233cde664441ce785c295a767f38081d707a076
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Sun Oct 28 07:34:42 2018 -0500

    Fixes gitignore

commit d96996cf70b0533f77235cf04f5e27dac3257406
Merge: f116394 b7952fa
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Sun Oct 28 07:28:54 2018 -0500

    Merge branch 'master' of github.com:subbramanil/slim-launcher

commit f116394038ca3593d207da9acf7e9c3d024240e6
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Sun Oct 28 07:28:37 2018 -0500

    Addressing Code quality Warnings-I

    - Addresses *UnsafeCallOnNullableType* warnings
      - Uses type safe '?.' operator in place of '!!' where applicable
    - Addresses *unchecked cast any to T* warning
      - Uses [reified type parameters](https://kotlinlang.org/docs/reference/inline-functions.html#reified-type-parameters)

commit b7952fa606ca00e5ca963d05286b2cb3c5cb9f10
Author: Subbramanian Lakshmanan <subbramanil@gmail.com>
Date:   Sun Oct 28 07:06:59 2018 -0500

    Set theme jekyll-theme-minimal

commit 65d181de8af8a186c293dcd352bcc24b487fe5b3
Merge: 6d2b937 cba3384
Author: Subbramanian Lakshmanan <subbu@esi-estech.com>
Date:   Sun Oct 28 06:29:55 2018 -0500

    Merge branch 'master' of github.com:sduduzog/slim-launcher

commit cba3384a9da75c931bd79311a5f899d428716b87
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 23:03:46 2018 +0200

    version code upload

commit 9c972850fbba5b8845043f3484e8ed0e62c767be
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 22:41:20 2018 +0200

    androidx test dep

commit 7ee47a7cdd9b76423753bf7f4f11240a8331af5d
Merge: 2cfa395 667a097
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 22:29:53 2018 +0200

    Merge remote-tracking branch 'origin/master'

    # Conflicts:
    #	app/build.gradle

commit 2cfa3955d8a5e199e6cfa90c1bd634d06c051011
Merge: 424d651 cd04437
Author: Beautus Sduduzo Gumede <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 20:59:28 2018 +0200

    Merge remote-tracking branch 'origin/master'

commit 667a09761c37d4c58f0831526c49a140a216e3a4
Merge: 424d651 cd04437
Author: Beautus Sduduzo Gumede <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 20:59:28 2018 +0200

    Merge remote-tracking branch 'origin/master'

commit 424d651a3bffc5c091e7865b0f2ef20966ad3089
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 20:56:08 2018 +0200

    Fix up fixed dependencies | 100% Kotlin project

commit e614a65903bff77d46c6dd912315e0c3ae4d5ebf
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 20:45:20 2018 +0200

    Fix up

commit cd04437ee4e7dd898dcc58b32236587830b5df41
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 19:13:32 2018 +0200

    Completely kotlin code for project

commit 0abcfc3ce9f38ece4057aafd3c01d96f53aee879
Merge: a098f5a ad6f902
Author: Beautus Sduduzo Gumede <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 07:58:41 2018 +0200

    Merge branch 'initial-setup-feature'

commit ad6f90266405980af148c8f475bd46873ef1aafe
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 07:55:25 2018 +0200

    Gradle app version

commit 8e0b71954c802ca74ae98ed299e298d91f16eb79
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 07:53:09 2018 +0200

    Cleaned Lint results

commit bdbd43909b9ec019a93bb05a2004523d5f2a8927
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 07:06:26 2018 +0200

    Cleaned Lint results

commit fad29ed86eeeca35958d7be6403e288c2d516028
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Sat Oct 13 06:32:53 2018 +0200

    setup screen for fresh installs

commit 8cdeea152355b97257746f2a219d8eae310ba101
Author: sduduzog <gumedesduduzo@gmail.com>
Date:   Fri Oct 12 21:56:16 2018 +0200

    kotlin extension dependencies

commit a098f5af2bfa541e4d1a9557405326ab3f178df7
Merge: 9789193 67ce106
Author: Beautus Sduduzo Gumede <gumedesduduzo@gmail.com>
Date:   Sun Oct 7 17:02:08 2018 +0200

    Merge remote-tracking branch 'origin/master'

commit 9789193367f2cebbb796b69b1a5d567d9e60df03
Author: Beautus Sduduzo Gumede <gumedesduduzo@gmail.com>
Date:   Sun Oct 7 17:01:56 2018 +0200

    cleanup

commit 67ce106aea665d129820415809ff8ecf97bb907b
Merge: e313842 28f4c89
Author: Beautus Sduduzo Gumede <gumedesduduzo@gmail.com>
Date:   Sun Oct 7 17:00:57 2018 +0200

    Merge pull request #1 from subbramanil/master

    Initialize Testing Framework
Subbramanian Lakshmanan пре 7 година
родитељ
комит
1c0f9aecf8
50 измењених фајлова са 834 додато и 254 уклоњено
  1. 6 3
      README.md
  2. 1 0
      _config.yml
  3. 25 16
      app/build.gradle
  4. 9 11
      app/src/androidTest/java/com/sduduzog/slimlauncher/DBTest.kt
  5. 3 3
      app/src/androidTest/java/com/sduduzog/slimlauncher/LiveDataTestUtil.kt
  6. 2 6
      app/src/androidTest/java/com/sduduzog/slimlauncher/TestUtil.kt
  7. 1 1
      app/src/main/AndroidManifest.xml
  8. 3 2
      app/src/main/java/com/sduduzog/slimlauncher/MainActivity.kt
  9. 0 16
      app/src/main/java/com/sduduzog/slimlauncher/data/App.kt
  10. 0 26
      app/src/main/java/com/sduduzog/slimlauncher/data/AppRoomDatabase.java
  11. 0 16
      app/src/main/java/com/sduduzog/slimlauncher/data/HomeApp.kt
  12. 1 1
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/AboutFragment.kt
  13. 20 26
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/AppsFragment.kt
  14. 2 2
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/AppsListAdapter.kt
  15. 2 2
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainAppsAdapter.kt
  16. 15 19
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainFragment.kt
  17. 13 12
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/SettingsFragment.kt
  18. 2 2
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/SettingsListAdapter.kt
  19. 6 3
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/ThemeChooserDialog.kt
  20. 16 0
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/App.kt
  21. 3 6
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/AppDao.kt
  22. 4 9
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/AppRepository.kt
  23. 29 0
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/AppRoomDatabase.kt
  24. 16 0
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/HomeApp.kt
  25. 4 10
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/MainViewModel.kt
  26. 8 0
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/DialogInteractionListener.kt
  27. 240 0
      app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SetupFragment.kt
  28. 9 0
      app/src/main/res/drawable/ic_check.xml
  29. 5 6
      app/src/main/res/layout-sw600dp/main_content.xml
  30. 2 2
      app/src/main/res/layout-sw600dp/main_fragment.xml
  31. 2 2
      app/src/main/res/layout-sw600dp/main_list_item.xml
  32. 139 0
      app/src/main/res/layout-v21/settings_fragment.xml
  33. 2 2
      app/src/main/res/layout/apps_fragment.xml
  34. 2 2
      app/src/main/res/layout/fragment_about.xml
  35. 5 5
      app/src/main/res/layout/main_bottom_sheet.xml
  36. 5 6
      app/src/main/res/layout/main_content.xml
  37. 2 2
      app/src/main/res/layout/main_fragment.xml
  38. 2 2
      app/src/main/res/layout/main_list_item.xml
  39. 2 2
      app/src/main/res/layout/settings_apps_list_item.xml
  40. 8 10
      app/src/main/res/layout/settings_fragment.xml
  41. 180 0
      app/src/main/res/layout/setup_fragment.xml
  42. 10 1
      app/src/main/res/navigation/nav_graph.xml
  43. 0 10
      app/src/main/res/values/colors.xml
  44. 1 0
      app/src/main/res/values/dimens.xml
  45. 22 3
      app/src/main/res/values/strings.xml
  46. 0 1
      app/src/main/res/values/styles.xml
  47. 0 4
      app/src/test/java/com/sduduzog/slimlauncher/MethodTestUtils.kt
  48. 1 0
      build.gradle
  49. 2 0
      gradle.properties
  50. 2 2
      gradle/wrapper/gradle-wrapper.properties

+ 6 - 3
README.md

@@ -11,15 +11,18 @@ The project got inspired by LessPhone [LessPhone](https://play.google.com/store/
 I liked it so much but I couldn't do with just 3 apps as daily apps so tah-daaa Slim launcher, everyone!
 
 ## TODO
+
 ### Features that I think will make this really cool for the app
+
 - quick voice recorder
 - notes app
 - todo list
 
 ### For the project
--Migrate to stable version of android studio for better contribution accessibility
--Write all tests for the app
 
-# Contribute
+- Migrate to stable version of android studio for better contribution accessibility
+- Write all tests for the app
+
+### Contribute
 
 - PRs are more than welcome.

+ 1 - 0
_config.yml

@@ -0,0 +1 @@
+theme: jekyll-theme-minimal

+ 25 - 16
app/build.gradle

@@ -4,15 +4,17 @@ apply plugin: 'kotlin-android'
 
 apply plugin: 'kotlin-android-extensions'
 
+apply plugin: 'kotlin-kapt'
+
 android {
     compileSdkVersion 28
     defaultConfig {
         applicationId "com.sduduzog.slimlauncher"
         minSdkVersion 15
         targetSdkVersion 28
-        versionCode 14
-        versionName "1.2.6"
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        versionCode 15
+        versionName "1.3.0"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         vectorDrawables.useSupportLibrary = true
     }
     buildTypes {
@@ -30,22 +32,26 @@ android {
 
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
+
+    // Kotlin Libraries
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
 
     // Support Libraries
-    implementation 'com.android.support:appcompat-v7:28.0.0'
-    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
-    implementation 'com.android.support:cardview-v7:28.0.0'
-    implementation 'com.android.support:design:28.0.0'
-    implementation 'com.android.support:recyclerview-v7:28.0.0'
+    implementation 'androidx.appcompat:appcompat:1.0.0'
+    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+    implementation 'androidx.cardview:cardview:1.0.0'
+    implementation 'androidx.recyclerview:recyclerview:1.0.0'
+
+    // Google Libraries
+    implementation 'com.google.android.material:material:1.0.0'
 
     // Arch Components
-    implementation 'android.arch.lifecycle:extensions:1.1.1'
+    implementation 'androidx.core:core-ktx:1.0.0'
+    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
     implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha06'
-    implementation 'android.arch.persistence.room:runtime:1.1.1'
-    annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
-    implementation 'android.arch.lifecycle:extensions:1.1.1'
-    annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
+    implementation 'androidx.room:room-runtime:2.1.0-alpha01'
+    kapt "androidx.room:room-compiler:2.1.0-alpha01"
+    kapt "androidx.lifecycle:lifecycle-compiler:2.0.0"
 
     // 3rd Party libs
     implementation 'com.daasuu:EasingInterpolator:1.0.0'
@@ -53,7 +59,10 @@ dependencies {
     // Test libs
     testImplementation 'junit:junit:4.12'
     testImplementation 'org.mockito:mockito-core:2.7.6'
-    androidTestImplementation 'android.arch.persistence.room:testing:1.1.1'
-    androidTestImplementation 'com.android.support.test:runner:1.0.2'
-    androidTestImplementation 'com.android.support.test:rules:1.0.2'
+    androidTestImplementation 'androidx.room:room-testing:2.1.0-alpha01'
+    androidTestImplementation 'androidx.test:runner:1.1.0'
+    androidTestImplementation 'androidx.test:rules:1.1.0'
+    androidTestImplementation 'androidx.annotation:annotation:1.0.0'
+    androidTestImplementation 'androidx.test:runner:1.1.0'
+    androidTestImplementation 'androidx.test:rules:1.1.0'
 }

+ 9 - 11
app/src/androidTest/java/com/sduduzog/slimlauncher/DBTest.kt

@@ -1,13 +1,11 @@
 package com.sduduzog.slimlauncher
 
-import android.arch.persistence.room.Room
-import android.content.Context
-import android.support.test.InstrumentationRegistry
-import android.support.test.runner.AndroidJUnit4
+import androidx.room.Room
+import androidx.test.InstrumentationRegistry
+import androidx.test.runner.AndroidJUnit4
 
-import com.sduduzog.slimlauncher.data.App
-import com.sduduzog.slimlauncher.data.AppDao
-import com.sduduzog.slimlauncher.data.AppRoomDatabase
+import com.sduduzog.slimlauncher.ui.main.model.AppDao
+import com.sduduzog.slimlauncher.ui.main.model.AppRoomDatabase
 
 import org.junit.After
 import org.junit.Before
@@ -27,19 +25,19 @@ class DBTest {
     fun createDb() {
         val context = InstrumentationRegistry.getTargetContext()
         mDb = Room.inMemoryDatabaseBuilder(context, AppRoomDatabase::class.java).build()
-        mAppDao = mDb!!.appDao()
+        mAppDao = mDb?.appDao()
     }
 
     @After
     fun closeDb() {
-        mDb!!.close()
+        mDb?.close()
     }
 
     @Test
     @Throws(InterruptedException::class)
     fun testInsertLiveDataApps() {
-        val app = TestUtil.createApp("TestApp", "com.test.testapp", "TestMainActivity")
-        mAppDao!!.insert(app)
+        val app = TestUtil.createApp("TestApp", "com.test.test.app", "TestMainActivity")
+        mAppDao?.insert(app)
         val appsInstalled = LiveDataTestUtil.getValue(mAppDao!!.apps)
         assertThat(appsInstalled.size, equalTo(1))
     }

+ 3 - 3
app/src/androidTest/java/com/sduduzog/slimlauncher/LiveDataTestUtil.kt

@@ -1,7 +1,7 @@
 package com.sduduzog.slimlauncher
 
-import android.arch.lifecycle.LiveData
-import android.arch.lifecycle.Observer
+import androidx.lifecycle.LiveData
+import androidx.lifecycle.Observer
 
 import java.util.concurrent.CountDownLatch
 import java.util.concurrent.TimeUnit
@@ -9,7 +9,7 @@ import java.util.concurrent.TimeUnit
 object LiveDataTestUtil {
 
     @Throws(InterruptedException::class)
-    fun <T> getValue(liveData: LiveData<T>): T {
+    inline fun <reified T> getValue(liveData: LiveData<T>): T {
         val data = arrayOfNulls<Any>(1)
         val latch = CountDownLatch(1)
         val observer = object : Observer<T> {

+ 2 - 6
app/src/androidTest/java/com/sduduzog/slimlauncher/TestUtil.kt

@@ -1,14 +1,10 @@
 package com.sduduzog.slimlauncher
 
-import com.sduduzog.slimlauncher.data.App
+import com.sduduzog.slimlauncher.ui.main.model.App
 
 internal object TestUtil {
 
     fun createApp(appName: String, packageName: String, activityName: String): App {
-        val app = App()
-        app.appName = appName
-        app.packageName = packageName
-        app.activityName = activityName
-        return app
+        return App(appName, packageName, activityName)
     }
 }

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

@@ -14,11 +14,11 @@
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
         tools:ignore="GoogleAppIndexingWarning"
-
         tools:replace="android:allowBackup">
         <activity
             android:name=".MainActivity"
             android:launchMode="singleTask"
+            android:screenOrientation="portrait"
             android:stateNotNeeded="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />

+ 3 - 2
app/src/main/java/com/sduduzog/slimlauncher/MainActivity.kt

@@ -1,13 +1,14 @@
 package com.sduduzog.slimlauncher
 
-import android.arch.lifecycle.ViewModelProviders
+import androidx.lifecycle.ViewModelProviders
 import android.content.SharedPreferences
 import android.content.res.Resources
 import android.os.Bundle
-import android.support.v7.app.AppCompatActivity
+import androidx.appcompat.app.AppCompatActivity
 import androidx.navigation.NavController
 import androidx.navigation.NavDestination
 import androidx.navigation.Navigation.findNavController
+import com.sduduzog.slimlauncher.ui.main.model.MainViewModel
 
 
 class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceChangeListener, NavController.OnNavigatedListener {

+ 0 - 16
app/src/main/java/com/sduduzog/slimlauncher/data/App.kt

@@ -1,16 +0,0 @@
-package com.sduduzog.slimlauncher.data
-
-import android.arch.persistence.room.ColumnInfo
-import android.arch.persistence.room.Entity
-import android.arch.persistence.room.PrimaryKey
-
-@Entity(tableName = "apps")
-class App {
-    @field:ColumnInfo(name = "app_name")
-    lateinit var appName: String
-    @PrimaryKey
-    @field:ColumnInfo(name = "package_name")
-    lateinit var packageName: String
-    @field:ColumnInfo(name = "activity_name")
-    lateinit var activityName: String
-}

+ 0 - 26
app/src/main/java/com/sduduzog/slimlauncher/data/AppRoomDatabase.java

@@ -1,26 +0,0 @@
-package com.sduduzog.slimlauncher.data;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.Room;
-import android.arch.persistence.room.RoomDatabase;
-import android.content.Context;
-
-@Database(entities = {App.class, HomeApp.class}, version = 1, exportSchema = false)
-public abstract class AppRoomDatabase extends RoomDatabase {
-    private static volatile AppRoomDatabase INSTANCE;
-
-    public static AppRoomDatabase getDatabase(final Context context) {
-        if (INSTANCE == null) {
-            synchronized (AppRoomDatabase.class) {
-                if (INSTANCE == null) {
-                    INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
-                            AppRoomDatabase.class, "app_database")
-                            .build();
-                }
-            }
-        }
-        return INSTANCE;
-    }
-
-    public abstract AppDao appDao();
-}

+ 0 - 16
app/src/main/java/com/sduduzog/slimlauncher/data/HomeApp.kt

@@ -1,16 +0,0 @@
-package com.sduduzog.slimlauncher.data
-
-import android.arch.persistence.room.ColumnInfo
-import android.arch.persistence.room.Entity
-import android.arch.persistence.room.PrimaryKey
-
-@Entity(tableName = "home_apps")
-class HomeApp {
-    @field:ColumnInfo(name = "app_name")
-    lateinit var appName: String
-    @PrimaryKey
-    @field:ColumnInfo(name = "package_name")
-    lateinit var packageName: String
-    @field:ColumnInfo(name = "activity_name")
-    lateinit var activityName: String
-}

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

@@ -2,7 +2,7 @@ package com.sduduzog.slimlauncher.ui.main
 
 
 import android.os.Bundle
-import android.support.v4.app.Fragment
+import androidx.fragment.app.Fragment
 import android.text.method.LinkMovementMethod
 import android.view.LayoutInflater
 import android.view.View

+ 20 - 26
app/src/main/java/com/sduduzog/slimlauncher/ui/main/AppsFragment.kt

@@ -1,19 +1,19 @@
 package com.sduduzog.slimlauncher.ui.main
 
-import android.arch.lifecycle.Observer
-import android.arch.lifecycle.ViewModelProviders
 import android.content.Intent
 import android.content.pm.ResolveInfo
 import android.os.Bundle
-import android.support.v4.app.Fragment
-import android.support.v7.widget.RecyclerView
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.Observer
+import androidx.lifecycle.ViewModelProviders
 import androidx.navigation.Navigation
-import com.sduduzog.slimlauncher.MainViewModel
 import com.sduduzog.slimlauncher.R
-import com.sduduzog.slimlauncher.data.App
+import com.sduduzog.slimlauncher.ui.main.model.App
+import com.sduduzog.slimlauncher.ui.main.model.MainViewModel
+import kotlinx.android.synthetic.main.apps_fragment.*
 import java.util.*
 
 
@@ -22,11 +22,20 @@ class AppsFragment : Fragment() {
     private var apps: MutableList<App> = mutableListOf()
     private lateinit var viewModel: MainViewModel
     private lateinit var mAdapter: AppsListAdapter
-    private lateinit var layout: RecyclerView
 
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                               savedInstanceState: Bundle?): View? {
-        val view = inflater.inflate(R.layout.apps_fragment, container, false)
+        return inflater.inflate(R.layout.apps_fragment, container, false)
+    }
+
+    override fun onActivityCreated(savedInstanceState: Bundle?) {
+        super.onActivityCreated(savedInstanceState)
+        viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
+        viewModel.apps.observe(this, Observer {
+            if (it != null) {
+                mAdapter.setList(it)
+            }
+        })
         val pm = activity!!.packageManager
         val main = Intent(Intent.ACTION_MAIN, null)
 
@@ -38,32 +47,17 @@ class AppsFragment : Fragment() {
         for (i in launchables.indices) {
             val item = launchables[i]
             val activity = item.activityInfo
-            val app = App()
-            app.appName = launchables[i].loadLabel(pm).toString()
-            app.packageName = activity.applicationInfo.packageName
-            app.activityName = activity.name
+            val app = App(launchables[i].loadLabel(pm).toString(), activity.applicationInfo.packageName, activity.name)
             apps.add(app)
         }
         mAdapter = AppsListAdapter(listOf(), InteractionHandler())
-        layout = view.findViewById(R.id.appList)
-        layout.adapter = mAdapter
-        return view
-    }
-
-    override fun onActivityCreated(savedInstanceState: Bundle?) {
-        super.onActivityCreated(savedInstanceState)
-        viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
-        viewModel.apps.observe(this, Observer {
-            if (it != null) {
-                mAdapter.setList(it)
-            }
-        })
+        appList.adapter = mAdapter
     }
 
     inner class InteractionHandler : OnListFragmentInteractionListener {
         override fun onListFragmentInteraction(app: App) {
             viewModel.addToHomeScreen(app)
-            val nav = Navigation.findNavController(layout)
+            val nav = Navigation.findNavController(appList)
             nav.popBackStack()
         }
     }

+ 2 - 2
app/src/main/java/com/sduduzog/slimlauncher/ui/main/AppsListAdapter.kt

@@ -1,12 +1,12 @@
 package com.sduduzog.slimlauncher.ui.main
 
-import android.support.v7.widget.RecyclerView
+import androidx.recyclerview.widget.RecyclerView
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import android.widget.TextView
 import com.sduduzog.slimlauncher.R
-import com.sduduzog.slimlauncher.data.App
+import com.sduduzog.slimlauncher.ui.main.model.App
 
 
 import com.sduduzog.slimlauncher.ui.main.AppsFragment.OnListFragmentInteractionListener

+ 2 - 2
app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainAppsAdapter.kt

@@ -1,12 +1,12 @@
 package com.sduduzog.slimlauncher.ui.main
 
-import android.support.v7.widget.RecyclerView
+import androidx.recyclerview.widget.RecyclerView
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import android.widget.TextView
 import com.sduduzog.slimlauncher.R
-import com.sduduzog.slimlauncher.data.HomeApp
+import com.sduduzog.slimlauncher.ui.main.model.HomeApp
 
 class MainAppsAdapter(private var mValues: MutableSet<HomeApp>,
                       private val mListener: MainFragment.OnListFragmentInteractionListener?)

+ 15 - 19
app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainFragment.kt

@@ -1,31 +1,31 @@
 package com.sduduzog.slimlauncher.ui.main
 
 import android.animation.ObjectAnimator
-import android.arch.lifecycle.Observer
-import android.arch.lifecycle.ViewModelProviders
 import android.content.*
 import android.content.Context.MODE_PRIVATE
 import android.net.Uri
 import android.os.Build
 import android.os.Bundle
 import android.provider.MediaStore
-import android.support.design.widget.BottomSheetBehavior
-import android.support.design.widget.BottomSheetBehavior.STATE_COLLAPSED
-import android.support.design.widget.BottomSheetBehavior.STATE_HALF_EXPANDED
-import android.support.v4.app.Fragment
 import android.util.Log
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import android.widget.FrameLayout
 import android.widget.Toast
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.Observer
+import androidx.lifecycle.ViewModelProviders
 import androidx.navigation.Navigation
 import com.daasuu.ei.Ease
 import com.daasuu.ei.EasingInterpolator
+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.MainViewModel
 import com.sduduzog.slimlauncher.R
-import com.sduduzog.slimlauncher.data.HomeApp
+import com.sduduzog.slimlauncher.ui.main.model.HomeApp
+import com.sduduzog.slimlauncher.ui.main.model.MainViewModel
 import kotlinx.android.synthetic.main.main_bottom_sheet.*
 import kotlinx.android.synthetic.main.main_content.*
 import java.text.SimpleDateFormat
@@ -51,7 +51,7 @@ class MainFragment : Fragment() {
         super.onActivityCreated(savedInstanceState)
         sheetBehavior = BottomSheetBehavior.from(bottomSheet)
         optionsView.alpha = 0.0f
-        viewModel = ViewModelProviders.of(activity!!).get(MainViewModel::class.java)
+        viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
         adapter = MainAppsAdapter(mutableSetOf(), InteractionHandler())
         mainAppsList.adapter = adapter
         viewModel.homeApps.observe(this, Observer {
@@ -100,7 +100,7 @@ class MainFragment : Fragment() {
 
     fun updateUi() {
         val twenty4Hour = context?.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
-                ?.getBoolean(getString(R.string.prefs_settings_key_clocktype), false)
+                ?.getBoolean(getString(R.string.prefs_settings_key_clock_type), false)
         val date = Date()
         if (twenty4Hour as Boolean) {
             val fWatchTime = SimpleDateFormat("HH:mm", Locale.ENGLISH)
@@ -149,7 +149,7 @@ class MainFragment : Fragment() {
     }
 
     private fun rateApp() {
-        val uri = Uri.parse("market://details?id=" + context!!.packageName)
+        val uri = Uri.parse("market://details?id=" + context?.packageName)
         val goToMarket = Intent(Intent.ACTION_VIEW, uri)
         goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY or
                 Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
@@ -161,7 +161,7 @@ class MainFragment : Fragment() {
             Log.d(TAG, goToMarket.data?.query)
         } catch (e: ActivityNotFoundException) {
             startActivity(Intent(Intent.ACTION_VIEW,
-                    Uri.parse("http://play.google.com/store/apps/details?id=" + context!!.packageName)))
+                    Uri.parse("http://play.google.com/store/apps/details?id=" + context?.packageName)))
         }
     }
 
@@ -172,13 +172,9 @@ class MainFragment : Fragment() {
     private fun setEventListeners() {
         clockTextView.setOnClickListener {
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
-                try {
-                    val intent = Intent(android.provider.AlarmClock.ACTION_SHOW_ALARMS)
-                    intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
-                    startActivity(intent)
-                } catch (e: Exception) {
-                    Log.e(TAG, e.message)
-                }
+                val intent = Intent(android.provider.AlarmClock.ACTION_SHOW_ALARMS)
+                intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+                startActivity(intent)
             }
         }
         bottomSheet.setOnClickListener {

+ 13 - 12
app/src/main/java/com/sduduzog/slimlauncher/ui/main/SettingsFragment.kt

@@ -1,19 +1,20 @@
 package com.sduduzog.slimlauncher.ui.main
 
 
-import android.arch.lifecycle.Observer
-import android.arch.lifecycle.ViewModelProviders
+import androidx.lifecycle.Observer
+import androidx.lifecycle.ViewModelProviders
 import android.content.Context.MODE_PRIVATE
 import android.os.Bundle
-import android.support.v4.app.Fragment
-import android.support.v7.widget.LinearLayoutManager
+import androidx.fragment.app.Fragment
+import androidx.recyclerview.widget.LinearLayoutManager
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import androidx.core.content.edit
 import androidx.navigation.Navigation
-import com.sduduzog.slimlauncher.MainViewModel
+import com.sduduzog.slimlauncher.ui.main.model.MainViewModel
 import com.sduduzog.slimlauncher.R
-import com.sduduzog.slimlauncher.data.HomeApp
+import com.sduduzog.slimlauncher.ui.main.model.HomeApp
 import kotlinx.android.synthetic.main.settings_fragment.*
 
 
@@ -22,8 +23,6 @@ class SettingsFragment : Fragment() {
     private lateinit var viewModel: MainViewModel
     private lateinit var adapter: SettingsListAdapter
 
-    private val TAG: String = "SettingsFragment"
-
     override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                               savedInstanceState: Bundle?): View? {
         return inflater.inflate(R.layout.settings_fragment, container, false)
@@ -49,13 +48,15 @@ class SettingsFragment : Fragment() {
         settingsAppList.layoutManager = LinearLayoutManager(activity)
         addButton.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_openAppsFragment))
         changeThemeText.setOnClickListener {
-            val themeChooserDialog = ThemeChooserDialog()
-            themeChooserDialog.showNow(fragmentManager, TAG)
+            val themeChooserDialog = ThemeChooserDialog.getThemeChooser()
+            themeChooserDialog.showNow(fragmentManager, "THEME_CHOOSER")
         }
         val settings = context!!.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
-        clockTypeChecker.isChecked = settings.getBoolean(getString(R.string.prefs_settings_key_clocktype), false)
+        clockTypeChecker.isChecked = settings.getBoolean(getString(R.string.prefs_settings_key_clock_type), false)
         clockTypeChecker.setOnCheckedChangeListener { _, b ->
-            settings.edit().putBoolean(getString(R.string.prefs_settings_key_clocktype), b).apply()
+            settings.edit {
+                putBoolean(getString(R.string.prefs_settings_key_clock_type), b)
+            }
         }
     }
 

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

@@ -1,13 +1,13 @@
 package com.sduduzog.slimlauncher.ui.main
 
-import android.support.v7.widget.RecyclerView
+import androidx.recyclerview.widget.RecyclerView
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
 import android.widget.Button
 import android.widget.TextView
 import com.sduduzog.slimlauncher.R
-import com.sduduzog.slimlauncher.data.HomeApp
+import com.sduduzog.slimlauncher.ui.main.model.HomeApp
 
 class SettingsListAdapter(private var apps: List<HomeApp>, private val listener: SettingsFragment.OnListFragmentInteractionListener) : RecyclerView.Adapter<SettingsListAdapter.AppViewHolder>() {
 

+ 6 - 3
app/src/main/java/com/sduduzog/slimlauncher/ui/main/ThemeChooserDialog.kt

@@ -4,8 +4,9 @@ import android.app.Dialog
 import android.content.Context.MODE_PRIVATE
 import android.content.SharedPreferences
 import android.os.Bundle
-import android.support.v4.app.DialogFragment
-import android.support.v7.app.AlertDialog
+import androidx.appcompat.app.AlertDialog
+import androidx.core.content.edit
+import androidx.fragment.app.DialogFragment
 import com.sduduzog.slimlauncher.R
 
 class ThemeChooserDialog : DialogFragment() {
@@ -19,7 +20,9 @@ class ThemeChooserDialog : DialogFragment() {
         builder.setTitle(R.string.theme_chooser_dialog_title)
         builder.setSingleChoiceItems(R.array.themes_array, active) { dialogInterface, i ->
             dialogInterface.dismiss()
-            settings.edit().putInt(getString(R.string.prefs_settings_key_theme), i).apply()
+            settings.edit {
+                putInt(getString(R.string.prefs_settings_key_theme), i)
+            }
         }
         return builder.create()
     }

+ 16 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/App.kt

@@ -0,0 +1,16 @@
+package com.sduduzog.slimlauncher.ui.main.model
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+@Entity(tableName = "apps")
+data class App(
+        @field:ColumnInfo(name = "app_name")
+        var appName: String,
+        @PrimaryKey
+        @field:ColumnInfo(name = "package_name")
+        var packageName: String,
+        @field:ColumnInfo(name = "activity_name")
+        var activityName: String
+)

+ 3 - 6
app/src/main/java/com/sduduzog/slimlauncher/data/AppDao.kt → app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/AppDao.kt

@@ -1,7 +1,7 @@
-package com.sduduzog.slimlauncher.data
+package com.sduduzog.slimlauncher.ui.main.model
 
-import android.arch.lifecycle.LiveData
-import android.arch.persistence.room.*
+import androidx.lifecycle.LiveData
+import androidx.room.*
 
 @Dao
 interface AppDao {
@@ -16,9 +16,6 @@ interface AppDao {
     @Insert(onConflict = OnConflictStrategy.IGNORE)
     fun insert(app: App)
 
-    @Update
-    fun update(app: App)
-
     @Insert
     fun addHomeApp(app: HomeApp)
 

+ 4 - 9
app/src/main/java/com/sduduzog/slimlauncher/data/AppRepository.kt → app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/AppRepository.kt

@@ -1,22 +1,20 @@
-package com.sduduzog.slimlauncher.data
+package com.sduduzog.slimlauncher.ui.main.model
 
 import android.app.Application
-import android.arch.lifecycle.LiveData
 import android.content.Intent
 import android.content.pm.PackageManager
 import android.content.pm.ResolveInfo
 import android.os.AsyncTask
+import androidx.lifecycle.LiveData
 import java.util.*
 
 class AppRepository(application: Application) {
 
-    private val db: AppRoomDatabase = AppRoomDatabase.getDatabase(application)
+    private val db: AppRoomDatabase = AppRoomDatabase.getDatabase(application)!!
     private var appDao: AppDao = db.appDao()
     private var _apps: LiveData<List<App>> = appDao.apps
     private var _homeApps: LiveData<List<HomeApp>> = appDao.homeApps
 
-    private val TAG: String = "REPO"
-
     private var pm: PackageManager = application.packageManager
 
     val homeApps: LiveData<List<HomeApp>>
@@ -68,10 +66,7 @@ class AppRepository(application: Application) {
             for (i in launchables.indices) {
                 val item = launchables[i]
                 val activity = item.activityInfo
-                val app = App()
-                app.appName = launchables[i].loadLabel(pm).toString()
-                app.packageName = activity.applicationInfo.packageName
-                app.activityName = activity.name
+                val app = App(launchables[i].loadLabel(pm).toString(), activity.applicationInfo.packageName, activity.name)
                 mAsyncTaskDao.insert(app)
             }
             return null

+ 29 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/AppRoomDatabase.kt

@@ -0,0 +1,29 @@
+package com.sduduzog.slimlauncher.ui.main.model
+
+import android.content.Context
+import androidx.room.Database
+import androidx.room.Room
+import androidx.room.RoomDatabase
+
+@Database(entities = [App::class, HomeApp::class], version = 1, exportSchema = false)
+abstract class AppRoomDatabase : RoomDatabase() {
+
+    abstract fun appDao(): AppDao
+
+    companion object {
+        @Volatile
+        @JvmStatic
+        private var INSTANCE: AppRoomDatabase? = null
+
+        fun getDatabase(context: Context): AppRoomDatabase? {
+            synchronized(AppRoomDatabase::class.java) {
+                if (INSTANCE == null) {
+                    INSTANCE = Room.databaseBuilder(context.applicationContext,
+                            AppRoomDatabase::class.java, "app_database")
+                            .build()
+                }
+                return INSTANCE
+            }
+        }
+    }
+}

+ 16 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/HomeApp.kt

@@ -0,0 +1,16 @@
+package com.sduduzog.slimlauncher.ui.main.model
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+@Entity(tableName = "home_apps")
+data class HomeApp(
+        @field:ColumnInfo(name = "app_name")
+        var appName: String,
+        @PrimaryKey
+        @field:ColumnInfo(name = "package_name")
+        var packageName: String,
+        @field:ColumnInfo(name = "activity_name")
+        var activityName: String
+)

+ 4 - 10
app/src/main/java/com/sduduzog/slimlauncher/MainViewModel.kt → app/src/main/java/com/sduduzog/slimlauncher/ui/main/model/MainViewModel.kt

@@ -1,11 +1,8 @@
-package com.sduduzog.slimlauncher
+package com.sduduzog.slimlauncher.ui.main.model
 
 import android.app.Application
-import android.arch.lifecycle.AndroidViewModel
-import android.arch.lifecycle.LiveData
-import com.sduduzog.slimlauncher.data.App
-import com.sduduzog.slimlauncher.data.AppRepository
-import com.sduduzog.slimlauncher.data.HomeApp
+import androidx.lifecycle.AndroidViewModel
+import androidx.lifecycle.LiveData
 
 class MainViewModel(application: Application) : AndroidViewModel(application) {
     private var _repository: AppRepository = AppRepository(application)
@@ -32,10 +29,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
     }
 
     fun addToHomeScreen(app: App) {
-        val home = HomeApp()
-        home.activityName = app.activityName
-        home.appName = app.appName
-        home.packageName = app.packageName
+        val home = HomeApp(app.appName, app.packageName, app.activityName)
         _repository.insert(home)
     }
 }

+ 8 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/DialogInteractionListener.kt

@@ -0,0 +1,8 @@
+package com.sduduzog.slimlauncher.ui.main.setup
+
+import com.sduduzog.slimlauncher.ui.main.model.App
+
+interface DialogInteractionListener {
+    fun onAppsChosen(apps: List<App>)
+    fun onClockChosen()
+}

+ 240 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/main/setup/SetupFragment.kt

@@ -0,0 +1,240 @@
+package com.sduduzog.slimlauncher.ui.main.setup
+
+
+import android.app.AlertDialog
+import android.app.Dialog
+import android.content.Context.MODE_PRIVATE
+import android.content.Intent
+import android.content.pm.ResolveInfo
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.Toast
+import androidx.core.content.edit
+import androidx.fragment.app.DialogFragment
+import androidx.fragment.app.Fragment
+import androidx.lifecycle.Observer
+import androidx.lifecycle.ViewModelProviders
+import androidx.navigation.Navigation
+import com.sduduzog.slimlauncher.R
+import com.sduduzog.slimlauncher.ui.main.model.App
+import com.sduduzog.slimlauncher.ui.main.model.HomeApp
+import com.sduduzog.slimlauncher.ui.main.model.MainViewModel
+import kotlinx.android.synthetic.main.setup_fragment.*
+import java.util.*
+
+
+class SetupFragment : Fragment(), DialogInteractionListener {
+
+    private lateinit var viewModel: MainViewModel
+    private var state = 0
+    private val apps = mutableListOf<App>()
+
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+                              savedInstanceState: Bundle?): View? {
+        // Inflate the layout for this fragment
+        return inflater.inflate(R.layout.setup_fragment, container, false)
+    }
+
+    override fun onActivityCreated(savedInstanceState: Bundle?) {
+        super.onActivityCreated(savedInstanceState)
+        viewModel = ViewModelProviders.of(this).get(MainViewModel::class.java)
+        setLoading()
+        viewModel.homeApps.observe(this, ValueObserver())
+        setupButton.setOnClickListener {
+            when (state) {
+                1 -> chooseApps()
+                2 -> chooseClock()
+                else -> {
+                    val settings = activity!!.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
+                    settings.edit {
+                        putBoolean(getString(R.string.prefs_settings_key_fresh_install_setup), false)
+                    }
+                    finishSetup()
+                }
+            }
+        }
+
+    }
+
+    private fun checkFreshInstall() {
+        val settings = activity!!.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
+        if (settings.getBoolean(getString(R.string.prefs_settings_key_fresh_install_setup), true)) {
+            val pm = activity!!.packageManager
+            val main = Intent(Intent.ACTION_MAIN, null)
+
+            main.addCategory(Intent.CATEGORY_LAUNCHER)
+
+            val launchables = pm.queryIntentActivities(main, 0)
+            Collections.sort(launchables,
+                    ResolveInfo.DisplayNameComparator(pm))
+            for (i in launchables.indices) {
+                val item = launchables[i]
+                val activity = item.activityInfo
+                val app = App(launchables[i].loadLabel(pm).toString(), activity.applicationInfo.packageName, activity.name)
+                apps.add(app)
+            }
+            revealUI(state)
+        } else {
+            finishSetup()
+        }
+    }
+
+    private fun finishSetup() {
+        val nav = Navigation.findNavController(setupContainer)
+        nav.navigate(R.id.action_setupFragment_to_mainFragment2)
+    }
+
+    private fun setLoading() {
+        progressBar.visibility = View.VISIBLE
+        opt1Number.alpha = 0f
+        opt1Text.alpha = 0f
+        opt2Number.alpha = 0f
+        opt2Text.alpha = 0f
+        textViewLets.alpha = 0f
+        setupButton.alpha = 0f
+        tvWelcome.alpha = 0f
+        cvIcon.alpha = 0f
+    }
+
+    private fun revealUI(level: Int) {
+        progressBar.visibility = View.INVISIBLE
+        when (level) {
+            0 -> {
+                tvWelcome.animate().alpha(1f).duration = 1000
+                cvIcon.animate().alpha(1f).duration = 1500
+                textViewLets.animate().alpha(1f).duration = 1000
+                opt1Text.animate().setStartDelay(1000).alpha(1f).duration = 500
+                opt1Number.animate().setStartDelay(1000).alpha(1f).duration = 500
+                opt2Text.animate().setStartDelay(1500).alpha(1f).duration = 500
+                opt2Number.animate().setStartDelay(1500).alpha(1f).duration = 500
+                setupButton.animate().setStartDelay(2000).alpha(1f).duration = 500
+            }
+            1 -> {
+                setupButton.text = getString(R.string.setup_button_next)
+                ivTick1.visibility = View.VISIBLE
+            }
+            2 -> {
+                ivTick2.visibility = View.VISIBLE
+                setupButton.text = getString(R.string.setup_button_finish)
+            }
+        }
+        state++
+    }
+
+    private fun chooseApps() {
+        ChooseApps.newInstance(this, apps).show(fragmentManager, "APP_CHOOSER")
+    }
+
+    private fun chooseClock() {
+        ChooseClockType.newInstance(this).show(fragmentManager, "CLOCK_CHOOSER")
+    }
+
+    class ChooseApps : DialogFragment() {
+
+        private lateinit var listener: DialogInteractionListener
+        private lateinit var apps: List<App>
+        private lateinit var checkedItems: BooleanArray
+
+        companion object {
+            fun newInstance(listener: DialogInteractionListener, apps: List<App>): ChooseApps {
+                val chooser = ChooseApps()
+                chooser.apps = apps
+                chooser.listener = listener
+                return chooser
+            }
+        }
+
+        override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
+            val appNames = arrayOfNulls<String>(apps.size)
+            checkedItems = BooleanArray(apps.size)
+            for (i in apps.indices) {
+                appNames[i] = apps[i].appName
+            }
+
+            val builder = AlertDialog.Builder(context!!)
+            builder.setMultiChoiceItems(appNames, checkedItems) { _, i, b ->
+                checkedItems[i] = b
+                if (checkedItems.filter { it }.size == 5) {
+                    setApps()
+                    dismiss()
+                }
+
+            }
+            builder.setPositiveButton("Done") { _, _ ->
+                if (checkedItems.none { it }) {
+                    Toast.makeText(context, "Choose at least one app", Toast.LENGTH_SHORT).show()
+                } else {
+                    setApps()
+                }
+            }
+            return builder.create()
+        }
+
+        private fun setApps() {
+            val list = mutableListOf<App>()
+            for (i in checkedItems.indices) {
+                if (checkedItems[i]) {
+                    list.add(apps[i])
+                }
+            }
+            listener.onAppsChosen(list)
+        }
+    }
+
+    class ChooseClockType : DialogFragment() {
+
+        private lateinit var listener: DialogInteractionListener
+
+        companion object {
+            fun newInstance(listener: DialogInteractionListener): ChooseClockType {
+                val chooser = ChooseClockType()
+                chooser.listener = listener
+                return chooser
+            }
+        }
+
+        override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
+            val builder = AlertDialog.Builder(context!!)
+            builder.setTitle("Choose clock type")
+            builder.setSingleChoiceItems(R.array.clock_types, 0) { _, i ->
+                val settings = context!!.getSharedPreferences(getString(R.string.prefs_settings), MODE_PRIVATE)
+                if (i == 0)
+                    settings.edit {
+                        putBoolean(getString(R.string.prefs_settings_key_clock_type), false)
+                    }
+                else
+                    settings.edit {
+                        putBoolean(getString(R.string.prefs_settings_key_clock_type), true)
+                    }
+                listener.onClockChosen()
+                dismiss()
+            }
+            return builder.create()
+        }
+    }
+
+    inner class ValueObserver : Observer<List<HomeApp>> {
+        override fun onChanged(it: List<HomeApp>?) {
+            if (it != null && it.isEmpty()) {
+                checkFreshInstall()
+                viewModel.apps.removeObservers(this@SetupFragment)
+            } else {
+                if (state == 0)
+                    finishSetup()
+            }
+        }
+    }
+
+    override fun onAppsChosen(apps: List<App>) {
+        for (i in apps) {
+            viewModel.addToHomeScreen(i)
+        }
+        revealUI(state)
+    }
+
+    override fun onClockChosen() {
+        revealUI(state)
+    }
+}

+ 9 - 0
app/src/main/res/drawable/ic_check.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="#FF000000"
+        android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
+</vector>

+ 5 - 6
app/src/main/res/layout-sw600dp/main_content.xml

@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<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/main_content"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="?android:attr/colorBackground">
+    android:layout_height="match_parent">
 
     <TextView
         android:id="@+id/clockTextView"
@@ -27,7 +26,7 @@
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/clockTextView" />
 
-    <android.support.v7.widget.RecyclerView
+    <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/mainAppsList"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
@@ -37,7 +36,7 @@
         android:layout_marginEnd="32dp"
         android:layout_marginRight="32dp"
         android:layout_marginBottom="32dp"
-        app:layoutManager="android.support.v7.widget.LinearLayoutManager"
+        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
@@ -53,4 +52,4 @@
         app:layout_constraintStart_toEndOf="@+id/clockTextView"
         app:layout_constraintTop_toTopOf="@+id/clockTextView" />
 
-</android.support.constraint.ConstraintLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 2
app/src/main/res/layout-sw600dp/main_fragment.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/main"
     android:layout_width="match_parent"
@@ -10,4 +10,4 @@
 
     <include layout="@layout/main_bottom_sheet" />
 
-</android.support.design.widget.CoordinatorLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>

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

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="wrap_content">
@@ -16,4 +16,4 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
-</android.support.constraint.ConstraintLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 139 - 0
app/src/main/res/layout-v21/settings_fragment.xml

@@ -0,0 +1,139 @@
+<?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/frameLayout"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".ui.main.SettingsFragment">
+
+    <TextView
+        android:id="@+id/textView3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dp"
+        android:layout_marginTop="32dp"
+        android:text="@string/settings_title"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <Button
+        android:id="@+id/addButton"
+        style="@style/Widget.AppCompat.Button.Borderless"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:text="@string/settings_button_add"
+        app:layout_constraintBottom_toBottomOf="@+id/textView8"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/textView8"
+        app:layout_constraintVertical_bias="0.31" />
+
+    <androidx.recyclerview.widget.RecyclerView
+        android:id="@+id/settingsAppList"
+        android:layout_width="0dp"
+        android:layout_height="0dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginTop="24dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView8"
+        tools:listitem="@layout/settings_apps_list_item" />
+
+    <TextView
+        android:id="@+id/textView2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="24dp"
+        android:layout_marginTop="24dp"
+        android:text="@string/settings_text_use_24_hour_clock"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="24sp"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView3" />
+
+    <androidx.appcompat.widget.AppCompatCheckBox
+        android:id="@+id/clockTypeChecker"
+        style="@style/Widget.AppCompat.CompoundButton.CheckBox"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="8dp"
+        android:layout_marginEnd="24dp"
+        android:buttonTint="?android:colorForeground"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/textView2" />
+
+    <TextView
+        android:id="@+id/textView4"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/settings_text_tap_to_check_between_24_hour_or_12_hour"
+        app:layout_constraintStart_toStartOf="@+id/textView2"
+        app:layout_constraintTop_toBottomOf="@+id/textView2" />
+
+    <View
+        android:id="@+id/divider"
+        android:layout_width="0dp"
+        android:layout_height="1dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        android:background="?android:attr/listDivider"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView4" />
+
+    <TextView
+        android:id="@+id/changeThemeText"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="24dp"
+        android:layout_marginTop="8dp"
+        android:text="@string/main_options_change_theme"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="24sp"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/divider" />
+
+    <TextView
+        android:id="@+id/textView7"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/settings_text_tap_to_change_app_theme"
+        app:layout_constraintStart_toStartOf="@+id/changeThemeText"
+        app:layout_constraintTop_toBottomOf="@+id/changeThemeText" />
+
+    <View
+        android:id="@+id/divider2"
+        android:layout_width="0dp"
+        android:layout_height="1dp"
+        android:layout_marginStart="16dp"
+        android:layout_marginLeft="16dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        android:background="?android:attr/listDivider"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView7" />
+
+    <TextView
+        android:id="@+id/textView8"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="24dp"
+        android:layout_marginTop="16dp"
+        android:text="@string/settings_text_home_screen_apps"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="24sp"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/divider2" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 2
app/src/main/res/layout/apps_fragment.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.recyclerview.widget.RecyclerView 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/appList"
@@ -7,5 +7,5 @@
     android:layout_height="match_parent"
     android:layout_marginStart="16dp"
     android:layout_marginEnd="16dp"
-    app:layoutManager="android.support.v7.widget.LinearLayoutManager"
+    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
     tools:listitem="@layout/apps_list_item" />

+ 2 - 2
app/src/main/res/layout/fragment_about.xml

@@ -6,7 +6,7 @@
     android:layout_height="match_parent"
     tools:context="com.sduduzog.slimlauncher.ui.main.AboutFragment">
 
-    <android.support.constraint.ConstraintLayout
+    <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
 
@@ -43,5 +43,5 @@
             app:layout_constraintTop_toBottomOf="@+id/textView5" />
 
 
-    </android.support.constraint.ConstraintLayout>
+    </androidx.constraintlayout.widget.ConstraintLayout>
 </ScrollView>

+ 5 - 5
app/src/main/res/layout/main_bottom_sheet.xml

@@ -5,13 +5,13 @@
     android:id="@+id/bottomSheet"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
+    app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
     app:behavior_hideable="false"
     app:behavior_peekHeight="60dp"
     tools:context=".MainActivity">
 
 
-    <android.support.v7.widget.CardView
+    <androidx.cardview.widget.CardView
         android:id="@+id/optionsView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
@@ -81,9 +81,9 @@
                 android:textSize="24sp" />
 
         </LinearLayout>
-    </android.support.v7.widget.CardView>
+    </androidx.cardview.widget.CardView>
 
-    <android.support.constraint.ConstraintLayout
+    <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/iconTray"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
@@ -127,7 +127,7 @@
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintTop_toTopOf="parent"
             app:srcCompat="@drawable/ic_photo_camera" />
-    </android.support.constraint.ConstraintLayout>
+    </androidx.constraintlayout.widget.ConstraintLayout>
 
 
 </FrameLayout>

+ 5 - 6
app/src/main/res/layout/main_content.xml

@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<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/main_content"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:background="?android:attr/colorBackground">
+    android:layout_height="match_parent">
 
     <TextView
         android:id="@+id/clockTextView"
@@ -27,7 +26,7 @@
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/clockTextView" />
 
-    <android.support.v7.widget.RecyclerView
+    <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/mainAppsList"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
@@ -36,7 +35,7 @@
         android:layout_marginTop="32dp"
         android:layout_marginEnd="16dp"
         android:layout_marginRight="16dp"
-        app:layoutManager="android.support.v7.widget.LinearLayoutManager"
+        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
@@ -52,4 +51,4 @@
         app:layout_constraintStart_toEndOf="@+id/clockTextView"
         app:layout_constraintTop_toTopOf="@+id/clockTextView" />
 
-</android.support.constraint.ConstraintLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 2
app/src/main/res/layout/main_fragment.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/main"
     android:layout_width="match_parent"
@@ -10,4 +10,4 @@
 
     <include layout="@layout/main_bottom_sheet" />
 
-</android.support.design.widget.CoordinatorLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>

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

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="wrap_content">
@@ -16,4 +16,4 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
-</android.support.constraint.ConstraintLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 2
app/src/main/res/layout/settings_apps_list_item.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/linearLayout"
     android:layout_width="match_parent"
@@ -31,4 +31,4 @@
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 
-</android.support.constraint.ConstraintLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 8 - 10
app/src/main/res/layout/settings_fragment.xml

@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<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:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="?android:attr/colorBackground"
     tools:context=".ui.main.SettingsFragment">
 
     <TextView
@@ -32,7 +31,7 @@
         app:layout_constraintTop_toTopOf="@+id/textView8"
         app:layout_constraintVertical_bias="0.31" />
 
-    <android.support.v7.widget.RecyclerView
+    <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/settingsAppList"
         android:layout_width="0dp"
         android:layout_height="0dp"
@@ -54,13 +53,13 @@
         android:layout_marginStart="24dp"
         android:layout_marginLeft="24dp"
         android:layout_marginTop="24dp"
-        android:text="Use 24 hour clock"
+        android:text="@string/settings_text_use_24_hour_clock"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="24sp"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/textView3" />
 
-    <android.support.v7.widget.AppCompatCheckBox
+    <androidx.appcompat.widget.AppCompatCheckBox
         android:id="@+id/clockTypeChecker"
         style="@style/Widget.AppCompat.CompoundButton.CheckBox"
         android:layout_width="wrap_content"
@@ -68,7 +67,6 @@
         android:layout_marginTop="8dp"
         android:layout_marginEnd="24dp"
         android:layout_marginRight="24dp"
-        android:buttonTint="?android:colorForeground"
         android:textAppearance="@style/TextAppearance.AppCompat"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="@+id/textView2" />
@@ -77,7 +75,7 @@
         android:id="@+id/textView4"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="Tap to check between 24 hour or 12 hour"
+        android:text="@string/settings_text_tap_to_check_between_24_hour_or_12_hour"
         app:layout_constraintStart_toStartOf="@+id/textView2"
         app:layout_constraintTop_toBottomOf="@+id/textView2" />
 
@@ -112,7 +110,7 @@
         android:id="@+id/textView7"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:text="Tap to change app theme"
+        android:text="@string/settings_text_tap_to_change_app_theme"
         app:layout_constraintStart_toStartOf="@+id/changeThemeText"
         app:layout_constraintTop_toBottomOf="@+id/changeThemeText" />
 
@@ -137,10 +135,10 @@
         android:layout_marginStart="24dp"
         android:layout_marginLeft="24dp"
         android:layout_marginTop="16dp"
-        android:text="Home screen apps"
+        android:text="@string/settings_text_home_screen_apps"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="24sp"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/divider2" />
 
-</android.support.constraint.ConstraintLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 180 - 0
app/src/main/res/layout/setup_fragment.xml

@@ -0,0 +1,180 @@
+<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/setupContainer"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="com.sduduzog.slimlauncher.ui.main.setup.SetupFragment">
+
+    <androidx.cardview.widget.CardView
+        android:id="@+id/cvIcon"
+        android:layout_width="100dp"
+        android:layout_height="100dp"
+        android:layout_marginStart="32dp"
+        android:layout_marginLeft="32dp"
+        android:layout_marginTop="32dp"
+        android:layout_marginEnd="32dp"
+        android:layout_marginRight="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="65dp"
+                android:layout_height="65dp"
+                android:layout_marginStart="8dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="8dp"
+                android:layout_marginRight="8dp"
+                android:layout_marginBottom="8dp"
+                android:contentDescription="@string/app_name"
+                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>
+
+    <Button
+        android:id="@+id/setupButton"
+        style="@style/Widget.AppCompat.Button.Borderless"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginBottom="7dp"
+        android:text="@string/setup_button_start"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent" />
+
+    <TextView
+        android:id="@+id/tvWelcome"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:text="@string/setup_text_welcome"
+        android:textAppearance="@style/TextAppearance.AppCompat.Large"
+        android:textSize="32sp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/cvIcon" />
+
+    <TextView
+        android:id="@+id/textViewLets"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:text="@string/setup_text_lets_get_you_set_up"
+        android:textAppearance="@style/TextAppearance.AppCompat.Large"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tvWelcome" />
+
+    <TextView
+        android:id="@+id/opt1Text"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginEnd="32dp"
+        android:layout_marginRight="32dp"
+        android:text="@string/setup_text_choose_apps"
+        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+        app:layout_constraintEnd_toStartOf="@+id/ivTick1"
+        app:layout_constraintStart_toEndOf="@+id/opt1Number"
+        app:layout_constraintTop_toTopOf="@+id/opt1Number" />
+
+    <ImageView
+        android:id="@+id/ivTick1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        android:contentDescription="@string/icon_check"
+        android:visibility="invisible"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/opt1Text"
+        app:srcCompat="@drawable/ic_check" />
+
+    <TextView
+        android:id="@+id/opt2Text"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginEnd="32dp"
+        android:layout_marginRight="32dp"
+        android:text="@string/setup_text_choose_your_preferred_clock"
+        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+        app:layout_constraintEnd_toStartOf="@+id/ivTick2"
+        app:layout_constraintStart_toEndOf="@+id/opt2Number"
+        app:layout_constraintTop_toTopOf="@+id/opt2Number" />
+
+    <ImageView
+        android:id="@+id/ivTick2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="16dp"
+        android:layout_marginRight="16dp"
+        android:contentDescription="@string/icon_check"
+        android:visibility="invisible"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/opt2Text"
+        app:srcCompat="@drawable/ic_check" />
+
+    <TextView
+        android:id="@+id/opt1Number"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginTop="32dp"
+        android:text="@string/setup_text_1"
+        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textViewLets" />
+
+    <TextView
+        android:id="@+id/opt2Number"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginTop="32dp"
+        android:text="@string/setup_text_2"
+        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/opt1Text" />
+
+    <ProgressBar
+        android:id="@+id/progressBar"
+        style="?android:attr/progressBarStyle"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginTop="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginBottom="8dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 10 - 1
app/src/main/res/navigation/nav_graph.xml

@@ -3,7 +3,7 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/nav_graph"
-    app:startDestination="@id/mainFragment">
+    app:startDestination="@id/setupFragment">
 
     <fragment
         android:id="@+id/mainFragment"
@@ -36,4 +36,13 @@
         android:name="com.sduduzog.slimlauncher.ui.main.AboutFragment"
         android:label="fragment_about"
         tools:layout="@layout/fragment_about" />
+    <fragment
+        android:id="@+id/setupFragment"
+        android:name="com.sduduzog.slimlauncher.ui.main.setup.SetupFragment"
+        android:label="setup_fragment"
+        tools:layout="@layout/setup_fragment" >
+        <action
+            android:id="@+id/action_setupFragment_to_mainFragment2"
+            app:destination="@id/mainFragment" />
+    </fragment>
 </navigation>

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

@@ -5,16 +5,6 @@
     <color name="primaryColor">#212121</color>
     <color name="primaryDarkColor">#000000</color>
 
-
-    <color name="primaryGrey">#263238</color>
-    <color name="darkGrey">#000a12</color>
-
-    <color name="primaryTeal">#b2dfdb</color>
-    <color name="darkTeal">#82ada9</color>
-
-    <color name="primaryPink">#fce4ec</color>
-    <color name="darkPink">#c9b2ba</color>
-
     <color name="colorBlueGrey">#607d8b</color>
     <color name="colorBlueGreyDark">#455a64</color>
 

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

@@ -1,3 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
+
 </resources>

+ 22 - 3
app/src/main/res/values/strings.xml

@@ -11,6 +11,11 @@
         <item>Candy</item>
     </string-array>
 
+    <string-array name="clock_types">
+        <item>12 Hour</item>
+        <item>24 Hour</item>
+    </string-array>
+
     <string name="prefs_settings">settings</string>
     <string name="prefs_settings_key_theme">key_theme</string>
     <string name="main_slim_options">Slim options</string>
@@ -23,7 +28,6 @@
     <string name="settings_item_button_remove">remove</string>
     <string name="settings_title">Home screen settings</string>
     <string name="settings_button_add">Add</string>
-    <string name="settings_option_why">Why can\'t I add more?</string>
     <string name="about_title">Slim launcher</string>
     <string name="about_text">
         Created by : Beautus S Gumede\n
@@ -55,10 +59,25 @@
         OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
         DEALINGS IN THE SOFTWARE.
     </string>
-    <string name="content_description_expand_up">Expand up icon</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="prefs_settings_key_clocktype">clock_type</string>
+    <string name="prefs_settings_key_clock_type">clock_type</string>
+
+    <string name="prefs_settings_key_fresh_install_setup">key_fresh_install_setup</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!</string>
+    <string name="setup_text_choose_apps">Choose apps that will appear on your home screen</string>
+    <string name="setup_text_choose_your_preferred_clock">Choose your preferred clock type</string>
+    <string name="icon_check">Icon check</string>
+    <string name="setup_button_next">next</string>
+    <string name="setup_button_finish">Finish</string>
+    <string name="setup_text_1">1.</string>
+    <string name="setup_text_2">2.</string>
+    <string name="settings_text_use_24_hour_clock">Use 24 hour clock</string>
+    <string name="settings_text_tap_to_check_between_24_hour_or_12_hour">Tap to check between 24 hour or 12 hour</string>
+    <string name="settings_text_tap_to_change_app_theme">Tap to change app theme</string>
+    <string name="settings_text_home_screen_apps">Home screen apps</string>
 
 </resources>

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

@@ -1,6 +1,5 @@
 <resources>
 
-    <!-- Base application theme. -->
     <style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
         <item name="colorAccent">@color/colorAccent</item>
         <item name="android:colorForeground">@android:color/black</item>

+ 0 - 4
app/src/test/java/com/sduduzog/slimlauncher/MethodTestUtils.kt

@@ -1,4 +0,0 @@
-package com.sduduzog.slimlauncher
-
-class MethodTestUtils {
-}

+ 1 - 0
build.gradle

@@ -7,6 +7,7 @@ buildscript {
         jcenter()
     }
     dependencies {
+        //noinspection GradleDependency
         classpath 'com.android.tools.build:gradle:3.3.0-alpha11'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
 

+ 2 - 0
gradle.properties

@@ -7,6 +7,8 @@
 # Specifies the JVM arguments used for the daemon process.
 # The setting is particularly useful for tweaking memory settings.
 org.gradle.jvmargs=-Xmx1536m
+android.useAndroidX=true
+android.enableJetifier=true
 # When configured, Gradle will run in incubating parallel mode.
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
-#Mon Sep 24 01:50:43 SAST 2018
+#Sat Oct 13 17:11:51 SAST 2018
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip