Add icons to settings

+ To open Google Play, Github or my website
+ In the header, add settings icon to open device settings
This commit is contained in:
Finn M Glas 2020-05-24 20:24:44 +02:00
parent 6c5df6189e
commit 9681c7021f
No known key found for this signature in database
GPG key ID: 25037A2E81AB459C
9 changed files with 86 additions and 49 deletions

View file

@ -51,6 +51,9 @@ class SettingsActivity : AppCompatActivity() {
// 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() } activity_settings_close.setOnClickListener() { finish() }
activity_settings_device_settings.setOnClickListener {
startActivityForResult(Intent(android.provider.Settings.ACTION_SETTINGS), 0)
}
} }
fun backHome(view: View) { finish() } fun backHome(view: View) { finish() }

View file

@ -82,8 +82,12 @@ class SettingsFragmentMeta : Fragment() {
.show() .show()
} }
// Footer onClicks
fragment_settings_meta_footer_github_icon.setOnClickListener {
openNewTabWindow(getString(R.string.settings_footer_repo), this.context!!)
}
// rate app // rate app
fragment_settings_meta_rate_app_btn.setOnClickListener { fragment_settings_meta_footer_play_icon.setOnClickListener {
try { try {
val rateIntent = rateIntentForUrl("market://details") val rateIntent = rateIntentForUrl("market://details")
startActivity(rateIntent) startActivity(rateIntent)
@ -93,11 +97,10 @@ class SettingsFragmentMeta : Fragment() {
} }
} }
// Footer onClicks /*fragment_settings_meta_footer_website_icon.setOnClickListener {
fragment_settings_meta_footer_github_link.setOnClickListener { openNewTabWindow(getString(R.string.settings_footer_web), this.context!!)
openNewTabWindow(getString(R.string.settings_footer_repo), this.context!!) }*/
} fragment_settings_meta_footer_globe_icon.setOnClickListener {
fragment_settings_meta_footer_website_link.setOnClickListener {
openNewTabWindow(getString(R.string.settings_footer_web), this.context!!) openNewTabWindow(getString(R.string.settings_footer_web), this.context!!)
} }

View file

@ -37,7 +37,7 @@
android:id="@+id/activity_settings_close" android:id="@+id/activity_settings_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_marginLeft="8dp"
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:gravity="center" android:gravity="center"
android:includeFontPadding="true" android:includeFontPadding="true"
@ -51,6 +51,23 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
custom:type="solid" /> custom:type="solid" />
<com.finnmglas.launcher.extern.FontAwesome
android:id="@+id/activity_settings_device_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:gravity="center"
android:includeFontPadding="true"
android:paddingLeft="16sp"
android:paddingRight="16sp"
android:text="@string/fas_settings"
android:textColor="?attr/colorAccent"
android:textSize="22sp"
custom:layout_constraintBottom_toBottomOf="parent"
custom:layout_constraintStart_toStartOf="parent"
custom:layout_constraintTop_toTopOf="parent"
custom:type="solid" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-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:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_settings_apps_container" android:id="@+id/fragment_settings_apps_container"
@ -9,8 +8,8 @@
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:gravity="center|top" android:gravity="center|top"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="16sp"
android:paddingLeft="32sp" android:paddingLeft="32sp"
android:paddingTop="16sp"
android:paddingRight="32sp" android:paddingRight="32sp"
tools:context=".settings.SettingsFragmentApps"> tools:context=".settings.SettingsFragmentApps">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-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_meta_container" android:id="@+id/fragment_settings_meta_container"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -9,8 +9,8 @@
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:gravity="center|top" android:gravity="center|top"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="16sp"
android:paddingLeft="32sp" android:paddingLeft="32sp"
android:paddingTop="16sp"
android:paddingRight="32sp" android:paddingRight="32sp"
tools:context=".settings.SettingsFragmentMeta"> tools:context=".settings.SettingsFragmentMeta">
@ -36,50 +36,61 @@
android:text="@string/settings_reset" android:text="@string/settings_reset"
android:textAllCaps="false" /> android:textAllCaps="false" />
<Button
android:id="@+id/fragment_settings_meta_rate_app_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_feedback"
android:textAllCaps="false" />
<LinearLayout <LinearLayout
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"
android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <com.finnmglas.launcher.extern.FontAwesome
android:id="@+id/fragment_settings_meta_footer_by_text" android:id="@+id/fragment_settings_meta_footer_play_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/settings_footer_by" android:layout_marginEnd="8dp"
android:textSize="18sp" /> android:layout_marginRight="8dp"
android:layout_weight="1"
<TextView android:gravity="center"
android:id="@+id/fragment_settings_meta_footer_website_link" android:includeFontPadding="true"
android:layout_width="wrap_content" android:paddingLeft="16sp"
android:layout_height="wrap_content" android:paddingRight="16sp"
android:text=" Finn M Glas" android:text="@string/fab_google_play"
android:textColor="?attr/colorAccent" android:textColor="?attr/colorAccent"
android:textSize="18sp" android:textSize="40sp"
tools:ignore="HardcodedText" /> custom:type="brands" />
<TextView <com.finnmglas.launcher.extern.FontAwesome
android:id="@+id/fragment_settings_meta_footer_pipe_text" android:id="@+id/fragment_settings_meta_footer_github_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text=" | " android:layout_marginEnd="8dp"
android:textSize="18sp" android:layout_marginRight="8dp"
tools:ignore="HardcodedText" /> android:layout_weight="1"
android:gravity="center"
<TextView android:includeFontPadding="true"
android:id="@+id/fragment_settings_meta_footer_github_link" android:paddingLeft="16sp"
android:layout_width="wrap_content" android:paddingRight="16sp"
android:layout_height="wrap_content" android:text="@string/fab_github"
android:text="Open Source"
android:textColor="?attr/colorAccent" android:textColor="?attr/colorAccent"
android:textSize="18sp" android:textSize="40sp"
tools:ignore="HardcodedText" /> custom:type="brands" />
<com.finnmglas.launcher.extern.FontAwesome
android:id="@+id/fragment_settings_meta_footer_globe_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:gravity="center"
android:includeFontPadding="true"
android:paddingLeft="16sp"
android:paddingRight="16sp"
android:text="@string/fas_globe"
android:textColor="?attr/colorAccent"
android:textSize="40sp"
custom:type="solid" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View file

