Skip to content

Commit

Permalink
Experimental: Port colorized notification from Pengeek to AOSP Roms
Browse files Browse the repository at this point in the history
Co-authored-by: MonwF <[email protected]>
Signed-off-by: DrDisagree <[email protected]>
  • Loading branch information
Mahmud0808 and MonwF committed Jan 3, 2025
1 parent beaca2d commit f88ed85
Show file tree
Hide file tree
Showing 6 changed files with 398 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ object Preferences {
const val LSCLOCK_FONT_TEXT_SCALING = "xposed_lockscreenclocktextscaling"
const val LSCLOCK_USERNAME = "xposed_lockscreenclockcustomusername"
const val LSCLOCK_DEVICENAME = "xposed_lockscreenclockcustomdevicename"
const val COLORED_NOTIFICATION_VIEW_SWITCH = "xposed_colorednotificationview"

// LS Widgets
const val LOCKSCREEN_WIDGETS_ENABLED: String = "lockscreen_widgets_enabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import android.content.Intent
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand All @@ -21,7 +19,7 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
import com.drdisagree.iconify.R
import com.drdisagree.iconify.common.Const.SWITCH_ANIMATION_DELAY
import com.drdisagree.iconify.common.Preferences.COLORED_NOTIFICATION_VIEW_SWITCH
import com.drdisagree.iconify.common.Preferences.HEADER_IMAGE_OVERLAP
import com.drdisagree.iconify.common.Preferences.HIDE_DATA_DISABLED_ICON
import com.drdisagree.iconify.common.Preferences.OP_QS_HEADER_GAP_EXPANDED
Expand All @@ -34,7 +32,6 @@ import com.drdisagree.iconify.ui.activities.MainActivity
import com.drdisagree.iconify.ui.base.BaseFragment
import com.drdisagree.iconify.ui.dialogs.EditTextDialog
import com.drdisagree.iconify.ui.utils.ViewHelper.setHeader
import com.drdisagree.iconify.utils.SystemUtils
import com.google.android.material.slider.Slider
import kotlin.random.Random

Expand Down Expand Up @@ -72,9 +69,9 @@ class Experimental : BaseFragment() {
binding.headerImageOverlap.setSwitchChangeListener { _: CompoundButton?, isChecked: Boolean ->
putBoolean(HEADER_IMAGE_OVERLAP, isChecked)

Handler(Looper.getMainLooper()).postDelayed(
{ SystemUtils.restartSystemUI() },
SWITCH_ANIMATION_DELAY
MainActivity.showOrHidePendingActionButton(
activityBinding = (requireActivity() as MainActivity).binding,
requiresSystemUiRestart = true
)
}

Expand All @@ -84,6 +81,18 @@ class Experimental : BaseFragment() {
putBoolean(HIDE_DATA_DISABLED_ICON, isChecked)
}

// Header image overlap
binding.colorizeNotificationView.isSwitchChecked =
getBoolean(COLORED_NOTIFICATION_VIEW_SWITCH, false)
binding.colorizeNotificationView.setSwitchChangeListener { _: CompoundButton?, isChecked: Boolean ->
putBoolean(COLORED_NOTIFICATION_VIEW_SWITCH, isChecked)

MainActivity.showOrHidePendingActionButton(
activityBinding = (requireActivity() as MainActivity).binding,
requiresSystemUiRestart = true
)
}

// OP QS Header Gap Expanded
binding.opQsGapExpanded.apply {
visibility = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/drdisagree/iconify/xposed/EntryList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.drdisagree.iconify.common.Const.PIXEL_LAUNCHER_PACKAGE
import com.drdisagree.iconify.common.Const.SYSTEMUI_PACKAGE
import com.drdisagree.iconify.xposed.modules.BackgroundChip
import com.drdisagree.iconify.xposed.modules.BatteryStyleManager
import com.drdisagree.iconify.xposed.modules.ColorizeNotification
import com.drdisagree.iconify.xposed.modules.ControllersProvider
import com.drdisagree.iconify.xposed.modules.DepthWallpaper
import com.drdisagree.iconify.xposed.modules.DepthWallpaperA14
Expand Down Expand Up @@ -52,7 +53,8 @@ object EntryList {
QuickSettings::class.java,
Statusbar::class.java,
BatteryStyleManager::class.java,
VolumePanel::class.java
VolumePanel::class.java,
ColorizeNotification::class.java
)

private val systemUiAndroid12ModPacks = listOf(
Expand Down
Loading

0 comments on commit f88ed85

Please sign in to comment.