Răsfoiți Sursa

chore: sweet animation on swipe

beautusg 7 ani în urmă
părinte
comite
8185252978

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

@@ -17,7 +17,7 @@ import com.sduduzog.slimlauncher.ui.main.MainViewModel
 class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceChangeListener, NavController.OnDestinationChangedListener {
 
     private lateinit var settings: SharedPreferences
-    private val label = "main_fragment"
+    private val label = "home_fragment"
     private lateinit var currentLabel: String
     private lateinit var viewModel: MainViewModel
     private lateinit var navigator: NavController

+ 47 - 0
app/src/main/java/com/sduduzog/slimlauncher/adapters/HomeAdapter.kt

@@ -0,0 +1,47 @@
+package com.sduduzog.slimlauncher.adapters
+
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import com.sduduzog.slimlauncher.R
+import com.sduduzog.slimlauncher.data.HomeApp
+import com.sduduzog.slimlauncher.utils.OnLaunchAppListener
+
+
+class HomeAdapter(private val listener: OnLaunchAppListener)
+    : RecyclerView.Adapter<HomeAdapter.ViewHolder>() {
+
+    private var apps: List<HomeApp> = listOf()
+
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
+        val view = LayoutInflater.from(parent.context)
+                .inflate(R.layout.main_fragment_list_item, parent, false)
+        return ViewHolder(view)
+    }
+
+    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
+        val item = apps.elementAt(position)
+        holder.mLabelView.text = item.appName
+        holder.mLabelView.setOnClickListener {
+            listener.onLaunch(item, it)
+        }
+    }
+
+    override fun getItemCount(): Int = apps.size
+
+    fun setItems(list: List<HomeApp>) {
+        this.apps = list
+        notifyDataSetChanged()
+    }
+
+
+    inner class ViewHolder(mView: View) : RecyclerView.ViewHolder(mView) {
+        val mLabelView: TextView = mView.findViewById(R.id.main_label)
+
+        override fun toString(): String {
+            return super.toString() + " '" + mLabelView.text + "'"
+        }
+    }
+}

+ 0 - 8
app/src/main/java/com/sduduzog/slimlauncher/data/DataRoomDatabase.kt

