Skip to content

Commit

Permalink
Custom charging icon not going away when not charging
Browse files Browse the repository at this point in the history
  • Loading branch information
DHD2280 committed Apr 25, 2024
1 parent ee2aba6 commit 9bad538
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
double distanceFromCenter = Math.sqrt(distanceX * distanceX + distanceY * distanceY);

if (distanceFromCenter <= radius) {
Object mTouchEventListener = getObjectField(param.thisObject, "mTouchEventListener");

if (useAuthForAdvancedReboot && ((BiometricManager) mContext.getSystemService(BiometricManager.class)).canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG) == BiometricManager.BIOMETRIC_SUCCESS) {
showAuth();
Expand Down Expand Up @@ -184,7 +183,6 @@ private void showAuth() {
private void showDialog() throws Exception {
log("Oxygen Customizer - Advanced Reboot Dialog");
final AlertDialog dialog = (AlertDialog) SystemUIDialogClass.getConstructor(Context.class).newInstance(mContext);
//final AlertDialog dialog = (AlertDialog) OplusThemeSystemUiDialog.getConstructor(Context.class, int.class).newInstance(mContext, ResourcesCompat.get);
dialog.setTitle(modRes.getString(R.string.advanced_reboot_title));
ListView listView = new ListView(mContext);
ArrayAdapter<String> adapter = new ArrayAdapter<>(mContext, android.R.layout.simple_list_item_1);
Expand Down Expand Up @@ -223,9 +221,6 @@ private void drawAdvancedReboot(Canvas canvas, Object param) {
textPaint.setTextAlign(Paint.Align.CENTER);

int viewWidth = (int) callMethod(param, "getWidth");
int viewHeight = (int) callMethod(param, "getHeight");

int buttonWidth = dp2px(mContext, 150);

radius = mContext.getResources().getDimensionPixelSize(
mContext.getResources().getIdentifier("oplus_default_bar_radius", "dimen", listenPackage));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
lp.setMargins(left, 0, right, mContext.getResources().getDimensionPixelSize(mContext.getResources().getIdentifier("battery_margin_bottom", "dimen", mContext.getPackageName())));
mStockChargingIcon.setLayoutParams(lp);
}
} else {
mStockChargingIcon.setVisibility(View.GONE);
}
}
}
Expand Down

0 comments on commit 9bad538

Please sign in to comment.