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