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;
|
public static final int PERMISSION_REQUEST = 100;
|
||||||
|
|
||||||
private boolean areViewsEnabled;
|
private boolean areViewsEnabled;
|
||||||
|
private boolean recreating;
|
||||||
|
|
||||||
private boolean createdWithPermissionsGranted;
|
private boolean createdWithPermissionsGranted;
|
||||||
private String[] permissions;
|
private String[] permissions;
|
||||||
|
|
@ -66,6 +67,8 @@ public abstract class AbsBaseActivity extends AbsThemeActivity implements KabVie
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void postRecreate() {
|
protected void postRecreate() {
|
||||||
|
if (!recreating) {
|
||||||
|
recreating = true;
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
@ -73,6 +76,7 @@ public abstract class AbsBaseActivity extends AbsThemeActivity implements KabVie
|
||||||
}
|
}
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchKeyEvent(@NonNull KeyEvent event) {
|
public boolean dispatchKeyEvent(@NonNull KeyEvent event) {
|
||||||
|
|
|
||||||
|
|
@ -287,10 +287,12 @@ public class PlaybackControlsFragment extends Fragment implements MusicServiceEv
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hide() {
|
public void hide() {
|
||||||
|
if (playPauseFab != null) {
|
||||||
playPauseFab.setScaleX(0f);
|
playPauseFab.setScaleX(0f);
|
||||||
playPauseFab.setScaleY(0f);
|
playPauseFab.setScaleY(0f);
|
||||||
playPauseFab.setRotation(0f);
|
playPauseFab.setRotation(0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void updateProgressSliderTint() {
|
private void updateProgressSliderTint() {
|
||||||
int color = ColorUtil.getPrimaryTextColor(getContext(), false);
|
int color = ColorUtil.getPrimaryTextColor(getContext(), false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue