use of com.yalantis.starwarsdemo.widget.ClipRevealFrame in project StarWars.Android by Yalantis.
the class SideFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mRootView = inflater.cloneInContext(new ContextThemeWrapper(getContext(), getTheme())).inflate(R.layout.fragment_side, container, false);
final Bundle args = getArguments();
if (args != null) {
mRootView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
v.removeOnLayoutChangeListener(this);
int cx = args.getInt("cx");
int cy = args.getInt("cy");
// get the hypothenuse so the mRadius is from one corner to the other
float radius = (float) Math.hypot(right, bottom);
// http://developer.android.com/guide/topics/graphics/hardware-accel.html
if (Build.VERSION.SDK_INT >= 18) {
Animator reveal = createCheckoutRevealAnimator((ClipRevealFrame) v, cx, cy, 28f, radius);
reveal.start();
} else {
removeOldSideFragment();
}
}
});
}
ButterKnife.bind(this, mRootView);
return mRootView;
}
Aggregations