mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
remove unnecessary attribute isLandscape
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<bool name="isLandscape">true</bool>
|
||||
</resources>
|
||||
@@ -265,7 +265,6 @@
|
||||
<attr name="compact" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<bool name="isLandscape">false</bool>
|
||||
<!-- if the device is big enough (ex. a tablet) -->
|
||||
<bool name="isBigScreen">false</bool>
|
||||
</resources>
|
||||
|
||||
@@ -106,7 +106,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
|
||||
|
||||
// enter fullscreen mode if necessary,
|
||||
// this is needed here because if the app is opened while already in landscape mode, onConfigurationChanged() is not triggered
|
||||
setScreenMode();
|
||||
setScreenMode(getResources().getConfiguration());
|
||||
|
||||
webView.setWebChromeClient(new WebChromeClient() {
|
||||
@Override
|
||||
@@ -212,13 +212,13 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
|
||||
Log.i(TAG, "onConfigurationChanged(" + newConfig.orientation + ")");
|
||||
super.onConfigurationChanged(newConfig);
|
||||
// orientation might have changed, enter/exit fullscreen mode if needed
|
||||
setScreenMode();
|
||||
setScreenMode(newConfig);
|
||||
}
|
||||
|
||||
private void setScreenMode() {
|
||||
private void setScreenMode(Configuration config) {
|
||||
// enter/exit fullscreen mode depending on orientation (landscape/portrait),
|
||||
// on tablets there is enough height so fullscreen mode is never enabled there
|
||||
boolean enable = getResources().getBoolean(R.bool.isLandscape) && !getResources().getBoolean(R.bool.isBigScreen);
|
||||
boolean enable = config.orientation == Configuration.ORIENTATION_LANDSCAPE && !getResources().getBoolean(R.bool.isBigScreen);
|
||||
getWindow().getDecorView().setSystemUiVisibility(enable? View.SYSTEM_UI_FLAG_FULLSCREEN : 0);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
|
||||
Reference in New Issue
Block a user