本文整理汇总了Java中android.view.ViewGroup.setClipChildren方法的典型用法代码示例。如果您正苦于以下问题:Java ViewGroup.setClipChildren方法的具体用法?Java ViewGroup.setClipChildren怎么用?Java ViewGroup.setClipChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.ViewGroup
的用法示例。
在下文中一共展示了ViewGroup.setClipChildren方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupViewPager
import android.view.ViewGroup; //导入方法依赖的package包/类
public static void setupViewPager(final ViewPager viewPager) {
ViewGroup.LayoutParams layoutParams = viewPager.getLayoutParams();
layoutParams.width = ((Activity) viewPager.getContext()).getWindowManager().getDefaultDisplay().getWidth() / 7 * 5;
layoutParams.height = (int) ((layoutParams.width / 0.75));
viewPager.setOffscreenPageLimit(2);
if (viewPager.getParent() instanceof ViewGroup) {
ViewGroup viewParent = ((ViewGroup) viewPager.getParent());
viewParent.setClipChildren(false);
viewPager.setClipChildren(false);
}
viewPager.setPageTransformer(true, new ExpandingViewPagerTransformer());
// viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
// @Override
// public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
// ExpandingFragment expandingFragment = getCurrentFragment(viewPager);
// if(expandingFragment != null && expandingFragment.isOpenend()){
// expandingFragment.close();
// }
// }
//
// @Override
// public void onPageSelected(int position) {
//
// }
//
// @Override
// public void onPageScrollStateChanged(int state) {
//
// }
// });
}
示例2: traverseViewTreeDisablingClipping
import android.view.ViewGroup; //导入方法依赖的package包/类
private void traverseViewTreeDisablingClipping(ViewGroup viewGroup) {
viewGroup.setClipChildren(false);
try {
traverseViewTreeDisablingClipping((ViewGroup) viewGroup.getParent());
} catch (Exception e) {
}
}
示例3: getView
import android.view.ViewGroup; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
parent.setClipChildren(false);
parent.setClipToPadding(false);
if (convertView == null) {
convertView = layoutInflater.inflate(R.layout.item_conversation, null);
convertView.setTag(new ViewHolder(convertView));
}
initializeViews(getItem(position), (ViewHolder) convertView.getTag());
return convertView;
}
示例4: attach2Window
import android.view.ViewGroup; //导入方法依赖的package包/类
/**
* 手动添加,不在XML添加的话.
*/
public void attach2Window(Activity activity)
{
ViewGroup rootView = (ViewGroup)activity.findViewById(Window.ID_ANDROID_CONTENT);
ViewGroup.LayoutParams layoutParams =
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
rootView.addView(this, layoutParams);
rootView.setClipChildren(false);
rootView.setClipToPadding(false);
}
示例5: TvViewBring
import android.view.ViewGroup; //导入方法依赖的package包/类
public TvViewBring(ViewGroup vg)
{
vg.setClipChildren(false);
vg.setClipToPadding(false);
}
示例6: clearClippedChildren
import android.view.ViewGroup; //导入方法依赖的package包/类
/**
* Clear the animation garbage of the target view.
*/
private static void clearClippedChildren(ViewGroup viewGroup) {
viewGroup.setClipChildren(true);
viewGroup.invalidate();
viewGroup.setClipChildren(false);
}