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


Java AbsoluteLayout類代碼示例

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


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

示例1: GoogleMobileAds_RemoveBanner

import android.widget.AbsoluteLayout; //導入依賴的package包/類
public void GoogleMobileAds_RemoveBanner()
{
	if( adView != null )
	{
		RunnerActivity.ViewHandler.post( new Runnable() {
		public void run() 
	    {
			AbsoluteLayout layout = (AbsoluteLayout)RunnerActivity.CurrentActivity.findViewById(R.id.ad);
			ViewGroup vg = (ViewGroup)layout;
			if(vg!=null)
			{
				vg.removeView( adView );
			}
			adView.destroy();
			adView = null;
			
	    }});
	}
}
 
開發者ID:Magicrafter13,項目名稱:1946,代碼行數:20,代碼來源:GooglePlayServicesExtension.java

示例2: GoogleMobileAds_MoveBanner

import android.widget.AbsoluteLayout; //導入依賴的package包/類
public void GoogleMobileAds_MoveBanner( double _x, double _y )
{
	Log.i("yoyo", "MoveBanner:" + _x + "," + _y);
	final int x = (int)_x;
	final int y = (int)_y;
	BannerXPos = x;
	BannerYPos = y;

	if( adView != null )
	{
		RunnerActivity.ViewHandler.post( new Runnable() {
		public void run()
		{
			if( x < 0 || y < 0) {
				adView.setVisibility(View.INVISIBLE);
			}
			else
			{
				AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, x,y );
				adView.setLayoutParams( params);
				adView.requestLayout();
				adView.setVisibility(View.VISIBLE);
			}
		}});
	}
}
 
開發者ID:Magicrafter13,項目名稱:1946,代碼行數:27,代碼來源:GooglePlayServicesExtension.java

示例3: getTouchView

import android.widget.AbsoluteLayout; //導入依賴的package包/類
private View getTouchView(int x, int y) {
    View v = null;
    AbsoluteLayout.LayoutParams MinParam = null;
    for (int i = 0; i < absoluteLayout.getChildCount(); i++) {
        View view = absoluteLayout.getChildAt(i);

        AbsoluteLayout.LayoutParams param = (AbsoluteLayout.LayoutParams) view.getLayoutParams();
        if (x >= param.x && x <= (param.x + param.width))
            if (y >= param.y && y <= (param.y + param.height)) {
                if (v == null || (MinParam.height * MinParam.width > param.width * param.height)) {
                    v = view;
                    MinParam = param;
                }
            }
    }
    return v;
}
 
開發者ID:w568w,項目名稱:fuckView,代碼行數:18,代碼來源:FullScreenPopupWindow.java

示例4: run

import android.widget.AbsoluteLayout; //導入依賴的package包/類
@Override
public void run() {
    AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(
            w, h + HEIGHT_PADDING, x, y);

    if (mTextEdit == null) {
        mTextEdit = new DummyEdit(getContext());

        mLayout.addView(mTextEdit, params);
    } else {
        mTextEdit.setLayoutParams(params);
    }

    mTextEdit.setVisibility(View.VISIBLE);
    mTextEdit.requestFocus();

    InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showSoftInput(mTextEdit, 0);
}
 
開發者ID:stephen47,項目名稱:android-sdl2-gradle-template,代碼行數:20,代碼來源:SDLActivity.java

示例5: addViewToParentAdAPI

import android.widget.AbsoluteLayout; //導入依賴的package包/類
public final void addViewToParentAdAPI() {
	if(parent != null){
		final View containerView = parent.getContainerViewAdAPI();
		
		if(containerView != null){
			if(containerView instanceof AbsoluteLayout){
				AndroidUIUtil.removeFromParent(peer);
				AbsoluteLayout vg = (AbsoluteLayout)containerView;
				
//					LogManager.log("AbsoluteLayout addView for " + this.toString());
				final Border border = (parent instanceof JComponent)?((JComponent)parent).getBorder():null;
				final Insets insets = (border != null)?border.getBorderInsets(parent):null;
				vg.addView(peer, new AbsoluteLayout.LayoutParams(width, height, x - ((insets != null)?insets.left:0), y - ((insets != null)?insets.top:0)));
			}else if(containerView instanceof HCTabHost){
				//view已加入,不用處理
			}
		}
	}
}
 
開發者ID:javalovercn,項目名稱:j2se_for_android,代碼行數:20,代碼來源:Component.java

示例6: updateBubbleSize

import android.widget.AbsoluteLayout; //導入依賴的package包/類
private void updateBubbleSize() {
    int oldWidth = mBubbleWidth;
    int oldHeight = mBubbleHeight;
    mBubbleWidth = (int) Math.max(mBubbleMinWidth,
            Integer.toString(mEnd).length() * mCharWidth + LayoutUtils.dp2pix(mContext, 8));
    mBubbleHeight = (int) Math.max(mBubbleMinHeight,
            mCharHeight + LayoutUtils.dp2pix(mContext, 8));

    if (oldWidth != mBubbleWidth && oldHeight != mBubbleHeight) {
        //noinspection deprecation
        AbsoluteLayout.LayoutParams lp = (AbsoluteLayout.LayoutParams) mBubble.getLayoutParams();
        lp.width = mBubbleWidth;
        lp.height = mBubbleHeight;
        mBubble.setLayoutParams(lp);
    }
}
 
開發者ID:seven332,項目名稱:Nimingban,代碼行數:17,代碼來源:Slider.java

示例7: setTitle

import android.widget.AbsoluteLayout; //導入依賴的package包/類
/**
	 * 給菜單添加標題
	 * @param title
	 */
	public void setTitle(CharSequence title) {
		if (mListTitle[0] == null || mListTitle[1] == null) {
			return;
		}

		mListTitle[0].setText(title);
		mListTitle[0].setTextScaleX(0.5f);
		mListTitle[0].setTextSize(mTextSize);
		mListTitle[0].setTextColor(mTextColor);
//		mListTitle[0].setBackgroundResource(R.drawable.popup_list);
		mListTitle[0].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, mListTitleHeight, m_cur_lx, m_cur_ly - mListTitleHeight));

		mListTitle[1].setText(title);
		mListTitle[1].setTextScaleX(0.5f);
		mListTitle[1].setTextSize(mTextSize);
		mListTitle[1].setTextColor(mTextColor);
//		mListTitle[1].setBackgroundResource(R.drawable.popup_list);
		mListTitle[1].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, mListTitleHeight, m_cur_rx, m_cur_ry - mListTitleHeight));

	}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:25,代碼來源:CSMenu.java

示例8: ViewHolder

import android.widget.AbsoluteLayout; //導入依賴的package包/類
public ViewHolder() {
	m_listItem_layout = new AbsoluteLayout(CSShareMenu.this.m_context);
	m_lLayout = new LinearLayout(CSShareMenu.this.m_context);
	m_appName = new TextView(CSShareMenu.this.m_context);
	m_icon = new ImageView(CSShareMenu.this.m_context);
	m_icon.setLayoutParams(new LinearLayout.LayoutParams(m_image_width,
			m_image_height));
	m_appName.setTextSize(22);
	m_appName.setTextScaleX(0.5f);
	m_lLayout.setGravity(Gravity.CENTER_VERTICAL);
	m_lLayout.addView(m_icon);
	m_lLayout.addView(m_appName);
	m_lLayout.setLayoutParams(new AbsoluteLayout.LayoutParams(m_shareMenu_width, LayoutParams.WRAP_CONTENT, 0, 0));
	m_lLayout.setBackgroundResource(mListLayoutSelector);
	m_listItem_layout.addView(m_lLayout);
}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:17,代碼來源:CSShareMenu.java

示例9: addToLayout

import android.widget.AbsoluteLayout; //導入依賴的package包/類
@Override
public void addToLayout(ViewGroup layout) {
	// TODO Auto-generated method stub
	if(mToggleButtons[0] == null || mToggleButtons[1] == null){
		return;
	}
	
	if(m_is_3D){

	if(m_cur_width == WRAP_CONTENT || m_cur_height == WRAP_CONTENT){
		mToggleButtons[0].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_lx, m_cur_ly));
		mToggleButtons[1].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_rx, m_cur_ry));
	}else{
		mToggleButtons[0].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_lx, m_cur_ly));
		mToggleButtons[1].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_rx, m_cur_ry));
	}
	}
	layout.addView(mToggleButtons[0]);
	layout.addView(mToggleButtons[1]);
	
}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:22,代碼來源:CSToggleButton.java

示例10: setLocation

import android.widget.AbsoluteLayout; //導入依賴的package包/類
/**
 * 設置控件的位置
 */
@Override
public void setLocation(int x, int y) {
	super.setLocation(x, y);
	if(mToggleButtons[0] == null || mToggleButtons[1] == null){
		return;
	}
	
	if(mToggleButtons[0].getLayoutParams() != null && mToggleButtons[1].getLayoutParams() != null){
		if(m_cur_width == WRAP_CONTENT || m_cur_height == WRAP_CONTENT){
			mToggleButtons[0].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_lx, m_cur_ly));
			mToggleButtons[1].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_rx, m_cur_ry));
		}else{
			mToggleButtons[0].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_lx, m_cur_ly));
			mToggleButtons[1].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_rx, m_cur_ry));
		}
		mToggleButtons[0].requestLayout();
		mToggleButtons[1].requestLayout();
	}
}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:23,代碼來源:CSToggleButton.java

示例11: setLocation

import android.widget.AbsoluteLayout; //導入依賴的package包/類
@SuppressWarnings("deprecation")
@Override
public void setLocation(int x, int y) {
	super.setLocation(x, y);
	if(m_seekBars[0] == null || m_seekBars[1] == null){
		return;
	}
	
	if(m_seekBars[0].getLayoutParams() != null && m_seekBars[1].getLayoutParams() != null){
		if(m_cur_width == WRAP_CONTENT || m_cur_height == WRAP_CONTENT){
			m_seekBars[0].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_lx, m_cur_ly));
			m_seekBars[1].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_rx, m_cur_ry));
		}else{
			m_seekBars[0].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_lx, m_cur_ly));
			m_seekBars[1].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_rx, m_cur_ry));
		}
		m_seekBars[0].requestLayout();
		m_seekBars[1].requestLayout();
	}
}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:21,代碼來源:CSSeekBar.java

示例12: setLocation

import android.widget.AbsoluteLayout; //導入依賴的package包/類
@SuppressWarnings("deprecation")
@Override
public void setLocation(int x, int y) {
	super.setLocation(x, y);
	if(m_radioButtons[0] == null || m_radioButtons[1] == null){
		return;
	}
	if(m_radioButtons[0].getLayoutParams() != null && m_radioButtons[1].getLayoutParams() != null){
		if(m_cur_width == WRAP_CONTENT || m_cur_height == WRAP_CONTENT){
			m_radioButtons[0].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_lx, m_cur_ly));
			m_radioButtons[1].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_rx, m_cur_ry));
		}else{
			m_radioButtons[0].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_lx, m_cur_ly));
			m_radioButtons[1].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_rx, m_cur_ry));
		}
		m_radioButtons[0].requestLayout();
		m_radioButtons[1].requestLayout();
	}
}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:20,代碼來源:CSRadioButton.java

示例13: setDimension

import android.widget.AbsoluteLayout; //導入依賴的package包/類
@Override
public void setDimension(boolean is3d) {
	super.setDimension(is3d);
	if(m_imageviews[0] == null || m_imageviews[1] == null){
		return;
	}
	
	if(m_imageviews[0].getLayoutParams() != null && m_imageviews[1].getLayoutParams() != null){
		if(m_cur_width == WRAP_CONTENT || m_cur_height == WRAP_CONTENT){
			m_imageviews[0].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_lx, m_cur_ly));
			m_imageviews[1].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_rx, m_cur_ry));
		}else{
			m_imageviews[0].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_lx, m_cur_ly));
			m_imageviews[1].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_rx, m_cur_ry));
		}
		m_imageviews[0].requestLayout();
		m_imageviews[1].requestLayout();
	}
}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:20,代碼來源:CSImageView.java

示例14: setLocation

import android.widget.AbsoluteLayout; //導入依賴的package包/類
@Override
public void setLocation(int x, int y) {
	super.setLocation(x, y);
	if(m_imageviews[0] == null || m_imageviews[1] == null){
		return;
	}
	if(m_imageviews[0].getLayoutParams() != null && m_imageviews[1].getLayoutParams() != null){
		if(m_cur_width == WRAP_CONTENT || m_cur_height == WRAP_CONTENT){
			m_imageviews[0].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_lx, m_cur_ly));
			m_imageviews[1].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_rx, m_cur_ry));
		}else{
			m_imageviews[0].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_lx, m_cur_ly));
			m_imageviews[1].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_rx, m_cur_ry));
		}
		m_imageviews[0].requestLayout();
		m_imageviews[1].requestLayout();
	}
}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:19,代碼來源:CSImageView.java

示例15: addToLayout

import android.widget.AbsoluteLayout; //導入依賴的package包/類
@Override
public void addToLayout(ViewGroup alayout) {
	if(m_imageviews[0] == null || m_imageviews[1] == null){
		return;
	}

	if(alayout == null){
		return;
	}

	if(m_cur_width == WRAP_CONTENT || m_cur_height == WRAP_CONTENT){
		m_imageviews[0].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_lx, m_cur_ly));
		m_imageviews[1].setLayoutParams(new AbsoluteLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, m_cur_rx, m_cur_ry));
	}else{
		m_imageviews[0].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_lx, m_cur_ly));
		m_imageviews[1].setLayoutParams(new AbsoluteLayout.LayoutParams(m_cur_width, m_cur_height, m_cur_rx, m_cur_ry));
	}

	alayout.addView(m_imageviews[0]);
	alayout.addView(m_imageviews[1]);
}
 
開發者ID:hubert1002,項目名稱:WiCamera3D,代碼行數:22,代碼來源:CSImageView.java


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