-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Xposed Menu: Separate theming options
- Loading branch information
1 parent
fbc5ef9
commit 8a37172
Showing
8 changed files
with
467 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
app/src/main/java/com/drdisagree/iconify/ui/activities/XposedThemes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
package com.drdisagree.iconify.ui.activities; | ||
|
||
import static com.drdisagree.iconify.common.Const.SWITCH_ANIMATION_DELAY; | ||
import static com.drdisagree.iconify.common.Preferences.BLACK_QSPANEL; | ||
import static com.drdisagree.iconify.common.Preferences.DUALTONE_QSPANEL; | ||
import static com.drdisagree.iconify.common.Preferences.FLUID_NOTIF_TRANSPARENCY; | ||
import static com.drdisagree.iconify.common.Preferences.FLUID_POWERMENU_TRANSPARENCY; | ||
import static com.drdisagree.iconify.common.Preferences.FLUID_QSPANEL; | ||
import static com.drdisagree.iconify.common.Preferences.LIGHT_QSPANEL; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Bundle; | ||
import android.os.Handler; | ||
import android.os.Looper; | ||
|
||
import com.drdisagree.iconify.R; | ||
import com.drdisagree.iconify.config.RPrefs; | ||
import com.drdisagree.iconify.databinding.ActivityXposedQuickSettingsBinding; | ||
import com.drdisagree.iconify.databinding.ActivityXposedThemesBinding; | ||
import com.drdisagree.iconify.ui.utils.ViewHelper; | ||
import com.drdisagree.iconify.utils.SystemUtil; | ||
|
||
public class XposedThemes extends AppCompatActivity { | ||
|
||
private ActivityXposedThemesBinding binding; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
binding = ActivityXposedThemesBinding.inflate(getLayoutInflater()); | ||
setContentView(binding.getRoot()); | ||
|
||
// Header | ||
ViewHelper.setHeader(this, binding.header.toolbar, R.string.activity_title_themes); | ||
|
||
// Light Theme | ||
binding.enableLightTheme.setChecked(RPrefs.getBoolean(LIGHT_QSPANEL, false)); | ||
binding.enableLightTheme.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
RPrefs.putBoolean(LIGHT_QSPANEL, isChecked); | ||
binding.enableDualTone.setEnabled(isChecked); | ||
new Handler(Looper.getMainLooper()).postDelayed(SystemUtil::handleSystemUIRestart, SWITCH_ANIMATION_DELAY); | ||
}); | ||
binding.lightThemeContainer.setOnClickListener(v -> { | ||
if (binding.enableLightTheme.isEnabled()) | ||
binding.enableLightTheme.toggle(); | ||
}); | ||
binding.enableDualTone.setEnabled(binding.enableLightTheme.isChecked()); | ||
|
||
// Dual Tone | ||
binding.enableDualTone.setChecked(RPrefs.getBoolean(DUALTONE_QSPANEL, false)); | ||
binding.enableDualTone.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
RPrefs.putBoolean(DUALTONE_QSPANEL, isChecked); | ||
new Handler(Looper.getMainLooper()).postDelayed(SystemUtil::doubleToggleDarkMode, SWITCH_ANIMATION_DELAY); | ||
}); | ||
|
||
binding.dualToneContainer.setOnClickListener(v -> { | ||
if (binding.enableDualTone.isEnabled()) | ||
binding.enableDualTone.toggle(); | ||
}); | ||
|
||
// Pixel Black Theme | ||
binding.enableBlackTheme.setChecked(RPrefs.getBoolean(BLACK_QSPANEL, false)); | ||
binding.enableBlackTheme.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
RPrefs.putBoolean(BLACK_QSPANEL, isChecked); | ||
new Handler(Looper.getMainLooper()).postDelayed(SystemUtil::handleSystemUIRestart, SWITCH_ANIMATION_DELAY); | ||
}); | ||
binding.blackThemeContainer.setOnClickListener(v -> { | ||
if (binding.enableBlackTheme.isEnabled()) | ||
binding.enableBlackTheme.toggle(); | ||
}); | ||
|
||
// Fluid QS Theme | ||
binding.enableFluidTheme.setChecked(RPrefs.getBoolean(FLUID_QSPANEL, false)); | ||
binding.enableFluidTheme.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
RPrefs.putBoolean(FLUID_QSPANEL, isChecked); | ||
binding.enableNotificationTransparency.setEnabled(isChecked); | ||
binding.enablePowermenuTransparency.setEnabled(isChecked); | ||
new Handler(Looper.getMainLooper()).postDelayed(SystemUtil::handleSystemUIRestart, SWITCH_ANIMATION_DELAY); | ||
}); | ||
binding.fluidThemeContainer.setOnClickListener(v -> { | ||
if (binding.enableFluidTheme.isEnabled()) | ||
binding.enableFluidTheme.toggle(); | ||
}); | ||
binding.enableNotificationTransparency.setEnabled(binding.enableFluidTheme.isChecked()); | ||
binding.enablePowermenuTransparency.setEnabled(binding.enableFluidTheme.isChecked()); | ||
|
||
// Fluid QS Notification Transparency | ||
binding.enableNotificationTransparency.setChecked(RPrefs.getBoolean(FLUID_NOTIF_TRANSPARENCY, false)); | ||
binding.enableNotificationTransparency.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
RPrefs.putBoolean(FLUID_NOTIF_TRANSPARENCY, isChecked); | ||
new Handler(Looper.getMainLooper()).postDelayed(SystemUtil::handleSystemUIRestart, SWITCH_ANIMATION_DELAY); | ||
}); | ||
binding.notificationTransparencyContainer.setOnClickListener(v -> { | ||
if (binding.enableNotificationTransparency.isEnabled()) | ||
binding.enableNotificationTransparency.toggle(); | ||
}); | ||
|
||
// Fluid QS Power Menu Transparency | ||
binding.enablePowermenuTransparency.setChecked(RPrefs.getBoolean(FLUID_POWERMENU_TRANSPARENCY, false)); | ||
binding.enablePowermenuTransparency.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
RPrefs.putBoolean(FLUID_POWERMENU_TRANSPARENCY, isChecked); | ||
new Handler(Looper.getMainLooper()).postDelayed(SystemUtil::handleSystemUIRestart, SWITCH_ANIMATION_DELAY); | ||
}); | ||
binding.powermenuTransparencyContainer.setOnClickListener(v -> { | ||
if (binding.enablePowermenuTransparency.isEnabled()) | ||
binding.enablePowermenuTransparency.toggle(); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M9.02,19.75C8.16,19.75 7.3,19.34 6.48,18.52L2.47,14.51C1.66,13.7 1.25,12.85 1.25,11.97C1.25,11.1 1.66,10.24 2.47,9.43L9.15,2.75C9.29,2.61 9.48,2.53 9.68,2.53C9.88,2.53 10.07,2.61 10.21,2.75L17.56,10.1C17.88,10.42 18.06,10.84 18.06,11.3C18.06,11.75 17.88,12.18 17.56,12.5L11.54,18.52C10.74,19.34 9.88,19.75 9.02,19.75ZM9.69,4.35L3.54,10.5C3.02,11.02 2.76,11.52 2.76,11.98C2.76,12.44 3.02,12.94 3.54,13.45L7.55,17.46C8.6,18.51 9.45,18.51 10.5,17.46L16.52,11.44C16.58,11.38 16.59,11.23 16.52,11.16L9.69,4.35Z" | ||
android:fillColor="#292D32"/> | ||
<path | ||
android:pathData="M9.689,4.04C9.499,4.04 9.309,3.97 9.159,3.82L7.819,2.48C7.529,2.19 7.529,1.71 7.819,1.42C8.109,1.13 8.589,1.13 8.879,1.42L10.219,2.76C10.509,3.05 10.509,3.53 10.219,3.82C10.069,3.97 9.879,4.04 9.689,4.04Z" | ||
android:fillColor="#292D32"/> | ||
<path | ||
android:pathData="M2.071,12.67C1.671,12.67 1.341,12.36 1.321,11.95C1.301,11.54 1.621,11.19 2.041,11.17L17.171,10.51C17.581,10.49 17.931,10.81 17.951,11.23C17.971,11.64 17.651,11.99 17.231,12.01L2.101,12.67C2.091,12.67 2.081,12.67 2.071,12.67Z" | ||
android:fillColor="#292D32"/> | ||
<path | ||
android:pathData="M16,22.75H3C2.59,22.75 2.25,22.41 2.25,22C2.25,21.59 2.59,21.25 3,21.25H16C16.41,21.25 16.75,21.59 16.75,22C16.75,22.41 16.41,22.75 16,22.75Z" | ||
android:fillColor="#292D32"/> | ||
<path | ||
android:pathData="M18.85,20.83C17.42,20.83 16.25,19.66 16.25,18.23C16.25,16.78 17.96,14.86 18.3,14.48C18.58,14.17 19.12,14.17 19.4,14.48C19.74,14.85 21.45,16.77 21.45,18.22C21.45,19.67 20.28,20.83 18.85,20.83ZM18.85,16.17C18.3,16.89 17.75,17.77 17.75,18.24C17.75,18.85 18.24,19.34 18.85,19.34C19.46,19.34 19.95,18.85 19.95,18.24C19.95,17.76 19.4,16.88 18.85,16.17Z" | ||
android:fillColor="#292D32"/> | ||
</vector> |
Oops, something went wrong.