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


Java LinearLayout.getChildAt方法代碼示例

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


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

示例1: invalidateActivated

import android.widget.LinearLayout; //導入方法依賴的package包/類
private TextView invalidateActivated(View view, final boolean isActive, final boolean noArrowIfAlone, final boolean allowArrowVisible) {
    int contentColor = isActive ? contentColorActivated : contentColorDeactivated;
    LinearLayout child = (LinearLayout) view;
    TextView tv = (TextView) child.getChildAt(0);
    tv.setTextColor(contentColor);
    ImageView iv = (ImageView) child.getChildAt(1);
    iv.setColorFilter(contentColor, PorterDuff.Mode.SRC_IN);
    if (noArrowIfAlone && getChildCount() == 1)
        iv.setVisibility(View.GONE);
    else if (allowArrowVisible)
        iv.setVisibility(View.VISIBLE);
    else
        iv.setVisibility(View.GONE);
    return tv;
}
 
開發者ID:aliumujib,項目名稱:Orin,代碼行數:16,代碼來源:BreadCrumbLayout.java

示例2: setStars

import android.widget.LinearLayout; //導入方法依賴的package包/類
@BindingAdapter({"stars"})
public static void setStars(LinearLayout linearLayout, float rating) {

	Context context = linearLayout.getContext();
	int color = AssetHelper.getColorFromScore(rating);

	// Child 0 is the textView with the written score
	Drawable roundedBackground = ContextCompat.getDrawable(context, R.drawable.rounded_edges);
	roundedBackground.setColorFilter(color, PorterDuff.Mode.ADD);
	linearLayout.getChildAt(0).setBackground(roundedBackground);

	int nStars = Math.round(rating);
	for (int i = 1; i <= nStars; ++i) {
		ImageView imageView = (ImageView) linearLayout.getChildAt(i);
		imageView.setColorFilter(color);
	}
}
 
開發者ID:EduardoVernier,項目名稱:bikedeboa-android,代碼行數:18,代碼來源:BindingAdapters.java

示例3: selectInLayout

import android.widget.LinearLayout; //導入方法依賴的package包/類
private View selectInLayout(LinearLayout layout, Object tag) {
	View selected = null;
	int count = layout.getChildCount();
	for (int i = 0; i<count; i++) {
		View v = layout.getChildAt(i);
		if (tag == v.getTag()) {
			selected = v;				
		} else {
			v.setVisibility(View.GONE);
		}
	}
	if (selected != null) {
		selected.setVisibility(View.VISIBLE);
	}
	return selected;
}
 
開發者ID:tiberiusteng,項目名稱:financisto1-holo,代碼行數:17,代碼來源:RecurActivity.java

示例4: initPoint

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
     * 初始化底部小點
     */
    private void initPoint(int views) {
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.point);

        points = new ImageView[views];

        //循環取得小點圖片
        for (int i = 0; i < views; i++) {
            //得到一個LinearLayout下麵的每一個子元素
            points[i] = (ImageView) linearLayout.getChildAt(i);
            //默認都設為灰色
            points[i].setEnabled(true);
            //給每個小點設置監聽
//            points[i].setOnClickListener(this);
            //設置位置tag,方便取出與當前位置對應
            points[i].setTag(i);
        }

        //設置當麵默認的位置
        currentIndex = 0;
        //設置為白色,即選中狀態
        points[currentIndex].setEnabled(false);
    }
 
開發者ID:Datatellit,項目名稱:xlight_android_native,代碼行數:26,代碼來源:SplashActivity.java

示例5: init

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void init(Context context){
	this.mContext=context;
	LayoutInflater inflater=LayoutInflater.from(context);
	inflater.inflate(R.layout.call_select_dialog, this);
	if(list!=null){
		setList(list, title);
	}
	else if(this.title!=null){
		LinearLayout v=(LinearLayout) getChildAt(0);
		LinearLayout v1=(LinearLayout) v.getChildAt(0);
		titleText=(TextView)v1.getChildAt(0);
		closeBT=(ImageView) v1.getChildAt(1);
		closeBT.setOnTouchListener(defaultTounchListener);
		titleText.setText(this.title);
	}
}
 
開發者ID:LingjuAI,項目名稱:AssistantBySDK,代碼行數:17,代碼來源:LingjuCheckListBox.java

示例6: setContent

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void setContent() {
    if (!isShowBubble() && !isMiddleItem()) {
        return;
    }

    LinearLayout bodyContainer = (LinearLayout) view.findViewById(R.id.message_item_body);

    // 調整container的位置
    int index = isReceivedMessage() ? 0 : 3;
    if (bodyContainer.getChildAt(index) != contentContainer) {
        bodyContainer.removeView(contentContainer);
        bodyContainer.addView(contentContainer, index);
    }

    if (isMiddleItem()) {
        setGravity(bodyContainer, Gravity.CENTER);
    } else {
        if (isReceivedMessage()) {
            setGravity(bodyContainer, Gravity.LEFT);
            contentContainer.setBackgroundResource(leftBackground());
        } else {
            setGravity(bodyContainer, Gravity.RIGHT);
            contentContainer.setBackgroundResource(rightBackground());
        }
    }
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:27,代碼來源:ChatRoomMsgViewHolderBase.java

示例7: onMeasure

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
 * 設置子View和自己的寬和高
 * @param widthMeasureSpec
 * @param heightMeasureSpec
 */
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    if (!mMeasureOnce) {
        //初始化控件
        mWapper =(LinearLayout)getChildAt(0);
        mMenu = (ViewGroup)mWapper.getChildAt(0);
        mContent =(ViewGroup)mWapper.getChildAt(1);
        mMenuWidth = mScreenWidth - mMenuRightPadding;
        mMenu.getLayoutParams().width = mMenuWidth;
        mContent.getLayoutParams().width = mScreenWidth;

        //mCanScrollArea = getMeasuredWidth()/5;
        mCanScrollArea = 40;
    }
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);

}
 
開發者ID:zongkaili,項目名稱:MenuSet,代碼行數:23,代碼來源:SlideMenu.java

示例8: addCrumb

