本文整理了Java中android.support.v7.widget.Toolbar.getParent()
方法的一些代码示例,展示了Toolbar.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.getParent()
方法的具体详情如下:
包路径:android.support.v7.widget.Toolbar
类名称:Toolbar
方法名:getParent
暂无
代码示例来源:origin: florent37/MaterialViewPager
private MaterialViewPagerHeader(Toolbar toolbar) {
this.toolbar = toolbar;
this.context = toolbar.getContext();
this.toolbarLayout = (View) toolbar.getParent();
}
代码示例来源:origin: jorgegil96/All-NBA
private void expandToolbar() {
if (toolbar.getParent() instanceof AppBarLayout) {
((AppBarLayout) toolbar.getParent()).setExpanded(true, true);
}
}
代码示例来源:origin: XiqingLiu/JesMVP
/**
* 设置Toolbar滑动Flag
*
* @param flag
*/
public void setToolBarScrollFlag(int flag) {
AppBarLayout.LayoutParams params =
(AppBarLayout.LayoutParams) ((View) (mToolBar.getParent())).getLayoutParams();
params.setScrollFlags(flag);
}
代码示例来源:origin: garretyoder/app-theme-engine
@SuppressWarnings("unchecked")
public static void themeOverflow(@NonNull Activity activity, @Nullable String key) {
final Toolbar toolbar = getPostInflationToolbar();
final int toolbarColor = Config.toolbarColor(activity, key, toolbar);
final int tintColor = Config.getToolbarTitleColor(activity, toolbar, key, toolbarColor);
// The collapse icon displays when action views are expanded (e.g. SearchView)
try {
final Field field = Toolbar.class.getDeclaredField("mCollapseIcon");
field.setAccessible(true);
Drawable collapseIcon = (Drawable) field.get(toolbar);
if (collapseIcon != null)
field.set(toolbar, TintHelper.createTintedDrawable(collapseIcon, tintColor));
} catch (Exception e) {
e.printStackTrace();
}
if (toolbar != null && toolbar.getParent() instanceof CollapsingToolbarLayout)
return; // collapsing toolbar handles the overflow color
ATEUtil.setOverflowButtonColor(activity, toolbar, tintColor);
}
代码示例来源:origin: kollerlukas/Camera-Roll-Android-App
((ViewGroup) toolbar.getParent()).addView(selectorToolbar,
toolbar.getLayoutParams());
代码示例来源:origin: garretyoder/app-theme-engine
if (toolbar.getParent() instanceof CollapsingToolbarLayout) {
collapsingToolbar = (CollapsingToolbarLayout) toolbar.getParent();
collapsingToolbar.setStatusBarScrimColor(Config.statusBarColor(context, key));
collapsingToolbar.setContentScrim(new ColorDrawable(toolbarColor));
} else if (toolbar.getParent() instanceof AppBarLayout) {
ATEUtil.setBackgroundCompat((View) toolbar.getParent(), new ColorDrawable(toolbarColor));
} else {
ATEUtil.setBackgroundCompat(toolbar, new ColorDrawable(toolbarColor));
代码示例来源:origin: xuancao/DynamicSkin
if (toolbar.getParent() instanceof CollapsingToolbarLayout) {
collapsingToolbar = (CollapsingToolbarLayout) toolbar.getParent();
collapsingToolbar.setStatusBarScrimColor(Config.statusBarColor(context, key));
collapsingToolbar.setContentScrim(new ColorDrawable(toolbarColor));
内容来源于网络,如有侵权,请联系作者删除!