Created
October 23, 2017 08:20
-
-
Save THEb0nny/5ab7ce69c8a11f58e1d59c143b67847a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onConfigurationChanged(Configuration newConfig) { | |
super.onConfigurationChanged(newConfig); | |
Log.d("Orientation", "Config changed"); | |
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE || newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { | |
SharedPref.orient = SharedPref.getRotateOrientation(OverlayNavRingService.context); // Вызовем метод, который скажет в какой ориентации точно | |
SharedPref.displayMetric(); // Нужно же новые параметры размера записать после смены ориентации | |
refreshNavRingView(); | |
} | |
} | |
public void refreshNavRingView() { | |
Log.d("refreshNavRingView", "refreshNavRingView called"); | |
try { Thread.sleep(2000); } | |
catch (InterruptedException e) { e.printStackTrace(); } | |
setNavRingViewState(View.VISIBLE); | |
try { Thread.sleep(2000); } | |
catch (InterruptedException e) { e.printStackTrace(); } | |
setNavRingViewState(View.GONE); | |
Log.d("refreshNavRingView", "kek"); | |
} | |
private void setNavRingViewState(int state) { | |
Message navRingViewState = new Message(); | |
navRingViewState.obj = state; | |
OverlayNavRingService.handlerNavRingView.sendMessage(navRingViewState); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment