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


Java ImageView.setScaleX方法代码示例

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


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

import android.widget.ImageView; //导入方法依赖的package包/类
private void initOtherViews() {
    layoutAbout = (LinearLayout) findViewById(R.id.layout_about);
    layoutAbout.setVisibility(View.VISIBLE);
    layoutAbout.setAlpha(0);
    layoutAbout.setTranslationY(-30);
    layoutAbout.animate()
            .setDuration(300)
            .alpha(1)
            .translationY(0);

    ivAdd = (ImageView) findViewById(R.id.iv_add);
    ivAdd.setVisibility(View.VISIBLE);
    ivAdd.setScaleX(0);
    ivAdd.setScaleY(0);
    ivAdd.animate()
            .setDuration(200)
            .scaleX(1)
            .scaleY(1);
}
 
开发者ID:huzenan,项目名称:EasyTransition,代码行数:20,代码来源:DetailActivity.java

示例3: onCreateTileView

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void onCreateTileView(View tileView) throws Throwable {
    super.onCreateTileView(tileView);

    if (isPrimary() && hasField(tileView, "mIconFrame") && !Utils.isOxygenOs35Rom()) {
        mDataOffView = new ImageView(mContext);
        mDataOffView.setImageDrawable(mGbContext.getDrawable(R.drawable.ic_mobile_data_off));
        mDataOffView.setVisibility(View.GONE);
        FrameLayout iconFrame = (FrameLayout) XposedHelpers.getObjectField(tileView, "mIconFrame");
        iconFrame.addView(mDataOffView, FrameLayout.LayoutParams.WRAP_CONTENT,
                FrameLayout.LayoutParams.WRAP_CONTENT);
        if (mScalingFactor != 1f) {
            mDataOffView.setScaleX(mScalingFactor);
            mDataOffView.setScaleY(mScalingFactor);
        }
        if (PhoneWrapper.hasMsimSupport()) {
            FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mDataOffView.getLayoutParams();
            int marginPx = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, -4,
                    mContext.getResources().getDisplayMetrics()));
            lp.leftMargin = marginPx;
            lp.topMargin = Math.round(marginPx/2f);
            mDataOffView.setLayoutParams(lp);
        }
    }
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:26,代码来源:CellularTile.java

示例4: transformPage

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void transformPage(View view, float position) {

    int pageWidth = view.getWidth();
    ImageView imgView = (ImageView)view.findViewById(R.id.img);
    if (position < -1) { // [-Infinity,-1)
        // This page is way off-screen to the left.
    } else if (position <= 0) { // [-1,0]

        view.setAlpha((1 - MIN_ALPHA) * (1 - Math.abs(position)) + MIN_ALPHA);
        float transX = pageWidth * -position;
        view.setTranslationX(transX);
        float scale = (DEFAULT_SCALE - 1.0f) * (1 - Math.abs(position)) + 1;
        imgView.setScaleX(scale);
        imgView.setScaleY(scale);

    } else if (position <= 1) { // (0,1]
        imgView.setAlpha(1.0f);
        imgView.setScaleX(DEFAULT_SCALE);
        imgView.setScaleY(DEFAULT_SCALE);

    } else { // (1,+Infinity]
        // This page is way off-screen to the right.
    }
}
 
开发者ID:lycheetw,项目名称:SwipeSectorLayout,代码行数:26,代码来源:CustomTransformer.java

示例5: setRotation

import android.widget.ImageView; //导入方法依赖的package包/类
public static void setRotation(ImageView view,float degree) {
    view.setRotation(degree);
    if (view.getDrawable() != null) {
        if (degree == 90 || degree == 270) {
            int viewWidth = view.getDrawable().getIntrinsicWidth();// mImageView.getWidth();
            int viewHeight = view.getDrawable().getIntrinsicHeight();//mImageView.getHeight();
            view.setScaleX(viewWidth / (float) viewHeight);
            view.setScaleY(viewHeight / (float) viewHeight);
        } else {
            view.setScaleX(1);
            view.setScaleY(1);
        }
    }
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:15,代码来源:BitmapCommonUtils.java

示例6: transformPage

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void transformPage(ImageView ivBg, float position, int direction) {
    ivBg.setScaleX(mScale);
    ivBg.setScaleY(mScale);
    float totalMoveWidth = ivBg.getWidth() * ((mScale - 1) / 2);
    int lastPosition = Math.round(position);
    float mFraction;
    if (lastPosition % 2 == 0) {
        mFraction = -1 * (float) Math.sin(Math.PI * position);
    } else {
        mFraction = (float) Math.sin(Math.PI * position);
    }
    ivBg.setTranslationX(totalMoveWidth * mFraction);
}
 
开发者ID:codeestX,项目名称:ECardFlow,代码行数:15,代码来源:MoveAnimMode.java

示例7: transformPage

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void transformPage(ImageView ivBg, float position, int direction) {
    ivBg.setScaleX(mScale);
    ivBg.setScaleY(mScale);
    float totalMoveWidth = ivBg.getWidth() * ((mScale - 1) / 2);
    int lastPosition = Math.round(position);
    float mFraction;
    if (lastPosition % 2 == 0) {
        mFraction = -1 * (float) Math.sin(Math.PI * position);
    } else {
        mFraction = (float) Math.sin(Math.PI * position);
    }
    ivBg.setTranslationY(totalMoveWidth * mFraction);
}
 
开发者ID:codeestX,项目名称:ECardFlow,代码行数:15,代码来源:CrossMoveAnimMode.java

示例8: ItemHolder

import android.widget.ImageView; //导入方法依赖的package包/类
public ItemHolder(View itemView) {
    super(itemView);

    mIconImage = (ImageView) itemView.findViewById(R.id.listViewLeftIcon);

    mTitle = (TextView) itemView.findViewById(R.id.listViewTitleText);
    mSubTitle = (TextView) itemView.findViewById(R.id.listViewSubText);
    duration = (TextView) itemView.findViewById(R.id.listViewRightSubText);
    duration.setVisibility(View.INVISIBLE);

    mTitle.setTypeface(TypefaceHelper.getTypeface(itemView.getContext().getApplicationContext(), TypefaceHelper.FUTURA_BOOK));
    mSubTitle.setTypeface(TypefaceHelper.getTypeface(itemView.getContext().getApplicationContext(), TypefaceHelper.FUTURA_BOOK));

    mOverFlow = (ImageView) itemView.findViewById(R.id.listViewOverflow);

    mOverFlow.setOnClickListener(this);
    mOverFlow.setVisibility(View.VISIBLE);
    mOverFlow.setOnClickListener(this);
    itemView.setOnClickListener(this);

    RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) itemView.getLayoutParams();
    params.height = (int) mApp.convertDpToPixels(72.0f, mContext);
    itemView.setLayoutParams(params);

    mIconImage.setScaleX(0.55f);
    mIconImage.setScaleY(0.55f);

}
 
开发者ID:reyanshmishra,项目名称:Rey-MusicPlayer,代码行数:29,代码来源:FolderAdapter.java

示例9: transformPage

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void transformPage(ImageView ivBg, float position, int direction) {
    float mFraction = mScaleRate * (float) Math.abs(Math.sin(Math.PI * position));
    ivBg.setScaleX(1 + mFraction);
    ivBg.setScaleY(1 + mFraction);
}
 
开发者ID:codeestX,项目名称:ECardFlow,代码行数:7,代码来源:ScaleAnimMode.java


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