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


Java LinearLayout.getMeasuredHeight方法代碼示例

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


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

示例1: init

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void init(Context context) {
	mFlipAnimation = new RotateAnimation(0, -180,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f);
	mFlipAnimation.setInterpolator(new LinearInterpolator());
	mFlipAnimation.setDuration(250);
	mFlipAnimation.setFillAfter(true);
	mReverseFlipAnimation = new RotateAnimation(-180, 0,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f,
			RotateAnimation.RELATIVE_TO_SELF, 0.5f);
	mReverseFlipAnimation.setInterpolator(new LinearInterpolator());
	mReverseFlipAnimation.setDuration(250);
	mReverseFlipAnimation.setFillAfter(true);

	mRefreshView = (LinearLayout) View.inflate(context, R.layout.pull_to_refresh_header, null);
	mRefreshViewText = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_text);
	mRefreshViewImage = (ImageView) mRefreshView.findViewById(R.id.pull_to_refresh_image);
	mRefreshViewProgress = (ProgressBar) mRefreshView.findViewById(R.id.pull_to_refresh_progress);
	mRefreshViewLastUpdated = (TextView) mRefreshView.findViewById(R.id.pull_to_refresh_updated_at);

	mRefreshState = PULL_TO_REFRESH;
	mRefreshViewImage.setMinimumHeight(50); //設置下拉最小的高度為50
	
	setFadingEdgeLength(0);
	setHeaderDividersEnabled(false);

	//把refreshview加入到listview的頭部
	addHeaderView(mRefreshView);
	super.setOnScrollListener(this);
	mRefreshView.setOnClickListener(this);

	mRefreshView.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
	mRefreshViewHeight = mRefreshView.getMeasuredHeight();
	mRefreshOriginalTopPadding = -mRefreshViewHeight;
	
	resetHeaderPadding();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:38,代碼來源:PullToRefreshListView.java

示例2: init

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void init(Context context) {
    inflater = LayoutInflater.from(context);
    headView = (LinearLayout) inflater.inflate(R.layout.kf5_list_head, null);
    arrowImageView = (ImageView) headView.findViewById(R.id.kf5_head_arrowImageView);
    arrowImageView.setMinimumWidth(70);
    arrowImageView.setMinimumHeight(50);
    progressBar = (ProgressBar) headView.findViewById(R.id.kf5_head_progressBar);
    tipsTextview = (TextView) headView.findViewById(R.id.kf5_head_tipsTextView);
    lastUpdatedTextView = (TextView) headView.findViewById(R.id.kf5_head_lastUpdatedTextView);
    measureView(headView);
    headContentHeight = headView.getMeasuredHeight();
    headContentWidth = headView.getMeasuredWidth();
    headView.setPadding(0, -1 * headContentHeight, 0, 0);
    headView.invalidate();
    addHeaderView(headView);
    setOnScrollListener(this);
    animation = new RotateAnimation(0, -180,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    animation.setInterpolator(new LinearInterpolator());
    animation.setDuration(250);
    animation.setFillAfter(true);
    reverseAnimation = new RotateAnimation(-180, 0,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f,
            RotateAnimation.RELATIVE_TO_SELF, 0.5f);
    reverseAnimation.setInterpolator(new LinearInterpolator());
    reverseAnimation.setDuration(200);
    reverseAnimation.setFillAfter(true);

    state = DONE;
    isRefreshable = false;
}
 
開發者ID:Zyj163,項目名稱:yyox,代碼行數:33,代碼來源:RefreshListView.java

示例3: init

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void init(Context context) {
    try {
        inflater = LayoutInflater.from(context);
        llheader = (LinearLayout) inflater.inflate(R.layout.udesk_layout_get_more, null);
        pbLoading = (ProgressBar) llheader.findViewById(R.id.udesk_get_more_progress);
        tvTips = (TextView) llheader.findViewById(R.id.udesk_get_more_tips);

        measureView(llheader);
        headContentHeight = llheader.getMeasuredHeight();

        llheader.setPadding(0, -1 * headContentHeight, 0, 0);
        llheader.invalidate();

        addHeaderView(llheader, null, false);

        setOnScrollListener(this);

        state = DONE;
        isRefreshable = false;
        isPush = true;
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
開發者ID:lennyup,項目名稱:react-native-udesk,代碼行數:25,代碼來源:UDPullGetMoreListView.java

示例4: init

import android.widget.LinearLayout; //導入方法依賴的package包/類
private void init(Context context) {
        setCacheColorHint(context.getResources().getColor(ResourceUtils.getIdByName(getContext(), "color",
                "sobot_transparent")));
        inflater = LayoutInflater.from(context);

        fl = (FrameLayout)inflater.inflate(ResourceUtils.getIdByName(getContext(), "layout",
                "sobot_dropdown_lv_head"), null);
        headView = (LinearLayout) fl.findViewById(ResourceUtils.getIdByName(getContext(), "id",
                "drop_down_head"));

        progressBar = (ProgressBar) fl.findViewById(ResourceUtils.getIdByName(getContext(), "id",
                "sobot_loading"));
        measureView(headView);


        headContentHeight = headView.getMeasuredHeight();
        headContentWidth = headView.getMeasuredWidth();

        headView.setPadding(0, -1 * headContentHeight, 0, 0);
        headView.invalidate();

        Log.v("size", "width:" + headContentWidth + " height:"
                + headContentHeight);

        addHeaderView(fl, null, false);
//		addHeaderView(headView, null, false);
        setOnScrollListener(this);


        state = DONE;
        isRefreshableHeader = false;
    }
 
開發者ID:fengdongfei,項目名稱:CXJPadProject,代碼行數:33,代碼來源:DropdownListView.java

示例5: Login

import android.widget.LinearLayout; //導入方法依賴的package包/類
/**
     * 點擊頭像後的操作
     * @param view
     */
    public void Login(View view){
        //通過存儲在本地的用戶信息及登錄狀態判斷所要打開的頁麵
//        String name = mPreferences.getString("userName", "0");
//        String passWord = mPreferences.getString("passWord", "0");
        //這塊必須要再取一次,否則由未登錄轉為登錄時isLogin值還是false
        isLogin = mPreferences.getBoolean("isLogin", false);
       if(isLogin){
            //打個吐司測試一下,實際上要做選取圖片或拍照的操作
            //Toast.makeText(MainActivity.this,"你已經登陸了",Toast.LENGTH_SHORT).show();
            //textViewLogin.setText("已登錄");這句寫在這裏是有問題的,應該寫在onCreate方法中
           mCameraDialog = new Dialog(MainActivity.this,R.style.my_dialog);
           LinearLayout root = (LinearLayout) LayoutInflater.from(MainActivity.this).inflate(R.layout.camera_control,null);
           root.findViewById(R.id.btn_camera).setOnClickListener(btnListener);
           root.findViewById(R.id.btn_photo).setOnClickListener(btnListener);
           root.findViewById(R.id.btn_cancel).setOnClickListener(btnListener);
           //將dialog布局通過setcontentview填充
           mCameraDialog.setContentView(root);
           Window dialogWindow = mCameraDialog.getWindow();
           dialogWindow.setGravity(Gravity.BOTTOM);
           //有個滑出的動畫,對高度進行設置,不讓他全屏
           //dialogWindow.setWindowAnimations(R.style.dialogstyle);
           WindowManager.LayoutParams lp = dialogWindow.getAttributes();//獲取對話框當前的參數值
           lp.x = 0; // 新位置X坐標
           lp.y = -20; // 新位置Y坐標
           lp.width =(int)getResources().getDisplayMetrics().widthPixels;// 寬度  
//      lp.height = WindowManager.LayoutParams.WRAP_CONTENT;//高度
//     lp.alpha = 9f; //透明度
           root.measure(0,0);
           lp.height = root.getMeasuredHeight();
           lp.alpha = 9f; // 透明度  
           dialogWindow.setAttributes(lp);
           mCameraDialog.show();
        }else {
           Intent intent = new Intent(MainActivity.this,LoginActivity.class);
           startActivity(intent);
       }
    }
 
開發者ID:AndroidBoySC,項目名稱:Mybilibili,代碼行數:42,代碼來源:MainActivity.java


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