Rename packages and move files

- Rename MainActivity to HomeActivity
- Move functions.kt one level up
- Rename package `extern` to `libraries`
- Fix layouts and layout elements (nomenclature: 
`activity_fragment_element`)
- Move SectionsPagerAdapter code into the related activity kotlin file
This commit is contained in:
Finn M Glas 2020-06-17 20:42:45 +02:00
parent a828b90bb2
commit 7669c44b4d
No known key found for this signature in database
GPG key ID: 902A30146014DFBF
34 changed files with 604 additions and 489 deletions

View file

@ -14,7 +14,7 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/finnmglasTheme"> android:theme="@style/finnmglasTheme">
<activity android:name=".MainActivity" <activity android:name=".HomeActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"> tools:ignore="LockedOrientationActivity">
<intent-filter> <intent-filter>
@ -28,7 +28,7 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"> tools:ignore="LockedOrientationActivity">
</activity> </activity>
<activity android:name=".choose.ChooseActivity" <activity android:name=".list.ListActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"> tools:ignore="LockedOrientationActivity">
</activity> </activity>

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.extern package com.finnmglas.launcher
import android.app.Activity import android.app.Activity
import android.app.AlertDialog import android.app.AlertDialog
@ -17,8 +17,7 @@ import android.view.animation.*
import android.widget.Button import android.widget.Button
import android.widget.ImageView import android.widget.ImageView
import android.widget.Toast import android.widget.Toast
import com.finnmglas.launcher.choose.ChooseActivity import com.finnmglas.launcher.list.ListActivity
import com.finnmglas.launcher.R
import com.finnmglas.launcher.settings.SettingsActivity import com.finnmglas.launcher.settings.SettingsActivity
import com.finnmglas.launcher.settings.intendedSettingsPause import com.finnmglas.launcher.settings.intendedSettingsPause
import kotlin.math.roundToInt import kotlin.math.roundToInt
@ -217,7 +216,7 @@ fun openSettings(activity: Activity){
} }
fun openAppsList(activity: Activity){ fun openAppsList(activity: Activity){
val intent = Intent(activity, ChooseActivity::class.java) val intent = Intent(activity, ListActivity::class.java)
intent.putExtra("action", "view") intent.putExtra("action", "view")
intendedSettingsPause = true intendedSettingsPause = true
activity.startActivity(intent) activity.startActivity(intent)

View file

@ -11,10 +11,9 @@ import android.view.*
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.GestureDetectorCompat import androidx.core.view.GestureDetectorCompat
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.finnmglas.launcher.choose.apps.AppsRecyclerAdapter import com.finnmglas.launcher.list.apps.AppsRecyclerAdapter
import com.finnmglas.launcher.extern.*
import com.finnmglas.launcher.tutorial.TutorialActivity import com.finnmglas.launcher.tutorial.TutorialActivity
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.home.*
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
import kotlin.concurrent.fixedRateTimer import kotlin.concurrent.fixedRateTimer
@ -24,7 +23,7 @@ import kotlin.math.abs
lateinit var viewAdapter: RecyclerView.Adapter<*> lateinit var viewAdapter: RecyclerView.Adapter<*>
lateinit var viewManager: RecyclerView.LayoutManager lateinit var viewManager: RecyclerView.LayoutManager
class MainActivity : AppCompatActivity(), class HomeActivity : AppCompatActivity(),
GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener { GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener {
private var currentTheme = "" // keep track of theme changes private var currentTheme = "" // keep track of theme changes
@ -74,13 +73,13 @@ class MainActivity : AppCompatActivity(),
else -> R.style.customTheme else -> R.style.customTheme
} }
) )
setContentView(R.layout.activity_main) setContentView(R.layout.home)
// Start by showing the settings icon // Start by showing the settings icon
showSettingsIcon() showSettingsIcon()
// As older APIs somehow do not recognize the xml defined onClick // As older APIs somehow do not recognize the xml defined onClick
activity_main_settings_icon.setOnClickListener() { home_settings_icon.setOnClickListener() {
openSettings(this) openSettings(this)
overridePendingTransition(R.anim.bottom_up, android.R.anim.fade_out) overridePendingTransition(R.anim.bottom_up, android.R.anim.fade_out)
} }
@ -107,7 +106,7 @@ class MainActivity : AppCompatActivity(),
loadSettings(sharedPref) loadSettings(sharedPref)
if (currentTheme == "custom") { if (currentTheme == "custom") {
activity_main_settings_icon.setTextColor(vibrantColor) home_settings_icon.setTextColor(vibrantColor)
} }
mDetector = GestureDetectorCompat(this, this) mDetector = GestureDetectorCompat(this, this)
@ -121,21 +120,23 @@ class MainActivity : AppCompatActivity(),
// TODO: do this immediately after changing preferences // TODO: do this immediately after changing preferences
if (currentTheme != getSavedTheme(this)) recreate() if (currentTheme != getSavedTheme(this)) recreate()
if (activity_main_background_image != null && getSavedTheme(this) == "custom") if (home_background_image != null && getSavedTheme(
activity_main_background_image.setImageBitmap(background) this
) == "custom")
home_background_image.setImageBitmap(background)
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
val timeFormat = SimpleDateFormat("HH:mm:ss", Locale.getDefault()) val timeFormat = SimpleDateFormat("HH:mm:ss", Locale.getDefault())
clockTimer = fixedRateTimer("clockTimer", true, 0L, 100) { clockTimer = fixedRateTimer("clockTimer", true, 0L, 100) {
this@MainActivity.runOnUiThread { this@HomeActivity.runOnUiThread {
val t = timeFormat.format(Date()) val t = timeFormat.format(Date())
if (activity_main_time_view.text != t) if (home_time_view.text != t)
activity_main_time_view.text = t home_time_view.text = t
val d = dateFormat.format(Date()) val d = dateFormat.format(Date())
if (activity_main_date_view.text != d) if (home_date_view.text != d)
activity_main_date_view.text = d home_date_view.text = d
} }
} }
} }
@ -149,13 +150,29 @@ class MainActivity : AppCompatActivity(),
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK) { if (settingsIconShown) hideSettingsIcon() } if (keyCode == KeyEvent.KEYCODE_BACK) { if (settingsIconShown) hideSettingsIcon() }
else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) launch(volumeUpApp, this) else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) launch(
else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) launch(volumeDownApp, this) volumeUpApp,
this
)
else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) launch(
volumeDownApp,
this
)
return true return true
} }
fun dateViewOnTouch(v: View) { launch(calendarApp, this) } fun dateViewOnTouch(v: View) {
fun timeViewOnTouch(v: View) { launch(clockApp, this) } launch(
calendarApp,
this
)
}
fun timeViewOnTouch(v: View) {
launch(
clockApp,
this
)
}
override fun onFling(e1: MotionEvent, e2: MotionEvent, dX: Float, dY: Float): Boolean { override fun onFling(e1: MotionEvent, e2: MotionEvent, dX: Float, dY: Float): Boolean {
@ -168,24 +185,42 @@ class MainActivity : AppCompatActivity(),
val strictness = 4 // how distinguished the swipe has to be to be accepted val strictness = 4 // how distinguished the swipe has to be to be accepted
// Only open if the swipe was not from the phones top edge // Only open if the swipe was not from the phones top edge
if (diffY < -height / 8 && abs(diffY) > strictness * abs(diffX) && e1.y > 100) launch(downApp, this) if (diffY < -height / 8 && abs(diffY) > strictness * abs(diffX) && e1.y > 100) launch(
downApp,
this
)
else if (diffY > height / 8 && abs(diffY) > strictness * abs(diffX)) { else if (diffY > height / 8 && abs(diffY) > strictness * abs(diffX)) {
launch(upApp, this) launch(
upApp,
this
)
overridePendingTransition(R.anim.bottom_up, android.R.anim.fade_out) overridePendingTransition(R.anim.bottom_up, android.R.anim.fade_out)
} }
else if (diffX > width / 4 && abs(diffX) > strictness * abs(diffY)) launch(leftApp, this) else if (diffX > width / 4 && abs(diffX) > strictness * abs(diffY)) launch(
else if (diffX < -width / 4 && abs(diffX) > strictness * abs(diffY)) launch(rightApp, this) leftApp,
this
)
else if (diffX < -width / 4 && abs(diffX) > strictness * abs(diffY)) launch(
rightApp,
this
)
return true return true
} }
override fun onLongPress(event: MotionEvent) { override fun onLongPress(event: MotionEvent) {
if(longClickApp != "") launch(longClickApp, this) if(longClickApp != "") launch(
longClickApp,
this
)
else openSettings(this) else openSettings(this)
} }
override fun onDoubleTap(event: MotionEvent): Boolean { override fun onDoubleTap(event: MotionEvent): Boolean {
launch(doubleClickApp, this) launch(
doubleClickApp,
this
)
return false return false
} }
@ -201,23 +236,25 @@ class MainActivity : AppCompatActivity(),
} }
private fun showSettingsIcon(){ private fun showSettingsIcon(){
activity_main_settings_icon.fadeRotateIn() home_settings_icon.fadeRotateIn()
activity_main_settings_icon.visibility = View.VISIBLE home_settings_icon.visibility = View.VISIBLE
settingsIconShown = true settingsIconShown = true
tooltipTimer = fixedRateTimer("tooltipTimer", true, 10000, 1000) { tooltipTimer = fixedRateTimer("tooltipTimer", true, 10000, 1000) {
this@MainActivity.runOnUiThread { hideSettingsIcon() } this@HomeActivity.runOnUiThread { hideSettingsIcon() }
} }
} }
private fun hideSettingsIcon(){ private fun hideSettingsIcon(){
tooltipTimer.cancel() tooltipTimer.cancel()
activity_main_settings_icon.fadeRotateOut() home_settings_icon.fadeRotateOut()
activity_main_settings_icon.visibility = View.INVISIBLE home_settings_icon.visibility = View.INVISIBLE
settingsIconShown = false settingsIconShown = false
} }
fun settingsIconOnTouch(view: View){ openSettings(this) } fun settingsIconOnTouch(view: View){
openSettings(this)
}
override fun onTouchEvent(event: MotionEvent): Boolean { override fun onTouchEvent(event: MotionEvent): Boolean {
return if (mDetector.onTouchEvent(event)) { false } else { super.onTouchEvent(event) } return if (mDetector.onTouchEvent(event)) { false } else { super.onTouchEvent(event) }

View file

@ -1,38 +0,0 @@
package com.finnmglas.launcher.choose
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.finnmglas.launcher.*
import com.finnmglas.launcher.choose.apps.ChooseFragmentApps
import com.finnmglas.launcher.choose.other.ChooseFragmentOther
private val TAB_TITLES = arrayOf(
R.string.choose_tab_app,
R.string.choose_tab_other
)
/** Returns the fragment corresponding to the selected tab.*/
class ChooseSectionsPagerAdapter(private val context: Context, fm: FragmentManager)
: FragmentPagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
override fun getItem(position: Int): Fragment {
return when (position){
0 -> ChooseFragmentApps()
1 -> ChooseFragmentOther()
else -> Fragment()
}
}
override fun getPageTitle(position: Int): CharSequence? {
return context.resources.getString(TAB_TITLES[position])
}
override fun getCount(): Int {
return when (action) {
"view" -> 1
else -> 2
}
}
}

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.extern // replace with your package package com.finnmglas.launcher.libraries // replace with your package
// On GitHub: https://github.com/finnmglas/fontawesome-android // On GitHub: https://github.com/finnmglas/fontawesome-android

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.choose package com.finnmglas.launcher.list
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
@ -8,20 +8,26 @@ import android.view.WindowManager
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.finnmglas.launcher.R import com.finnmglas.launcher.*
import com.finnmglas.launcher.extern.*
import com.finnmglas.launcher.settings.intendedSettingsPause import com.finnmglas.launcher.settings.intendedSettingsPause
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import kotlinx.android.synthetic.main.activity_choose.* import kotlinx.android.synthetic.main.list.*
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.finnmglas.launcher.list.apps.ChooseFragmentApps
import com.finnmglas.launcher.list.other.ChooseFragmentOther
var intendedChoosePause = false // know when to close var intendedChoosePause = false // know when to close
// TODO: Better solution for this (used in choose-fragments) // TODO: Better solution for this (used in list-fragments)
var action = "view" var action = "view"
var forApp = "" var forApp = ""
class ChooseActivity : AppCompatActivity() { class ListActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
@ -36,16 +42,16 @@ class ChooseActivity : AppCompatActivity() {
else -> R.style.finnmglasTheme else -> R.style.finnmglasTheme
} }
) )
setContentView(R.layout.activity_choose) setContentView(R.layout.list)
if (getSavedTheme(this) == "custom") { if (getSavedTheme(this) == "custom") {
activity_choose_container.setBackgroundColor(dominantColor) list_container.setBackgroundColor(dominantColor)
activity_choose_app_bar.setBackgroundColor(dominantColor) list_appbar.setBackgroundColor(dominantColor)
activity_choose_close.setTextColor(vibrantColor) list_close.setTextColor(vibrantColor)
} }
// As older APIs somehow do not recognize the xml defined onClick // As older APIs somehow do not recognize the xml defined onClick
activity_choose_close.setOnClickListener() { finish() } list_close.setOnClickListener() { finish() }
// get info about which action this activity is open for // get info about which action this activity is open for
val bundle = intent.extras val bundle = intent.extras
@ -57,18 +63,18 @@ class ChooseActivity : AppCompatActivity() {
// Hide tabs for the "view" action // Hide tabs for the "view" action
if (action == "view") { if (action == "view") {
activity_choose_tabs.visibility = View.GONE list_tabs.visibility = View.GONE
} }
when (action) { when (action) {
"view" -> activity_choose_heading.text = getString(R.string.choose_title_view) "view" -> list_heading.text = getString(R.string.choose_title_view)
"pick" -> activity_choose_heading.text = getString(R.string.choose_title) "pick" -> list_heading.text = getString(R.string.choose_title)
} }
val sectionsPagerAdapter = ChooseSectionsPagerAdapter(this, supportFragmentManager) val sectionsPagerAdapter = ListSectionsPagerAdapter(this, supportFragmentManager)
val viewPager: ViewPager = findViewById(R.id.activity_choose_view_pager) val viewPager: ViewPager = findViewById(R.id.list_viewpager)
viewPager.adapter = sectionsPagerAdapter viewPager.adapter = sectionsPagerAdapter
val tabs: TabLayout = findViewById(R.id.activity_choose_tabs) val tabs: TabLayout = findViewById(R.id.list_tabs)
tabs.setupWithViewPager(viewPager) tabs.setupWithViewPager(viewPager)
} }
@ -101,3 +107,32 @@ class ChooseActivity : AppCompatActivity() {
fun backHome(view: View) { finish() } fun backHome(view: View) { finish() }
} }
private val TAB_TITLES = arrayOf(
R.string.choose_tab_app,
R.string.choose_tab_other
)
/** Returns the fragment corresponding to the selected tab.*/
class ListSectionsPagerAdapter(private val context: Context, fm: FragmentManager)
: FragmentPagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
override fun getItem(position: Int): Fragment {
return when (position){
0 -> ChooseFragmentApps()
1 -> ChooseFragmentOther()
else -> Fragment()
}
}
override fun getPageTitle(position: Int): CharSequence? {
return context.resources.getString(TAB_TITLES[position])
}
override fun getCount(): Int {
return when (action) {
"view" -> 1
else -> 2
}
}
}

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.choose.apps package com.finnmglas.launcher.list.apps
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.choose.apps package com.finnmglas.launcher.list.apps
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
@ -12,9 +12,9 @@ import android.widget.ImageView
import android.widget.PopupMenu import android.widget.PopupMenu
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.finnmglas.launcher.R import com.finnmglas.launcher.*
import com.finnmglas.launcher.extern.* import com.finnmglas.launcher.libraries.*
import com.finnmglas.launcher.choose.intendedChoosePause import com.finnmglas.launcher.list.intendedChoosePause
class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forApp: String?): class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forApp: String?):
RecyclerView.Adapter<AppsRecyclerAdapter.ViewHolder>() { RecyclerView.Adapter<AppsRecyclerAdapter.ViewHolder>() {
@ -23,9 +23,9 @@ class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forAp
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView),
View.OnClickListener { View.OnClickListener {
var textView: TextView = itemView.findViewById(R.id.choose_row_app_name) var textView: TextView = itemView.findViewById(R.id.list_apps_row_name)
var img: ImageView = itemView.findViewById(R.id.choose_row_app_icon) as ImageView var img: ImageView = itemView.findViewById(R.id.list_apps_row_icon) as ImageView
var menuDots: FontAwesome = itemView.findViewById(R.id.choose_row_app_menu) var menuDots: FontAwesome = itemView.findViewById(R.id.list_apps_row_menu)
override fun onClick(v: View) { override fun onClick(v: View) {
val pos = adapterPosition val pos = adapterPosition
@ -60,7 +60,9 @@ class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forAp
viewHolder.textView.text = appLabel viewHolder.textView.text = appLabel
viewHolder.img.setImageDrawable(appIcon) viewHolder.img.setImageDrawable(appIcon)
if (getSavedTheme(activity) == "dark") transformGrayscale(viewHolder.img) if (getSavedTheme(activity) == "dark") transformGrayscale(
viewHolder.img
)
// decide when to show the options popup menu about // decide when to show the options popup menu about
if (isSystemApp || action == "pick") { if (isSystemApp || action == "pick") {
@ -93,13 +95,18 @@ class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forAp
val intent = Intent(Intent.ACTION_UNINSTALL_PACKAGE) val intent = Intent(Intent.ACTION_UNINSTALL_PACKAGE)
intent.data = Uri.parse("package:$appPackageName") intent.data = Uri.parse("package:$appPackageName")
intent.putExtra(Intent.EXTRA_RETURN_RESULT, true) intent.putExtra(Intent.EXTRA_RETURN_RESULT, true)
activity.startActivityForResult(intent, REQUEST_UNINSTALL) activity.startActivityForResult(intent,
REQUEST_UNINSTALL
)
true true
} }
R.id.app_menu_info -> { // open app settings R.id.app_menu_info -> { // open app settings
intendedChoosePause = true intendedChoosePause = true
openAppSettings(appPackageName, activity) openAppSettings(
appPackageName,
activity
)
true true
} }
else -> false else -> false
@ -114,7 +121,7 @@ class AppsRecyclerAdapter(val activity: Activity, val action: String?, val forAp
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val inflater = LayoutInflater.from(parent.context) val inflater = LayoutInflater.from(parent.context)
val view: View = inflater.inflate(R.layout.recycler_apps_row, parent, false) val view: View = inflater.inflate(R.layout.list_apps_row, parent, false)
return ViewHolder(view) return ViewHolder(view)
} }

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.choose.apps package com.finnmglas.launcher.list.apps
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
@ -7,10 +7,11 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.finnmglas.launcher.R import com.finnmglas.launcher.R
import com.finnmglas.launcher.choose.action import com.finnmglas.launcher.list.action
import com.finnmglas.launcher.extern.* import com.finnmglas.launcher.list.forApp
import com.finnmglas.launcher.choose.forApp import com.finnmglas.launcher.dominantColor
import kotlinx.android.synthetic.main.fragment_choose_apps.* import com.finnmglas.launcher.getSavedTheme
import kotlinx.android.synthetic.main.list_apps.*
/** The 'Apps' Tab associated Fragment in the Chooser */ /** The 'Apps' Tab associated Fragment in the Chooser */
@ -23,14 +24,14 @@ class ChooseFragmentApps : Fragment() {
inflater: LayoutInflater, container: ViewGroup?, inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
return inflater.inflate(R.layout.fragment_choose_apps, container, false) return inflater.inflate(R.layout.list_apps, container, false)
} }
override fun onStart() { override fun onStart() {
super.onStart() super.onStart()
if (getSavedTheme(context!!) == "custom") { if (getSavedTheme(context!!) == "custom") {
fragment_choose_apps_container.setBackgroundColor(dominantColor) list_apps_container.setBackgroundColor(dominantColor)
} }
// set up the list / recycler // set up the list / recycler
@ -41,7 +42,7 @@ class ChooseFragmentApps : Fragment() {
forApp forApp
) )
fragment_choose_apps_recycler_view.apply { list_apps_rview.apply {
// improve performance (since content changes don't change the layout size) // improve performance (since content changes don't change the layout size)
setHasFixedSize(true) setHasFixedSize(true)
layoutManager = viewManager layoutManager = viewManager

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.choose.other package com.finnmglas.launcher.list.other
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
@ -7,9 +7,9 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.finnmglas.launcher.R import com.finnmglas.launcher.R
import com.finnmglas.launcher.extern.dominantColor import com.finnmglas.launcher.dominantColor
import com.finnmglas.launcher.extern.getSavedTheme import com.finnmglas.launcher.getSavedTheme
import kotlinx.android.synthetic.main.fragment_choose_other.* import kotlinx.android.synthetic.main.list_other.*
/** The 'Other' Tab associated Fragment in the Chooser */ /** The 'Other' Tab associated Fragment in the Chooser */
@ -21,19 +21,19 @@ class ChooseFragmentOther : Fragment() {
inflater: LayoutInflater, container: ViewGroup?, inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
return inflater.inflate(R.layout.fragment_choose_other, container, false) return inflater.inflate(R.layout.list_other, container, false)
} }
override fun onStart() { override fun onStart() {
if (getSavedTheme(context!!) == "custom") { if (getSavedTheme(context!!) == "custom") {
fragment_choose_other_container.setBackgroundColor(dominantColor) list_other_container.setBackgroundColor(dominantColor)
} }
// set up the list / recycler // set up the list / recycler
val viewManager = LinearLayoutManager(context) val viewManager = LinearLayoutManager(context)
val viewAdapter = OtherRecyclerAdapter(activity!!) val viewAdapter = OtherRecyclerAdapter(activity!!)
fragment_choose_other_recycler_view.apply { list_other_rview.apply {
// improve performance (since content changes don't change the layout size) // improve performance (since content changes don't change the layout size)
setHasFixedSize(true) setHasFixedSize(true)
layoutManager = viewManager layoutManager = viewManager

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.choose.other package com.finnmglas.launcher.list.other
class OtherInfo(label: String, data: String, icon: String) { class OtherInfo(label: String, data: String, icon: String) {
var label: CharSequence? = label var label: CharSequence? = label

View file

@ -1,4 +1,4 @@
package com.finnmglas.launcher.choose.other package com.finnmglas.launcher.list.other
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
@ -8,8 +8,9 @@ import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.finnmglas.launcher.R import com.finnmglas.launcher.R
import com.finnmglas.launcher.extern.* import com.finnmglas.launcher.REQUEST_CHOOSE_APP
import com.finnmglas.launcher.choose.forApp import com.finnmglas.launcher.libraries.*
import com.finnmglas.launcher.list.forApp
/* Will only be used if an app / action is picked */ /* Will only be used if an app / action is picked */
class OtherRecyclerAdapter(val activity: Activity): class OtherRecyclerAdapter(val activity: Activity):
@ -19,8 +20,8 @@ class OtherRecyclerAdapter(val activity: Activity):
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView),
View.OnClickListener { View.OnClickListener {
var textView: TextView = itemView.findViewById(R.id.row_other_name) var textView: TextView = itemView.findViewById(R.id.list_other_row_name)
var iconView: FontAwesome = itemView.findViewById(R.id.row_other_fa_icon) var iconView: FontAwesome = itemView.findViewById(R.id.list_other_row_icon)
override fun onClick(v: View) { override fun onClick(v: View) {
@ -45,7 +46,7 @@ class OtherRecyclerAdapter(val activity: Activity):
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val inflater = LayoutInflater.from(parent.context) val inflater = LayoutInflater.from(parent.context)
val view: View = inflater.inflate(R.layout.recycler_other_row, parent, false) val view: View = inflater.inflate(R.layout.list_other_row, parent, false)
return ViewHolder(view) return ViewHolder(view)
} }

View file

@ -9,10 +9,17 @@ import android.view.View
import android.view.WindowManager import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.finnmglas.launcher.R import com.finnmglas.launcher.*
import com.finnmglas.launcher.extern.*
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import kotlinx.android.synthetic.main.activity_settings.* import kotlinx.android.synthetic.main.settings.*
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.finnmglas.launcher.settings.actions.SettingsFragmentActions
import com.finnmglas.launcher.settings.meta.SettingsFragmentMeta
import com.finnmglas.launcher.settings.theme.SettingsFragmentTheme
var intendedSettingsPause = false // know when to close var intendedSettingsPause = false // know when to close
@ -31,21 +38,21 @@ class SettingsActivity : AppCompatActivity() {
} }
) )
setContentView(R.layout.activity_settings) setContentView(R.layout.settings)
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN) window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
val sectionsPagerAdapter = SettingsSectionsPagerAdapter(this, supportFragmentManager) val sectionsPagerAdapter = SettingsSectionsPagerAdapter(this, supportFragmentManager)
val viewPager: ViewPager = findViewById(R.id.activity_settings_view_pager) val viewPager: ViewPager = findViewById(R.id.settings_viewpager)
viewPager.adapter = sectionsPagerAdapter viewPager.adapter = sectionsPagerAdapter
val tabs: TabLayout = findViewById(R.id.activity_settings_tabs) val tabs: TabLayout = findViewById(R.id.settings_tabs)
tabs.setupWithViewPager(viewPager) tabs.setupWithViewPager(viewPager)
// As older APIs somehow do not recognize the xml defined onClick // As older APIs somehow do not recognize the xml defined onClick
activity_settings_close.setOnClickListener() { finish() } settings_close.setOnClickListener() { finish() }
// open device settings (see https://stackoverflow.com/a/62092663/12787264) // open device settings (see https://stackoverflow.com/a/62092663/12787264)
activity_settings_device_settings.setOnClickListener { settings_system.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
startActivity(Intent(Settings.ACTION_SETTINGS)) startActivity(Intent(Settings.ACTION_SETTINGS))
} }
@ -55,12 +62,12 @@ class SettingsActivity : AppCompatActivity() {
super.onStart() super.onStart()
if (getSavedTheme(this) == "custom") { if (getSavedTheme(this) == "custom") {
activity_settings_container.setBackgroundColor(dominantColor) settings_container.setBackgroundColor(dominantColor)
activity_settings_app_bar.setBackgroundColor(dominantColor) settings_appbar.setBackgroundColor(dominantColor)
activity_settings_device_settings.setTextColor(vibrantColor) settings_system.setTextColor(vibrantColor)
activity_settings_close.setTextColor(vibrantColor) settings_close.setTextColor(vibrantColor)
activity_settings_tabs.setSelectedTabIndicatorColor(vibrantColor) settings_tabs.setSelectedTabIndicatorColor(vibrantColor)
} }
} }
@ -96,5 +103,30 @@ class SettingsActivity : AppCompatActivity() {
} }
} }
}
private val TAB_TITLES = arrayOf(
R.string.settings_tab_app,
R.string.settings_tab_theme,
R.string.settings_tab_launcher
)
/** Returns the fragment corresponding to the selected tab.*/
class SettingsSectionsPagerAdapter(private val context: Context, fm: FragmentManager)
: FragmentPagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
override fun getItem(position: Int): Fragment {
return when (position){
0 -> SettingsFragmentActions()
1 -> SettingsFragmentTheme()
2 -> SettingsFragmentMeta()
else -> Fragment()
}
}
override fun getPageTitle(position: Int): CharSequence? {
return context.resources.getString(TAB_TITLES[position])
}
override fun getCount(): Int { return 3 }
} }

