mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-01-20 20:18:35 +01:00
fixed tablet mode option on 7 inch tablets
This commit is contained in:
parent
bb59fdd684
commit
998f6db124
@ -34,8 +34,8 @@ android {
|
||||
applicationId "org.mariotaku.twidere"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 25
|
||||
versionCode 282
|
||||
versionName '3.4.20'
|
||||
versionCode 283
|
||||
versionName '3.4.21'
|
||||
multiDexEnabled true
|
||||
|
||||
buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("true")'
|
||||
|
@ -1228,8 +1228,7 @@ public final class Utils implements Constants {
|
||||
*/
|
||||
public static boolean isScreenTablet(@NonNull Context context) {
|
||||
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
|
||||
final float mw = Math.min(metrics.widthPixels / metrics.density, metrics.heightPixels / metrics.density);
|
||||
return mw >= 600;
|
||||
return metrics.widthPixels / metrics.density >= 600;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -870,7 +870,7 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
||||
|
||||
|
||||
fun hasMultiColumns(): Boolean {
|
||||
if (!Utils.isScreenTablet(this)) return false
|
||||
if (!Utils.isDeviceTablet(this) || !Utils.isScreenTablet(this)) return false
|
||||
if (resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
return preferences.getBoolean("multi_column_tabs_landscape", resources.getBoolean(R.bool.default_multi_column_tabs_land))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user