mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 20:45:31 -04:00
universal7885: FMRadio: Restore output selection too
This commit is contained in:
parent
e682783f6b
commit
201c4fa92a
1 changed files with 24 additions and 17 deletions
|
|
@ -119,6 +119,7 @@ class MainFragment :
|
||||||
mSeekBar.min = 1
|
mSeekBar.min = 1
|
||||||
mSeekBar.max = 15
|
mSeekBar.max = 15
|
||||||
mSeekBar.progress = mVolume
|
mSeekBar.progress = mVolume
|
||||||
|
updateOutputStatus(false)
|
||||||
if (!mFreqSearchDone) {
|
if (!mFreqSearchDone) {
|
||||||
val mRestoreFreq = mSharedPref.getInt("freq", mFMInterface.mDevCtl.getValue(GetType.GET_TYPE_FM_LOWER_LIMIT))
|
val mRestoreFreq = mSharedPref.getInt("freq", mFMInterface.mDevCtl.getValue(GetType.GET_TYPE_FM_LOWER_LIMIT))
|
||||||
mFMInterface.mDefaultCtl.setValue(SetType.SET_TYPE_FM_FREQ, mRestoreFreq)
|
mFMInterface.mDefaultCtl.setValue(SetType.SET_TYPE_FM_FREQ, mRestoreFreq)
|
||||||
|
|
@ -206,11 +207,10 @@ class MainFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(v: View) {
|
private fun updateOutputStatus(mInverted : Boolean) {
|
||||||
when (v.id) {
|
var mCurrent = mSharedPref.getBoolean("speaker", false)
|
||||||
mOutputSwitch.id -> {
|
if (mInverted) mCurrent = !mCurrent
|
||||||
val mCurrent = mSharedPref.getBoolean("speaker", false)
|
if (mCurrent) {
|
||||||
if (!mCurrent) {
|
|
||||||
mOutputSwitch.setImageIcon(
|
mOutputSwitch.setImageIcon(
|
||||||
Icon.createWithResource(
|
Icon.createWithResource(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
|
|
@ -227,6 +227,13 @@ class MainFragment :
|
||||||
)
|
)
|
||||||
mFMInterface.mDevCtl.setValue(SetType.SET_TYPE_FM_SPEAKER_ROUTE, 0)
|
mFMInterface.mDevCtl.setValue(SetType.SET_TYPE_FM_SPEAKER_ROUTE, 0)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onClick(v: View) {
|
||||||
|
when (v.id) {
|
||||||
|
mOutputSwitch.id -> {
|
||||||
|
val mCurrent = mSharedPref.getBoolean("speaker", false)
|
||||||
|
updateOutputStatus(true)
|
||||||
mSharedPref.edit().putBoolean("speaker", !mCurrent).apply()
|
mSharedPref.edit().putBoolean("speaker", !mCurrent).apply()
|
||||||
}
|
}
|
||||||
mVolumeUp.id -> {
|
mVolumeUp.id -> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue