本文整理汇总了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));
}
示例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);
}
}
}
示例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.
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}