|
|
@ -18,11 +18,14 @@ package com.cyanogenmod.settings.device; |
|
|
|
|
|
|
|
|
|
|
|
import com.android.internal.util.cm.ScreenType; |
|
|
|
import com.android.internal.util.cm.ScreenType; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.app.ActionBar; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.preference.Preference; |
|
|
|
import android.preference.Preference; |
|
|
|
import android.preference.PreferenceActivity; |
|
|
|
import android.preference.PreferenceActivity; |
|
|
|
import android.preference.SwitchPreference; |
|
|
|
import android.preference.SwitchPreference; |
|
|
|
import android.provider.Settings; |
|
|
|
import android.provider.Settings; |
|
|
|
|
|
|
|
import android.view.Menu; |
|
|
|
|
|
|
|
import android.view.MenuItem; |
|
|
|
|
|
|
|
|
|
|
|
public class TouchscreenGestureSettings extends PreferenceActivity { |
|
|
|
public class TouchscreenGestureSettings extends PreferenceActivity { |
|
|
|
|
|
|
|
|
|
|
@ -50,6 +53,9 @@ public class TouchscreenGestureSettings extends PreferenceActivity { |
|
|
|
mPocketPreference = |
|
|
|
mPocketPreference = |
|
|
|
(SwitchPreference) findPreference(KEY_GESTURE_POCKET); |
|
|
|
(SwitchPreference) findPreference(KEY_GESTURE_POCKET); |
|
|
|
mPocketPreference.setEnabled(dozeEnabled); |
|
|
|
mPocketPreference.setEnabled(dozeEnabled); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final ActionBar actionBar = getActionBar(); |
|
|
|
|
|
|
|
actionBar.setDisplayHomeAsUpEnabled(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -62,6 +68,15 @@ public class TouchscreenGestureSettings extends PreferenceActivity { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
|
|
|
|
|
if (item.getItemId() == android.R.id.home) { |
|
|
|
|
|
|
|
onBackPressed(); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean enableDoze(boolean enable) { |
|
|
|
private boolean enableDoze(boolean enable) { |
|
|
|
return Settings.Secure.putInt(getContentResolver(), |
|
|
|
return Settings.Secure.putInt(getContentResolver(), |
|
|
|
Settings.Secure.DOZE_ENABLED, enable ? 1 : 0); |
|
|
|
Settings.Secure.DOZE_ENABLED, enable ? 1 : 0); |
|
|
|