当前位置: 首页>>代码示例>>Java>>正文


Java AbsoluteLayout.addView方法代码示例

本文整理汇总了Java中android.widget.AbsoluteLayout.addView方法的典型用法代码示例。如果您正苦于以下问题:Java AbsoluteLayout.addView方法的具体用法?Java AbsoluteLayout.addView怎么用?Java AbsoluteLayout.addView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.AbsoluteLayout的用法示例。


在下文中一共展示了AbsoluteLayout.addView方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: onCreate

import android.widget.AbsoluteLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.v("SDL", "onCreate():" + mSingleton);
    super.onCreate(savedInstanceState);
    
    SDLActivity.initialize();
    // So we can call stuff from static callbacks
    mSingleton = this;

    // Set up the surface
    mSurface = new SDLSurface(getApplication());
    
    if(Build.VERSION.SDK_INT >= 12) {
        mJoystickHandler = new SDLJoystickHandler_API12();
    }
    else {
        mJoystickHandler = new SDLJoystickHandler();
    }

    mLayout = new AbsoluteLayout(this);
    mLayout.addView(mSurface);

    setContentView(mLayout);
}
 
开发者ID:rhaps0dy,项目名称:android-haskell-sdl,代码行数:25,代码来源:SDLActivity.java

示例4: onCreate

import android.widget.AbsoluteLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    //Log.v("SDL", "onCreate()");
    super.onCreate(savedInstanceState);
    
    // So we can call stuff from static callbacks
    mSingleton = this;

    // Set up the surface
    mSurface = new SDLSurface(getApplication());

    mLayout = new AbsoluteLayout(this);
    mLayout.addView(mSurface);

    setContentView(mLayout);
}
 
开发者ID:droid-in-the-sky,项目名称:ult-tic-tac-toe,代码行数:17,代码来源:SDLActivity.java

示例5: onCreate

import android.widget.AbsoluteLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    //Log.v("SDL", "onCreate()");
    super.onCreate(savedInstanceState);
    
    // So we can call stuff from static callbacks
    mSingleton = this;

    // Set up the surface
    mSurface = new SDLSurface(getApplication());
    
    // Make sure this variable is initialized here!
    mExitCalledFromJava = false;
    
    if(Build.VERSION.SDK_INT >= 12) {
        mJoystickHandler = new SDLJoystickHandler_API12();
    }
    else {
        mJoystickHandler = new SDLJoystickHandler();
    }

    mLayout = new AbsoluteLayout(this);
    mLayout.addView(mSurface);

    setContentView(mLayout);
}
 
开发者ID:PICHURRIAJUEGOS-,项目名称:muruby,代码行数:27,代码来源:SDLActivity.java

示例6: initLayout

import android.widget.AbsoluteLayout; //导入方法依赖的package包/类
private void initLayout() {
    AbsoluteLayout layout = new AbsoluteLayout(this);

    TextView lblAdress = new TextView(this);
    AbsoluteLayout.LayoutParams p = new AbsoluteLayout.LayoutParams(
            AbsoluteLayout.LayoutParams.WRAP_CONTENT, LINE_HEIGHT, INSETS, INSETS);
    lblAdress.setLayoutParams(p);
    lblAdress.setText("IP Address");
    layout.addView(lblAdress);

    TextView lblAccelerometer = new TextView(this);
    p = new AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT, LINE_HEIGHT,
            INSETS, 3 * INSETS);
    lblAccelerometer.setLayoutParams(p);
    lblAccelerometer.setText("Accelerometer");
    layout.addView(lblAccelerometer);

    edtIpAddress = new EditText(this);
    edtIpAddress.setTextSize(12.0f);
    p = new AbsoluteLayout.LayoutParams(IP_WIDTH, AbsoluteLayout.LayoutParams.WRAP_CONTENT, 320
            - IP_WIDTH - INSETS, INSETS - 10);
    edtIpAddress.setLayoutParams(p);
    layout.addView(edtIpAddress);

    cbxAccelerometer = new CheckBox(this);
    cbxAccelerometer.setSelected(false);
    p = new AbsoluteLayout.LayoutParams(AbsoluteLayout.LayoutParams.WRAP_CONTENT,
            AbsoluteLayout.LayoutParams.WRAP_CONTENT, 320 - IP_WIDTH - INSETS, 3 * INSETS - 10);
    cbxAccelerometer.setLayoutParams(p);
    cbxAccelerometer.setOnCheckedChangeListener(this);
    layout.addView(cbxAccelerometer);

    setContentView(layout);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:35,代码来源:ARemote.java

示例7: onCreate

import android.widget.AbsoluteLayout; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        setContentView(R.layout.activity_test);

        button = (Button) findViewById(R.id.button);
        content = (AbsoluteLayout) findViewById(R.id.content);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.v("TestActivity", "button onClick");
             swipeBackLayout.closePane();
//
//                ConfigChatRoomDialog configChatRoomDialog = new ConfigChatRoomDialog(TestActivity.this);
//                configChatRoomDialog.show();

            }
        });
        View mainView = new View(this);

        mainView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
        mainView.setBackground(new GradientDrawable(GradientDrawable.Orientation.RIGHT_LEFT, new int[]{0xAA888888, 0x00888888}));

        AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(
                ScreenUtils.getScreenWidth(this), ViewGroup.LayoutParams.MATCH_PARENT, 0, 0);

        swipeBackLayout = new MySwipeBackLayout(this);
        swipeBackLayout.attachToView(mainView, this);
        content.addView(swipeBackLayout, params);


        swipeBackLayout.post(new Runnable() {
            @Override
            public void run() {
                swipeBackLayout.mSlideOffset = 1;
            }
        });
        swipeBackLayout.openPane();

        ArrayList<String> list = AppSaveInfoUtils.INSTANCE.getWhiteList("white_list_chat_room");
        WhiteListDialog dialog = new WhiteListDialog(this);
        dialog.setType(Type.OFFICIAL);

        dialog.setList(list);
        dialog.show();
    }
 
开发者ID:zhudongya123,项目名称:WechatChatroomHelper,代码行数:51,代码来源:TestActivity.java


注:本文中的android.widget.AbsoluteLayout.addView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。