Skip to content

Commit 44d1c7a

Browse files
committed
chore: format java code
1 parent 63c874c commit 44d1c7a

4 files changed

Lines changed: 37 additions & 50 deletions

File tree

‎app/android/src/main/java/com/capacitorjs/plugins/app/AppPlugin.java‎

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,16 @@ public class AppPlugin extends Plugin {
3333
public void load() {
3434
boolean disableBackButtonHandler = getConfig().getBoolean("disableBackButtonHandler", false);
3535

36-
bridge
37-
.getApp()
38-
.setStatusChangeListener((isActive) -> {
39-
Logger.debug(getLogTag(), "Firing change: " + isActive);
40-
JSObject data = new JSObject();
41-
data.put("isActive", isActive);
42-
notifyListeners(EVENT_STATE_CHANGE, data, false);
43-
});
44-
bridge
45-
.getApp()
46-
.setAppRestoredListener((result) -> {
47-
Logger.debug(getLogTag(), "Firing restored result");
48-
notifyListeners(EVENT_RESTORED_RESULT, result.getWrappedResult(), true);
49-
});
36+
bridge.getApp().setStatusChangeListener((isActive) -> {
37+
Logger.debug(getLogTag(), "Firing change: " + isActive);
38+
JSObject data = new JSObject();
39+
data.put("isActive", isActive);
40+
notifyListeners(EVENT_STATE_CHANGE, data, false);
41+
});
42+
bridge.getApp().setAppRestoredListener((result) -> {
43+
Logger.debug(getLogTag(), "Firing restored result");
44+
notifyListeners(EVENT_RESTORED_RESULT, result.getWrappedResult(), true);
45+
});
5046
this.onBackPressedCallback = new OnBackPressedCallback(!disableBackButtonHandler) {
5147
@Override
5248
public void handleOnBackPressed() {

‎local-notifications/android/src/main/java/com/capacitorjs/plugins/localnotifications/LocalNotificationsPlugin.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
@CapacitorPlugin(
3434
name = "LocalNotifications",
35-
permissions = @Permission(strings = { Manifest.permission.POST_NOTIFICATIONS }, alias = LocalNotificationsPlugin.LOCAL_NOTIFICATIONS)
35+
permissions = @Permission(strings = {Manifest.permission.POST_NOTIFICATIONS}, alias = LocalNotificationsPlugin.LOCAL_NOTIFICATIONS)
3636
)
3737
public class LocalNotificationsPlugin extends Plugin {
3838

‎push-notifications/android/src/main/java/com/capacitorjs/plugins/pushnotifications/PushNotificationsPlugin.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
@CapacitorPlugin(
2828
name = "PushNotifications",
29-
permissions = @Permission(strings = { Manifest.permission.POST_NOTIFICATIONS }, alias = PushNotificationsPlugin.PUSH_NOTIFICATIONS)
29+
permissions = @Permission(strings = {Manifest.permission.POST_NOTIFICATIONS}, alias = PushNotificationsPlugin.PUSH_NOTIFICATIONS)
3030
)
3131
public class PushNotificationsPlugin extends Plugin {
3232

‎splash-screen/android/src/main/java/com/capacitorjs/plugins/splashscreen/SplashScreen.java‎

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,14 @@ public boolean onPreDraw() {
138138
if (!isVisible && !isHiding) {
139139
isVisible = true;
140140

141-
new Handler(context.getMainLooper()).postDelayed(
142-
() -> {
143-
// Splash screen is done... start drawing content.
144-
if (settings.isAutoHide()) {
145-
isVisible = false;
146-
onPreDrawListener = null;
147-
content.getViewTreeObserver().removeOnPreDrawListener(this);
148-
}
149-
},
150-
settings.getShowDuration()
151-
);
141+
new Handler(context.getMainLooper()).postDelayed(() -> {
142+
// Splash screen is done... start drawing content.
143+
if (settings.isAutoHide()) {
144+
isVisible = false;
145+
onPreDrawListener = null;
146+
content.getViewTreeObserver().removeOnPreDrawListener(this);
147+
}
148+
}, settings.getShowDuration());
152149
}
153150

154151
// Not ready to dismiss splash screen
@@ -225,16 +222,13 @@ private void showDialog(
225222
isVisible = true;
226223

227224
if (settings.isAutoHide()) {
228-
new Handler(context.getMainLooper()).postDelayed(
229-
() -> {
230-
hideDialog(activity, isLaunchSplash);
225+
new Handler(context.getMainLooper()).postDelayed(() -> {
226+
hideDialog(activity, isLaunchSplash);
231227

232-
if (splashListener != null) {
233-
splashListener.completed();
234-
}
235-
},
236-
settings.getShowDuration()
237-
);
228+
if (splashListener != null) {
229+
splashListener.completed();
230+
}
231+
}, settings.getShowDuration());
238232
} else {
239233
// If no autoHide, call complete
240234
if (splashListener != null) {
@@ -344,12 +338,12 @@ private void buildViews() {
344338
Integer spinnerBarColor = config.getSpinnerColor();
345339
if (spinnerBarColor != null) {
346340
int[][] states = new int[][] {
347-
new int[] { android.R.attr.state_enabled }, // enabled
348-
new int[] { -android.R.attr.state_enabled }, // disabled
349-
new int[] { -android.R.attr.state_checked }, // unchecked
350-
new int[] { android.R.attr.state_pressed } // pressed
341+
new int[] {android.R.attr.state_enabled}, // enabled
342+
new int[] {-android.R.attr.state_enabled}, // disabled
343+
new int[] {-android.R.attr.state_checked}, // unchecked
344+
new int[] {android.R.attr.state_pressed} // pressed
351345
};
352-
int[] colors = new int[] { spinnerBarColor, spinnerBarColor, spinnerBarColor, spinnerBarColor };
346+
int[] colors = new int[] {spinnerBarColor, spinnerBarColor, spinnerBarColor, spinnerBarColor};
353347
ColorStateList colorStateList = new ColorStateList(states, colors);
354348
spinnerBar.setIndeterminateTintList(colorStateList);
355349
}
@@ -397,16 +391,13 @@ public void onAnimationEnd(Animator animator) {
397391
isVisible = true;
398392

399393
if (settings.isAutoHide()) {
400-
new Handler(context.getMainLooper()).postDelayed(
401-
() -> {
402-
hide(settings.getFadeOutDuration(), isLaunchSplash);
394+
new Handler(context.getMainLooper()).postDelayed(() -> {
395+
hide(settings.getFadeOutDuration(), isLaunchSplash);
403396

404-
if (splashListener != null) {
405-
splashListener.completed();
406-
}
407-
},
408-
settings.getShowDuration()
409-
);
397+
if (splashListener != null) {
398+
splashListener.completed();
399+
}
400+
}, settings.getShowDuration());
410401
} else {
411402
// If no autoHide, call complete
412403
if (splashListener != null) {

0 commit comments

Comments
 (0)