@@ -25,14 +25,6 @@ abstract class DataRoomDatabase : RoomDatabase() {
                 if (INSTANCE == null) {
                     INSTANCE = Room.databaseBuilder(context.applicationContext,
                             DataRoomDatabase::class.java, "app_database")
-                            .addCallback(object : Callback(){
-                                override fun onCreate(db: SupportSQLiteDatabase) {
-                                    super.onCreate(db)
-                                    val database = DataRoomDatabase.getDatabase(context)!!
-                                    val dao = database.noteDao()
-                                    PopulateDatabaseTask(dao).execute()
-                                }
-                            })
                             .addMigrations(MIGRATION_1_2, MIGRATION_2_3)
                             .build()
                 }

+ 0 - 38
app/src/main/java/com/sduduzog/slimlauncher/data/PopulateDatabaseTask.kt

@@ -1,38 +0,0 @@
-package com.sduduzog.slimlauncher.data
-
-import android.os.AsyncTask
-import java.util.*
-
-class PopulateDatabaseTask(private val dao: NoteDao) : AsyncTask<Void, Void, Void>() {
-    override fun doInBackground(vararg p0: Void?): Void? {
-        val demoNote = Note("""
-            Dear reader.
-
-            This is a demo note. Also a short summary to help you get started in how to use create, edit
-            or delete note items.
-
-            1. Creating a note: Pretty easy actually. Just tap the button with the pen icon and type away.
-            To save your note, press back and exit the editing screen. And done! the note is saved :)
-
-            2. Editing a note: When you open a note, like this one, it is on reader mode, double tap on this text to enter editor mode, and make your changes.
-
-            3. Deleting a note: I think you know this one. Go back, swipe this note away, and its gone.
-
-            That's it! You're ready to go. Remember to give us feedback on the app and on changes you might wanna see in the future.
-            And don't forget to give us 5 stars ;)
-
-            ## TO COME ##
-            - Tasks : Like a todo list or whatever
-            - Voice recorder/ voice note : I'd like to integrate this nicely with text notes. Like taking text notes, record sound all in one note.
-            - Insights : See which apps you use the most, see which apps you haven't used in a long time,
-            probably to suggest clearing some, and some informative usage patterns, All while we're offline :)
-
-            Remember! All you need is less.
-
-            Thanks for the support
-        """.trimIndent(), Date().time)
-        dao.saveNote(demoNote)
-        return null
-    }
-
-}

+ 0 - 74
app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeAppsAdapter.kt

@@ -1,74 +0,0 @@
-package com.sduduzog.slimlauncher.ui.main
-
-import android.content.ActivityNotFoundException
-import android.content.ComponentName
-import android.content.Intent
-import android.view.LayoutInflater
-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
-import com.sduduzog.slimlauncher.data.MainViewModel
-
-
-class HomeAppsAdapter(private var fragment: MainFragment)
-    : RecyclerView.Adapter<HomeAppsAdapter.ViewHolder>() {
-
-    private var apps: List<HomeApp> = listOf()
-    private var viewModel = ViewModelProviders.of(fragment.activity!!).get(MainViewModel::class.java)
-
-    init {
-        viewModel.apps.observe(fragment, Observer {
-            if (it != null) {
-                apps = it
-                notifyDataSetChanged()
-            }
-        })
-    }
-
-    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HomeAppsAdapter.ViewHolder {
-        val view = LayoutInflater.from(parent.context)
-                .inflate(R.layout.main_fragment_list_item, parent, false)
-        return ViewHolder(view)
-    }
-
-    override fun onBindViewHolder(holder: HomeAppsAdapter.ViewHolder, position: Int) {
-        val item = apps.elementAt(position)
-        holder.mLabelView.text = item.appName
-        holder.mLabelView.setOnClickListener {
-            val name = ComponentName(item.packageName, item.activityName)
-            val intent = Intent()
-            intent.action = Intent.ACTION_MAIN
-            intent.addCategory(Intent.CATEGORY_LAUNCHER)
-            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
-            intent.component = name
-            try {
-                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)
-            }
-        }
-    }
-
-    override fun getItemCount(): Int = apps.size
-
-    inner class ViewHolder(mView: View) : RecyclerView.ViewHolder(mView) {
-        val mLabelView: TextView = mView.findViewById(R.id.main_label)
-
-        override fun toString(): String {
-            return super.toString() + " '" + mLabelView.text + "'"
-        }
-    }
-}

+ 186 - 6
app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeFragment.kt

@@ -1,20 +1,200 @@
 package com.sduduzog.slimlauncher.ui.main
 
+import android.content.*
+import android.os.Build
 import android.os.Bundle
+import android.provider.AlarmClock
+import android.provider.MediaStore
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
-import android.widget.TextView
+import androidx.core.app.ActivityOptionsCompat
+import androidx.lifecycle.Observer
+import androidx.lifecycle.ViewModelProviders
+import androidx.navigation.Navigation
+import com.sduduzog.slimlauncher.MainActivity
 import com.sduduzog.slimlauncher.R
+import com.sduduzog.slimlauncher.adapters.HomeAdapter
+import com.sduduzog.slimlauncher.data.HomeApp
+import com.sduduzog.slimlauncher.data.MainViewModel
 import com.sduduzog.slimlauncher.ui.BaseFragment
+import com.sduduzog.slimlauncher.utils.OnLaunchAppListener
+import kotlinx.android.synthetic.main.home_fragment.*
+import java.text.SimpleDateFormat
+import java.util.*
 