View file

@ -1,36 +0,0 @@
package com.finnmglas.launcher.settings
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.finnmglas.launcher.*
import com.finnmglas.launcher.settings.actions.SettingsFragmentApps
import com.finnmglas.launcher.settings.meta.SettingsFragmentMeta
import com.finnmglas.launcher.settings.theme.SettingsFragmentTheme
private val TAB_TITLES = arrayOf(
R.string.settings_tab_app,
R.string.settings_tab_theme,
R.string.settings_tab_launcher
)
/** Returns the fragment corresponding to the selected tab.*/
class SettingsSectionsPagerAdapter(private val context: Context, fm: FragmentManager)
: FragmentPagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
override fun getItem(position: Int): Fragment {
return when (position){
0 -> SettingsFragmentApps()
1 -> SettingsFragmentTheme()
2 -> SettingsFragmentMeta()
else -> Fragment()
}
}
override fun getPageTitle(position: Int): CharSequence? {
return context.resources.getString(TAB_TITLES[position])
}
override fun getCount(): Int { return 3 }
}

View file

@ -11,10 +11,9 @@ import android.widget.Button
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.finnmglas.launcher.choose.ChooseActivity import com.finnmglas.launcher.*
import com.finnmglas.launcher.R import com.finnmglas.launcher.list.ListActivity
import com.finnmglas.launcher.extern.FontAwesome import com.finnmglas.launcher.libraries.FontAwesome
import com.finnmglas.launcher.extern.*
import com.finnmglas.launcher.settings.intendedSettingsPause import com.finnmglas.launcher.settings.intendedSettingsPause
import java.lang.Exception import java.lang.Exception
@ -26,11 +25,11 @@ class ActionsRecyclerAdapter(val activity: Activity):
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView),
View.OnClickListener { View.OnClickListener {
var textView: TextView = itemView.findViewById(R.id.row_action_name) var textView: TextView = itemView.findViewById(R.id.settings_actions_row_name)
var fontAwesome: FontAwesome = itemView.findViewById(R.id.row_app_fa_icon) var fontAwesome: FontAwesome = itemView.findViewById(R.id.settings_actions_row_icon)
var img: ImageView = itemView.findViewById(R.id.row_app_icon) as ImageView var img: ImageView = itemView.findViewById(R.id.settings_actions_row_icon_img) as ImageView
var chooseButton: Button = itemView.findViewById(R.id.row_choose_button) var chooseButton: Button = itemView.findViewById(R.id.settings_actions_row_button_choose)
var removeAction: FontAwesome = itemView.findViewById(R.id.row_remove_action) var removeAction: FontAwesome = itemView.findViewById(R.id.settings_actions_row_remove)
override fun onClick(v: View) { override fun onClick(v: View) {
@ -64,7 +63,10 @@ class ActionsRecyclerAdapter(val activity: Activity):
viewHolder.chooseButton.visibility = View.VISIBLE viewHolder.chooseButton.visibility = View.VISIBLE
viewHolder.chooseButton.setOnClickListener{ chooseApp(actionName.toString()) } viewHolder.chooseButton.setOnClickListener{ chooseApp(actionName.toString()) }
if (getSavedTheme(activity) =="custom") if (getSavedTheme(activity) =="custom")
setButtonColor(viewHolder.chooseButton, vibrantColor) setButtonColor(
viewHolder.chooseButton,
vibrantColor
)
} }
if (content!!.startsWith("launcher")) { if (content!!.startsWith("launcher")) {
@ -84,7 +86,9 @@ class ActionsRecyclerAdapter(val activity: Activity):
viewHolder.img.setImageDrawable(activity.packageManager.getApplicationIcon(content.toString())) viewHolder.img.setImageDrawable(activity.packageManager.getApplicationIcon(content.toString()))
viewHolder.img.setOnClickListener{ chooseApp(actionName.toString()) } viewHolder.img.setOnClickListener{ chooseApp(actionName.toString()) }
if (getSavedTheme(activity) == "dark") transformGrayscale(viewHolder.img) if (getSavedTheme(activity) == "dark") transformGrayscale(
viewHolder.img
)
} catch (e : Exception) { // the button is shown, user asked to select an action } catch (e : Exception) { // the button is shown, user asked to select an action
viewHolder.img.visibility = View.INVISIBLE viewHolder.img.visibility = View.INVISIBLE
@ -92,7 +96,10 @@ class ActionsRecyclerAdapter(val activity: Activity):
viewHolder.chooseButton.visibility = View.VISIBLE viewHolder.chooseButton.visibility = View.VISIBLE
viewHolder.chooseButton.setOnClickListener{ chooseApp(actionName.toString()) } viewHolder.chooseButton.setOnClickListener{ chooseApp(actionName.toString()) }
if (getSavedTheme(activity) =="custom") if (getSavedTheme(activity) =="custom")
setButtonColor(viewHolder.chooseButton, vibrantColor) setButtonColor(
viewHolder.chooseButton,
vibrantColor
)
} }
} }
} }
@ -101,28 +108,46 @@ class ActionsRecyclerAdapter(val activity: Activity):
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val inflater = LayoutInflater.from(parent.context) val inflater = LayoutInflater.from(parent.context)
val view: View = inflater.inflate(R.layout.recycler_actions_row, parent, false) val view: View = inflater.inflate(R.layout.settings_actions_row, parent, false)
return ViewHolder(view) return ViewHolder(view)
} }
init { init {
actionsList = ArrayList() actionsList = ArrayList()
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_up),"upApp", upApp)) actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_up),"upApp",
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_down),"downApp", downApp)) upApp
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_left), "leftApp", leftApp)) ))
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_right), "rightApp", rightApp)) actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_down),"downApp",
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_vol_up), "volumeUpApp", volumeUpApp)) downApp
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_vol_down), "volumeDownApp", volumeDownApp)) ))
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_double_click), "doubleClickApp", doubleClickApp)) actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_left), "leftApp",
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_long_click), "longClickApp", longClickApp)) leftApp
))
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_right), "rightApp",
rightApp
))
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_vol_up), "volumeUpApp",
volumeUpApp
))
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_vol_down), "volumeDownApp",
volumeDownApp
))
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_double_click), "doubleClickApp",
doubleClickApp
))
actionsList.add(ActionInfo(activity.getString(R.string.settings_choose_long_click), "longClickApp",
longClickApp
))
} }
/* */ /* */
private fun chooseApp(forAction: String) { private fun chooseApp(forAction: String) {
val intent = Intent(activity, ChooseActivity::class.java) val intent = Intent(activity, ListActivity::class.java)
intent.putExtra("action", "pick") intent.putExtra("action", "pick")
intent.putExtra("forApp", forAction) // for which action we choose the app intent.putExtra("forApp", forAction) // for which action we choose the app
intendedSettingsPause = true intendedSettingsPause = true
activity.startActivityForResult(intent, REQUEST_CHOOSE_APP) activity.startActivityForResult(intent,
REQUEST_CHOOSE_APP
)
} }
} }

