本文整理匯總了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);
}