diff options
| author | Tanuj M <thetanuj@hotmail.com> | 2020-10-22 23:57:08 +0530 |
|---|---|---|
| committer | Tanuj M <thetanuj@hotmail.com> | 2020-10-22 23:57:08 +0530 |
| commit | ca8308f95d83172778eb869f2a8d43c52bf0774a (patch) | |
| tree | aff44797fecdb0d09cf7a3a68c0d9958b01a80a4 | |
| parent | 31c9a6df87b2a684fe50fe25b10cce3f7fd8edec (diff) | |
| download | SidePhOnelauncher-ca8308f95d83172778eb869f2a8d43c52bf0774a.tar.gz SidePhOnelauncher-ca8308f95d83172778eb869f2a8d43c52bf0774a.tar.bz2 SidePhOnelauncher-ca8308f95d83172778eb869f2a8d43c52bf0774a.zip | |
Changes in settings links and hints
| -rw-r--r-- | app/src/main/java/app/olauncher/data/Constants.kt | 9 | ||||
| -rw-r--r-- | app/src/main/java/app/olauncher/ui/SettingsFragment.kt | 26 | ||||
| -rw-r--r-- | app/src/main/res/layout/fragment_settings.xml | 118 | ||||
| -rw-r--r-- | app/src/main/res/values/strings.xml | 7 |
4 files changed, 74 insertions, 86 deletions
diff --git a/app/src/main/java/app/olauncher/data/Constants.kt b/app/src/main/java/app/olauncher/data/Constants.kt index 8e0e2ac..9c2f32b 100644 --- a/app/src/main/java/app/olauncher/data/Constants.kt +++ b/app/src/main/java/app/olauncher/data/Constants.kt @@ -19,9 +19,10 @@ object Constants { const val REQUEST_CODE_ENABLE_ADMIN = 666 const val REQUEST_CODE_EDIT_SETTINGS = 777 - const val CODE_EMAIL_HINT = 10 - const val CODE_RATE_HINT = 20 - const val CODE_DONATE_HINT = 25 + const val HINT_ABOUT_US = 5 + const val HINT_EMAIL_US = 10 + const val HINT_RATE_US = 20 + const val HINT_DONATE = 25 const val TRIPLE_TAP_DELAY_MS = 400 const val LONG_PRESS_DELAY_MS = 600 @@ -29,8 +30,6 @@ object Constants { const val URL_ABOUT_OLAUNCHER = "https://www.notion.so/About-Olauncher-4843e398b05a455bb521b0665b26fbcd" const val URL_OLAUNCHER_PRIVACY = "https://www.notion.so/Olauncher-Privacy-Policy-dd6ac5101ddd4b3da9d27057889d44ab" const val URL_OLAUNCHER_PLAY_STORE = "https://play.google.com/store/apps/details?id=app.olauncher" - const val URL_TWITTER_TANUJNOTES = "https://twitter.com/tanujnotes/" - const val URL_GITHUB_TANUJNOTES = "https://github.com/tanujnotes/" const val WALLPAPER_WORKER_NAME = "WALLPAPER_WORKER_NAME" const val URL_DARK_WALLPAPERS = "https://gist.githubusercontent.com/tanujnotes/481074b27ad4dc2607326c97439bb3ac/raw" diff --git a/app/src/main/java/app/olauncher/ui/SettingsFragment.kt b/app/src/main/java/app/olauncher/ui/SettingsFragment.kt index ad10dcf..2517f62 100644 --- a/app/src/main/java/app/olauncher/ui/SettingsFragment.kt +++ b/app/src/main/java/app/olauncher/ui/SettingsFragment.kt @@ -105,8 +105,6 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe R.id.rate -> rateApp() R.id.email -> sendEmailIntent() R.id.privacy -> openUrl(Constants.URL_OLAUNCHER_PRIVACY) - R.id.twitter -> openUrl(Constants.URL_TWITTER_TANUJNOTES) - R.id.github -> openUrl(Constants.URL_GITHUB_TANUJNOTES) } } @@ -139,8 +137,6 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe rate.setOnClickListener(this) email.setOnClickListener(this) privacy.setOnClickListener(this) - twitter.setOnClickListener(this) - github.setOnClickListener(this) maxApps0.setOnClickListener(this) maxApps1.setOnClickListener(this) @@ -300,12 +296,10 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe "mailto:thetanuj1@gmail.com?" + "subject=Hello%20Team%20Olauncher!" ) - try { startActivity(emailIntent) } catch (e: Exception) { - showToastLong(requireContext(), "Sending email failed. Direct message instead.") - openUrl(Constants.URL_TWITTER_TANUJNOTES) + showToastLong(requireContext(), "Failed! Send email to thetanuj1@gmail.com") } } @@ -324,26 +318,28 @@ class SettingsFragment : Fragment(), View.OnClickListener, View.OnLongClickListe private fun populateActionHints() { when { - prefs.toShowHintCounter in Constants.CODE_EMAIL_HINT..Constants.CODE_EMAIL_HINT + 1 -> { + prefs.toShowHintCounter == Constants.HINT_ABOUT_US -> { + Toast.makeText(context, getString(R.string.about_hint), Toast.LENGTH_LONG).show() + about.setCompoundDrawablesWithIntrinsicBounds(0, android.R.drawable.arrow_down_float, 0, 0) + } + prefs.toShowHintCounter == Constants.HINT_EMAIL_US -> { Toast.makeText(context, getString(R.string.email_us_hint), Toast.LENGTH_LONG).show() - email.setCompoundDrawablesWithIntrinsicBounds(0, android.R.drawable.arrow_down_float, 0, 0); + email.setCompoundDrawablesWithIntrinsicBounds(0, android.R.drawable.arrow_down_float, 0, 0) } - prefs.toShowHintCounter in Constants.CODE_RATE_HINT..Constants.CODE_RATE_HINT + 1 -> { + prefs.toShowHintCounter in Constants.HINT_RATE_US..Constants.HINT_RATE_US + 1 -> { Toast.makeText(context, getString(R.string.rate_us_hint), Toast.LENGTH_LONG).show() - rate.setCompoundDrawablesWithIntrinsicBounds(0, android.R.drawable.arrow_down_float, 0, 0); + rate.setCompoundDrawablesWithIntrinsicBounds(0, android.R.drawable.arrow_down_float, 0, 0) } - prefs.toShowHintCounter % Constants.CODE_DONATE_HINT == 0 -> { + prefs.toShowHintCounter % Constants.HINT_DONATE == 0 -> { Toast.makeText(context, getString(R.string.donate_hint), Toast.LENGTH_LONG).show() - about.setCompoundDrawablesWithIntrinsicBounds(0, android.R.drawable.arrow_down_float, 0, 0); + about.setCompoundDrawablesWithIntrinsicBounds(0, android.R.drawable.arrow_down_float, 0, 0) } } } private fun openEditSettingsPermission() { - // if (!Settings.System.canWrite(this)) { val intent = Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS) intent.data = Uri.parse("package:" + BuildConfig.APPLICATION_ID) activity?.startActivityForResult(intent, Constants.REQUEST_CODE_EDIT_SETTINGS) -// } } }
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 47e707c..3da30fe 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -395,81 +395,73 @@ android:layout_height="0dp" android:layout_weight="2" /> - <HorizontalScrollView + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:clipToPadding="false" - android:paddingHorizontal="16dp" - android:scrollbars="none"> + android:orientation="horizontal" + android:paddingHorizontal="16dp"> - <LinearLayout + <TextView + android:id="@+id/about" + style="@style/TextSmallLight" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="horizontal"> + android:layout_marginEnd="8dp" + android:padding="8dp" + android:text="@string/about" /> - <TextView - android:id="@+id/about" - style="@style/TextSmallLight" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:padding="8dp" - android:text="@string/about" /> + <Space + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" /> - <TextView - android:id="@+id/share" - style="@style/TextSmallLight" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:padding="8dp" - android:text="@string/share" /> + <TextView + android:id="@+id/share" + style="@style/TextSmallLight" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:text="@string/share" /> - <TextView - android:id="@+id/rate" - style="@style/TextSmallLight" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:padding="8dp" - android:text="@string/rate" /> + <Space + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" /> - <TextView - android:id="@+id/email" - style="@style/TextSmallLight" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:padding="8dp" - android:text="@string/email" /> + <TextView + android:id="@+id/rate" + style="@style/TextSmallLight" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:text="@string/rate" /> - <TextView - android:id="@+id/privacy" - style="@style/TextSmallLight" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:padding="8dp" - android:text="@string/privacy" /> + <Space + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" /> - <TextView - android:id="@+id/twitter" - style="@style/TextSmallLight" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:padding="8dp" - android:text="@string/twitter" /> + <TextView + android:id="@+id/email" + style="@style/TextSmallLight" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:text="@string/email" /> - <TextView - android:id="@+id/github" - style="@style/TextSmallLight" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="8dp" - android:text="@string/github" /> + <Space + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" /> - </LinearLayout> - </HorizontalScrollView> + <TextView + android:id="@+id/privacy" + style="@style/TextSmallLight" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="8dp" + android:text="@string/privacy" /> + + </LinearLayout> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 22b902e..9c07b06 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -48,7 +48,8 @@ \nDuring this time, you can double tap to unlock. You can also triple tap anytime to fully lock the phone immediately.</string> <string name="auto_show_keyboard">Auto show keyboard</string> <string name="hide">Hide</string> - <string name="rate_us_hint">Love using Olauncher?\nPlease consider rating us.</string> - <string name="email_us_hint">Have feedback?\nFeel free to email us.</string> - <string name="donate_hint">Want to support?\nBuy us a coffee :)</string> + <string name="about_hint">Tip: About has all the latest info about Olauncher.</string> + <string name="rate_us_hint">Love using Olauncher? Please rate us. Thank you.</string> + <string name="email_us_hint">Have feedback? Feel free to email us.</string> + <string name="donate_hint">Want to support? Buy us a coffee :)</string> </resources>
\ No newline at end of file |
