本文整理汇总了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已加入,不用处理
}
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}