import android.widget.LinearLayout; //導入方法依賴的package包/類
public void addCrumb(@NonNull Crumb crumb, boolean refreshLayout) {
    LinearLayout view = (LinearLayout) LayoutInflater.from(getContext()).inflate(R.layout.bread_crumb, this, false);
    view.setTag(mCrumbs.size());
    view.setOnClickListener(this);

    ImageView iv = (ImageView) view.getChildAt(1);
    if (Build.VERSION.SDK_INT >= 19 && iv.getDrawable() != null) {
        iv.getDrawable().setAutoMirrored(true);
    }
    iv.setVisibility(View.GONE);

    mChildFrame.addView(view, new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    mCrumbs.add(crumb);
    if (refreshLayout) {
        mActive = mCrumbs.size() - 1;
        requestLayout();
    }
    invalidateActivatedAll();
}
 
開發者ID:aliumujib,項目名稱:Orin,代碼行數:21,代碼來源:BreadCrumbLayout.java

示例9: getDesiredHeight

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
 * Calculates desired height for layout
 *
 * @param layout the source layout
 * @return the desired layout height
 */
private int getDesiredHeight(LinearLayout layout) {
    if (layout != null && layout.getChildAt(0) != null) {
        itemHeight = layout.getChildAt(0).getMeasuredHeight();
    }
    
    int desired = itemHeight * visibleItems - itemHeight * ITEM_OFFSET_PERCENT / 50;
    
    return Math.max(desired, getSuggestedMinimumHeight());
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:WheelView.java

示例10: getDesiredHeight

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
 * Calculates desired height for layout
 * 
 * @param layout
 *            the source layout
 * @return the desired layout height
 */
private int getDesiredHeight(LinearLayout layout) {
	if (layout != null && layout.getChildAt(0) != null) {
		itemHeight = layout.getChildAt(0).getMeasuredHeight();
	}

	int desired = itemHeight * visibleItems - itemHeight * ITEM_OFFSET_PERCENT / 50;

	return Math.max(desired, getSuggestedMinimumHeight());
}
 
開發者ID:LingjuAI,項目名稱:AssistantBySDK,代碼行數:17,代碼來源:WheelView.java

示例11: removeChild

import android.widget.LinearLayout; //導入方法依賴的package包/類
public void removeChild(String childId) {
    int containerCount = linearLayout.getChildCount();

    LinearLayout lastContainer = null;
    List<LinearLayout> containerList = new ArrayList<>();
    for (int i = 0; i < containerCount; i++) {
        LinearLayout container = (LinearLayout) linearLayout.getChildAt(i);
        containerList.add(container);
    }
    for (LinearLayout resultContainer : containerList) {
        if (lastContainer == null) {
            LinearLayout child = (LinearLayout) resultContainer.findViewWithTag(childId);
            if (child != null) {
                resultContainer.removeView(child);
                if (resultContainer.getChildCount() == 0) {
                    linearLayout.removeView(resultContainer);
                    break;
                } else {
                    lastContainer = resultContainer;
                }
            }
        } else {
            View view = resultContainer.getChildAt(0);
            resultContainer.removeView(view);
            lastContainer.addView(view);
            if (resultContainer.getChildCount() == 0) {
                linearLayout.removeView(resultContainer);
                break;
            } else {
                lastContainer = resultContainer;
            }
        }
    }
}
 
開發者ID:hushengjun,項目名稱:FastAndroid,代碼行數:35,代碼來源:CallUserGridView.java

示例12: onMeasure

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
 * 將記錄的值設置到控件上,並隻讓控件設置一次
 * @param widthMeasureSpec
 * @param heightMeasureSpec
 */
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    if(!isonce) {
        mParentView = (LinearLayout) this.getChildAt(0);
        mTopView = (ViewGroup) mParentView.getChildAt(0);
        mTopView.getLayoutParams().height = mTopViewHeight;
        isonce=true;
    }
}
 
開發者ID:funnyzhaov,項目名稱:Tribe,代碼行數:16,代碼來源:PullToZoomScrollView.java

示例13: dismiss

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
 * Animate the views too look more lively
 */
public void dismiss()
{
    LinearLayout layout = (LinearLayout) getChildAt(0);

    for (int i = 0; i < layout.getChildCount(); i++)
    {
        View v = layout.getChildAt(i);
        v.setScaleX(1);
        v.setScaleY(1);
        v.animate().cancel();
        v.animate().translationY(isReversed ? -v.getHeight() :v.getHeight())
                .scaleX(0).scaleY(0).setDuration(100)
                .setStartDelay(80 * i)
                .setInterpolator(null)
                .start();
    }
    // hide view when finish animating
    new Handler().postDelayed(new Runnable()
    {
        @Override
        public void run()
        {
            manager.dismiss();
        }
    }, 150 * layout.getChildCount());
}
 
開發者ID:Emadoki,項目名稱:edslider,代碼行數:30,代碼來源:EdSliderView.java

示例14: resetCourseTable

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void resetCourseTable() {
    for (int i = 1; i < TABLE_ROW; i++) {
        for (int j = 1; j < TABLE_COL; j++) {
            LinearLayout tr = (LinearLayout) courseContainer.getChildAt(i);
            CourseBlock text = (CourseBlock) tr.getChildAt(j);
            text.resetBlock();
        }
    }
    isDisplayABCD = false;
    isDisplaySat = false;
    isDisplaySun = false;
    isDisplayNoTime = false;
    requestLayout();
}
 
開發者ID:kamisakihideyoshi,項目名稱:TaipeiTechRefined,代碼行數:15,代碼來源:CourseTableLayout.java

示例15: getDesiredHeight

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
 * Calculates desired height for layout
 * 
 * @param layout
 *            the source layout
 * @return the desired layout height
 */
private int getDesiredHeight(LinearLayout layout) {
	if (layout != null && layout.getChildAt(0) != null) {
		itemHeight = layout.getChildAt(0).getMeasuredHeight();
	}

	int desired = itemHeight * visibleItems - itemHeight
			* ITEM_OFFSET_PERCENT / 50;

	return Math.max(desired, getSuggestedMinimumHeight());
}
 
開發者ID:SavorGit,項目名稱:Hotspot-master-devp,代碼行數:18,代碼來源:WheelView.java


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