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


Java ImageView.setY方法代码示例

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


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

示例1: onCreate

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

    r = (int)Math.sqrt(screenW * screenW + screenH * screenH) + 10;

    ImageView earth = (ImageView) findViewById(R.id.earth);
    targetPlanet = (ImageView) findViewById(R.id.planet_target);
    loginLayout = findViewById(R.id.login_layout);

    earth.setY(screenH / 2);
    targetPlanet.setY(-screenH / 2 - screenW / 2);
    targetPlanet.setScaleX(0.25f);
    targetPlanet.setScaleY(0.25f);

    wowo.addTemporarilyInvisibleViews(0, earth, findViewById(R.id.cloud_blue), findViewById(R.id.cloud_red));
    wowo.addTemporarilyInvisibleViews(0, targetPlanet);
    wowo.addTemporarilyInvisibleViews(2, loginLayout, findViewById(R.id.button));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:GuidePageActivity2.java

示例2: initExpression

import android.widget.ImageView; //导入方法依赖的package包/类
private void initExpression() {

        int dp80 = (int) getResources().getDimension(R.dimen.dp80);
        int dp10 = (int) getResources().getDimension(R.dimen.dp10);
        for (int x=0; x<expressions.length; x++){
            ImageView imageView = new ImageView(this);
            imageView.setPadding(dp10, dp10, dp10, dp10);
            final int result = expressions[x];
            imageView.setImageResource(result);
            imageView.setLayoutParams(new ViewGroup.LayoutParams(windowWidth /4, dp80));
            imageView.setX(x%4* windowWidth /4);
            imageView.setY(x/4* dp80);
            imageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    rl_expression.setVisibility(View.GONE);
                    iv_icon.setImageResource(R.mipmap.icon);
                    addExpressionToWindow(result);
                }
            });
            rl_expression.addView(imageView);
        }
    }
 
开发者ID:Zhaoss,项目名称:WeiXinRecordedDemo,代码行数:24,代码来源:EditVideoActivity.java

示例3: initExpression

import android.widget.ImageView; //导入方法依赖的package包/类
/**
 * 初始化表情
 */
private void initExpression() {

    int dp80 = (int) getResources().getDimension(R.dimen.dp80);
    int dp10 = (int) getResources().getDimension(R.dimen.dp10);
    for (int x=0; x<expressions.length; x++){
        ImageView imageView = new ImageView(this);
        imageView.setPadding(dp10, dp10, dp10, dp10);
        final int result = expressions[x];
        imageView.setImageResource(result);
        imageView.setLayoutParams(new ViewGroup.LayoutParams(windowWidth /4, dp80));
        imageView.setX(x%4* windowWidth /4);
        imageView.setY(x/4* dp80);
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                rl_expression.setVisibility(View.GONE);
                iv_icon.setImageResource(R.mipmap.icon);
                addExpressionToWindow(result);
            }
        });
        rl_expression.addView(imageView);
    }
}
 
开发者ID:Zhaoss,项目名称:WeiXinRecordedDemo,代码行数:27,代码来源:EditVideoActivity.java

示例4: getImageView

import android.widget.ImageView; //导入方法依赖的package包/类
private ImageView getImageView(int x, int y) {
    ImageView imageView = new ImageView(context);
    LayoutParams layoutParams = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    imageView.setLayoutParams(layoutParams);
    imageView.setImageResource(R.drawable.circle);
    imageView.setX(x);
    imageView.setY(y);
    imageView.setOnTouchListener(new TouchListenerImpl());
    return imageView;
}
 
开发者ID:mohammedirfan655,项目名称:document-scanner,代码行数:11,代码来源:PolygonView.java

示例5: addTrainToScreen

import android.widget.ImageView; //导入方法依赖的package包/类
private void addTrainToScreen(Rect trainRect) {
    rootView = new FrameLayout(this);
    engineView = addTrain(trainRect, TrainView.ENGINE, rootView);
    for (int i = 0; i < NUMBER_OF_CARS; i++) {
        carsView.add(addTrain(trainRect, TrainView.CAR, rootView));
    }

    rootView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            fadeOutActivity();
        }
    });

    float iconToWidthFactor = 0.34f;
    ImageView startRoof = new ImageView(this);
    startRoof.setImageResource(R.drawable.long_start_point_roof);
    int trainRectSize = (int) (trainRect.width() * (1f - iconToWidthFactor));
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(trainRectSize, trainRectSize);
    startRoof.setX(trainRect.left + trainRect.width() * iconToWidthFactor / 2 - 15);
    startRoof.setY(trainRect.top + trainRect.width() * iconToWidthFactor / 2);
    rootView.addView(startRoof, lp);

    startRoof.setAlpha(0f);
    startRoof.animate()
            .alpha(1f)
            .setInterpolator(new DecelerateInterpolator())
            .setDuration(500)
            .start();

    setContentView(rootView);
}
 
开发者ID:nirhart,项目名称:shortrain,代码行数:33,代码来源:TrainActionActivity.java

示例6: creatImg

import android.widget.ImageView; //导入方法依赖的package包/类
ImageView creatImg(){
    ImageView top = new ImageView(getContext());
    top.setLayoutParams(new LayoutParams(width,width));
    top.setY(height - width);
    top.setBackgroundColor(0xFF999999);
    top.setScaleType(ImageView.ScaleType.CENTER_CROP);
    return top;
}
 
开发者ID:KishanV,项目名称:Android-Music-Player,代码行数:9,代码来源:imgSlider.java

示例7: songSliderThumb

import android.widget.ImageView; //导入方法依赖的package包/类
public songSliderThumb(Context context, int width, int height,int ID) {
    super(context, width, height);
    this.ID = ID;
    setBackgroundColor(0x0000000);
    //SongSliderImg = new songSliderImg(width,height,0,0);
    RaidiusSqure = new radiusSqure(width,height,0,0,width*0.1f);
    RaidiusSqure.setColor(0xFFFFFFFF);

    name = textImg.getFMText(getContext(),"DEMO", Ui.cd.getHt(16));

    back = thumbBack.getFMview(getContext(),false);
    back.setSize(width - Ui.cd.getHt(2),height - Ui.cd.getHt(2));
    back.setX(Ui.cd.getHt(1));
    back.setY(Ui.cd.getHt(1));
    back.setClickable(false);
    addView(back);

    Iv = new ImageView(context){
        @Override
        protected void onDraw(Canvas canvas) {
            canvas.clipPath(back.img.mask);
            super.onDraw(canvas);
        }
    };
    Iv.setLayoutParams(new FrameLayout.LayoutParams(width - Ui.cd.getHt(2),height - Ui.cd.getHt(2)));
     addView(Iv);
    Iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
    Iv.setBackgroundColor(0x00FFFFFF);
    Iv.setX(Ui.cd.getHt(1));
    Iv.setY(Ui.cd.getHt(1));
    //setImg("3.png");

    ring = thumbRing.getFMview(getContext(),false);
    ring.setSize(width,height);
    ring.setClickable(false);
    addView(ring);
    if(android.os.Build.VERSION.SDK_INT <= 18){
        setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    }

   // addView(name);
}
 
开发者ID:KishanV,项目名称:Android-Music-Player,代码行数:43,代码来源:songSliderThumb.java


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