AdvancedDisplay: Adapt to S style

* Use Theme.SubSettingsBase for theme

Original Change-Id: Ic879ce61d83a33da12829008a4336c8a23230d63
Change-Id: Ib16512c898f7419cd40ab71985945dc5636c26de

Change-Id: I603bde2d7e3f6d3a1fbae37ca0300100917fa7be
Signed-off-by: Francescodario Cuzzocrea <bosconovic@gmail.com>
tirimbino
TheScarastic 3 years ago committed by Francescodario Cuzzocrea
parent 1da0686439
commit bde5edaf1d
  1. 2
      AdvancedDisplay/AndroidManifest.xml
  2. 8
      AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java
  3. 14
      AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayFragment.java

@ -7,7 +7,7 @@
<application
android:label="@string/app_name"
android:theme="@style/Theme.Main">
android:theme="@style/Theme.SubSettingsBase">
<receiver android:name="org.lineageos.settings.device.BootCompletedReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />

@ -17,14 +17,16 @@
package org.lineageos.settings.device;
import android.os.Bundle;
import android.preference.PreferenceActivity;
public class AdvancedDisplayActivity extends PreferenceActivity {
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
import com.android.settingslib.collapsingtoolbar.R;
public class AdvancedDisplayActivity extends CollapsingToolbarBaseActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction().replace(android.R.id.content,
getFragmentManager().beginTransaction().replace(R.id.content_frame,
new AdvancedDisplayFragment()).commit();
}
}

@ -16,10 +16,8 @@
package org.lineageos.settings.device;
import android.app.ActionBar;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.preference.PreferenceFragment;
@ -36,9 +34,6 @@ public class AdvancedDisplayFragment extends PreferenceFragment {
addPreferencesFromResource(R.xml.screen_preferences);
Resources res = getResources();
final ActionBar actionBar = getActivity().getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
/* mDNIe */
mmDNIeScenario = (mDNIeScenario) findPreference(Constants.KEY_MDNIE_SCENARIO);
mmDNIeScenario.setEnabled(
@ -48,13 +43,4 @@ public class AdvancedDisplayFragment extends PreferenceFragment {
mmDNIeAccessibility.setEnabled(
FileUtils.isFileWritable(res.getString(R.string.mdnie_accessibility_sysfs_file)));
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
getActivity().onBackPressed();
return true;
}
return false;
}
}

Loading…
Cancel
Save