Java Code Examples for android.transition.Explode#setDuration()
The following examples show how to use
android.transition.Explode#setDuration() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PieActivity.java From PercentageChartView with Apache License 2.0 | 6 votes |
private void setupLayout() { Explode transition = new Explode(); transition.setDuration(600); transition.setInterpolator(new OvershootInterpolator(1f)); getWindow().setEnterTransition(transition); FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter( getSupportFragmentManager(), FragmentPagerItems.with(this) .add("behavior", BehaviorSubFragment.class, new Bundler().putBoolean(ORIENTATION_STATE_ARG, true).get()) .add("progress", ProgressSubFragment.class) .add("background", BackgroundSubFragment.class, new Bundler().putBoolean(OFFSET_STATE_ARG, true).get()) .add("text", TextSubFragment.class) .create()); mViewPager.setAdapter(adapter); mViewPager.setOffscreenPageLimit(3); mTAbs.setViewPager(mViewPager); shadowColor = Color.WHITE; blur = distX = distY = 2f; }
Example 2
Source File: RingActivity.java From PercentageChartView with Apache License 2.0 | 6 votes |
private void setupLayout() { Explode transition = new Explode(); transition.setDuration(600); transition.setInterpolator(new OvershootInterpolator(1f)); getWindow().setEnterTransition(transition); FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter( getSupportFragmentManager(), FragmentPagerItems.with(this) .add("behavior", BehaviorSubFragment.class, new Bundler().putBoolean(ORIENTATION_STATE_ARG, true).get()) .add("progress bar", ProgressSubFragment.class, new Bundler().putBoolean(BAR_STATE_ARG, true).get()) .add("background bar", BackgroundBarSubFragment.class) .add("background", BackgroundSubFragment.class, new Bundler().putBoolean(ORIENTATION_STATE_ARG, false).get()) .add("text", TextSubFragment.class) .create()); mViewPager.setAdapter(adapter); mViewPager.setOffscreenPageLimit(4); mTAbs.setViewPager(mViewPager); shadowColor = Color.WHITE; blur = distX = distY = 2f; }
Example 3
Source File: FillActivity.java From PercentageChartView with Apache License 2.0 | 6 votes |
private void setupLayout() { Explode transition = new Explode(); transition.setDuration(600); transition.setInterpolator(new OvershootInterpolator(1f)); getWindow().setEnterTransition(transition); FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter( getSupportFragmentManager(), FragmentPagerItems.with(this) .add("behavior", BehaviorSubFragment.class, new Bundler().putBoolean(ORIENTATION_STATE_ARG, false).get()) .add("progress", ProgressSubFragment.class) .add("background", BackgroundSubFragment.class, new Bundler().putBoolean(OFFSET_STATE_ARG, true).get()) .add("text", TextSubFragment.class) .create()); mViewPager.setAdapter(adapter); mViewPager.setOffscreenPageLimit(3); mTAbs.setViewPager(mViewPager); shadowColor = Color.WHITE; blur = distX = distY = 2f; }
Example 4
Source File: MainActivity.java From Android-Developer-Fundamentals-Version-2 with GNU General Public License v3.0 | 6 votes |
public void animationsAndTransitions(View view) { switch (view.getId()) { case R.id.image_circle: Intent intent = new Intent(this, MainActivity.class); Explode explode = new Explode(); explode.setDuration(400); getWindow().setExitTransition(explode); intent.putExtra(ANIMATION, EXPLODE_ANIMATION); ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this); startActivity(intent, options.toBundle()); break; case R.id.image_line: Intent intent2 = new Intent(this, MainActivity.class); intent2.putExtra(ANIMATION, FADE_TRANSITION); Fade fade = new Fade(); fade.setDuration(400); getWindow().setExitTransition(fade); startActivity(intent2, ActivityOptions.makeSceneTransitionAnimation(this).toBundle()); break; case R.id.image_square: Animation rotateAnimation = AnimationUtils.loadAnimation(this, R.anim.anim_rotate); mYellowSquare.startAnimation(rotateAnimation); break; case R.id.image_android: Intent intent3 = new Intent(MainActivity.this, SecondActivity.class); ActivityOptions options2 = ActivityOptions.makeSceneTransitionAnimation(this, Pair.create((View) mGreenAndroid, "swap_shared_transition_android_icon"), Pair.create((View) mYellowSquare, "swap_shared_transition_square") ); startActivity(intent3, options2.toBundle()); break; default: break; } }
Example 5
Source File: TextFormatterActivity.java From PercentageChartView with Apache License 2.0 | 5 votes |
private void setupLayout() { Explode transition = new Explode(); transition.setDuration(600); transition.setInterpolator(new OvershootInterpolator(1f)); getWindow().setEnterTransition(transition); mPieChart.setTextFormatter(progress -> { int voters = (int) (progress * maxVoters / 100); if(voters > 1000) { voters /= 1000; return voters + " k voters"; } return voters + " Voters"; }); mFillChart.setTextFormatter(progress -> { int cals = (int) (progress * maxCalories / 100); return cals + " cal"; }); SpannableStringBuilder b = new SpannableStringBuilder(); mRingChart.setTextFormatter(progress -> { int days = (int) (progress * maxDays / 100); // b.clear(); // String text =; // b.append(text); // int start = String.valueOf(days).length(); // int end = b.length(); // b.setSpan(new RelativeSizeSpan(0.4f), 0, start, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); // mText.setText(b); return days + " days"; }); }
Example 6
Source File: GradientColorsActivity.java From PercentageChartView with Apache License 2.0 | 5 votes |
private void setupLayoutAnimation() { Explode transition = new Explode(); transition.setDuration(600); transition.setInterpolator(new OvershootInterpolator(1f)); getWindow().setEnterTransition(transition); displayedMode = MODE_PIE; mConstraintSet = new ConstraintSet(); mConstraintSet.clone(mConstraintLayout); fade = new Fade(); fade.setDuration(400); }
Example 7
Source File: AdaptiveColorsActivity.java From PercentageChartView with Apache License 2.0 | 5 votes |
private void setupLayoutAnimation() { Explode transition = new Explode(); transition.setDuration(600); transition.setInterpolator(new OvershootInterpolator(1f)); getWindow().setEnterTransition(transition); displayedMode = MODE_PIE; mConstraintSet = new ConstraintSet(); mConstraintSet.clone(mConstraintLayout); fade = new Fade(); fade.setDuration(400); }
Example 8
Source File: MaterialAnimationActivity.java From UltimateAndroid with Apache License 2.0 | 5 votes |
private void setupWindowAnimations() { Explode explode = new Explode(); explode.setDuration(2000); getWindow().setExitTransition(explode); Fade fade = new Fade(); getWindow().setReenterTransition(fade); }
Example 9
Source File: TransitionAnimationByExplodeActivity.java From Android-Animation-Set with Apache License 2.0 | 4 votes |
private Transition buildEnterTransitionByCode() { Explode enterTransition = new Explode(); enterTransition.setDuration(500); return enterTransition; }
Example 10
Source File: TransitionAnimationByExplodeActivity.java From Study_Android_Demo with Apache License 2.0 | 4 votes |
private Transition buildEnterTransitionByCode() { Explode enterTransition = new Explode(); enterTransition.setDuration(500); return enterTransition; }
Example 11
Source File: DetailActivity1.java From UltimateAndroid with Apache License 2.0 | 4 votes |
private void setupWindowAnimations() { Explode explode = new Explode(); explode.setDuration(2000); getWindow().setEnterTransition(explode); }