Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,16 @@ public class AppPlugin extends Plugin {
public void load() {
boolean disableBackButtonHandler = getConfig().getBoolean("disableBackButtonHandler", false);

bridge
.getApp()
.setStatusChangeListener((isActive) -> {
Logger.debug(getLogTag(), "Firing change: " + isActive);
JSObject data = new JSObject();
data.put("isActive", isActive);
notifyListeners(EVENT_STATE_CHANGE, data, false);
});
bridge
.getApp()
.setAppRestoredListener((result) -> {
Logger.debug(getLogTag(), "Firing restored result");
notifyListeners(EVENT_RESTORED_RESULT, result.getWrappedResult(), true);
});
bridge.getApp().setStatusChangeListener((isActive) -> {
Logger.debug(getLogTag(), "Firing change: " + isActive);
JSObject data = new JSObject();
data.put("isActive", isActive);
notifyListeners(EVENT_STATE_CHANGE, data, false);
});
bridge.getApp().setAppRestoredListener((result) -> {
Logger.debug(getLogTag(), "Firing restored result");
notifyListeners(EVENT_RESTORED_RESULT, result.getWrappedResult(), true);
});
this.onBackPressedCallback = new OnBackPressedCallback(!disableBackButtonHandler) {
@Override
public void handleOnBackPressed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

@CapacitorPlugin(
name = "LocalNotifications",
permissions = @Permission(strings = { Manifest.permission.POST_NOTIFICATIONS }, alias = LocalNotificationsPlugin.LOCAL_NOTIFICATIONS)
permissions = @Permission(strings = {Manifest.permission.POST_NOTIFICATIONS}, alias = LocalNotificationsPlugin.LOCAL_NOTIFICATIONS)
)
public class LocalNotificationsPlugin extends Plugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

@CapacitorPlugin(
name = "PushNotifications",
permissions = @Permission(strings = { Manifest.permission.POST_NOTIFICATIONS }, alias = PushNotificationsPlugin.PUSH_NOTIFICATIONS)
permissions = @Permission(strings = {Manifest.permission.POST_NOTIFICATIONS}, alias = PushNotificationsPlugin.PUSH_NOTIFICATIONS)
)
public class PushNotificationsPlugin extends Plugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,14 @@ public boolean onPreDraw() {
if (!isVisible && !isHiding) {
isVisible = true;

new Handler(context.getMainLooper()).postDelayed(
() -> {
// Splash screen is done... start drawing content.
if (settings.isAutoHide()) {
isVisible = false;
onPreDrawListener = null;
content.getViewTreeObserver().removeOnPreDrawListener(this);
}
},
settings.getShowDuration()
);
new Handler(context.getMainLooper()).postDelayed(() -> {
// Splash screen is done... start drawing content.
if (settings.isAutoHide()) {
isVisible = false;
onPreDrawListener = null;
content.getViewTreeObserver().removeOnPreDrawListener(this);
}
}, settings.getShowDuration());
}

// Not ready to dismiss splash screen
Expand Down Expand Up @@ -225,16 +222,13 @@ private void showDialog(
isVisible = true;

if (settings.isAutoHide()) {
new Handler(context.getMainLooper()).postDelayed(
() -> {
hideDialog(activity, isLaunchSplash);
new Handler(context.getMainLooper()).postDelayed(() -> {
hideDialog(activity, isLaunchSplash);

if (splashListener != null) {
splashListener.completed();
}
},
settings.getShowDuration()
);
if (splashListener != null) {
splashListener.completed();
}
}, settings.getShowDuration());
} else {
// If no autoHide, call complete
if (splashListener != null) {
Expand Down Expand Up @@ -344,12 +338,12 @@ private void buildViews() {
Integer spinnerBarColor = config.getSpinnerColor();
if (spinnerBarColor != null) {
int[][] states = new int[][] {
new int[] { android.R.attr.state_enabled }, // enabled
new int[] { -android.R.attr.state_enabled }, // disabled
new int[] { -android.R.attr.state_checked }, // unchecked
new int[] { android.R.attr.state_pressed } // pressed
new int[] {android.R.attr.state_enabled}, // enabled
new int[] {-android.R.attr.state_enabled}, // disabled
new int[] {-android.R.attr.state_checked}, // unchecked
new int[] {android.R.attr.state_pressed} // pressed
};
int[] colors = new int[] { spinnerBarColor, spinnerBarColor, spinnerBarColor, spinnerBarColor };
int[] colors = new int[] {spinnerBarColor, spinnerBarColor, spinnerBarColor, spinnerBarColor};
ColorStateList colorStateList = new ColorStateList(states, colors);
spinnerBar.setIndeterminateTintList(colorStateList);
}
Expand Down Expand Up @@ -397,16 +391,13 @@ public void onAnimationEnd(Animator animator) {
isVisible = true;

if (settings.isAutoHide()) {
new Handler(context.getMainLooper()).postDelayed(
() -> {
hide(settings.getFadeOutDuration(), isLaunchSplash);
new Handler(context.getMainLooper()).postDelayed(() -> {
hide(settings.getFadeOutDuration(), isLaunchSplash);

if (splashListener != null) {
splashListener.completed();
}
},
settings.getShowDuration()
);
if (splashListener != null) {
splashListener.completed();
}
}, settings.getShowDuration());
} else {
// If no autoHide, call complete
if (splashListener != null) {
Expand Down
Loading