當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewGroup.setClipChildren方法代碼示例

本文整理匯總了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) {
//
//            }
//        });
    }
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:36,代碼來源:ExpandingPagerFactory.java

示例2: traverseViewTreeDisablingClipping

import android.view.ViewGroup; //導入方法依賴的package包/類
private void traverseViewTreeDisablingClipping(ViewGroup viewGroup) {
    viewGroup.setClipChildren(false);
    try {
        traverseViewTreeDisablingClipping((ViewGroup) viewGroup.getParent());
    } catch (Exception e) {
    }
}
 
開發者ID:wonderkiln,項目名稱:ShadowKit-Android,代碼行數:8,代碼來源:ShadowLayout.java

示例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;
}
 
開發者ID:javonleee,項目名稱:DragPointView,代碼行數:12,代碼來源:ItemConversationAdapter.java

示例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);
}
 
開發者ID:Dreamxiaoxuan,項目名稱:AndroidTvDemo,代碼行數:13,代碼來源:MainUpView.java

示例5: TvViewBring

import android.view.ViewGroup; //導入方法依賴的package包/類
public TvViewBring(ViewGroup vg)
{
    vg.setClipChildren(false);
    vg.setClipToPadding(false);
}
 
開發者ID:Dreamxiaoxuan,項目名稱:AndroidTvDemo,代碼行數:6,代碼來源:TvViewBring.java

示例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);
}
 
開發者ID:cheenid,項目名稱:FLFloatingButton,代碼行數:9,代碼來源:TrashView.java


注:本文中的android.view.ViewGroup.setClipChildren方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。