Skip to content

Commit

Permalink
fix: No ActionBar on DebugActivity when AppCompat is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
aikrq committed Dec 24, 2024
1 parent 09c05fb commit 2a5fc01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/a/a/a/Ix.java
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ public String a() {
XmlBuilder activityTag = new XmlBuilder("activity");
activityTag.addAttribute("android", "name", ".DebugActivity");
activityTag.addAttribute("android", "screenOrientation", "portrait");
activityTag.addAttribute("android", "theme", "@style/AppTheme.DebugActivity");
applicationTag.a(activityTag);
}
if (c.isAdMobEnabled) {
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/a/a/a/yq.java
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,11 @@ private String getXMLStyle() {
stylesFileBuilder.addStyle("AppTheme.AppBarOverlay", "ThemeOverlay.MaterialComponents.Dark.ActionBar");
stylesFileBuilder.addStyle("AppTheme.PopupOverlay", "ThemeOverlay.MaterialComponents.Light");
}
stylesFileBuilder.addStyle("AppTheme.DebugActivity", "AppTheme");
stylesFileBuilder.addItemToStyle("AppTheme.DebugActivity", "actionBarStyle", "@style/ThemeOverlay.MaterialComponents.ActionBar.Primary");
stylesFileBuilder.addItemToStyle("AppTheme.DebugActivity", "actionBarTheme", "@style/Widget.MaterialComponents.ActionBar.Primary");
stylesFileBuilder.addItemToStyle("AppTheme.DebugActivity", "windowActionBar", "true");
stylesFileBuilder.addItemToStyle("AppTheme.DebugActivity", "windowNoTitle", "false");
return CommandBlock.applyCommands("styles.xml", stylesFileBuilder.toCode());
} else {
XmlBuilderHelper stylesFileBuilder = new XmlBuilderHelper();
Expand All @@ -970,6 +975,7 @@ private String getXMLStyle() {
stylesFileBuilder.addItemToStyle("NoActionBar", "android:colorControlNormal", "@color/colorControlNormal");
stylesFileBuilder.addStyle("NoStatusBar", "AppTheme");
stylesFileBuilder.addItemToStyle("NoStatusBar", "android:windowFullscreen", "true");
stylesFileBuilder.addStyle("AppTheme.DebugActivity", "AppTheme");
return CommandBlock.applyCommands("styles.xml", stylesFileBuilder.toCode());
}
}
Expand Down

0 comments on commit 2a5fc01

Please sign in to comment.