View file

@ -10,16 +10,15 @@ import android.view.ViewGroup
import android.widget.Toast import android.widget.Toast
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.finnmglas.launcher.choose.ChooseActivity import com.finnmglas.launcher.*
import com.finnmglas.launcher.R import com.finnmglas.launcher.list.ListActivity
import com.finnmglas.launcher.extern.*
import com.finnmglas.launcher.settings.intendedSettingsPause import com.finnmglas.launcher.settings.intendedSettingsPause
import kotlinx.android.synthetic.main.fragment_settings_apps.* import kotlinx.android.synthetic.main.settings_actions.*
/** The 'Apps' Tab associated Fragment in Settings */ /** The 'Apps' Tab associated Fragment in Settings */
class SettingsFragmentApps : Fragment() { class SettingsFragmentActions : Fragment() {
/** Lifecycle functions */ /** Lifecycle functions */
@ -27,16 +26,22 @@ class SettingsFragmentApps : Fragment() {
inflater: LayoutInflater, container: ViewGroup?, inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
return inflater.inflate(R.layout.fragment_settings_apps, container, false) return inflater.inflate(R.layout.settings_actions, container, false)
} }
override fun onStart() { override fun onStart() {
if (getSavedTheme(context!!) == "custom") { if (getSavedTheme(context!!) == "custom") {
fragment_settings_apps_container.setBackgroundColor(dominantColor) settings_actions_container.setBackgroundColor(dominantColor)
setButtonColor(fragment_settings_apps_btn, vibrantColor) setButtonColor(
setButtonColor(fragment_settings_apps_install_btn, vibrantColor) settings_actions_button_view_apps,
vibrantColor
)
setButtonColor(
settings_actions_button_install_apps,
vibrantColor
)
} }
@ -44,7 +49,7 @@ class SettingsFragmentApps : Fragment() {
val actionViewManager = LinearLayoutManager(context) val actionViewManager = LinearLayoutManager(context)
val actionViewAdapter = ActionsRecyclerAdapter( activity!! ) val actionViewAdapter = ActionsRecyclerAdapter( activity!! )
activity_settings_actions_recycler_view.apply { settings_actions_rview.apply {
// improve performance (since content changes don't change the layout size) // improve performance (since content changes don't change the layout size)
setHasFixedSize(true) setHasFixedSize(true)
layoutManager = actionViewManager layoutManager = actionViewManager
@ -52,13 +57,13 @@ class SettingsFragmentApps : Fragment() {
} }
// App management buttons // App management buttons
fragment_settings_apps_btn.setOnClickListener{ settings_actions_button_view_apps.setOnClickListener{
val intent = Intent(this.context, ChooseActivity::class.java) val intent = Intent(this.context, ListActivity::class.java)
intent.putExtra("action", "view") intent.putExtra("action", "view")
intendedSettingsPause = true intendedSettingsPause = true
startActivity(intent) startActivity(intent)
} }
fragment_settings_apps_install_btn.setOnClickListener{ settings_actions_button_install_apps.setOnClickListener{
try { try {
val rateIntent = Intent( val rateIntent = Intent(
Intent.ACTION_VIEW, Intent.ACTION_VIEW,

View file

@ -13,11 +13,10 @@ import androidx.fragment.app.Fragment
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import com.finnmglas.launcher.*
import com.finnmglas.launcher.tutorial.TutorialActivity import com.finnmglas.launcher.tutorial.TutorialActivity
import com.finnmglas.launcher.R
import com.finnmglas.launcher.extern.*
import com.finnmglas.launcher.settings.intendedSettingsPause import com.finnmglas.launcher.settings.intendedSettingsPause
import kotlinx.android.synthetic.main.fragment_settings_meta.* import kotlinx.android.synthetic.main.settings_meta.*
/** The 'Meta' Tab associated Fragment in Settings */ /** The 'Meta' Tab associated Fragment in Settings */
@ -29,28 +28,43 @@ class SettingsFragmentMeta : Fragment() {
inflater: LayoutInflater, container: ViewGroup?, inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
return inflater.inflate(R.layout.fragment_settings_meta, container, false) return inflater.inflate(R.layout.settings_meta, container, false)
} }
override fun onStart() { override fun onStart() {
if (getSavedTheme(context!!) == "custom") { if (getSavedTheme(context!!) == "custom") {
fragment_settings_meta_container.setBackgroundColor(dominantColor) settings_meta_container.setBackgroundColor(dominantColor)
setButtonColor(fragment_settings_meta_select_launcher_btn, vibrantColor) setButtonColor(
setButtonColor(fragment_settings_meta_view_tutorial_btn, vibrantColor) settings_meta_button_select_launcher,
setButtonColor(fragment_settings_meta_reset_settings_btn, vibrantColor) vibrantColor
setButtonColor(fragment_settings_meta_contact_btn, vibrantColor) )
setButtonColor(fragment_settings_meta_donate_btn, vibrantColor) setButtonColor(
settings_meta_button_view_tutorial,
vibrantColor
)
setButtonColor(
settings_meta_button_reset_settings,
vibrantColor
)
setButtonColor(
settings_meta_button_contact,
vibrantColor
)
setButtonColor(
settings_meta_button_donate,
vibrantColor
)
fragment_settings_meta_footer_play_icon.setTextColor(vibrantColor) settings_meta_icon_google_play.setTextColor(vibrantColor)
fragment_settings_meta_footer_github_icon.setTextColor(vibrantColor) settings_meta_icon_github.setTextColor(vibrantColor)
fragment_settings_meta_footer_globe_icon.setTextColor(vibrantColor) settings_meta_icon_globe.setTextColor(vibrantColor)
} }
// Button onClicks // Button onClicks
fragment_settings_meta_select_launcher_btn.setOnClickListener { settings_meta_button_select_launcher.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
// on newer sdk: choose launcher // on newer sdk: choose launcher
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@ -65,7 +79,10 @@ class SettingsFragmentMeta : Fragment() {
.setPositiveButton(android.R.string.yes, .setPositiveButton(android.R.string.yes,
DialogInterface.OnClickListener { _, _ -> DialogInterface.OnClickListener { _, _ ->
try { try {
openAppSettings(this.context!!.packageName, this.context!!) openAppSettings(
this.context!!.packageName,
this.context!!
)
} catch ( e : ActivityNotFoundException) { } catch ( e : ActivityNotFoundException) {
val intent = Intent(Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS) val intent = Intent(Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS)
startActivity(intent) startActivity(intent)
@ -77,20 +94,24 @@ class SettingsFragmentMeta : Fragment() {
} }
} }
fragment_settings_meta_view_tutorial_btn.setOnClickListener { settings_meta_button_view_tutorial.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
startActivity(Intent(this.context, TutorialActivity::class.java)) startActivity(Intent(this.context, TutorialActivity::class.java))
} }
// prompting for settings-reset confirmation // prompting for settings-reset confirmation
fragment_settings_meta_reset_settings_btn.setOnClickListener { settings_meta_button_reset_settings.setOnClickListener {
AlertDialog.Builder(this.context!!, R.style.AlertDialogCustom) AlertDialog.Builder(this.context!!, R.style.AlertDialogCustom)
.setTitle(getString(R.string.settings_reset)) .setTitle(getString(R.string.settings_reset))
.setMessage(getString(R.string.settings_reset_message)) .setMessage(getString(R.string.settings_reset_message))
.setPositiveButton(android.R.string.yes, .setPositiveButton(android.R.string.yes,
DialogInterface.OnClickListener { _, _ -> DialogInterface.OnClickListener { _, _ ->
resetSettings(this.context!!.getSharedPreferences(getString(R.string.preference_file_key), resetSettings(
Context.MODE_PRIVATE), this.context!!) this.context!!.getSharedPreferences(
getString(R.string.preference_file_key),
Context.MODE_PRIVATE
), this.context!!
)
activity!!.finish() activity!!.finish()
}) })
.setNegativeButton(android.R.string.no, null) .setNegativeButton(android.R.string.no, null)
@ -99,12 +120,15 @@ class SettingsFragmentMeta : Fragment() {
} }
// Footer onClicks // Footer onClicks
fragment_settings_meta_footer_github_icon.setOnClickListener { settings_meta_icon_github.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
openNewTabWindow(getString(R.string.settings_footer_repo), this.context!!) openNewTabWindow(
getString(R.string.settings_footer_repo),
this.context!!
)
} }
// rate app // rate app
fragment_settings_meta_footer_play_icon.setOnClickListener { settings_meta_icon_google_play.setOnClickListener {
try { try {
val rateIntent = rateIntentForUrl("market://details") val rateIntent = rateIntentForUrl("market://details")
intendedSettingsPause = true intendedSettingsPause = true
@ -116,21 +140,30 @@ class SettingsFragmentMeta : Fragment() {
} }
} }
fragment_settings_meta_footer_globe_icon.setOnClickListener { settings_meta_icon_globe.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
openNewTabWindow(getString(R.string.settings_footer_web), this.context!!) openNewTabWindow(
getString(R.string.settings_footer_web),
this.context!!
)
} }
// contact developer // contact developer
fragment_settings_meta_contact_btn.setOnClickListener { settings_meta_button_contact.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
openNewTabWindow(getString(R.string.settings_meta_contact_url), context!!) openNewTabWindow(
getString(R.string.settings_meta_contact_url),
context!!
)
} }
// donate // donate
fragment_settings_meta_donate_btn.setOnClickListener { settings_meta_button_donate.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
openNewTabWindow(getString(R.string.settings_meta_donate_url), context!!) openNewTabWindow(
getString(R.string.settings_meta_donate_url),
context!!
)
} }
super.onStart() super.onStart()

View file

@ -16,10 +16,9 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.palette.graphics.Palette import androidx.palette.graphics.Palette
import com.finnmglas.launcher.R import com.finnmglas.launcher.*
import com.finnmglas.launcher.extern.*
import com.finnmglas.launcher.settings.intendedSettingsPause import com.finnmglas.launcher.settings.intendedSettingsPause
import kotlinx.android.synthetic.main.fragment_settings_theme.* import kotlinx.android.synthetic.main.settings_theme.*
/** The 'Theme' Tab associated Fragment in Settings */ /** The 'Theme' Tab associated Fragment in Settings */
@ -31,36 +30,48 @@ class SettingsFragmentTheme : Fragment() {
inflater: LayoutInflater, container: ViewGroup?, inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View? {
return inflater.inflate(R.layout.fragment_settings_theme, container, false) return inflater.inflate(R.layout.settings_theme, container, false)
} }
override fun onStart(){ override fun onStart(){
// Hide 'select' button for the selected theme or allow customisation // Hide 'select' button for the selected theme or allow customisation
when (getSavedTheme(context!!)) { when (getSavedTheme(context!!)) {
"dark" -> fragment_settings_theme_select_dark_btn.visibility = View.INVISIBLE "dark" -> settings_theme_dark_button_select.visibility = View.INVISIBLE
"finn" -> fragment_settings_theme_select_finn_btn.visibility = View.INVISIBLE "finn" -> settings_theme_finn_button_select.visibility = View.INVISIBLE
"custom" -> { "custom" -> {
fragment_settings_theme_select_custom_btn.text = getString(R.string.settings_select_image) settings_theme_custom_button_select.text = getString(R.string.settings_select_image)
fragment_settings_theme_container.setBackgroundColor(dominantColor) settings_theme_container.setBackgroundColor(dominantColor)
setButtonColor(fragment_settings_theme_select_finn_btn, vibrantColor) setButtonColor(
setButtonColor(fragment_settings_theme_select_dark_btn, vibrantColor) settings_theme_finn_button_select,
setButtonColor(fragment_settings_theme_select_custom_btn, vibrantColor) vibrantColor
setButtonColor(fragment_settings_theme_custom_examples_btn, vibrantColor) )
setButtonColor(
settings_theme_dark_button_select,
vibrantColor
)
setButtonColor(
settings_theme_custom_button_select,
vibrantColor
)
setButtonColor(
settings_theme_custom_button_examples,
vibrantColor
)
} }
} }
// Theme changing buttons // Theme changing buttons
fragment_settings_theme_select_dark_btn.setOnClickListener { settings_theme_dark_button_select.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
saveTheme(context!!, "dark") saveTheme(context!!, "dark")
activity!!.recreate() activity!!.recreate()
} }
fragment_settings_theme_select_finn_btn.setOnClickListener { settings_theme_finn_button_select.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
saveTheme(context!!, "finn") saveTheme(context!!, "finn")
activity!!.recreate() activity!!.recreate()
} }
fragment_settings_theme_select_custom_btn.setOnClickListener { settings_theme_custom_button_select.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
// Request permission (on newer APIs) // Request permission (on newer APIs)
if (Build.VERSION.SDK_INT >= 23) { if (Build.VERSION.SDK_INT >= 23) {
@ -71,15 +82,20 @@ class SettingsFragmentTheme : Fragment() {
shouldShowRequestPermissionRationale(Manifest.permission.WRITE_EXTERNAL_STORAGE) shouldShowRequestPermissionRationale(Manifest.permission.WRITE_EXTERNAL_STORAGE)
-> {} -> {}
else else
-> requestPermissions(arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), REQUEST_PERMISSION_STORAGE) -> requestPermissions(arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),
REQUEST_PERMISSION_STORAGE
)
} }
} }
else letUserPickImage() else letUserPickImage()
} }
fragment_settings_theme_custom_examples_btn.setOnClickListener { settings_theme_custom_button_examples.setOnClickListener {
intendedSettingsPause = true intendedSettingsPause = true
// Show example usage // Show example usage
openNewTabWindow("https://github.com/finnmglas/Launcher/blob/master/docs/README.md", context!!) openNewTabWindow(
"https://github.com/finnmglas/Launcher/blob/master/docs/README.md",
context!!
)
} }
super.onStart() super.onStart()
@ -128,16 +144,28 @@ class SettingsFragmentTheme : Fragment() {
// never let dominantColor equal vibrantColor // never let dominantColor equal vibrantColor
if(dominantColor == vibrantColor) { if(dominantColor == vibrantColor) {
vibrantColor = manipulateColor(vibrantColor, 1.2F) vibrantColor =
dominantColor = manipulateColor(dominantColor, 0.8F) manipulateColor(
vibrantColor,
1.2F
)
dominantColor =
manipulateColor(
dominantColor,
0.8F
)
} }
/* Save image Uri as string */ /* Save image Uri as string */
val editor: SharedPreferences.Editor = context!!.getSharedPreferences( val editor: SharedPreferences.Editor = context!!.getSharedPreferences(
context!!.getString(R.string.preference_file_key), Context.MODE_PRIVATE).edit() context!!.getString(R.string.preference_file_key), Context.MODE_PRIVATE).edit()
editor.putString("background_uri", imageUri.toString()) editor.putString("background_uri", imageUri.toString())
editor.putInt("custom_dominant", dominantColor) editor.putInt("custom_dominant",
editor.putInt("custom_vibrant", vibrantColor) dominantColor
)
editor.putInt("custom_vibrant",
vibrantColor
)
editor.apply() editor.apply()
saveTheme(context!!, "custom") saveTheme(context!!, "custom")

View file

@ -6,9 +6,8 @@ import android.os.Bundle
import android.util.TypedValue import android.util.TypedValue
import android.view.* import android.view.*
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.finnmglas.launcher.R import com.finnmglas.launcher.*
import com.finnmglas.launcher.extern.* import kotlinx.android.synthetic.main.tutorial.*
import kotlinx.android.synthetic.main.activity_tutorial.*
class TutorialActivity : AppCompatActivity(){ class TutorialActivity : AppCompatActivity(){
@ -38,15 +37,15 @@ class TutorialActivity : AppCompatActivity(){
else -> R.style.finnmglasTheme else -> R.style.finnmglasTheme
} }
) )
setContentView(R.layout.activity_tutorial) setContentView(R.layout.tutorial)
if (getSavedTheme(this) == "custom") { if (getSavedTheme(this) == "custom") {
activity_firststartup_app_bar.setBackgroundColor(dominantColor) tutorial_appbar.setBackgroundColor(dominantColor)
activity_firststartup_container.setBackgroundColor(dominantColor) tutorial_container.setBackgroundColor(dominantColor)
activity_firststartup_close.setTextColor(vibrantColor) tutorial_close.setTextColor(vibrantColor)
} }
activity_firststartup_hint_text.blink() // animate tutorial_page_hint.blink() // animate
loadMenu(this) loadMenu(this)
val sharedPref = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE) val sharedPref = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE)
@ -54,12 +53,15 @@ class TutorialActivity : AppCompatActivity(){
isFirstTime = !sharedPref.getBoolean("startedBefore", false) isFirstTime = !sharedPref.getBoolean("startedBefore", false)
if (isFirstTime) if (isFirstTime)
defaultApps = resetSettings(sharedPref, this) // UP, DOWN, RIGHT, LEFT, VOLUME_UP, VOLUME_DOWN defaultApps = resetSettings(
sharedPref,
this
) // UP, DOWN, RIGHT, LEFT, VOLUME_UP, VOLUME_DOWN
else else
activity_firststartup_app_bar.visibility = View.VISIBLE tutorial_appbar.visibility = View.VISIBLE
// As older APIs somehow do not recognize the xml defined onClick // As older APIs somehow do not recognize the xml defined onClick
activity_firststartup_close.setOnClickListener() { finish() } tutorial_close.setOnClickListener() { finish() }
} }
/** Touch- and Key-related functions to navigate */ /** Touch- and Key-related functions to navigate */
@ -98,16 +100,16 @@ class TutorialActivity : AppCompatActivity(){
if (menuNumber < intro.size){ if (menuNumber < intro.size){
val entry = intro[menuNumber].split("|").toTypedArray() //heading|infoText|hintText|size val entry = intro[menuNumber].split("|").toTypedArray() //heading|infoText|hintText|size
activity_firststartup_section_heading.text = entry[0] tutorial_page_heading.text = entry[0]
if (entry[4] == "1" && isFirstTime) if (entry[4] == "1" && isFirstTime)
activity_firststartup_descriptive_text.text = String.format(entry[1], tutorial_page_text.text = String.format(entry[1],
defaultApps[0], defaultApps[1], defaultApps[2], defaultApps[3], defaultApps[4], defaultApps[5]) defaultApps[0], defaultApps[1], defaultApps[2], defaultApps[3], defaultApps[4], defaultApps[5])
else if (entry[4] == "1" && !isFirstTime) else if (entry[4] == "1" && !isFirstTime)
activity_firststartup_descriptive_text.text = String.format(entry[1], tutorial_page_text.text = String.format(entry[1],
"-", "-", "-", "-", "-", "-") "-", "-", "-", "-", "-", "-")
else activity_firststartup_descriptive_text.text = entry[1] else tutorial_page_text.text = entry[1]
activity_firststartup_hint_text.text = entry[2] tutorial_page_hint.text = entry[2]
activity_firststartup_descriptive_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, entry[3].toFloat()) tutorial_page_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, entry[3].toFloat())
} else { // End intro } else { // End intro
if (isFirstTime){ if (isFirstTime){

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/fragment_choose_apps_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
android:gravity="center|top"
android:orientation="vertical"
tools:context=".choose.apps.ChooseFragmentApps">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/fragment_choose_apps_recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/fragment_choose_other_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
android:gravity="center|top"
android:orientation="vertical"
tools:context=".choose.other.ChooseFragmentOther">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/fragment_choose_other_recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View file

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/fragment_settings_apps_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorPrimary"
android:gravity="center|top"
android:orientation="vertical"
android:paddingLeft="32sp"
android:paddingTop="16sp"
android:paddingRight="32sp"
tools:context=".settings.actions.SettingsFragmentApps">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/activity_settings_actions_recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toTopOf="@+id/settings_app_btn_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:id="@+id/settings_app_btn_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<Button
android:id="@+id/fragment_settings_apps_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_apps"
android:textAllCaps="false" />
<Button
android:id="@+id/fragment_settings_apps_install_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_install"
android:textAllCaps="false" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View file

@ -1,17 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto" xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main_container" android:id="@+id/home_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:longClickable="false" android:longClickable="false"
tools:context=".MainActivity"> tools:context=".HomeActivity">
<ImageView <ImageView
android:id="@+id/activity_main_background_image" android:id="@+id/home_background_image"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:adjustViewBounds="true" android:adjustViewBounds="true"
@ -20,7 +21,7 @@
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<TextView <TextView
android:id="@+id/activity_main_date_view" android:id="@+id/home_date_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
@ -33,7 +34,7 @@
app:layout_constraintVertical_bias="0.45" /> app:layout_constraintVertical_bias="0.45" />
<TextView <TextView
android:id="@+id/activity_main_time_view" android:id="@+id/home_time_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
@ -45,8 +46,8 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/activity_main_settings_icon" android:id="@+id/home_settings_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="settingsIconOnTouch" android:onClick="settingsIconOnTouch"

View file

@ -1,16 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto" xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_choose_container" android:id="@+id/list_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
tools:context=".choose.ChooseActivity"> tools:context=".list.ListActivity">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/activity_choose_app_bar" android:id="@+id/list_appbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
@ -23,7 +24,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <TextView
android:id="@+id/activity_choose_heading" android:id="@+id/list_heading"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
@ -36,8 +37,8 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/activity_choose_close" android:id="@+id/list_close"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
@ -57,7 +58,7 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/activity_choose_tabs" android:id="@+id/list_tabs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
custom:tabTextColor="?attr/android:textColor" /> custom:tabTextColor="?attr/android:textColor" />
@ -65,13 +66,13 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/activity_choose_view_pager" android:id="@+id/list_viewpager"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/activity_choose_app_bar" app:layout_constraintTop_toBottomOf="@id/list_appbar"
custom:layout_behavior="@string/appbar_scrolling_view_behavior" /> custom:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,23 @@
<?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"
android:id="@+id/list_apps_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_apps_rview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/list_apps_row_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="15sp"> android:layout_margin="15sp">
<ImageView <ImageView
android:id="@+id/choose_row_app_icon" android:id="@+id/list_apps_row_icon"
android:layout_width="40sp" android:layout_width="40sp"
android:layout_height="40sp" android:layout_height="40sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
@ -16,7 +18,7 @@
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<TextView <TextView
android:id="@+id/choose_row_app_name" android:id="@+id/list_apps_row_name"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="60sp" android:layout_marginStart="60sp"
@ -27,12 +29,12 @@
android:text="" android:text=""
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/choose_row_app_menu" app:layout_constraintEnd_toStartOf="@+id/list_apps_row_menu"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/choose_row_app_menu" android:id="@+id/list_apps_row_menu"
android:layout_width="30sp" android:layout_width="30sp"
android:layout_height="0dp" android:layout_height="0dp"
android:gravity="center" android:gravity="center"

View file

@ -0,0 +1,23 @@
<?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"
android:id="@+id/list_other_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_other_rview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/list_other_row_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="15sp"> android:layout_margin="15sp">
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/row_other_fa_icon" android:id="@+id/list_other_row_icon"
android:layout_width="40sp" android:layout_width="40sp"
android:layout_height="40sp" android:layout_height="40sp"
android:gravity="center" android:gravity="center"
@ -18,7 +19,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/row_other_name" android:id="@+id/list_other_row_name"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="60sp" android:layout_marginStart="60sp"

View file

@ -4,13 +4,13 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto" xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_settings_container" android:id="@+id/settings_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".settings.SettingsActivity"> tools:context=".settings.SettingsActivity">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/activity_settings_app_bar" android:id="@+id/settings_appbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -19,7 +19,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <TextView
android:id="@+id/activity_settings_heading" android:id="@+id/settings_heading"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
@ -33,8 +33,8 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/activity_settings_close" android:id="@+id/settings_close"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
@ -52,8 +52,8 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
custom:type="solid" /> custom:type="solid" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/activity_settings_device_settings" android:id="@+id/settings_system"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
@ -67,11 +67,12 @@
custom:layout_constraintBottom_toBottomOf="parent" custom:layout_constraintBottom_toBottomOf="parent"
custom:layout_constraintStart_toStartOf="parent" custom:layout_constraintStart_toStartOf="parent"
custom:layout_constraintTop_toTopOf="parent" custom:layout_constraintTop_toTopOf="parent"
custom:type="solid" /> custom:type="solid"
android:layout_marginStart="8dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/activity_settings_tabs" android:id="@+id/settings_tabs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:tabTextColor="?attr/android:textColor" /> app:tabTextColor="?attr/android:textColor" />
@ -79,7 +80,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/activity_settings_view_pager" android:id="@+id/settings_viewpager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />

View file

@ -0,0 +1,49 @@
<?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"
android:id="@+id/settings_actions_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="32sp"
android:paddingTop="16sp"
android:paddingRight="32sp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/settings_actions_rview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toTopOf="@+id/settings_actions_buttons"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:id="@+id/settings_actions_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<Button
android:id="@+id/settings_actions_button_view_apps"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_apps"
android:textAllCaps="false" />
<Button
android:id="@+id/settings_actions_button_install_apps"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_install"
android:textAllCaps="false" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/settings_actions_row_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/row_action_name" android:id="@+id/settings_actions_row_name"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
@ -15,12 +17,12 @@
android:text="" android:text=""
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/row_choose_button" app:layout_constraintEnd_toStartOf="@id/settings_actions_row_button_choose"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button <Button
android:id="@+id/row_choose_button" android:id="@+id/settings_actions_row_button_choose"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_choose_btn" android:text="@string/settings_choose_btn"
@ -30,38 +32,38 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/row_app_fa_icon" android:id="@+id/settings_actions_row_icon"
android:layout_width="@dimen/app_icon_side" android:layout_width="@dimen/app_icon_side"
android:layout_height="@dimen/app_icon_side" android:layout_height="@dimen/app_icon_side"
android:gravity="center" android:gravity="center"
android:textSize="30sp" android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/row_choose_button" app:layout_constraintEnd_toEndOf="@id/settings_actions_row_button_choose"
app:layout_constraintHorizontal_bias="0.2" app:layout_constraintHorizontal_bias="0.2"
app:layout_constraintStart_toStartOf="@+id/row_choose_button" app:layout_constraintStart_toStartOf="@+id/settings_actions_row_button_choose"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/row_app_icon" android:id="@+id/settings_actions_row_icon_img"
android:layout_width="@dimen/app_icon_side" android:layout_width="@dimen/app_icon_side"
android:layout_height="@dimen/app_icon_side" android:layout_height="@dimen/app_icon_side"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/row_choose_button" app:layout_constraintEnd_toEndOf="@id/settings_actions_row_button_choose"
app:layout_constraintHorizontal_bias="0.2" app:layout_constraintHorizontal_bias="0.2"
app:layout_constraintStart_toStartOf="@+id/row_choose_button" app:layout_constraintStart_toStartOf="@+id/settings_actions_row_button_choose"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/row_remove_action" android:id="@+id/settings_actions_row_remove"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="8sp" android:padding="8sp"
android:text="@string/fas_times" android:text="@string/fas_times"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/row_app_icon" app:layout_constraintStart_toEndOf="@+id/settings_actions_row_icon_img"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto" xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_settings_meta_container" android:id="@+id/settings_meta_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
@ -15,21 +15,21 @@
tools:context=".settings.meta.SettingsFragmentMeta"> tools:context=".settings.meta.SettingsFragmentMeta">
<Button <Button
android:id="@+id/fragment_settings_meta_select_launcher_btn" android:id="@+id/settings_meta_button_select_launcher"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_select_launcher" android:text="@string/settings_select_launcher"
android:textAllCaps="false" /> android:textAllCaps="false" />
<Button <Button
android:id="@+id/fragment_settings_meta_view_tutorial_btn" android:id="@+id/settings_meta_button_view_tutorial"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_show_tutorial" android:text="@string/settings_show_tutorial"
android:textAllCaps="false" /> android:textAllCaps="false" />
<Button <Button
android:id="@+id/fragment_settings_meta_reset_settings_btn" android:id="@+id/settings_meta_button_reset_settings"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="32sp" android:layout_marginBottom="32sp"
@ -37,6 +37,7 @@
android:textAllCaps="false" /> android:textAllCaps="false" />
<LinearLayout <LinearLayout
android:id="@+id/settings_meta_layout_icons"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="32sp" android:layout_marginTop="32sp"
@ -44,8 +45,8 @@
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/fragment_settings_meta_footer_play_icon" android:id="@+id/settings_meta_icon_google_play"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
@ -60,8 +61,8 @@
android:textSize="40sp" android:textSize="40sp"
custom:type="brands" /> custom:type="brands" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/fragment_settings_meta_footer_github_icon" android:id="@+id/settings_meta_icon_github"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
@ -76,8 +77,8 @@
android:textSize="40sp" android:textSize="40sp"
custom:type="brands" /> custom:type="brands" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/fragment_settings_meta_footer_globe_icon" android:id="@+id/settings_meta_icon_globe"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
@ -95,7 +96,7 @@
</LinearLayout> </LinearLayout>
<Button <Button
android:id="@+id/fragment_settings_meta_contact_btn" android:id="@+id/settings_meta_button_contact"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="32sp" android:layout_marginTop="32sp"
@ -103,7 +104,7 @@
android:textAllCaps="false" /> android:textAllCaps="false" />
<Button <Button
android:id="@+id/fragment_settings_meta_donate_btn" android:id="@+id/settings_meta_button_donate"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_meta_donate" android:text="@string/settings_meta_donate"

View file

@ -2,9 +2,8 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_settings_theme_container" android:id="@+id/settings_theme_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
@ -16,6 +15,7 @@
tools:context=".settings.meta.SettingsFragmentMeta"> tools:context=".settings.meta.SettingsFragmentMeta">
<ScrollView <ScrollView
android:id="@+id/settings_theme_scroller"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -25,6 +25,7 @@
android:orientation="vertical"> android:orientation="vertical">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/settings_theme_finn"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10sp" android:layout_marginBottom="10sp"
@ -35,6 +36,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/settings_theme_finn_img"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:adjustViewBounds="true" android:adjustViewBounds="true"
@ -43,7 +45,7 @@
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<Button <Button
android:id="@+id/fragment_settings_theme_select_finn_btn" android:id="@+id/settings_theme_finn_button_select"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_select_theme" android:text="@string/settings_select_theme"
@ -56,6 +58,7 @@
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/settings_theme_dark"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10sp" android:layout_marginBottom="10sp"
@ -66,6 +69,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/settings_theme_dark_img"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:adjustViewBounds="true" android:adjustViewBounds="true"
@ -74,7 +78,7 @@
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<Button <Button
android:id="@+id/fragment_settings_theme_select_dark_btn" android:id="@+id/settings_theme_dark_button_select"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_select_theme" android:text="@string/settings_select_theme"
@ -86,6 +90,7 @@
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/settings_theme_custom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10sp" android:layout_marginBottom="10sp"
@ -96,7 +101,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/imageView" android:id="@+id/settings_theme_custom_img"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:adjustViewBounds="true" android:adjustViewBounds="true"
@ -105,7 +110,7 @@
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<Button <Button
android:id="@+id/fragment_settings_theme_select_custom_btn" android:id="@+id/settings_theme_custom_button_select"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_select_theme" android:text="@string/settings_select_theme"
@ -114,13 +119,13 @@
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintEnd_toEndOf="parent" />
<Button <Button
android:id="@+id/fragment_settings_theme_custom_examples_btn" android:id="@+id/settings_theme_custom_button_examples"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_theme_examples" android:text="@string/settings_theme_examples"
android:textAllCaps="false" android:textAllCaps="false"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/fragment_settings_theme_select_custom_btn" /> app:layout_constraintEnd_toStartOf="@id/settings_theme_custom_button_select" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto" xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_firststartup_container" android:id="@+id/tutorial_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
@ -11,7 +12,7 @@
tools:context=".tutorial.TutorialActivity"> tools:context=".tutorial.TutorialActivity">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/activity_firststartup_app_bar" android:id="@+id/tutorial_appbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
@ -25,7 +26,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<TextView <TextView
android:id="@+id/activity_firststartup_heading" android:id="@+id/tutorial_heading"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
@ -37,8 +38,8 @@
custom:layout_constraintStart_toStartOf="parent" custom:layout_constraintStart_toStartOf="parent"
custom:layout_constraintTop_toTopOf="parent" /> custom:layout_constraintTop_toTopOf="parent" />
<com.finnmglas.launcher.extern.FontAwesome <com.finnmglas.launcher.libraries.FontAwesome
android:id="@+id/activity_firststartup_close" android:id="@+id/tutorial_close"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
@ -60,7 +61,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<TextView <TextView
android:id="@+id/activity_firststartup_section_heading" android:id="@+id/tutorial_page_heading"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
@ -73,7 +74,7 @@
app:layout_constraintVertical_bias="0.100000024" /> app:layout_constraintVertical_bias="0.100000024" />
<TextView <TextView
android:id="@+id/activity_firststartup_descriptive_text" android:id="@+id/tutorial_page_text"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginStart="32dp" android:layout_marginStart="32dp"
@ -89,10 +90,10 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.6" app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/activity_firststartup_section_heading" /> app:layout_constraintTop_toBottomOf="@id/tutorial_page_heading" />
<TextView <TextView
android:id="@+id/activity_firststartup_hint_text" android:id="@+id/tutorial_page_hint"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginStart="32dp" android:layout_marginStart="32dp"
@ -109,6 +110,6 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.6" app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/activity_firststartup_descriptive_text" /> app:layout_constraintTop_toBottomOf="@id/tutorial_page_text" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>