AdvancedDisplay: Adapt to S style
authorTheScarastic <warabhishek@gmail.com>
Wed, 6 Oct 2021 07:25:13 +0000 (07:25 +0000)
committerFrancescodario Cuzzocrea <bosconovic@gmail.com>
Sat, 26 Feb 2022 20:24:40 +0000 (21:24 +0100)
 * Use Theme.SubSettingsBase for theme

Original Change-Id: Ic879ce61d83a33da12829008a4336c8a23230d63
Change-Id: Ib16512c898f7419cd40ab71985945dc5636c26de

Change-Id: I603bde2d7e3f6d3a1fbae37ca0300100917fa7be
Signed-off-by: Francescodario Cuzzocrea <bosconovic@gmail.com>
AdvancedDisplay/AndroidManifest.xml
AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java
AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayFragment.java

index 71b93b041f9312cced7beaf519b6ff7181a12cbc..f5fd7c3dee9a36680220496f326ba16bb18a3e9d 100644 (file)
@@ -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" />
index 92397c38c028124a1bb011e39b22459e85d09d82..30189f46295dfb9b40c09a757d8ee0197734d76a 100644 (file)
 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();
     }
 }
index 371a203bfab16c0a7342838abb50afa61cbd0b35..5446860858030f2dda2743f7575c64091ddb7d84 100644 (file)
 
 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;
-    }
 }