Skip to content

Commit

Permalink
Merge pull request #156 from rom4ster/develop
Browse files Browse the repository at this point in the history
Fix Not Working On Lock Screen
  • Loading branch information
KieronQuinn authored Oct 15, 2024
2 parents 32dd708 + 25dc533 commit 32ff7c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@
android:theme="@style/Theme.ClassicPowerMenu.Fullscreen"
android:noHistory="true"
android:exported="true"
android:showOnLockScreen="true"
android:launchMode="singleInstance"
android:showOnLockScreen="true"
android:showWhenLocked="true"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.kieronquinn.app.classicpowermenu.ui.activities

import android.app.KeyguardManager
import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.transition.Fade
Expand Down Expand Up @@ -38,6 +40,8 @@ class PowerMenuActivity : MonetCompatActivity(), PowerMenuStarter.PowerMenuStart
window.enterTransition = Fade()
window.reenterTransition = Fade()
window.setupWindowFlags()
setShowWhenLocked(true)
setTurnScreenOn(true)
super.onCreate(savedInstanceState)
requestedOrientation = viewModel.getRequestedOrientation()
hideStatusBar()
Expand Down Expand Up @@ -99,10 +103,10 @@ class PowerMenuActivity : MonetCompatActivity(), PowerMenuStarter.PowerMenuStart
}

private fun Window.setupWindowFlags(){
addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED)
addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON)
addFlags(WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON)
//addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED)
//addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
//addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON)
//addFlags(WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON)
}

private fun Window.setupLayout(){
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencyResolutionManagement {
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter()
maven { url 'https://api.xposed.info/' }
}
}
rootProject.name = "Classic Power Menu"
Expand Down

0 comments on commit 32ff7c0

Please sign in to comment.