Avoid multiple recreate() calls
This commit is contained in:
parent
2e034eb47a
commit
32c56ca3ae
2 changed files with 15 additions and 9 deletions
|
|
@ -22,6 +22,7 @@ public abstract class AbsBaseActivity extends AbsThemeActivity implements KabVie
|
|||
public static final int PERMISSION_REQUEST = 100;
|
||||
|
||||
private boolean areViewsEnabled;
|
||||
private boolean recreating;
|
||||
|
||||
private boolean createdWithPermissionsGranted;
|
||||
private String[] permissions;
|
||||
|
|
@ -66,12 +67,15 @@ public abstract class AbsBaseActivity extends AbsThemeActivity implements KabVie
|
|||
}
|
||||
|
||||
protected void postRecreate() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
recreate();
|
||||
}
|
||||
}, 200);
|
||||
if (!recreating) {
|
||||
recreating = true;
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
recreate();
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -287,9 +287,11 @@ public class PlaybackControlsFragment extends Fragment implements MusicServiceEv
|
|||
}
|
||||
|
||||
public void hide() {
|
||||
playPauseFab.setScaleX(0f);
|
||||
playPauseFab.setScaleY(0f);
|
||||
playPauseFab.setRotation(0f);
|
||||
if (playPauseFab != null) {
|
||||
playPauseFab.setScaleX(0f);
|
||||
playPauseFab.setScaleY(0f);
|
||||
playPauseFab.setRotation(0f);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateProgressSliderTint() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue