Animate and Screen rotation
See original GitHub issueЗдравствуйте! При повороте экрана приложение вылетает без каких либо сообщений в лог.
LoginView
public interface LoginView extends MvpView {
void showLoginScreen();
void showRegisterScreen();
}
LoginPresenter
@InjectViewState
public class LoginPresenter extends MvpPresenter<LoginView> {
public LoginPresenter() { }
public void changeScreen(int screen) {
if (screen==0){
getViewState().showLoginScreen();
}else{
getViewState().showRegisterScreen();
}
}
}
ActivityLogin
public class ActivityLogin extends MvpAppCompatActivity implements LoginView {
@InjectPresenter
LoginPresenter pLoginPresenter;
@Bind(R.id.tvBottomMessage_login) TextView tvBottomMessage_login;
@Bind(R.id.tvBottomMessage_register) TextView tvBottomMessage_register;
@Bind(R.id.rlLogin) View myViewLog;
@Bind(R.id.rlRegister) View myViewReg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
tvBottomMessage_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
pLoginPresenter.changeScreen(1);
}
});
tvBottomMessage_register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
pLoginPresenter.changeScreen(0);
}
});
}
@Override
public void showLoginScreen() {
int finalRadius2 = Math.max(myViewLog.getWidth(), myViewLog.getHeight());
Animator anim = ViewAnimationUtils.createCircularReveal(myViewLog, myViewLog.getWidth() / 2, myViewLog.getHeight(), 0, finalRadius2);
myViewReg.setZ(0);
myViewLog.setZ(1);
anim.start();
}
@Override
public void showRegisterScreen() {
int finalRadius2 = Math.max(myViewReg.getWidth(), myViewReg.getHeight());
Animator anim = ViewAnimationUtils.createCircularReveal(myViewReg, myViewReg.getWidth() / 2, myViewReg.getHeight(), 0, finalRadius2);
myViewReg.setZ(1);
myViewLog.setZ(0);
anim.start();
}
}
Не могу понять, как сохранить текущий вид, для его последующего отображения после поворота экрана.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10
Top Results From Across the Web
How do I reset the stage rotation?! - Adobe Support Community
Press Ctrl + 0 (Win) or Cmd + 0 (Mac). Likes.
Read more >CSS3 Rotate Animation - Stack Overflow
I have a rotating image using the same thing as you: .knoop1 img{ position:absolute; width:114px; height:114px; top:400px; margin:0 auto; ...
Read more >Rotation in animations - Unity - Manual
Animation from external sources often contains rotational keyframeA frame that marks the start or end point of a transition in an animation. Frames...
Read more >Rotate Phone on Lottiefiles. Free Lottie Animation
Ever needed to someone to rotate their phone to get a landscape experience? Do it with this.. Use on your web, react, flutter,...
Read more >Android needs to improve the screen rotation animation. - Reddit
Or, speed up overall screen rotation. Even with animations disabled, you can be sitting there for a second or two just waiting.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There has two solution:
id
to EditText field(much simply)getViewState().setText(text)
and make special strategy for this command likeDeleteAfterExecuteStrategy
that delete this command inafterApply