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


Java LinearLayout.setClipChildren方法代碼示例

本文整理匯總了Java中android.widget.LinearLayout.setClipChildren方法的典型用法代碼示例。如果您正苦於以下問題:Java LinearLayout.setClipChildren方法的具體用法?Java LinearLayout.setClipChildren怎麽用?Java LinearLayout.setClipChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.LinearLayout的用法示例。


在下文中一共展示了LinearLayout.setClipChildren方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleStyledAttributes

import android.widget.LinearLayout; //導入方法依賴的package包/類
@Override
public void handleStyledAttributes(TypedArray a) {
    mRootContainer = new LinearLayout(getContext());
    mRootContainer.setOrientation(VERTICAL);
    mHeaderContainer = new FrameLayout(getContext());

    if (mZoomView != null) {
        mHeaderContainer.addView(mZoomView);
    }
    if (mHeaderView != null) {
        mHeaderContainer.addView(mHeaderView);
    }
    int contentViewResId = a.getResourceId(R.styleable.PullToZoomView_contentView, 0);
    if (contentViewResId > 0) {
        LayoutInflater mLayoutInflater = LayoutInflater.from(getContext());
        mContentView = mLayoutInflater.inflate(contentViewResId, null, false);
    }

    mRootContainer.addView(mHeaderContainer);
    if (mContentView != null) {
        mRootContainer.addView(mContentView);
    }

    mRootContainer.setClipChildren(false);
    mHeaderContainer.setClipChildren(false);

    mRootView.addView(mRootContainer);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:29,代碼來源:PullToZoomScrollViewEx.java

示例2: setupChildren

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void setupChildren() {
    topbar = new LinearLayout(getContext());
    topbar.setOrientation(LinearLayout.HORIZONTAL);
    topbar.setClipChildren(false);
    topbar.setClipToPadding(false);
    addView(topbar, new LayoutParams(1));

    buttonPast.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
    topbar.addView(buttonPast, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1));

    title.setGravity(Gravity.CENTER);
    topbar.addView(title, new LinearLayout.LayoutParams(
            0, LayoutParams.MATCH_PARENT, DEFAULT_DAYS_IN_WEEK - 2
    ));

    buttonFuture.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
    topbar.addView(buttonFuture, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1));

    pager.setId(R.id.mcv_pager);
    pager.setOffscreenPageLimit(1);
    addView(pager, new LayoutParams(calendarMode.visibleWeeksCount + DAY_NAMES_ROW));
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:23,代碼來源:MaterialCalendarView.java

示例3: initializeResources

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void initializeResources() {
  if (recipients != null) recipients.removeListener(this);

  recipients       = RecipientFactory.getRecipientsForIds(this, getIntent().getLongArrayExtra(RECIPIENTS_EXTRA), true);
  threadId         = getIntent().getLongExtra(THREAD_ID_EXTRA, -1);
  archived         = getIntent().getBooleanExtra(IS_ARCHIVED_EXTRA, false);
  distributionType = getIntent().getIntExtra(DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT);

  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
    LinearLayout conversationContainer = ViewUtil.findById(this, R.id.conversation_container);
    conversationContainer.setClipChildren(true);
    conversationContainer.setClipToPadding(true);
  }

  recipients.addListener(this);
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:17,代碼來源:ConversationActivity.java

示例4: build

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
 * Generate the view
 * @param builder the configs
 */
public void build(EdSliderBuilder builder)
{
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);

    LinearLayout layout = new LinearLayout(getContext());
    layout.setLayoutParams(params);
    layout.setOrientation(LinearLayout.HORIZONTAL);
    layout.setBackgroundResource(builder.backgroundResId);
    layout.setClipChildren(false);
    layout.setClipToPadding(false);

    for (EdIcon edIcon : builder.list)
    {
        params = new LinearLayout.LayoutParams(builder.size, builder.size);
        params.setMargins(builder.margin, builder.margin, builder.margin, builder.margin);
        ImageView image = new ImageView(getContext());
        image.setLayoutParams(params);
        image.setImageResource(edIcon.drawableid);
        image.setScaleType(ImageView.ScaleType.FIT_CENTER);

        layout.addView(image);
    }

    this.addView(layout);
    this.manager = builder.manager;
    this.flags = new boolean[builder.list.size()];
    this.boundary = builder.boundary;
    this.isReversed = builder.isReversed;
}
 
開發者ID:Emadoki,項目名稱:edslider,代碼行數:35,代碼來源:EdSliderView.java

示例5: fill

import android.widget.LinearLayout; //導入方法依賴的package包/類
public static void fill(LinearLayout linearLayout, ArrayList<ItemInfo> itemInfos) {
    for (ItemInfo info : itemInfos) {
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(-1, info.itemHeight);
        TextView textView = makeItem(linearLayout.getContext(), info);

        int paddingLeft = linearLayout.getPaddingLeft();
        if (paddingLeft > 0) {
            params.setMargins(params.leftMargin - paddingLeft, params.topMargin,
                    params.rightMargin, params.bottomMargin);
            textView.setPadding(paddingLeft + textView.getPaddingLeft(), textView.getPaddingTop(),
                    textView.getPaddingRight(), textView.getPaddingBottom());
            linearLayout.setClipToPadding(false);
            linearLayout.setClipChildren(false);
        }

        linearLayout.addView(textView, params);
    }
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:19,代碼來源:UIItem.java


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