Автомобиль мигает справа, прежде чем он начинает анимацию.Это прекрасно работает в устройствах Android, хотя.И значок приложения отображается перед заставкой, а это не то, что я хочу.Как я могу заставить его работать?
Посмотрите видео здесь
Код:
public void start() {
if (current != null) {
current.show();
return;
}
showSplashForm1();
}
private void showSplashForm1() {
Form splashForm = new Form(new BorderLayout(BorderLayout.CENTER_BEHAVIOR_CENTER));
Container parentContainer = new Container(BoxLayout.y());
splashForm.add(BorderLayout.CENTER, parentContainer);
Label logoLabel = new Label(theme.getImage("logoMain.png").scaledWidth(screenWidth * 3 / 4));
parentContainer.add(logoLabel);
Label carLabel = new Label();
Container carContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
carContainer.add(carLabel);
carLabel.setVisible(false); //added this line for iOS splash screenshots
Image carImage = (Image) theme.getImage("car_static.gif");
Timeline tcar = (Timeline) carImage;
carLabel.setIcon(tcar);
Label loadingLabel = new Label();
Image loadingImage = (Image) theme.getImage("dots_min_time.gif");
Timeline tloading = (Timeline) loadingImage;
loadingLabel.setIcon(tloading);
Container animateContainer = BoxLayout.encloseY(carContainer, loadingLabel);
splashForm.add(BorderLayout.SOUTH, animateContainer);
Display.getInstance().scheduleBackgroundTask(new Runnable() {
@Override
public void run() {
testDriveAndBookingAndContactStorage(splashForm);
}
});
splashForm.show();
splashForm.revalidate();
//car animation starts
carLabel.setX(-screenWidth);
//carLabel.setVisible(true);
carLabel.setVisible(BrowserComponent.isNativeBrowserSupported()); //updated
carContainer.animateLayout(4200);
splashForm.setTransitionOutAnimator(CommonTransitions.createFastSlide(CommonTransitions.SLIDE_VERTICAL, true, 500));
new UITimer(new Runnable() {
public void run() {
carLabel.setHidden(true);
if (Preferences.get(AllUrl.customerId, null) != null) {
new Home(theme).show();
} else {
new LoginAndSignUp(theme, "").show();
}
}
}).schedule(4200, false, splashForm);
}