當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageView.setScaleY方法代碼示例

本文整理匯總了Java中android.widget.ImageView.setScaleY方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageView.setScaleY方法的具體用法?Java ImageView.setScaleY怎麽用?Java ImageView.setScaleY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.ImageView的用法示例。


在下文中一共展示了ImageView.setScaleY方法的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: 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

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

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

示例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.setScaleY方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。