-class HomeFragment: BaseFragment() {
+
+class HomeFragment : BaseFragment(), MainActivity.OnBackPressedListener, OnLaunchAppListener {
+
+    private lateinit var receiver: BroadcastReceiver
+    private lateinit var viewModel: MainViewModel
+
+    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
+                              savedInstanceState: Bundle?): View {
+        return inflater.inflate(R.layout.home_fragment, container, false)
+    }
+
+    override fun onActivityCreated(savedInstanceState: Bundle?) {
+        super.onActivityCreated(savedInstanceState)
+        val adapter1 = HomeAdapter(this)
+        val adapter2 = HomeAdapter(this)
+        home_fragment_list.adapter = adapter1
+        home_fragment_list_exp.adapter = adapter2
+
+        activity?.let {
+            viewModel = ViewModelProviders.of(it).get(MainViewModel::class.java)
+        } ?: throw Error("Activity null, something here is fucked up")
+
+        viewModel.apps.observe(this, Observer { list ->
+            list?.let { apps ->
+                adapter1.setItems(apps.filter {
+                    it.sortingIndex < 4
+                })
+                adapter2.setItems(apps.filter {
+                    it.sortingIndex >= 4
+                })
+            }
+        })
+
+        setEventListeners()
+
+        home_fragment_options.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_homeFragment_to_optionsFragment))
+    }
+
+    override fun onStart() {
+        super.onStart()
+        receiver = ClockReceiver()
+        activity?.registerReceiver(receiver, IntentFilter(Intent.ACTION_TIME_TICK))
+    }
 
     override fun getFragmentView(): View {
-        return TextView(context)
+        return main_fragment2
     }
 
-    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
-        return inflater.inflate(R.layout.home_fragment, container, false)
+    override fun onResume() {
+        super.onResume()
+        updateUi()
+    }
+
+    override fun onAttach(context: Context?) {
+        super.onAttach(context)
+        with(context as MainActivity) {
+            this.onBackPressedListener = this@HomeFragment
+        }
+    }
+
+    override fun onDetach() {
+        super.onDetach()
+        with(context as MainActivity) {
+            this.onBackPressedListener = null
+        }
+    }
+
+    override fun onStop() {
+        super.onStop()
+        activity?.unregisterReceiver(receiver)
+    }
+
+    override fun onBackPress() {
+    }
+
+    override fun onBackPressed() {
+        // Do nothing
+    }
+
+    private fun setEventListeners() {
+
+
+        home_fragment_time.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)
+                    if (intent.resolveActivity(context!!.packageManager) != null)
+                        startActivity(intent, opts.toBundle())
+                } catch (e: ActivityNotFoundException) {
+                    // Do nothing, we've failed :(
+                }
+            }
+        }
+
+        home_fragment_date.setOnClickListener {
+            try {
+                val intent = Intent(Intent.ACTION_MAIN)
+                intent.addCategory(Intent.CATEGORY_APP_CALENDAR)
+                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 :(
+            }
+        }
+
+        home_fragment_call.setOnClickListener {
+            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
+            }
+        }
+
+        home_fragment_camera.setOnClickListener {
+            try {
+                val intent = Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA)
+                launchActivity(it, intent)
+            } catch (e: Exception) {
+                // Do nothing
+            }
+        }
+    }
+
+    fun updateUi() {
+        val twenty4Hour = context?.getSharedPreferences(getString(R.string.prefs_settings), Context.MODE_PRIVATE)
+                ?.getBoolean(getString(R.string.prefs_settings_key_time_format), true)
+        val date = Date()
+        if (twenty4Hour as Boolean) {
+            val fWatchTime = SimpleDateFormat("h:mm", Locale.ENGLISH)
+            val fWatchTimeAP = SimpleDateFormat("aa", Locale.ENGLISH)
+            home_fragment_time.text = fWatchTime.format(date)
+            home_fragment_time_format.text = fWatchTimeAP.format(date)
+            home_fragment_time_format.visibility = View.VISIBLE
+        } else {
+            val fWatchTime = SimpleDateFormat("H:mm", Locale.ENGLISH)
+            home_fragment_time.text = fWatchTime.format(date)
+            home_fragment_time_format.visibility = View.GONE
+        }
+        val fWatchDate = SimpleDateFormat("EEE, MMM dd", Locale.ENGLISH)
+        home_fragment_date.text = fWatchDate.format(date)
+    }
+
+    override fun onLaunch(app: HomeApp, view: View) {
+        val intent = Intent()
+        val name = ComponentName(app.packageName, app.activityName)
+        intent.action = Intent.ACTION_MAIN
+        intent.addCategory(Intent.CATEGORY_LAUNCHER)
+        intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
+        intent.component = name
+        launchActivity(view, intent)
+    }
+
+    inner class ClockReceiver : BroadcastReceiver() {
+        override fun onReceive(ctx: Context?, intent: Intent?) {
+            updateUi()
+        }
     }
-}
+}

+ 0 - 165
app/src/main/java/com/sduduzog/slimlauncher/ui/main/MainFragment.kt

@@ -1,165 +0,0 @@
-package com.sduduzog.slimlauncher.ui.main
-
-import android.content.*
-import android.os.Build
-import android.os.Bundle
-import android.provider.AlarmClock
-import android.provider.MediaStore
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.core.app.ActivityOptionsCompat
-import androidx.navigation.Navigation
-import com.sduduzog.slimlauncher.MainActivity
-import com.sduduzog.slimlauncher.R
-import com.sduduzog.slimlauncher.ui.BaseFragment
-import kotlinx.android.synthetic.main.home_fragment.*
-import java.text.SimpleDateFormat
-import java.util.*
-
-
-class MainFragment : BaseFragment(), MainActivity.OnBackPressedListener {
-
-    private lateinit var receiver: BroadcastReceiver
-
-    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
-                              savedInstanceState: Bundle?): View {
-        return inflater.inflate(R.layout.home_fragment, container, false)
-    }
-
-    override fun onActivityCreated(savedInstanceState: Bundle?) {
-        super.onActivityCreated(savedInstanceState)
-        home_fragment_list.adapter = HomeAppsAdapter(this)
-        setEventListeners()
-
-        home_fragment_options.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_mainFragment_to_optionsFragment))
-    }
-
-    override fun onStart() {
-        super.onStart()
-        receiver = ClockReceiver()
-        activity?.registerReceiver(receiver, IntentFilter(Intent.ACTION_TIME_TICK))
-    }
-
-    override fun getFragmentView(): View {
-        return main_fragment2
-    }
-
-    override fun onResume() {
-        super.onResume()
-        updateUi()
-    }
-
-    override fun onAttach(context: Context?) {
-        super.onAttach(context)
-        with(context as MainActivity) {
-            this.onBackPressedListener = this@MainFragment
-        }
-    }
-
-    override fun onDetach() {
-        super.onDetach()
-        with(context as MainActivity) {
-            this.onBackPressedListener = null
-        }
-    }
-
-    override fun onStop() {
-        super.onStop()
-        activity?.unregisterReceiver(receiver)
-    }
-
-    override fun onBackPress() {
-    }
-
-    override fun onBackPressed() {
-        // Do nothing
-    }
-
-    private fun setEventListeners() {
-
-
-        home_fragment_time.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)
-                    if (intent.resolveActivity(context!!.packageManager) != null)
-                        startActivity(intent, opts.toBundle())
-                } catch (e: ActivityNotFoundException) {
-                    // Do nothing, we've failed :(
-                }
-            }
-        }
-
-        home_fragment_date.setOnClickListener {
-            try {
-                val intent = Intent(Intent.ACTION_MAIN)
-                intent.addCategory(Intent.CATEGORY_APP_CALENDAR)
-                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 :(
-            }
-        }
-
-        home_fragment_call.setOnClickListener {
-            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
-            }
-        }
-
-        home_fragment_camera.setOnClickListener {
-            try {
-                val intent = Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA)
-                launchActivity(it, intent)
-            } catch (e: Exception) {
-                // Do nothing
-            }
-        }
-    }
-
-    fun updateUi() {
-        val twenty4Hour = context?.getSharedPreferences(getString(R.string.prefs_settings), Context.MODE_PRIVATE)
-                ?.getBoolean(getString(R.string.prefs_settings_key_time_format), true)
-        val date = Date()
-        if (twenty4Hour as Boolean) {
-            val fWatchTime = SimpleDateFormat("h:mm", Locale.ENGLISH)
-            val fWatchTimeAP = SimpleDateFormat("aa", Locale.ENGLISH)
-            home_fragment_time.text = fWatchTime.format(date)
-            home_fragment_time_format.text = fWatchTimeAP.format(date)
-            home_fragment_time_format.visibility = View.VISIBLE
-        } else {
-            val fWatchTime = SimpleDateFormat("H:mm", Locale.ENGLISH)
-            home_fragment_time.text = fWatchTime.format(date)
-            home_fragment_time_format.visibility = View.GONE
-        }
-        val fWatchDate = SimpleDateFormat("EEE, MMM dd", Locale.ENGLISH)
-        home_fragment_date.text = fWatchDate.format(date)
-    }
-
-
-    inner class ClockReceiver : BroadcastReceiver() {
-        override fun onReceive(ctx: Context?, intent: Intent?) {
-            updateUi()
-        }
-    }
-}

