本文整理汇总了Java中io.codetail.widget.RevealFrameLayout类的典型用法代码示例。如果您正苦于以下问题:Java RevealFrameLayout类的具体用法?Java RevealFrameLayout怎么用?Java RevealFrameLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RevealFrameLayout类属于io.codetail.widget包,在下文中一共展示了RevealFrameLayout类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import io.codetail.widget.RevealFrameLayout; //导入依赖的package包/类
public void init() {
if (isInEditMode()) return;
LayoutInflater layoutInflater = LayoutInflater.from(getContext());
drawerMode = Setup.Companion.appSettings().getDrawerStyle();
switch (drawerMode) {
case DrawerMode.HORIZONTAL_PAGED:
drawerViewPaged = (AppDrawerPaged) layoutInflater.inflate(R.layout.view_app_drawer_paged, this, false);
addView(drawerViewPaged);
layoutInflater.inflate(R.layout.view_drawer_indicator, this, true);
break;
case DrawerMode.VERTICAL:
drawerViewGrid = (AppDrawerVertical) layoutInflater.inflate(R.layout.view_app_drawer_vertical, this, false);
int marginHorizontal = Tool.INSTANCE.dp2px(Setup.Companion.appSettings().getVerticalDrawerHorizontalMargin(), getContext());
int marginVertical = Tool.INSTANCE.dp2px(Setup.Companion.appSettings().getVerticalDrawerVerticalMargin(), getContext());
RevealFrameLayout.LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
lp.leftMargin = marginHorizontal;
lp.rightMargin = marginHorizontal;
lp.topMargin = marginVertical;
lp.bottomMargin = marginVertical;
addView(drawerViewGrid, lp);
break;
}
}
示例2: ViewHolder
import io.codetail.widget.RevealFrameLayout; //导入依赖的package包/类
public ViewHolder(View contentView) {
super(contentView);
card = (CardView) contentView.findViewById(R.id.card);
chartlet = (ImageView) contentView.findViewById(R.id.chartlet_review);
download = (TextView) contentView.findViewById(R.id.download_btn);
mReveal = (RevealFrameLayout) card.getParent();
}
示例3: setContentView
import io.codetail.widget.RevealFrameLayout; //导入依赖的package包/类
@Override
public void setContentView(final View userView) {
int viewRootId = getResources().getIdentifier("activity_circular_reveal", "layout", getPackageName());
super.setContentView(viewRootId);
final RevealFrameLayout revealFrameLayout = (RevealFrameLayout)findViewById(R.id.ripples_effect_activity_root);
revealFrameLayout.addView(userView);
int[] clickPoint = getIntent().getIntArrayExtra("start_point");
if(null != clickPoint){
mClickPoint = clickPoint;
}
final DisplayMetrics dm = new DisplayMetrics();
WindowManager wm = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
wm.getDefaultDisplay().getMetrics(dm);
revealFrameLayout.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
revealFrameLayout.getViewTreeObserver().removeOnPreDrawListener(this);
int finalRadius = Math.max(dm.widthPixels, dm.heightPixels);
SupportAnimator animator =
ViewAnimationUtils.createCircularReveal(userView, mClickPoint[0], mClickPoint[1], 0, finalRadius);
animator.setInterpolator(new AccelerateDecelerateInterpolator());
animator.setDuration(circularRevealDuration);
animator.start();
return false;
}
});
}