本文整理汇总了Java中android.support.v7.widget.AppCompatImageView.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatImageView.setVisibility方法的具体用法?Java AppCompatImageView.setVisibility怎么用?Java AppCompatImageView.setVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatImageView
的用法示例。
在下文中一共展示了AppCompatImageView.setVisibility方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LocaleUtils.loadLocale(this);
setContentView(R.layout.activity_splash);
AppCompatImageView logo = findViewById(R.id.logo);
logo.setVisibility(View.VISIBLE);
// final SpringyAnimator scaleY = new SpringyAnimator(SpringAnimationType.SCALEY, 5, 3, 0.5f, 1);
// final SpringyAnimator rotate = new SpringyAnimator(SpringAnimationType.ROTATEY, 5, 3, 180, 0);
// rotate.setDelay(100);
// scaleY.setDelay(200);
// rotate.startSpring(logo);
// scaleY.startSpring(logo);
new Timer().schedule(new TimerTask() {
@Override
public void run() {
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finishAfterTransition();
}
}, 800);
}
示例2: init
import android.support.v7.widget.AppCompatImageView; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs, int defStyleAttr) {
mImageHeart = new AppCompatImageView(context);
TypedArray a = context.getTheme().obtainStyledAttributes(
attrs,
R.styleable.InstaLikeView,
defStyleAttr, 0);
int likeColor = a.getColor(R.styleable.InstaLikeView_likeColor, ContextCompat.getColor(context, R.color.heartColor));
int likeSrc = a.getResourceId(R.styleable.InstaLikeView_likeSrc, R.drawable.img_heart);
int likeSize = a.getDimensionPixelSize(R.styleable.InstaLikeView_likeSize, getResources().getDimensionPixelSize(R.dimen.likeSize));
LayoutParams heartParams = new LayoutParams(likeSize, likeSize);
heartParams.addRule(CENTER_IN_PARENT, TRUE);
mImageHeart.setLayoutParams(heartParams);
mImageHeart.setVisibility(GONE);
mImageHeart.setImageResource(likeSrc);
mImageHeart.setColorFilter(likeColor);
addView(mImageHeart);
}