mirror of
https://github.com/jrpie/Launcher.git
synced 2025-04-19 10:20:51 +02:00
Create Fragments for settings
One fragment for every tab, openable with a swipe. The middle tab 'theme' still has to be filled.
This commit is contained in:
parent
abd7a44874
commit
716839e1b9
9 changed files with 347 additions and 2 deletions
|
@ -0,0 +1,20 @@
|
|||
package com.finnmglas.launcher
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
||||
/** The 'Apps' Tab associated Fragment in Settings */
|
||||
|
||||
class SettingsFragmentApps : Fragment() {
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
|
||||
return inflater.inflate(R.layout.fragment_settings_apps, container, false)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.finnmglas.launcher
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
||||
/** The 'Launcher' Tab associated Fragment in Settings */
|
||||
|
||||
class SettingsFragmentLauncher : Fragment() {
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
|
||||
return inflater.inflate(R.layout.fragment_settings_launcher, container, false)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.finnmglas.launcher
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
||||
/** The 'Theme' Tab associated Fragment in Settings */
|
||||
|
||||
class SettingsFragmentTheme : Fragment() {
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
|
||||
return inflater.inflate(R.layout.fragment_settings_theme, container, false)
|
||||
}
|
||||
}
|
|
@ -18,6 +18,9 @@ class SectionsPagerAdapter(private val context: Context, fm: FragmentManager)
|
|||
|
||||
override fun getItem(position: Int): Fragment {
|
||||
return when (position){
|
||||
0 -> SettingsFragmentApps()
|
||||
1 -> SettingsFragmentTheme()
|
||||
2 -> SettingsFragmentLauncher()
|
||||
else -> Fragment()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue