本文整理汇总了Java中de.mrapp.android.util.ThemeUtil.getDimensionPixelSize方法的典型用法代码示例。如果您正苦于以下问题:Java ThemeUtil.getDimensionPixelSize方法的具体用法?Java ThemeUtil.getDimensionPixelSize怎么用?Java ThemeUtil.getDimensionPixelSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类de.mrapp.android.util.ThemeUtil
的用法示例。
在下文中一共展示了ThemeUtil.getDimensionPixelSize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWindowInsetsListener
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Creates a listener, which allows to apply the window insets to the tab switcher's padding.
*
* @return The listener, which has been created, as an instance of the type {@link
* OnApplyWindowInsetsListener}. The listener may not be nullFG
*/
@NonNull
private OnApplyWindowInsetsListener createWindowInsetsListener() {
return new OnApplyWindowInsetsListener() {
@Override
public WindowInsetsCompat onApplyWindowInsets(final View v,
final WindowInsetsCompat insets) {
int left = insets.getSystemWindowInsetLeft();
int top = insets.getSystemWindowInsetTop();
int right = insets.getSystemWindowInsetRight();
int bottom = insets.getSystemWindowInsetBottom();
tabSwitcher.setPadding(left, top, right, bottom);
float touchableAreaTop = top;
if (tabSwitcher.getLayout() == Layout.TABLET) {
touchableAreaTop += getResources()
.getDimensionPixelSize(R.dimen.tablet_tab_container_height);
}
RectF touchableArea = new RectF(left, touchableAreaTop,
getDisplayWidth(MainActivity.this) - right, touchableAreaTop +
ThemeUtil.getDimensionPixelSize(MainActivity.this, R.attr.actionBarSize));
tabSwitcher.addDragGesture(
new SwipeGesture.Builder().setTouchableArea(touchableArea).create());
tabSwitcher.addDragGesture(
new PullDownGesture.Builder().setTouchableArea(touchableArea).create());
return insets;
}
};
}
示例2: obtainButtonBarElevation
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the elevation of the button bar from the activity's current theme.
*/
private void obtainButtonBarElevation() {
int elevation;
try {
elevation = ThemeUtil
.getDimensionPixelSize(getActivity(), R.attr.restoreDefaultsButtonBarElevation);
} catch (NotFoundException e) {
elevation = getResources().getDimensionPixelSize(R.dimen.button_bar_elevation);
}
setButtonBarElevation(pixelsToDp(getActivity(), elevation));
}
示例3: obtainNavigationWidth
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the width of the navigation from the activity's theme.
*/
private void obtainNavigationWidth() {
int navigationWidth;
try {
navigationWidth = ThemeUtil.getDimensionPixelSize(this, R.attr.navigationWidth);
} catch (NotFoundException e) {
navigationWidth = getResources().getDimensionPixelSize(R.dimen.navigation_width);
}
setNavigationWidth(navigationWidth);
}
示例4: obtainToolbarElevation
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the elevation of the activity's toolbar from the activity's theme.
*/
private void obtainToolbarElevation() {
int elevation;
try {
elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.toolbarElevation);
} catch (NotFoundException e) {
elevation = getResources().getDimensionPixelSize(R.dimen.toolbar_elevation);
}
setToolbarElevation(pixelsToDp(this, elevation));
}
示例5: obtainBreadcrumbElevation
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the elevation of the toolbar, which is used to show the bread crumb of the currently
* selected preference fragment, when using the split screen layout.
*/
private void obtainBreadcrumbElevation() {
int elevation;
try {
elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.breadCrumbElevation);
} catch (NotFoundException e) {
elevation = getResources().getDimensionPixelSize(R.dimen.bread_crumb_toolbar_elevation);
}
setBreadCrumbElevation(pixelsToDp(this, elevation));
}
示例6: obtainCardViewElevation
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the elevation of the card view, which contains the currently shown preference
* fragment, when using the split screen layout, from the activity's theme.
*/
private void obtainCardViewElevation() {
int elevation;
try {
elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.cardViewElevation);
} catch (NotFoundException e) {
elevation = getResources().getDimensionPixelSize(R.dimen.card_view_elevation);
}
setCardViewElevation(pixelsToDp(this, elevation));
}
示例7: obtainButtonBarElevation
import de.mrapp.android.util.ThemeUtil; //导入方法依赖的package包/类
/**
* Obtains the elevation of the button bar, which is shown when using the activity as a wizard,
* from the activity's theme.
*/
private void obtainButtonBarElevation() {
int elevation;
try {
elevation = ThemeUtil.getDimensionPixelSize(this, R.attr.buttonBarElevation);
} catch (NotFoundException e) {
elevation = getResources().getDimensionPixelSize(R.dimen.button_bar_elevation);
}
setButtonBarElevation(pixelsToDp(this, elevation));
}