add extra bottom padding to time holder only if the device has software nav bar
This commit is contained in:
parent
813132acce
commit
ebcc328d2e
2 changed files with 11 additions and 4 deletions
|
@ -28,6 +28,11 @@ public class Utils {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean hasNavBar(Resources res) {
|
||||||
|
int id = res.getIdentifier("config_showNavigationBar", "bool", "android");
|
||||||
|
return id > 0 && res.getBoolean(id);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean hasStoragePermission(Context cxt) {
|
public static boolean hasStoragePermission(Context cxt) {
|
||||||
return ContextCompat.checkSelfPermission(cxt, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
return ContextCompat.checkSelfPermission(cxt, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,10 +105,12 @@ public class VideoFragment extends ViewPagerFragment
|
||||||
final int right = timeHolder.getPaddingRight();
|
final int right = timeHolder.getPaddingRight();
|
||||||
final int bottom = timeHolder.getPaddingBottom();
|
final int bottom = timeHolder.getPaddingBottom();
|
||||||
|
|
||||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
|
if (Utils.hasNavBar(res)) {
|
||||||
timeHolder.setPadding(left, top, right, bottom + height);
|
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||||
} else {
|
timeHolder.setPadding(left, top, right, bottom + height);
|
||||||
timeHolder.setPadding(left, top, right + height, bottom);
|
} else {
|
||||||
|
timeHolder.setPadding(left, top, right + height, bottom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currTimeView = (TextView) view.findViewById(R.id.video_curr_time);
|
currTimeView = (TextView) view.findViewById(R.id.video_curr_time);
|
||||||
|
|
Loading…
Reference in a new issue