+ 6 - 6
app/src/main/java/com/sduduzog/slimlauncher/ui/options/CustomiseAppsFragment.kt

@@ -3,23 +3,22 @@ package com.sduduzog.slimlauncher.ui.options
 import android.graphics.Canvas
 import android.os.Bundle
 import android.view.LayoutInflater
-import android.view.MenuItem
 import android.view.View
 import android.view.ViewGroup
+import androidx.appcompat.widget.PopupMenu
 import androidx.lifecycle.Observer
 import androidx.lifecycle.ViewModelProviders
 import androidx.navigation.Navigation
 import androidx.recyclerview.widget.ItemTouchHelper
 import androidx.recyclerview.widget.RecyclerView
+import com.sduduzog.slimlauncher.R
 import com.sduduzog.slimlauncher.adapters.CustomAppsAdapter
 import com.sduduzog.slimlauncher.data.HomeApp
 import com.sduduzog.slimlauncher.data.MainViewModel
 import com.sduduzog.slimlauncher.ui.BaseFragment
-import com.sduduzog.slimlauncher.utils.OnShitDoneToAppsListener
 import com.sduduzog.slimlauncher.utils.OnItemActionListener
+import com.sduduzog.slimlauncher.utils.OnShitDoneToAppsListener
 import kotlinx.android.synthetic.main.customise_apps_fragment.*
