@@ -350,30 +350,30 @@ public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Th
350
350
setClockSize ();
351
351
});
352
352
353
- // if (StatClock != null) {
354
- // try {
355
- //// StatClock
356
- //// .after("updateMinWidth")
357
- //// .run(param -> {
358
- //// // StatClock has a method to update the minimum width of the clock
359
- //// // we can use it to update the clock width
360
- //// // Based on our custom formats
361
- //// TextView tv = (TextView) param.thisObject;
362
- //// tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, mClockSize);
363
- //// if (!mShowSeconds) {
364
- //// float totalWidth = measureTextWithSpans();
365
- //// totalWidth += mClockView.getPaddingStart() ;
366
- //// totalWidth += mClockView.getPaddingEnd() ;
367
- //// int calculatedMinWidth = (int) totalWidth;
368
- //// if (tv.getMinimumWidth() != calculatedMinWidth) {
369
- //// tv.setMinimumWidth(calculatedMinWidth);
370
- //// }
371
- //// }
372
- //// });
373
- // } catch (Throwable ignored) {
374
- // log("updateMinWidth in StatClock not found");
375
- // }
376
- // }
353
+ if (StatClock != null ) {
354
+ try {
355
+ StatClock
356
+ .after ("updateMinWidth" )
357
+ .run (param -> {
358
+ // StatClock has a method to update the minimum width of the clock
359
+ // we can use it to update the clock width
360
+ // Based on our custom formats
361
+ TextView tv = (TextView ) param .thisObject ;
362
+ tv .setTextSize (TypedValue .COMPLEX_UNIT_SP , mClockSize );
363
+ if (!mShowSeconds ) {
364
+ float totalWidth = measureTextWithSpans ();
365
+ totalWidth += rightClockPadding ;
366
+ totalWidth += rightClockPadding * 2 ;
367
+ int calculatedMinWidth = (int ) totalWidth ;
368
+ if (tv .getMinimumWidth () != calculatedMinWidth ) {
369
+ tv .setMinimumWidth (calculatedMinWidth );
370
+ }
371
+ }
372
+ });
373
+ } catch (Throwable ignored ) {
374
+ log ("updateMinWidth in StatClock not found" );
375
+ }
376
+ }
377
377
378
378
CollapsedStatusBarFragmentClass
379
379
.after ("animateShow" )
0 commit comments