本文整理了Java中android.support.v7.widget.CardView.getWidth()
方法的一些代码示例,展示了CardView.getWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CardView.getWidth()
方法的具体详情如下:
包路径:android.support.v7.widget.CardView
类名称:CardView
方法名:getWidth
暂无
代码示例来源:origin: arimorty/floatingsearchview
private int actionMenuAvailWidth() {
if (isInEditMode()) {
return mQuerySection.getMeasuredWidth() / 2;
}
return mQuerySection.getWidth() / 2;
}
代码示例来源:origin: fanrunqi/MaterialLogin
public void animateRevealShow() {
Animator mAnimator = ViewAnimationUtils.createCircularReveal(cvAdd, cvAdd.getWidth()/2,0, fab.getWidth() / 2, cvAdd.getHeight());
mAnimator.setDuration(500);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
}
@Override
public void onAnimationStart(Animator animation) {
cvAdd.setVisibility(View.VISIBLE);
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
代码示例来源:origin: fanrunqi/MaterialLogin
public void animateRevealClose() {
Animator mAnimator = ViewAnimationUtils.createCircularReveal(cvAdd,cvAdd.getWidth()/2,0, cvAdd.getHeight(), fab.getWidth() / 2);
mAnimator.setDuration(500);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
cvAdd.setVisibility(View.INVISIBLE);
super.onAnimationEnd(animation);
fab.setImageResource(R.drawable.plus);
AActivityTwo.super.onBackPressed();
}
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
@Override
代码示例来源:origin: freedom10086/Ruisi
private void hide_search_view() {
animator = ViewAnimationUtils.createCircularReveal(
searchCard,
searchCard.getWidth(),
0,
(float) Math.hypot(searchCard.getWidth(), searchCard.getHeight()),
0);
代码示例来源:origin: freedom10086/Ruisi
private void hideSearchView() {
animator = ViewAnimationUtils.createCircularReveal(
searchCard,
searchCard.getWidth(),
0,
(float) Math.hypot(searchCard.getWidth(), searchCard.getHeight()),
0);
animator.setInterpolator(new DecelerateInterpolator());
animator.setDuration(260);
animator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
searchCard.setVisibility(View.GONE);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
animator.start();
}
代码示例来源:origin: freedom10086/Ruisi
private void show_search_view() {
searchCard.setVisibility(View.VISIBLE);
animator = ViewAnimationUtils.createCircularReveal(
searchCard,
searchCard.getWidth(),
0,
0,
(float) Math.hypot(searchCard.getWidth(), searchCard.getHeight()));
animator.setInterpolator(new AccelerateInterpolator());
animator.setDuration(260);
animator.start();
animator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
KeyboardUtil.showKeyboard(searchInput);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
}
代码示例来源:origin: freedom10086/Ruisi
private void showSearchView() {
searchCard.setVisibility(View.VISIBLE);
animator = ViewAnimationUtils.createCircularReveal(
searchCard,
searchCard.getWidth(),
0,
0,
(float) Math.hypot(searchCard.getWidth(), searchCard.getHeight()));
animator.setInterpolator(new AccelerateInterpolator());
animator.setDuration(260);
animator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
KeyboardUtil.showKeyboard(searchInput);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
});
animator.start();
}
代码示例来源:origin: hieuapp/android-firebase-chat
public void animateRevealShow() {
Animator mAnimator = ViewAnimationUtils.createCircularReveal(cvAdd, cvAdd.getWidth()/2,0, fab.getWidth() / 2, cvAdd.getHeight());
mAnimator.setDuration(500);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
}
@Override
public void onAnimationStart(Animator animation) {
cvAdd.setVisibility(View.VISIBLE);
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
代码示例来源:origin: zhangke3016/TranslationCompat
public void animateRevealShow() {
Animator mAnimator = ViewAnimationCompatUtils.createCircularReveal(cvAdd, cvAdd.getWidth()/2,0, fab.getWidth() / 2, cvAdd.getHeight());
mAnimator.setDuration(300);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
}
@Override
public void onAnimationStart(Animator animation) {
cvAdd.setVisibility(View.VISIBLE);
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
代码示例来源:origin: hieuapp/android-firebase-chat
public void animateRevealClose() {
Animator mAnimator = ViewAnimationUtils.createCircularReveal(cvAdd,cvAdd.getWidth()/2,0, cvAdd.getHeight(), fab.getWidth() / 2);
mAnimator.setDuration(500);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
cvAdd.setVisibility(View.INVISIBLE);
super.onAnimationEnd(animation);
fab.setImageResource(R.drawable.ic_signup);
RegisterActivity.super.onBackPressed();
}
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
@Override
代码示例来源:origin: lv910929/RxDemo
public void animateRevealShow() {
Animator mAnimator = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
mAnimator = ViewAnimationUtils.createCircularReveal(cardViewRegister, cardViewRegister.getWidth() / 2, 0, floatButtonExit.getWidth() / 2, cardViewRegister.getHeight());
}
mAnimator.setDuration(500);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
}
@Override
public void onAnimationStart(Animator animation) {
cardViewRegister.setVisibility(View.VISIBLE);
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
代码示例来源:origin: zhangke3016/TranslationCompat
public void animateRevealClose() {
Animator mAnimator = ViewAnimationCompatUtils.createCircularReveal(cvAdd,cvAdd.getWidth()/2,0, cvAdd.getHeight(), fab.getWidth() / 2);
mAnimator.setDuration(300);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
cvAdd.setVisibility(View.INVISIBLE);
super.onAnimationEnd(animation);
fab.setImageResource(R.drawable.plus);
// RegisterActivity.super.onBackPressed();
TransitionController.getInstance().exitActivity(RegisterActivity.this);
}
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
@Override
代码示例来源:origin: lv910929/RxDemo
public void animateRevealClose() {
Animator mAnimator = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
mAnimator = ViewAnimationUtils.createCircularReveal(cardViewRegister, cardViewRegister.getWidth() / 2, 0, cardViewRegister.getHeight(), floatButtonExit.getWidth() / 2);
mAnimator.setDuration(500);
mAnimator.setInterpolator(new AccelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
cardViewRegister.setVisibility(View.INVISIBLE);
super.onAnimationEnd(animation);
floatButtonExit.setImageResource(R.drawable.plus);
RegisterActivity.super.onBackPressed();
}
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
}
代码示例来源:origin: shiburagi/Drawer-Behavior
void updateSlideOffset(CardView child, Setting setting, float width, float slideOffset, boolean isLeftDrawer) {
if (setting.degree > 0) {
float percentage = (setting.degree) / 90f;
ViewCompat.setX(child, width * slideOffset - (child.getWidth()/2) * percentage * slideOffset);
ViewCompat.setRotationY(child, (isLeftDrawer ? -1 : 1) * setting.degree * slideOffset);
} else
super.updateSlideOffset(child, setting, width, slideOffset, isLeftDrawer);
}
代码示例来源:origin: limuyang2/CardSearchView
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Animator animatorHide = ViewAnimationUtils.createCircularReveal(search,
search.getWidth() - dip2px(context, 23),
dip2px(context, 23),
(float) Math.hypot(search.getWidth(), search.getHeight()),
0);
animatorHide.addListener(new Animator.AnimatorListener() {
代码示例来源:origin: zhangke3016/TranslationCompat
@Override
public void onTransitionEnd(Animator animator) {
getSupportActionBar().show();
mFloatingActionButton.animate().setDuration(300).scaleX(1).scaleY(1);
//ObjectAnimator mAnimator = ObjectAnimator.ofFloat(nsv,"translationY",nsv.getHeight(),0);
Animator mAnimator = ViewAnimationCompatUtils.createCircularReveal( cardview, 0, 0, cardview.getWidth() / 2, cardview.getHeight());
mAnimator.setDuration(500);
mAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
}
@Override
public void onAnimationStart(Animator animation) {
nsv.setVisibility(View.VISIBLE);
super.onAnimationStart(animation);
}
});
mAnimator.start();
}
代码示例来源:origin: Jerey-Jobs/KeepGank
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
final Animator animatorHide = ViewAnimationUtils.createCircularReveal(search,
search.getWidth() - dip2px(context, 23),
dip2px(context, 23),
(float) Math.hypot(search.getWidth(), search.getHeight()),
0);
animatorHide.addListener(new Animator.AnimatorListener() {
代码示例来源:origin: shrikanth7698/Custom-Navigation-Drawer
final TextView title1 = (TextView) menuLL.findViewWithTag("tv"+currentPos);
backCV1.animate().translationX(rootRL.getX()-backCV1.getWidth()).setDuration(300).start();
backCV.setVisibility(View.INVISIBLE);
System.out.println("Drawer Testing "+backCV.getTag());
backCV.animate().translationX(rootRL.getX()-backCV.getWidth()).setDuration(1).start();
backCV.animate().translationX(rootRL.getX()).setDuration(300).start();
backCV.setVisibility(View.VISIBLE);
代码示例来源:origin: Shahroz16/material-searchview
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
final Animator animatorHide = ViewAnimationUtils.createCircularReveal(cardLayout,
cardLayout.getWidth() - Util.dpToPx(getContext(), 56),
Util.dpToPx(getContext(), 23),
(float) Math.hypot(cardLayout.getWidth(), cardLayout.getHeight()),
0);
animatorHide.addListener(new Animator.AnimatorListener() {
代码示例来源:origin: limuyang2/CardSearchView
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Animator animator = ViewAnimationUtils.createCircularReveal(search,
search.getWidth() - dip2px(context, 23),
dip2px(context, 23),
0,
(float) Math.hypot(search.getWidth(), search.getHeight()));
animator.addListener(new Animator.AnimatorListener() {
@Override
内容来源于网络,如有侵权,请联系作者删除!