Fix notification panel not expanding and added user option to toggle

main
h4h13 2020-03-01 22:13:31 +05:30
parent 19c7b826f4
commit e6fb122796
8 changed files with 30 additions and 13 deletions

View File

@ -14,7 +14,7 @@ proguardDictionaries {
android {
compileSdkVersion 29
buildToolsVersion = '29.0.2'
buildToolsVersion = '29.0.3'
defaultConfig {
minSdkVersion 21

View File

@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":10414,"versionName":"3.4.970_0301","enabled":true,"outputFile":"app-nofont-release.apk","fullName":"nofontRelease","baseName":"nofont-release","dirName":""},"path":"app-nofont-release.apk","properties":{}}]

View File

@ -170,7 +170,7 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
registerReceiver(mBroadcastReceiver, mIntentFilter);
PreferenceUtil.getInstance(this).registerOnSharedPreferenceChangedListener(this);
if (getIntent().hasExtra(EXPAND_PANEL)) {
if (getIntent().hasExtra(EXPAND_PANEL) && PreferenceUtil.getInstance(this).isExpandPanel()) {
if (getIntent().getBooleanExtra(EXPAND_PANEL, false)) {
expandPanel();
getIntent().putExtra(EXPAND_PANEL, false);

View File

@ -54,7 +54,7 @@ class PlayingNotificationImpl : PlayingNotification() {
if (isFavorite) R.drawable.ic_favorite_white_24dp else R.drawable.ic_favorite_border_white_24dp
val action = Intent(service, MainActivity::class.java)
action.putExtra("expand", true)
action.putExtra(MainActivity.EXPAND_PANEL, true)
action.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
val clickIntent =
PendingIntent.getActivity(service, 0, action, PendingIntent.FLAG_UPDATE_CURRENT)

View File

@ -73,7 +73,7 @@ class PlayingNotificationOreo : PlayingNotification() {
val notificationLayoutBig = getCombinedRemoteViews(false, song)
val action = Intent(service, MainActivity::class.java)
action.putExtra("expand", true)
action.putExtra(MainActivity.EXPAND_PANEL, true)
action.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
val clickIntent = PendingIntent

View File

@ -216,6 +216,7 @@ public final class PreferenceUtil {
private static final String FILTER_SONG = "filter_song";
private static final String TAG = "PreferenceUtil";
private static final String EXPAND_NOW_PLAYING_PANEL = "expand_now_playing_panel";
private static PreferenceUtil sInstance;
private final SharedPreferences mPreferences;
@ -974,4 +975,8 @@ public final class PreferenceUtil {
@NonNull OnSharedPreferenceChangeListener sharedPreferenceChangeListener) {
mPreferences.unregisterOnSharedPreferenceChangeListener(sharedPreferenceChangeListener);
}
public boolean isExpandPanel() {
return mPreferences.getBoolean(EXPAND_NOW_PLAYING_PANEL, false);
}
}

View File

@ -842,4 +842,6 @@
<string name="amount">Amount</string>
<string name="note">Note(Optional)</string>
<string name="start_payment">Start payment</string>
<string name="pref_title_expand_now_playing_panel">Show now playing screen</string>
<string name="pref_summary_expand_now_playing_panel">Clicking on the notification will show now playing screen instead of the home screen</string>
</resources>

View File

@ -62,16 +62,25 @@
app:key="toggle_volume"
app:summary="@string/pref_summary_toggle_volume"
app:title="@string/pref_title_toggle_volume" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESwitchPreference
android:layout="@layout/list_item_view_switch"
app:defaultValue="false"
app:icon="@drawable/ic_volume_up_white_24dp"
app:key="expand_now_playing_panel"
app:summary="@string/pref_summary_expand_now_playing_panel"
app:title="@string/pref_title_expand_now_playing_panel" />
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESeekBarPreference
android:defaultValue="12"
android:key="new_blur_amount"
android:layout="@layout/list_item_view_seekbar"
android:max="25"
android:summary="@string/pref_blur_amount_summary"
android:title="@string/pref_blur_amount_title"
app:icon="@drawable/ic_blur_on_white_24dp"
app:showSeekBarValue="true" />
</code.name.monkey.appthemehelper.common.prefs.supportv7.ATEPreferenceCategory>
<code.name.monkey.appthemehelper.common.prefs.supportv7.ATESeekBarPreference
android:defaultValue="12"
android:key="new_blur_amount"
android:layout="@layout/list_item_view_seekbar"
android:max="25"
android:summary="@string/pref_blur_amount_summary"
android:title="@string/pref_blur_amount_title"
app:icon="@drawable/ic_blur_on_white_24dp"
app:showSeekBarValue="true" />
</androidx.preference.PreferenceScreen>