mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 14:31:30 +01:00
Removed button "all apps" from settings. Hide button "install apps" on small screens. (see #36)
This commit is contained in:
parent
d547c89763
commit
b0e4a0347a
2 changed files with 14 additions and 13 deletions
|
@ -32,6 +32,8 @@ SettingsFragmentActions : Fragment(), UIObject {
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
): View {
|
): View {
|
||||||
binding = SettingsActionsBinding.inflate(inflater, container, false)
|
binding = SettingsActionsBinding.inflate(inflater, container, false)
|
||||||
|
|
||||||
|
|
||||||
return binding!!.root
|
return binding!!.root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,16 +41,22 @@ SettingsFragmentActions : Fragment(), UIObject {
|
||||||
super<Fragment>.onStart()
|
super<Fragment>.onStart()
|
||||||
super<UIObject>.onStart()
|
super<UIObject>.onStart()
|
||||||
|
|
||||||
|
binding?.root?.viewTreeObserver?.addOnGlobalLayoutListener {
|
||||||
|
val buttonHeight = binding?.settingsActionsButtons?.height!!
|
||||||
|
val height = binding?.root?.height!!
|
||||||
|
|
||||||
|
if (buttonHeight > 0.2 * height) {
|
||||||
|
binding?.settingsActionsButtons?.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
binding?.settingsActionsButtons?.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setOnClicks() {
|
override fun setOnClicks() {
|
||||||
|
|
||||||
// App management buttons
|
|
||||||
binding!!.settingsActionsButtonViewApps.setOnClickListener {
|
|
||||||
val intent = Intent(this.context, ListActivity::class.java)
|
|
||||||
intent.putExtra("intention", ListActivity.ListActivityIntention.VIEW.toString())
|
|
||||||
startActivity(intent)
|
|
||||||
}
|
|
||||||
binding!!.settingsActionsButtonInstallApps.setOnClickListener {
|
binding!!.settingsActionsButtonInstallApps.setOnClickListener {
|
||||||
try {
|
try {
|
||||||
val intent = Intent(Intent.ACTION_MAIN)
|
val intent = Intent(Intent.ACTION_MAIN)
|
||||||
|
|
|
@ -29,13 +29,6 @@
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="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_view_all"
|
|
||||||
android:textAllCaps="false" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/settings_actions_button_install_apps"
|
android:id="@+id/settings_actions_button_install_apps"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Add table
Reference in a new issue