@ -13,7 +13,7 @@
<string name="settings_title">Einstellungen</string> <string name="settings_title">Einstellungen</string>
<string name="settings_show_tutorial">Zum Launcher Tutorial</string> <string name="settings_show_tutorial">Zum Launcher Tutorial</string>
<string name="settings_feedback">Feedback geben</string> <string name="settings_rate_google_play">Jetzt im Playstore bewerten</string>
<string name="settings_choose_up">Hochwischen</string> <string name="settings_choose_up">Hochwischen</string>
<string name="settings_choose_down">Runterwischen</string> <string name="settings_choose_down">Runterwischen</string>

View file

@ -12,7 +12,7 @@
<!-- Settings --> <!-- Settings -->
<string name="settings_title">Réglages</string> <string name="settings_title">Réglages</string>
<string name="settings_feedback">Donner une rétroaction</string> <string name="settings_rate_google_play">Donner une rétroaction</string>
<string name="settings_show_tutorial">Regardez le tutoriel</string> <string name="settings_show_tutorial">Regardez le tutoriel</string>
<string name="settings_choose_up">Balayez haut</string> <string name="settings_choose_up">Balayez haut</string>
@ -43,7 +43,7 @@
<!-- Choose Activity --> <!-- Choose Activity -->
<string name="choose_title">Choisir App</string> <string name="choose_title">Choisir App</string>
<string name="choose_title_launch">Lancer Apps</string> <string name="choose_title_launch">Lancer Apps</string>
<string name="choose_title_remove">Désinstaller Apps</string> <string name="choose_title_remove">Désinstaller</string>
<string name="choose_back_settings">Retourner</string> <string name="choose_back_settings">Retourner</string>

View file

@ -8,10 +8,14 @@
<string name="fas_ad" translatable="false">&#xf641;</string> <string name="fas_ad" translatable="false">&#xf641;</string>
<string name="fas_backspace" translatable="false">&#xf55a;</string> <string name="fas_backspace" translatable="false">&#xf55a;</string>
<string name="fas_calendar" translatable="false">&#xf133;</string> <string name="fas_calendar" translatable="false">&#xf133;</string>
<string name="fas_donate" translatable="false">&#xf4b9;</string>
<string name="fas_share" translatable="false">&#xf064;</string>
<!-- icons that can be used with type="brands" --> <!-- icons that can be used with type="brands" -->
<string name="fab_apple" translatable="false">&#xf179;</string> <string name="fab_apple" translatable="false">&#xf179;</string>
<string name="fab_instagram" translatable="false">&#xf16d;</string> <string name="fab_instagram" translatable="false">&#xf16d;</string>
<string name="fab_github" translatable="false">&#xf09b;</string>
<string name="fab_google_play" translatable="false">&#xf3ab;</string>
<!-- icons that can be used with type="solid" and type="regular" --> <!-- icons that can be used with type="solid" and type="regular" -->
<string name="fa_close_window" translatable="false">&#xf410;</string> <string name="fa_close_window" translatable="false">&#xf410;</string>

View file

@ -20,7 +20,7 @@
<string name="settings_tab_theme" translatable="false">Themes</string> <string name="settings_tab_theme" translatable="false">Themes</string>
<string name="settings_tab_launcher" translatable="false">Meta</string> <string name="settings_tab_launcher" translatable="false">Meta</string>
<string name="settings_feedback">Give some feedback</string> <string name="settings_rate_google_play">Rate us on Google Play</string>
<string name="settings_show_tutorial">View Launcher Tutorial</string> <string name="settings_show_tutorial">View Launcher Tutorial</string>
<string name="settings_choose_up">Swipe Up</string> <string name="settings_choose_up">Swipe Up</string>