-import androidx.appcompat.widget.PopupMenu
-import com.sduduzog.slimlauncher.R
 
 
 class CustomiseAppsFragment : BaseFragment(), OnShitDoneToAppsListener {
@@ -107,8 +106,9 @@ class CustomiseAppsFragment : BaseFragment(), OnShitDoneToAppsListener {
 
     override fun onAppMenuClicked(view: View, app: HomeApp) {
         showPopupMenu(view).setOnMenuItemClickListener {
-            when (it.itemId){
-                R.id.ca_menu_rename -> {}
+            when (it.itemId) {
+                R.id.ca_menu_rename -> {
+                }
                 R.id.ca_menu_remove -> {
                     viewModel.remove(app)
                 }

+ 8 - 0
app/src/main/java/com/sduduzog/slimlauncher/utils/OnLaunchAppListener.kt

@@ -0,0 +1,8 @@
+package com.sduduzog.slimlauncher.utils
+
+import android.view.View
+import com.sduduzog.slimlauncher.data.HomeApp
+
+interface OnLaunchAppListener{
+    fun onLaunch(app: HomeApp, view: View)
+}

+ 15 - 2
app/src/main/res/layout/customise_apps_fragment.xml

@@ -43,10 +43,23 @@
         android:layout_marginStart="8dp"
         android:layout_marginLeft="8dp"
         android:layout_marginBottom="8dp"
-        android:padding="@dimen/_12ssp"
+        android:padding="@dimen/_12sdp"
         android:text="@string/customise_apps_fragment_add"
         android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="18sp"
+        android:textSize="@dimen/_16ssp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintStart_toStartOf="parent" />
+
+    <TextView
+        android:id="@+id/customise_apps_fragment_counter"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/customise_apps_fragment_counter"
+        android:textSize="@dimen/_16ssp"
+        android:padding="@dimen/_12sdp"
+        android:layout_marginRight="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginBottom="8dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent" />
 </androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -10,7 +10,7 @@
         android:id="@+id/home_fragment_time"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:alpha="0"
+        android:alpha="-1"
         android:text="@string/main_placeholder_clock"
         android:textSize="@dimen/_40ssp"
         app:layout_constraintBottom_toTopOf="@+id/home_fragment_date"
@@ -23,7 +23,7 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="16dp"
-        android:alpha="0"
+        android:alpha="-1"
         android:textSize="@dimen/_13sdp"
         app:layout_constraintStart_toEndOf="@+id/home_fragment_time"
         app:layout_constraintTop_toTopOf="@+id/home_fragment_time" />
@@ -32,7 +32,7 @@
         android:id="@+id/home_fragment_date"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:alpha="0"
+        android:alpha="-1"
         android:padding="4dp"
         android:text="@string/main_placeholder_date"
         android:textSize="@dimen/_12sdp"
@@ -106,11 +106,12 @@
         android:id="@+id/home_fragment_call"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:padding="8dp"
-        app:layout_constraintTop_toBottomOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
         android:layout_marginStart="8dp"
         android:layout_marginLeft="8dp"
+        android:padding="8dp"
+        android:alpha="-1"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="parent"
         app:srcCompat="@drawable/ic_call"
         tools:ignore="ContentDescription" />
 
@@ -118,12 +119,13 @@
         android:id="@+id/home_fragment_camera"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:padding="8dp"
         android:layout_marginEnd="8dp"
         android:layout_marginRight="8dp"
+        android:padding="8dp"
+        android:alpha="-1"
+        app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toBottomOf="parent"
         app:srcCompat="@drawable/ic_photo_camera"
-        app:layout_constraintEnd_toEndOf="parent"
         tools:ignore="ContentDescription"
         tools:layout_editor_absoluteX="320dp" />
 

+ 3 - 0
app/src/main/res/layout/home_motion_start.xml

@@ -67,6 +67,7 @@
         android:layout_marginStart="16dp"
         android:layout_marginLeft="16dp"
         android:layout_marginEnd="16dp"
+        android:alpha="-2"
         android:layout_marginRight="16dp"
         android:layout_marginBottom="8dp"
         android:layout_marginTop="@dimen/_16sdp"
@@ -83,6 +84,7 @@
         android:layout_height="wrap_content"
         android:padding="@dimen/_8sdp"
         android:text="@string/main_fragment_options"
+        android:alpha="-3"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="@dimen/_18ssp"
         app:layout_constraintBottom_toBottomOf="parent"
@@ -95,6 +97,7 @@
         android:layout_height="wrap_content"
         android:padding="8dp"
         android:text="@string/main_fragment_notes"
+        android:alpha="-3"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="18sp"
         app:layout_constraintBottom_toBottomOf="parent"

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

@@ -8,7 +8,7 @@
     app:behavior_hideable="false"
     app:behavior_peekHeight="60dp"
     app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
-    tools:context="com.sduduzog.slimlauncher.ui.main.MainFragment">
+    tools:context="com.sduduzog.slimlauncher.ui.main.HomeFragment">
 
 
     <androidx.cardview.widget.CardView

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

@@ -4,7 +4,7 @@
     android:id="@+id/main"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    tools:context=".ui.main.MainFragment">
+    tools:context=".ui.main.HomeFragment">
 
     <include layout="@layout/main_content" />
 

+ 5 - 6
app/src/main/res/navigation/nav_graph.xml

@@ -3,16 +3,15 @@
     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/homeFragment">
 
     <fragment
-        android:id="@+id/mainFragment"
-        android:name="com.sduduzog.slimlauncher.ui.main.MainFragment"
-        android:label="main_fragment"
+        android:id="@+id/homeFragment"
+        android:name="com.sduduzog.slimlauncher.ui.main.HomeFragment"
+        android:label="home_fragment"
         tools:layout="@layout/main_fragment">
-
         <action
-            android:id="@+id/action_mainFragment_to_optionsFragment"
+            android:id="@+id/action_homeFragment_to_optionsFragment"
             app:destination="@id/optionsFragment" />
     </fragment>
     <fragment

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

@@ -101,6 +101,7 @@
     <string name="customise_apps_fragment_add">Add</string>
     <string name="menu_rename">Rename</string>
     <string name="menu_remove">Remove</string>
+    <string name="customise_apps_fragment_counter">%s slots left</string>
 
 
 </resources>