From 54c50b1a982fb9527c0958d3563850b1ea571994 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Sat, 12 Oct 2019 14:59:52 +0530 Subject: [PATCH] Back button will be dark --- app/build.gradle | 4 +- app/src/main/assets/retro-changelog.html | 2 +- .../retromusic/activities/AboutActivity.kt | 3 +- .../activities/LicenseActivity.java | 3 +- .../retromusic/activities/SettingsActivity.kt | 2 +- .../activities/WhatsNewActivity.java | 3 +- .../activities/bugreport/BugReportActivity.kt | 101 +++++++++--------- .../retromusic/extensions/ActivityEx.kt | 3 +- .../mainactivity/LibraryFragment.java | 2 +- .../main/res/layout/activity_bug_report.xml | 1 + .../res/layout/fragment_main_settings.xml | 1 + app/src/main/res/values/colors.xml | 1 + app/src/main/res/values/styles.xml | 6 +- app/src/main/res/values/styles_parents.xml | 2 +- .../util/ToolbarContentTintHelper.java | 5 +- 15 files changed, 68 insertions(+), 71 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 143dd68d..ccf7efa2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 380 - versionName '3.4.400-beta06' + versionCode 381 + versionName '3.4.400-beta07' multiDexEnabled true diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index 1651aa45..22111448 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

v3.4.400

v3.3.200

v.3.3.100

v3.3.000

v3.2.240

v3.2.220

v3.2.203

v3.2.135

v3.2.125

v3.2.120

v3.2.105

v3.2.100

v3.2.000

v3.1.900

v3.1.850

v3.1.800

v3.1.700

v3.1.400

v3.1.300

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file +

v3.4.400

v3.3.200

v.3.3.100

v3.3.000

v3.2.240

v3.2.220

v3.2.203

v3.2.135

v3.2.125

v3.2.120

v3.2.105

v3.2.100

v3.2.000

v3.1.900

v3.1.850

v3.1.800

v3.1.700

v3.1.400

v3.1.300

If you see entire app white or dark or black select same theme in settings to fix

FAQ's

*If you face any UI related issues you clear app data and cache, if its not working try to uninstall and install again.

\ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt index bd63a616..d89a0938 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/AboutActivity.kt @@ -9,7 +9,6 @@ import android.view.View import androidx.core.app.ShareCompat import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.LinearLayoutManager -import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.retromusic.Constants.APP_INSTAGRAM_LINK import code.name.monkey.retromusic.Constants.APP_TELEGRAM_LINK @@ -69,7 +68,7 @@ class AboutActivity : AbsBaseActivity(), View.OnClickListener { loadContributors() setSupportActionBar(toolbar) - ToolbarContentTintHelper.colorBackButton(toolbar, ATHUtil.resolveColor(this, R.attr.colorOnSurface)) + ToolbarContentTintHelper.colorBackButton(toolbar ) appVersion.text = getAppVersion() setUpView() } diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.java b/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.java index 022d88b3..6b947083 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.java @@ -30,7 +30,6 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import code.name.monkey.appthemehelper.ThemeStore; -import code.name.monkey.appthemehelper.util.ATHUtil; import code.name.monkey.appthemehelper.util.ColorUtil; import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper; import code.name.monkey.retromusic.R; @@ -66,7 +65,7 @@ public class LicenseActivity extends AbsBaseActivity { setLightNavigationBar(true); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); - ToolbarContentTintHelper.colorBackButton(toolbar, ATHUtil.INSTANCE.resolveColor(this, R.attr.colorOnSurface)); + ToolbarContentTintHelper.colorBackButton(toolbar ); WebView webView = findViewById(R.id.license); try { StringBuilder buf = new StringBuilder(); diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt index 272e8533..96b570f6 100755 --- a/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt @@ -39,7 +39,7 @@ class SettingsActivity : AbsBaseActivity() { setTitleTextColor(ATHUtil.resolveColor(this@SettingsActivity, R.attr.colorOnPrimary)) setBackgroundColor(ATHUtil.resolveColor(this@SettingsActivity, R.attr.colorPrimary)) setNavigationOnClickListener { onBackPressed() } - ToolbarContentTintHelper.colorBackButton(toolbar, ATHUtil.resolveColor(this@SettingsActivity, R.attr.colorOnSecondary)) + ToolbarContentTintHelper.colorBackButton(toolbar) } appBarLayout.setBackgroundColor(ATHUtil.resolveColor(this@SettingsActivity, R.attr.colorPrimary)) diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java b/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java index 4a5be75b..a9db522a 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java +++ b/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java @@ -19,7 +19,6 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import code.name.monkey.appthemehelper.ThemeStore; -import code.name.monkey.appthemehelper.util.ATHUtil; import code.name.monkey.appthemehelper.util.ColorUtil; import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper; import code.name.monkey.retromusic.R; @@ -67,7 +66,7 @@ public class WhatsNewActivity extends AbsBaseActivity { //setSupportActionBar(toolbar); toolbar.setNavigationOnClickListener(v -> onBackPressed()); - ToolbarContentTintHelper.colorBackButton(toolbar, ATHUtil.INSTANCE.resolveColor(this, R.attr.colorOnSecondary)); + ToolbarContentTintHelper.colorBackButton(toolbar); try { StringBuilder buf = new StringBuilder(); diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/bugreport/BugReportActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/bugreport/BugReportActivity.kt index aeb482ad..b72882ec 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/bugreport/BugReportActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/bugreport/BugReportActivity.kt @@ -19,6 +19,7 @@ import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.MaterialUtil import code.name.monkey.appthemehelper.util.TintHelper +import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.retromusic.R import code.name.monkey.retromusic.activities.base.AbsThemeActivity import code.name.monkey.retromusic.activities.bugreport.model.DeviceInfo @@ -58,7 +59,6 @@ open class BugReportActivity : AbsThemeActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_bug_report) - setStatusbarColorAuto() setNavigationbarColorAuto() setTaskDescriptionColorAuto() @@ -68,53 +68,51 @@ open class BugReportActivity : AbsThemeActivity() { if (TextUtils.isEmpty(title)) setTitle(R.string.report_an_issue) - deviceInfo = DeviceInfo(this) - airTextDeviceInfo!!.text = deviceInfo!!.toString() + airTextDeviceInfo.text = deviceInfo.toString() } private fun initViews() { val accentColor = ThemeStore.accentColor(this) val primaryColor = ATHUtil.resolveColor(this, R.attr.colorPrimary) - toolbar!!.setBackgroundColor(primaryColor) + toolbar.setBackgroundColor(primaryColor) setSupportActionBar(toolbar) + ToolbarContentTintHelper.colorBackButton(toolbar) + supportActionBar?.setDisplayHomeAsUpEnabled(true) + TintHelper.setTintAuto(optionUseAccount, accentColor, false) + optionUseAccount?.setOnClickListener { + inputTitle.isEnabled = true + inputDescription.isEnabled = true + inputUsername.isEnabled = true + inputPassword.isEnabled = true - supportActionBar!!.setDisplayHomeAsUpEnabled(true) - - TintHelper.setTintAuto(optionUseAccount!!, accentColor, false) - optionUseAccount!!.setOnClickListener { - inputTitle!!.isEnabled = true - inputDescription!!.isEnabled = true - inputUsername!!.isEnabled = true - inputPassword!!.isEnabled = true - - optionAnonymous!!.isChecked = false - sendFab!!.hide(object : FloatingActionButton.OnVisibilityChangedListener() { + optionAnonymous.isChecked = false + sendFab.hide(object : FloatingActionButton.OnVisibilityChangedListener() { override fun onHidden(fab: FloatingActionButton?) { super.onHidden(fab) - sendFab!!.setImageResource(R.drawable.ic_send_white_24dp) - sendFab!!.show() + sendFab.setImageResource(R.drawable.ic_send_white_24dp) + sendFab.show() } }) } - TintHelper.setTintAuto(optionAnonymous!!, accentColor, false) - optionAnonymous!!.setOnClickListener { - inputTitle!!.isEnabled = false - inputDescription!!.isEnabled = false - inputUsername!!.isEnabled = false - inputPassword!!.isEnabled = false + TintHelper.setTintAuto(optionAnonymous, accentColor, false) + optionAnonymous.setOnClickListener { + inputTitle.isEnabled = false + inputDescription.isEnabled = false + inputUsername.isEnabled = false + inputPassword.isEnabled = false - optionUseAccount!!.isChecked = false - sendFab!!.hide(object : FloatingActionButton.OnVisibilityChangedListener() { + optionUseAccount.isChecked = false + sendFab.hide(object : FloatingActionButton.OnVisibilityChangedListener() { override fun onHidden(fab: FloatingActionButton?) { super.onHidden(fab) - sendFab!!.setImageResource(R.drawable.ic_open_in_browser_white_24dp) - sendFab!!.show() + sendFab.setImageResource(R.drawable.ic_open_in_browser_white_24dp) + sendFab.show() } }) } - inputPassword!!.setOnEditorActionListener { _, actionId, _ -> + inputPassword.setOnEditorActionListener { _, actionId, _ -> if (actionId == EditorInfo.IME_ACTION_SEND) { reportIssue() return@setOnEditorActionListener true @@ -122,10 +120,10 @@ open class BugReportActivity : AbsThemeActivity() { false } - airTextDeviceInfo!!.setOnClickListener { copyDeviceInfoToClipBoard() } + airTextDeviceInfo.setOnClickListener { copyDeviceInfoToClipBoard() } - TintHelper.setTintAuto(sendFab!!, accentColor, true) - sendFab!!.setOnClickListener { reportIssue() } + TintHelper.setTintAuto(sendFab, accentColor, true) + sendFab.setOnClickListener { reportIssue() } MaterialUtil.setTint(inputLayoutTitle, false) MaterialUtil.setTint(inputLayoutDescription, false) @@ -134,10 +132,10 @@ open class BugReportActivity : AbsThemeActivity() { } private fun reportIssue() { - if (optionUseAccount!!.isChecked) { + if (optionUseAccount.isChecked) { if (!validateInput()) return - val username = inputUsername!!.text!!.toString() - val password = inputPassword!!.text!!.toString() + val username = inputUsername.text.toString() + val password = inputPassword.text.toString() sendBugReport(GithubLogin(username, password)) } else { copyDeviceInfoToClipBoard() @@ -151,43 +149,42 @@ open class BugReportActivity : AbsThemeActivity() { private fun copyDeviceInfoToClipBoard() { val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager - val clip = ClipData.newPlainText(getString(R.string.device_info), deviceInfo!!.toMarkdown()) - clipboard.setPrimaryClip(clip) - + val clip = ClipData.newPlainText(getString(R.string.device_info), deviceInfo?.toMarkdown()) + clipboard.primaryClip = clip Toast.makeText(this@BugReportActivity, R.string.copied_device_info_to_clipboard, Toast.LENGTH_LONG).show() } private fun validateInput(): Boolean { var hasErrors = false - if (optionUseAccount!!.isChecked) { - if (TextUtils.isEmpty(inputUsername!!.text)) { - setError(inputLayoutUsername!!, R.string.bug_report_no_username) + if (optionUseAccount.isChecked) { + if (TextUtils.isEmpty(inputUsername.text)) { + setError(inputLayoutUsername, R.string.bug_report_no_username) hasErrors = true } else { - removeError(inputLayoutUsername!!) + removeError(inputLayoutUsername) } - if (TextUtils.isEmpty(inputPassword!!.text)) { - setError(inputLayoutPassword!!, R.string.bug_report_no_password) + if (TextUtils.isEmpty(inputPassword.text)) { + setError(inputLayoutPassword, R.string.bug_report_no_password) hasErrors = true } else { - removeError(inputLayoutPassword!!) + removeError(inputLayoutPassword) } } - if (TextUtils.isEmpty(inputTitle!!.text)) { - setError(inputLayoutTitle!!, R.string.bug_report_no_title) + if (TextUtils.isEmpty(inputTitle.text)) { + setError(inputLayoutTitle, R.string.bug_report_no_title) hasErrors = true } else { - removeError(inputLayoutTitle!!) + removeError(inputLayoutTitle) } - if (TextUtils.isEmpty(inputDescription!!.text)) { - setError(inputLayoutDescription!!, R.string.bug_report_no_description) + if (TextUtils.isEmpty(inputDescription.text)) { + setError(inputLayoutDescription, R.string.bug_report_no_description) hasErrors = true } else { - removeError(inputLayoutDescription!!) + removeError(inputLayoutDescription) } return !hasErrors @@ -204,8 +201,8 @@ open class BugReportActivity : AbsThemeActivity() { private fun sendBugReport(login: GithubLogin) { if (!validateInput()) return - val bugTitle = inputTitle!!.text!!.toString() - val bugDescription = inputDescription!!.text!!.toString() + val bugTitle = inputTitle.text.toString() + val bugDescription = inputDescription.text.toString() val extraInfo = ExtraInfo() onSaveExtraInfo() diff --git a/app/src/main/java/code/name/monkey/retromusic/extensions/ActivityEx.kt b/app/src/main/java/code/name/monkey/retromusic/extensions/ActivityEx.kt index 764a5908..fc286a48 100644 --- a/app/src/main/java/code/name/monkey/retromusic/extensions/ActivityEx.kt +++ b/app/src/main/java/code/name/monkey/retromusic/extensions/ActivityEx.kt @@ -16,7 +16,6 @@ package code.name.monkey.retromusic.extensions import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.widget.Toolbar -import code.name.monkey.appthemehelper.ThemeStore import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper import code.name.monkey.retromusic.R @@ -25,7 +24,7 @@ fun AppCompatActivity.applyToolbar(toolbar: Toolbar) { toolbar.apply { setNavigationOnClickListener { onBackPressed() } setNavigationIcon(R.drawable.ic_keyboard_backspace_black_24dp) - ToolbarContentTintHelper.colorBackButton(toolbar, ThemeStore.textColorSecondary(this@applyToolbar)) + ToolbarContentTintHelper.colorBackButton(toolbar ) setBackgroundColor(ATHUtil.resolveColor(this@applyToolbar, R.attr.colorPrimary)) } setSupportActionBar(toolbar) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java index bdce1b0a..5789a8cd 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/mainactivity/LibraryFragment.java @@ -151,7 +151,7 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde }); getMainActivity().setSupportActionBar(toolbar); toolbar.setNavigationOnClickListener(v -> showMainMenu(OptionsSheetDialogFragment.LIBRARY)); - ToolbarContentTintHelper.colorBackButton(toolbar, ATHUtil.INSTANCE.resolveColor(requireContext(), R.attr.colorOnSurface)); + ToolbarContentTintHelper.colorBackButton(toolbar ); toolbar.setTitleTextColor(ATHUtil.INSTANCE.resolveColor(requireContext(), R.attr.colorOnSecondary)); } diff --git a/app/src/main/res/layout/activity_bug_report.xml b/app/src/main/res/layout/activity_bug_report.xml index 05eb8406..5f56db18 100644 --- a/app/src/main/res/layout/activity_bug_report.xml +++ b/app/src/main/res/layout/activity_bug_report.xml @@ -16,6 +16,7 @@ android:id="@+id/toolbar" style="@style/Toolbar" app:layout_collapseMode="pin" + app:navigationIcon="@drawable/ic_keyboard_backspace_black_24dp" app:title="@string/report_bug" app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" /> diff --git a/app/src/main/res/layout/fragment_main_settings.xml b/app/src/main/res/layout/fragment_main_settings.xml index 37fc8ecc..fc8682b2 100644 --- a/app/src/main/res/layout/fragment_main_settings.xml +++ b/app/src/main/res/layout/fragment_main_settings.xml @@ -130,6 +130,7 @@ android:fadingEdge="horizontal" android:singleLine="true" android:text="@string/general_settings_title" + android:textColor="?colorOnPrimary" android:textAppearance="@style/TextViewSubtitle1" android:textStyle="bold" /> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index fdea77d7..fda58cdb 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -13,6 +13,7 @@ #000000 #FFFFFF + #202020 #FEFEFE #FFFFFF #FEFEFE diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ebfea12c..5ba325cd 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -42,10 +42,10 @@