Merge pull request #215 from jtdor/issue61-keep-remote-above-lockscreen
Added option to keep the remote above the lockscreen (issue #61)
This commit is contained in:
commit
56b51c8f65
|
@ -61,6 +61,10 @@ public class Settings {
|
|||
public static final String KEY_PREF_SWITCH_TO_REMOTE_AFTER_MEDIA_START = "pref_switch_to_remote_after_media_start";
|
||||
public static final boolean DEFAULT_PREF_SWITCH_TO_REMOTE_AFTER_MEDIA_START = true;
|
||||
|
||||
// Keep remote activity above lockscreen
|
||||
public static final String KEY_PREF_KEEP_REMOTE_ABOVE_LOCKSCREEN = "pref_keep_remote_above_lockscreen";
|
||||
public static final boolean DEFAULT_KEY_PREF_KEEP_REMOTE_ABOVE_LOCKSCREEN = false;
|
||||
|
||||
// Show notifications
|
||||
public static final String KEY_PREF_SHOW_NOTIFICATION = "pref_show_notification";
|
||||
public static final boolean DEFAULT_PREF_SHOW_NOTIFICATION = false;
|
||||
|
|
|
@ -32,6 +32,7 @@ import android.view.KeyEvent;
|
|||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
|
@ -161,6 +162,17 @@ public class RemoteActivity extends BaseActivity
|
|||
// Force a refresh, mainly to update the time elapsed on the fragments
|
||||
hostConnectionObserver.forceRefreshResults();
|
||||
|
||||
// Check whether we should keep the remote activity above the lockscreen
|
||||
boolean keepAboveLockscreen = PreferenceManager
|
||||
.getDefaultSharedPreferences(this)
|
||||
.getBoolean(Settings.KEY_PREF_KEEP_REMOTE_ABOVE_LOCKSCREEN,
|
||||
Settings.DEFAULT_KEY_PREF_KEEP_REMOTE_ABOVE_LOCKSCREEN);
|
||||
if (keepAboveLockscreen) {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
|
||||
} else {
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
|
||||
}
|
||||
|
||||
checkPVREnabledAndSetMenuItems();
|
||||
}
|
||||
|
||||
|
|
|
@ -312,6 +312,7 @@
|
|||
<string name="theme_solarized_dark">Solarized dunkel</string>
|
||||
|
||||
<string name="switch_to_remote">Nach dem Abspielen eines Mediums zur Fernbedienung wechseln</string>
|
||||
<string name="keep_remote_above_lockscreen">Fernbedienung auf dem Sperrbildschirm anzeigen</string>
|
||||
<string name="show_notification">Nachricht mit aktueller Wiedergabe anzeigen</string>
|
||||
<string name="use_hardware_volume_keys">Lautstärketasten verwenden</string>
|
||||
<string name="vibrate_on_remote">Auf Fernbedienungs-Knopfdruck vibrieren</string>
|
||||
|
|
|
@ -319,6 +319,7 @@
|
|||
<string name="theme_solarized_dark">Solarized Dark</string>
|
||||
|
||||
<string name="switch_to_remote">Switch to remote after media start</string>
|
||||
<string name="keep_remote_above_lockscreen">Keep remote above lockscreen</string>
|
||||
<string name="show_notification">Show notification while playing</string>
|
||||
<string name="use_hardware_volume_keys">Use volume keys to control volume</string>
|
||||
<string name="vibrate_on_remote">Vibrate on remote button press</string>
|
||||
|
|
|
@ -29,6 +29,11 @@
|
|||
android:title="@string/switch_to_remote"
|
||||
android:defaultValue="true"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="pref_keep_remote_above_lockscreen"
|
||||
android:title="@string/keep_remote_above_lockscreen"
|
||||
android:defaultValue="false"/>
|
||||
|
||||
<SwitchPreference
|
||||
android:key="pref_show_notification"
|
||||
android:title="@string/show_notification"
|
||||
|
|
Loading…
Reference in New Issue