本文整理汇总了Java中android.support.v4.widget.DrawerLayout.getChildCount方法的典型用法代码示例。如果您正苦于以下问题:Java DrawerLayout.getChildCount方法的具体用法?Java DrawerLayout.getChildCount怎么用?Java DrawerLayout.getChildCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.widget.DrawerLayout
的用法示例。
在下文中一共展示了DrawerLayout.getChildCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStatusBarColor4Drawer
import android.support.v4.widget.DrawerLayout; //导入方法依赖的package包/类
/**
* 为DrawerLayout设置状态栏颜色
* <p>DrawLayout需设置 {@code android:fitsSystemWindows="true"}</p>
*
* @param activity activity
* @param drawer drawerLayout
* @param fakeStatusBar 伪造状态栏
* @param color 状态栏颜色值
* @param alpha 状态栏透明度,此透明度并非颜色中的透明度
* @param isTop drawerLayout是否在顶层
*/
public static void setStatusBarColor4Drawer(@NonNull final Activity activity,
@NonNull final DrawerLayout drawer,
@NonNull final View fakeStatusBar,
@ColorInt final int color,
@IntRange(from = 0, to = 255) final int alpha,
final boolean isTop) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
drawer.setFitsSystemWindows(false);
transparentStatusBar(activity);
setStatusBarColor(fakeStatusBar, color, isTop ? alpha : 0);
for (int i = 0, len = drawer.getChildCount(); i < len; i++) {
drawer.getChildAt(i).setFitsSystemWindows(false);
}
if (isTop) {
hideAlphaView(activity);
} else {
addStatusBarAlpha(activity, alpha, false);
}
}
示例2: setStatusBarAlpha4Drawer
import android.support.v4.widget.DrawerLayout; //导入方法依赖的package包/类
/**
* 为DrawerLayout设置状态栏透明度
* <p>DrawLayout需设置 {@code android:fitsSystemWindows="true"}</p>
*
* @param activity activity
* @param drawer drawerLayout
* @param fakeStatusBar 伪造状态栏
* @param alpha 状态栏透明度
* @param isTop drawerLayout是否在顶层
*/
public static void setStatusBarAlpha4Drawer(@NonNull final Activity activity,
@NonNull final DrawerLayout drawer,
@NonNull final View fakeStatusBar,
@IntRange(from = 0, to = 255) final int alpha,
final boolean isTop) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
drawer.setFitsSystemWindows(false);
transparentStatusBar(activity);
setStatusBarAlpha(fakeStatusBar, isTop ? alpha : 0);
for (int i = 0, len = drawer.getChildCount(); i < len; i++) {
drawer.getChildAt(i).setFitsSystemWindows(false);
}
if (isTop) {
hideAlphaView(activity);
} else {
addStatusBarAlpha(activity, alpha, false);
}
}