本文整理了Java中android.widget.ImageView.setRotation()
方法的一些代码示例,展示了ImageView.setRotation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setRotation()
方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setRotation
暂无
代码示例来源:origin: jdsjlzx/LRecyclerView
@Override public void run() {
if (mState == STATE_REFRESHING) {
mRefreshView.setRotation(mRotateAngle += 8);
mHandler.post(this);
}
}
}, 50);
代码示例来源:origin: westnordost/StreetComplete
@AnyThread public void onMapOrientation(float rotation, float tilt)
{
getActivity().runOnUiThread(() -> {
compassNeedle.setRotation((float) (180*rotation/Math.PI));
compassNeedle.setRotationX((float) (180*tilt/Math.PI));
});
}
代码示例来源:origin: jdsjlzx/LRecyclerView
@Override public void run() {
if (mState == STATE_REFRESHING) {
mRefreshView.setRotation(mRotateAngle += 8);
mHandler.post(this);
}
}
}, 50);
代码示例来源:origin: GitLqr/LQRWeChat
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case 0:
if (rainbowTop > rainbowStartTop) {
rainbowTop -= 10;
requestLayout();
mHandler.sendEmptyMessageDelayed(0, 15);
}
break;
case 1:
if (rainbowTop <= rainbowStickyTop) {
if (rainbowTop < rainbowStickyTop) {
rainbowTop += 10;
if (rainbowTop > rainbowStickyTop) {
rainbowTop = rainbowStickyTop;
}
}
mRainbowView.setRotation(rainbowRotateAngle -= 10);
} else {
mRainbowView.setRotation(rainbowRotateAngle += 10);
}
requestLayout();
mHandler.sendEmptyMessageDelayed(1, 15);
break;
}
}
};
代码示例来源:origin: ZieIony/Carbon
@Override
public void setRotation(float rotation) {
super.setRotation(rotation);
invalidateParentIfNeeded();
fireOnTransformationChangedListener();
}
代码示例来源:origin: jaydenxiao2016/AndroidFire
@Override
public void addTextureView() {
super.addTextureView();
coverImageView.setRotation(JCMediaManager.instance().videoRotation);
}
代码示例来源:origin: mikepenz/MaterialDrawer
@Override
public void bindView(ViewHolder viewHolder, List payloads) {
super.bindView(viewHolder, payloads);
Context ctx = viewHolder.itemView.getContext();
//bind the basic view parts
bindViewHelper(viewHolder);
//make sure all animations are stopped
if (viewHolder.arrow.getDrawable() instanceof IconicsDrawable) {
((IconicsDrawable) viewHolder.arrow.getDrawable()).color(this.arrowColor != null ? this.arrowColor.color(ctx) : getIconColor(ctx));
}
viewHolder.arrow.clearAnimation();
if (!isExpanded()) {
viewHolder.arrow.setRotation(this.arrowRotationAngleStart);
} else {
viewHolder.arrow.setRotation(this.arrowRotationAngleEnd);
}
//call the onPostBindView method to trigger post bind view actions (like the listener to modify the item if required)
onPostBindView(this, viewHolder.itemView);
}
代码示例来源:origin: jdsjlzx/LRecyclerView
/**
* refreshView在刷新区间内相对位移并跟随位移速度旋转
*/
private void refreshTranslation(int currentHeight, float offSet) {
if ((currentHeight - mHeaderViewHeight) / 2 < mRefreshShowTranslationY - mRefreshHideTranslationY) { // 判断是否在非刷新区间
float translationY = mRefreshView.getTranslationY() - offSet / 2; // 布局高度增加offset 相当于距离上边距offSet / 2
if (translationY > mRefreshShowTranslationY) {
translationY = mRefreshShowTranslationY;
} else if (translationY < mRefreshHideTranslationY) {
translationY = mRefreshHideTranslationY;
}
if (Math.abs(translationY) != mRefreshView.getTranslationY()) {
mRefreshView.setTranslationY(translationY);
}
}
mRefreshView.setRotation(mRotateAngle -= offSet);//旋转,角度大小跟随偏移量
}
代码示例来源:origin: jdsjlzx/LRecyclerView
/**
* refreshView在刷新区间内相对位移并跟随位移速度旋转
*/
private void refreshTranslation(int currentHeight, float offSet) {
if ((currentHeight - mHeaderViewHeight) / 2 < mRefreshShowTranslationY - mRefreshHideTranslationY) { // 判断是否在非刷新区间
float translationY = mRefreshView.getTranslationY() - offSet / 2; // 布局高度增加offset 相当于距离上边距offSet / 2
if (translationY > mRefreshShowTranslationY) {
translationY = mRefreshShowTranslationY;
} else if (translationY < mRefreshHideTranslationY) {
translationY = mRefreshHideTranslationY;
}
if (Math.abs(translationY) != mRefreshView.getTranslationY()) {
mRefreshView.setTranslationY(translationY);
}
}
mRefreshView.setRotation(mRotateAngle -= offSet);//旋转,角度大小跟随偏移量
}
代码示例来源:origin: GitLqr/LQRWeChat
rTop = rainbowMaxTop;
rainbowTop = rTop;
mRainbowView.setRotation(rainbowRotateAngle);
} else {
rTop = rainbowMaxTop;
rainbowTop = rTop;
rainbowRotateAngle += (rainbowTop - lastTop) * 3;
mRainbowView.setRotation(rainbowRotateAngle);
代码示例来源:origin: mikepenz/MaterialDrawer
viewHolder.arrow.setRotation(this.arrowRotationAngleStart);
} else {
viewHolder.arrow.setRotation(this.arrowRotationAngleEnd);
代码示例来源:origin: arimorty/floatingsearchview
mLeftAction.setImageDrawable(mIconBackArrow);
if (withAnim) {
mLeftAction.setRotation(45);
mLeftAction.setAlpha(0.0f);
ObjectAnimator rotateAnim = ViewPropertyObjectAnimator.animate(mLeftAction).rotation(0).get();
代码示例来源:origin: nuptboyzhb/SuperSwipeRefreshLayout
@Override
public void onPullEnable(boolean enable) {
textView.setText(enable ? "松开刷新" : "下拉刷新");
imageView.setVisibility(View.VISIBLE);
imageView.setRotation(enable ? 180 : 0);
}
});
代码示例来源:origin: nuptboyzhb/SuperSwipeRefreshLayout
@Override
public void onPushEnable(boolean enable) {
footerTextView.setText(enable ? "松开加载" : "上拉加载");
footerImageView.setVisibility(View.VISIBLE);
footerImageView.setRotation(enable ? 0 : 180);
}
代码示例来源:origin: nuptboyzhb/SuperSwipeRefreshLayout
@Override
public void onPullEnable(boolean enable) {
textView.setText(enable ? "松开刷新" : "下拉刷新");
imageView.setVisibility(View.VISIBLE);
imageView.setRotation(enable ? 180 : 0);
}
});
代码示例来源:origin: nuptboyzhb/SuperSwipeRefreshLayout
@Override
public void onPullEnable(boolean enable) {
textView.setText(enable ? "松开刷新" : "下拉刷新");
imageView.setVisibility(View.VISIBLE);
imageView.setRotation(enable ? 180 : 0);
}
});
代码示例来源:origin: bignerdranch/expandable-recycler-view
@SuppressLint("NewApi")
@Override
public void setExpanded(boolean expanded) {
super.setExpanded(expanded);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
if (expanded) {
mArrowExpandImageView.setRotation(ROTATED_POSITION);
} else {
mArrowExpandImageView.setRotation(INITIAL_POSITION);
}
}
}
代码示例来源:origin: fossasia/pslab-android
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
Float value = (float) MathUtils.map((double) slideOffset, 0.0, 1.0, 0.0, 0.8);
tvShadow.setVisibility(View.VISIBLE);
tvShadow.setAlpha(value);
arrowUpDown.setRotation(slideOffset * 180);
}
});
代码示例来源:origin: AnthonyFermin/DropDownView
@Override
protected void onResume() {
super.onResume();
headerChevronIV.setRotation(dropDownView.isExpanded()
? 180f : 0f);
}
代码示例来源:origin: fossasia/pslab-android
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
Float value = (float) MathUtils.map((double) slideOffset, 0.0, 1.0, 0.0, 0.8);
tvShadow.setVisibility(View.VISIBLE);
tvShadow.setAlpha(value);
arrowUpDown.setRotation(slideOffset * 180);
}
});
内容来源于网络,如有侵权,请联系作者删除!