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