From d0d3453379b9a62ff42796d46d9eb88586e4d706 Mon Sep 17 00:00:00 2001 From: h4h13 Date: Wed, 31 Jul 2019 01:50:01 +0530 Subject: [PATCH] Fix search keyboard not popping --- app/build.gradle | 4 +- app/src/main/assets/retro-changelog.html | 2 +- .../activities/EqualizerActivity.kt | 186 ------------------ .../retromusic/activities/SearchActivity.kt | 2 +- .../settings/ThemeSettingsFragment.kt | 29 ++- app/src/main/res/layout/activity_search.xml | 4 +- .../res/layout/activity_song_tag_editor.xml | 7 +- app/src/main/res/xml/pref_general.xml | 29 ++- 8 files changed, 39 insertions(+), 224 deletions(-) delete mode 100644 app/src/main/java/code/name/monkey/retromusic/activities/EqualizerActivity.kt diff --git a/app/build.gradle b/app/build.gradle index c7879949..d530e270 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { vectorDrawables.useSupportLibrary = true applicationId "code.name.monkey.retromusic" - versionCode 342 - versionName '3.2.136' + versionCode 343 + versionName '3.2.200' multiDexEnabled true diff --git a/app/src/main/assets/retro-changelog.html b/app/src/main/assets/retro-changelog.html index 9d3807db..96a43f89 100644 --- a/app/src/main/assets/retro-changelog.html +++ b/app/src/main/assets/retro-changelog.html @@ -1 +1 @@ -

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

v3.1.240

v3.1.200

v3.0.570

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.2.200

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

v3.1.240

v3.1.200

v3.0.570

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/EqualizerActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/EqualizerActivity.kt deleted file mode 100644 index 6feda4ce..00000000 --- a/app/src/main/java/code/name/monkey/retromusic/activities/EqualizerActivity.kt +++ /dev/null @@ -1,186 +0,0 @@ -package code.name.monkey.retromusic.activities - -import android.os.Bundle -import android.transition.TransitionManager -import android.view.LayoutInflater -import android.view.MenuItem -import android.view.View -import android.widget.AdapterView -import android.widget.ArrayAdapter -import android.widget.SeekBar -import android.widget.TextView -import code.name.monkey.appthemehelper.ThemeStore -import code.name.monkey.appthemehelper.util.ColorUtil -import code.name.monkey.appthemehelper.util.MaterialValueHelper -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.AbsMusicServiceActivity -import code.name.monkey.retromusic.extensions.applyToolbar -import code.name.monkey.retromusic.helper.EqualizerHelper -import code.name.monkey.retromusic.util.ViewUtil -import kotlinx.android.synthetic.main.activity_equalizer.* -import kotlinx.android.synthetic.main.activity_equalizer.appBarLayout -import kotlinx.android.synthetic.main.activity_equalizer.toolbar -import kotlinx.android.synthetic.main.activity_playing_queue.* - -/** - * @author Hemanth S (h4h13). - */ - -class EqualizerActivity : AbsMusicServiceActivity(), AdapterView.OnItemSelectedListener { - - private val seekBarChangeListener = object : SeekBar.OnSeekBarChangeListener { - override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { - if (fromUser) { - if (seekBar === bassBoostStrength) { - bassBoost.isEnabled = progress > 0 - EqualizerHelper.instance!!.bassBoostStrength = progress - EqualizerHelper.instance!!.isBassBoostEnabled = progress > 0 - } else if (seekBar === virtualizerStrength) { - virtualizer.isEnabled = progress > 0 - EqualizerHelper.instance!!.isVirtualizerEnabled = progress > 0 - EqualizerHelper.instance!!.virtualizerStrength = progress - } - } - } - - override fun onStartTrackingTouch(seekBar: SeekBar) { - - } - - override fun onStopTrackingTouch(seekBar: SeekBar) { - - } - } - - private var presetsNamesAdapter: ArrayAdapter? = null - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_equalizer) - - setStatusbarColorAuto() - setNavigationbarColorAuto() - setTaskDescriptionColorAuto() - setLightNavigationBar(true) - - setupToolbar() - - equalizerSwitch.isChecked = EqualizerHelper.instance!!.equalizer.enabled - equalizerSwitch.setBackgroundColor(ThemeStore.accentColor(this)) - val widgetColor = MaterialValueHelper.getPrimaryTextColor(this, ColorUtil.isColorLight(ThemeStore.accentColor(this))) - equalizerSwitch.setTextColor(widgetColor) - TintHelper.setTintAuto(equalizerSwitch, widgetColor, false) - equalizerSwitch.setOnCheckedChangeListener { buttonView, isChecked -> - when (buttonView.id) { - R.id.equalizerSwitch -> { - EqualizerHelper.instance!!.equalizer.enabled = isChecked - TransitionManager.beginDelayedTransition(content) - content.visibility = if (isChecked) View.VISIBLE else View.GONE - } - } - } - - presetsNamesAdapter = ArrayAdapter(this, android.R.layout.simple_list_item_1) - presets.adapter = presetsNamesAdapter - presets.onItemSelectedListener = this - - bassBoostStrength.progress = EqualizerHelper.instance!!.bassBoostStrength - ViewUtil.setProgressDrawable(bassBoostStrength, ThemeStore.accentColor(this)) - bassBoostStrength.setOnSeekBarChangeListener(seekBarChangeListener) - - virtualizerStrength.progress = EqualizerHelper.instance!!.virtualizerStrength - ViewUtil.setProgressDrawable(virtualizerStrength, ThemeStore.accentColor(this)) - virtualizerStrength.setOnSeekBarChangeListener(seekBarChangeListener) - - setupUI() - addPresets() - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - if (item.itemId == android.R.id.home) { - onBackPressed() - return true - } - return super.onOptionsItemSelected(item) - } - - private fun setupToolbar() { - val primaryColor = ThemeStore.primaryColor(this) - appBarLayout.setBackgroundColor(primaryColor) - applyToolbar(toolbar) - } - - private fun addPresets() { - presetsNamesAdapter!!.clear() - presetsNamesAdapter!!.add("Custom") - for (j in 0 until EqualizerHelper.instance!!.equalizer.numberOfPresets) { - presetsNamesAdapter!! - .add(EqualizerHelper.instance!!.equalizer.getPresetName(j.toShort())) - presetsNamesAdapter!!.notifyDataSetChanged() - } - presets.setSelection(EqualizerHelper.instance!!.equalizer.currentPreset.toInt() + 1) - } - - private fun setupUI() { - frequencyBands.removeAllViews() - val bands: Short - try { - // get number of supported bands - bands = EqualizerHelper.instance!!.numberOfBands.toShort() - - // for each of the supported bands, we will set up a slider from -10dB to 10dB boost/attenuation, - // as well as text labels to assist the user - for (i in 0 until bands) { - - val view = LayoutInflater.from(this).inflate(R.layout.retro_seekbar, frequencyBands, false) - val freqTextView = view.findViewById(R.id.hurtz) - freqTextView.text = String.format("%d Hz", EqualizerHelper.instance!!.getCenterFreq(i) / 1000) - - val minDbTextView = view.findViewById(R.id.minus_db) - minDbTextView.text = String.format("%d dB", EqualizerHelper.instance!!.bandLevelLow / 100) - - val maxDbTextView = view.findViewById(R.id.plus_db) - maxDbTextView.text = String.format("%d dB", EqualizerHelper.instance!!.bandLevelHigh / 100) - - val bar = view.findViewById(R.id.seekbar) - ViewUtil.setProgressDrawable(bar, ThemeStore.accentColor(this)) - bar.max = EqualizerHelper.instance!!.bandLevelHigh - EqualizerHelper.instance!! - .bandLevelLow - bar.progress = EqualizerHelper.instance!!.getBandLevel(i) - EqualizerHelper.instance!! - .bandLevelLow - bar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { - override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { - EqualizerHelper.instance!!.setBandLevel(i, - progress + EqualizerHelper.instance!!.bandLevelLow) - if (fromUser) { - presets.setSelection(0) - } - } - - override fun onStartTrackingTouch(seekBar: SeekBar) {} - - override fun onStopTrackingTouch(seekBar: SeekBar) {} - }) - - frequencyBands.addView(view) - } - } catch (e: Exception) { - e.printStackTrace() - } - - } - - override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) { - if (position == 0) { - return - } - EqualizerHelper.instance!!.equalizer.usePreset((position - 1).toShort()) - setupUI() - } - - override fun onNothingSelected(parent: AdapterView<*>) { - - } -} diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/SearchActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/SearchActivity.kt index 967ff329..f6586f1d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/SearchActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/SearchActivity.kt @@ -64,7 +64,7 @@ class SearchActivity : AbsMusicServiceActivity(), OnQueryTextListener, SearchCon keyboardPopup.setOnClickListener { val inputManager = getSystemService(Service.INPUT_METHOD_SERVICE) as InputMethodManager - inputManager.showSoftInput(searchView, 0) + inputManager.showSoftInput(searchView, InputMethodManager.SHOW_IMPLICIT) } keyboardPopup.backgroundTintList = ColorStateList.valueOf(ThemeStore.accentColor(this)) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/settings/ThemeSettingsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/settings/ThemeSettingsFragment.kt index ef2a62f3..29006206 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/settings/ThemeSettingsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/settings/ThemeSettingsFragment.kt @@ -23,6 +23,7 @@ import androidx.preference.Preference import androidx.preference.TwoStatePreference import code.name.monkey.appthemehelper.* import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEColorPreference +import code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.VersionUtils import code.name.monkey.retromusic.App @@ -41,12 +42,21 @@ import com.afollestad.materialdialogs.color.colorChooser class ThemeSettingsFragment : AbsSettingsFragment() { override fun invalidateSettings() { - val primaryColorPref: ATEColorPreference? = findPreference("primary_color") - primaryColorPref?.let { - it.isVisible = PreferenceUtil.getInstance().generalTheme == R.style.Theme_RetroMusic_Color - val primaryColor = ThemeStore.primaryColor(activity!!) - it.setColor(primaryColor, ColorUtil.darkenColor(primaryColor)) - it.setOnPreferenceClickListener { + + val categoryColor: ATEPreferenceCategory? = findPreference("category_color") + val primaryColorPref = ATEColorPreference(preferenceScreen.context) + + val primaryColor = ThemeStore.primaryColor(activity!!) + + primaryColorPref.apply { + key = "primary_color" + isPersistent = false + setSummary(R.string.primary_color_desc) + setTitle(R.string.primary_color) + isCopyingEnabled = true + setIcon(R.drawable.ic_colorize_white_24dp) + setColor(primaryColor, ColorUtil.darkenColor(primaryColor)) + setOnPreferenceClickListener { MaterialDialog(activity!!, BottomSheet()).show { title(R.string.primary_color) positiveButton(R.string.set) @@ -83,10 +93,6 @@ class ThemeSettingsFragment : AbsSettingsFragment() { return@setOnPreferenceChangeListener false } - if (theme == "color") { - primaryColorPref?.isVisible = true - } - setSummary(generalTheme, newValue) when (theme) { @@ -144,6 +150,9 @@ class ThemeSettingsFragment : AbsSettingsFragment() { } } + if (PreferenceUtil.getInstance().generalTheme == R.style.Theme_RetroMusic_Color && App.isProVersion) { + categoryColor?.addPreference(primaryColorPref) + } } override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 7d2b0f07..1df3bbd5 100755 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -41,7 +41,7 @@ app:srcCompat="@drawable/ic_keyboard_backspace_black_24dp" /> - - + - - - - - - - - - - + + + + \ No newline at end of file