mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
use isBigScreen and isLandscape attrs
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- in small devices (e.i. not tablets) in landscape height is low, better enter fullscreen -->
|
||||
<bool name="webxdcFullscreen">true</bool>
|
||||
<bool name="isLandscape">true</bool>
|
||||
</resources>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- if the device is big enough (ex. a tablet), there is no need to enter fullscreen -->
|
||||
<bool name="webxdcFullscreen">false</bool>
|
||||
<bool name="isBigScreen">true</bool>
|
||||
</resources>
|
||||
|
||||
@@ -258,6 +258,7 @@
|
||||
<attr name="compact" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<!-- in portrait mode there is enough height, no need to enter fullscreen -->
|
||||
<bool name="webxdcFullscreen">false</bool>
|
||||
<bool name="isLandscape">false</bool>
|
||||
<!-- if the device is big enough (ex. a tablet) -->
|
||||
<bool name="isBigScreen">false</bool>
|
||||
</resources>
|
||||
|
||||
@@ -214,7 +214,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
|
||||
private void setScreenMode() {
|
||||
// enter/exit fullscreen mode depending on orientation (landscape/portrait),
|
||||
// on tablets there is enought height so fullscreen mode is never enabled there
|
||||
boolean enable = getResources().getBoolean(R.bool.webxdcFullscreen);
|
||||
boolean enable = getResources().getBoolean(R.bool.isLandscape) && !getResources().getBoolean(R.bool.isBigScreen);
|
||||
getWindow().getDecorView().setSystemUiVisibility(enable? View.SYSTEM_UI_FLAG_FULLSCREEN : 0);
|
||||
if (enable) {
|
||||
getSupportActionBar().hide();
|
||||
|
||||
Reference in New Issue
Block a user