android.transition.ChangeBounds Java Examples
The following examples show how to use
android.transition.ChangeBounds.
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: ProgramEventDetailActivity.java From dhis2-android-capture-app with BSD 3-Clause "New" or "Revised" License | 7 votes |
@Override public void showHideFilter() { Transition transition = new ChangeBounds(); transition.setDuration(200); TransitionManager.beginDelayedTransition(binding.backdropLayout, transition); backDropActive = !backDropActive; ConstraintSet initSet = new ConstraintSet(); initSet.clone(binding.backdropLayout); binding.filterOpen.setVisibility(backDropActive ? View.VISIBLE : View.GONE); if (backDropActive) { initSet.connect(R.id.eventsLayout, ConstraintSet.TOP, R.id.filterLayout, ConstraintSet.BOTTOM, 50); } else { initSet.connect(R.id.eventsLayout, ConstraintSet.TOP, R.id.backdropGuideTop, ConstraintSet.BOTTOM, 0); } initSet.applyTo(binding.backdropLayout); }
Example #2
Source File: AnswerDetailActivity.java From AndroidPlusJava with GNU General Public License v3.0 | 6 votes |
@Override protected void init() { super.init(); String serialised = getIntent().getStringExtra(Constant.EXTRA_ANSWER); try { mAnswer = (Answer) AVObject.parseAVObject(serialised); } catch (Exception e) { e.printStackTrace(); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mQuestionTitle.setTransitionName(getString(R.string.question_title_transition)); mAnswerText.setTransitionName(getString(R.string.answer_transition)); ChangeBounds changeBounds = new ChangeBounds(); changeBounds.setPathMotion(new ArcMotion()); getWindow().setSharedElementEnterTransition(changeBounds); } initActionBar(); initViews(); }
Example #3
Source File: SearchTEActivity.java From dhis2-android-capture-app with BSD 3-Clause "New" or "Revised" License | 6 votes |
private void swipeFilters(boolean general) { Transition transition = new ChangeBounds(); transition.setDuration(200); TransitionManager.beginDelayedTransition(binding.backdropLayout, transition); if (backDropActive && !general && switchOpenClose == 0) switchOpenClose = 1; else if (backDropActive && general && switchOpenClose == 1) switchOpenClose = 0; else { switchOpenClose = general ? 0 : 1; backDropActive = !backDropActive; } binding.filterOpen.setVisibility(backDropActive ? View.VISIBLE : View.GONE); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) activeFilter(general); }
Example #4
Source File: DataSetDetailActivity.java From dhis2-android-capture-app with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public void showHideFilter() { Transition transition = new ChangeBounds(); transition.setDuration(200); TransitionManager.beginDelayedTransition(binding.backdropLayout, transition); backDropActive = !backDropActive; ConstraintSet initSet = new ConstraintSet(); initSet.clone(binding.backdropLayout); if (backDropActive) { initSet.connect(R.id.eventsLayout, ConstraintSet.TOP, R.id.filterLayout, ConstraintSet.BOTTOM, 50); } else { initSet.connect(R.id.eventsLayout, ConstraintSet.TOP, R.id.backdropGuideTop, ConstraintSet.BOTTOM, 0); } initSet.applyTo(binding.backdropLayout); binding.filterOpen.setVisibility(backDropActive ? View.VISIBLE : View.GONE); }
Example #5
Source File: Simple1Fragment.java From YcShareElement with Apache License 2.0 | 6 votes |
@Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); final View imgView = view.findViewById(R.id.s1_img); imgView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { TransitionSet simple2Transition = new TransitionSet(); simple2Transition.addTransition(new ChangeImageTransform()); simple2Transition.addTransition(new ChangeBounds()); Simple2Fragment simple2Fragment = new Simple2Fragment(); simple2Fragment.setSharedElementEnterTransition(simple2Transition); simple2Fragment.setSharedElementReturnTransition(simple2Transition); FragmentTransaction fragmentTransaction = getActivity().getSupportFragmentManager().beginTransaction(); fragmentTransaction.addSharedElement(imgView, imgView.getTransitionName()); fragmentTransaction.replace(R.id.simple_container, simple2Fragment, "simple2"); fragmentTransaction.addToBackStack("simple2"); fragmentTransaction.commit(); } }); }
Example #6
Source File: DefaultShareElementTransitionFactory.java From YcShareElement with Apache License 2.0 | 6 votes |
protected TransitionSet buildShareElementsTransition(List<View> shareViewList) { TransitionSet transitionSet = new TransitionSet(); if (shareViewList == null || shareViewList.size() == 0) { return transitionSet; } transitionSet.addTransition(new ChangeClipBounds()); transitionSet.addTransition(new ChangeTransform()); transitionSet.addTransition(new ChangeBounds()); transitionSet.addTransition(new ChangeTextTransition()); if (mUseDefaultImageTransform) { transitionSet.addTransition(new ChangeImageTransform()); } else { transitionSet.addTransition(new ChangeOnlineImageTransition()); } return transitionSet; }
Example #7
Source File: MainActivity.java From auid2 with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mSceneRoot = (ViewGroup) findViewById(R.id.scene_root); mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.scene1, this); mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.scene2, this); mTransition = new ChangeBounds(); mTransition.setDuration(DateUtils.SECOND_IN_MILLIS); mTransition.setInterpolator(new AccelerateDecelerateInterpolator()); TransitionManager.go(mScene1); mCurrentScene = mScene1; findViewById(R.id.button).setOnClickListener(this); }
Example #8
Source File: ImageTransitionSet.java From Anecdote with Apache License 2.0 | 5 votes |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) private void init() { setOrdering(ORDERING_TOGETHER); addTransition(new ChangeBounds()). addTransition(new ChangeTransform()). addTransition(new ChangeImageTransform()); super.addListener(this); }
Example #9
Source File: FragmentTransitionLauncher.java From candybar with Apache License 2.0 | 5 votes |
public void prepare(androidx.fragment.app.Fragment toFragment) { final Bundle transitionBundle = TransitionBundleFactory.createTransitionBundle(context, fromView, bitmap); if (Build.VERSION.SDK_INT >= 21) { toFragment.setSharedElementEnterTransition(new ChangeBounds()); toFragment.setSharedElementReturnTransition(new ChangeBounds()); } toFragment.setArguments(transitionBundle); }
Example #10
Source File: MainActivity.java From journaldev with MIT License | 5 votes |
private void showAnimation() { show = true; ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(this, R.layout.activity_main_animation); ChangeBounds transition = new ChangeBounds(); transition.setInterpolator(new AnticipateInterpolator(1.0f)); transition.setDuration(1200); TransitionManager.beginDelayedTransition(cc1, transition); constraintSet.applyTo(cc1); }
Example #11
Source File: MainActivity.java From journaldev with MIT License | 5 votes |
private void revertAnimation() { show = false; ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(this, R.layout.activity_main); ChangeBounds transition = new ChangeBounds(); transition.setInterpolator(new AnticipateInterpolator(1.0f)); transition.setDuration(1200); TransitionManager.beginDelayedTransition(cc1, transition); constraintSet.applyTo(cc1); }
Example #12
Source File: TransitionKitKat.java From Noyze with Apache License 2.0 | 5 votes |
@Override public Object getAudioTransition() { final ChangeText tc = new ChangeText(); tc.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN); final TransitionSet inner = new TransitionSet(); inner.addTransition(tc).addTransition(new ChangeBounds()); final TransitionSet tg = new TransitionSet(); tg.addTransition(new Fade(Fade.OUT)).addTransition(inner). addTransition(new Fade(Fade.IN)); tg.setOrdering(TransitionSet.ORDERING_SEQUENTIAL); tg.setDuration(TRANSITION_DURATION); return tg; }
Example #13
Source File: TransitionUtils.java From Material-Movies with Apache License 2.0 | 5 votes |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) public static Transition makeSharedElementEnterTransition(Context context) { Transition changeBounds = new ChangeBounds(); changeBounds.addTarget(R.id.item_movie_cover); return changeBounds; }
Example #14
Source File: DraweeTransition.java From fresco with MIT License | 5 votes |
public static TransitionSet createTransitionSet( ScalingUtils.ScaleType fromScale, ScalingUtils.ScaleType toScale, @Nullable PointF fromFocusPoint, @Nullable PointF toFocusPoint) { TransitionSet transitionSet = new TransitionSet(); transitionSet.addTransition(new ChangeBounds()); transitionSet.addTransition( new DraweeTransition(fromScale, toScale, fromFocusPoint, toFocusPoint)); return transitionSet; }
Example #15
Source File: TransitionKitKat.java From Noyze with Apache License 2.0 | 5 votes |
@Override public Object getAudioTransition() { final ChangeText tc = new ChangeText(); tc.setChangeBehavior(ChangeText.CHANGE_BEHAVIOR_OUT_IN); final TransitionSet inner = new TransitionSet(); inner.addTransition(tc).addTransition(new ChangeBounds()); final TransitionSet tg = new TransitionSet(); tg.addTransition(new Fade(Fade.OUT)).addTransition(inner). addTransition(new Fade(Fade.IN)); tg.setOrdering(TransitionSet.ORDERING_SEQUENTIAL); tg.setDuration(TRANSITION_DURATION); return tg; }
Example #16
Source File: CacheControlActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
private void updateStorageUsageRow() { View view = layoutManager.findViewByPosition(storageUsageRow); if (view instanceof StroageUsageView) { StroageUsageView stroageUsageView = ((StroageUsageView) view); long currentTime = System.currentTimeMillis(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && currentTime - fragmentCreateTime > 250) { TransitionSet transition = new TransitionSet(); ChangeBounds changeBounds = new ChangeBounds(); changeBounds.setDuration(250); changeBounds.excludeTarget(stroageUsageView.legendLayout,true); Fade in = new Fade(Fade.IN); in.setDuration(290); transition .addTransition(new Fade(Fade.OUT).setDuration(250)) .addTransition(changeBounds) .addTransition(in); transition.setOrdering(TransitionSet.ORDERING_TOGETHER); transition.setInterpolator(CubicBezierInterpolator.EASE_OUT); TransitionManager.beginDelayedTransition(listView, transition); } stroageUsageView.setStorageUsage(calculating, databaseSize, totalSize, totalDeviceFreeSize, totalDeviceSize); RecyclerView.ViewHolder holder = listView.findViewHolderForAdapterPosition(storageUsageRow); if (holder != null) { stroageUsageView.setEnabled(listAdapter.isEnabled(holder)); } } else { listAdapter.notifyDataSetChanged(); } }
Example #17
Source File: ConferenceActivity.java From conference-app with Apache License 2.0 | 5 votes |
/** * Enable to share views across activities with animation * on Android 5.0 Lollipop */ @TargetApi(Build.VERSION_CODES.LOLLIPOP) private void setupLollipop() { getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS); getWindow().setSharedElementExitTransition(new ChangeBounds()); getWindow().setSharedElementEnterTransition(new ChangeBounds()); }
Example #18
Source File: MainActivity.java From conference-app with Apache License 2.0 | 5 votes |
/** * Enable to share views across activities with animation * on Android 5.0 Lollipop */ @TargetApi(Build.VERSION_CODES.LOLLIPOP) private void setupLollipop() { getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS); getWindow().setSharedElementExitTransition(new ChangeBounds()); getWindow().setSharedElementEnterTransition(new ChangeBounds()); }
Example #19
Source File: CacheControlActivity.java From Telegram with GNU General Public License v2.0 | 5 votes |
private void updateStorageUsageRow() { View view = layoutManager.findViewByPosition(storageUsageRow); if (view instanceof StroageUsageView) { StroageUsageView stroageUsageView = ((StroageUsageView) view); long currentTime = System.currentTimeMillis(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && currentTime - fragmentCreateTime > 250) { TransitionSet transition = new TransitionSet(); ChangeBounds changeBounds = new ChangeBounds(); changeBounds.setDuration(250); changeBounds.excludeTarget(stroageUsageView.legendLayout,true); Fade in = new Fade(Fade.IN); in.setDuration(290); transition .addTransition(new Fade(Fade.OUT).setDuration(250)) .addTransition(changeBounds) .addTransition(in); transition.setOrdering(TransitionSet.ORDERING_TOGETHER); transition.setInterpolator(CubicBezierInterpolator.EASE_OUT); TransitionManager.beginDelayedTransition(listView, transition); } stroageUsageView.setStorageUsage(calculating, databaseSize, totalSize, totalDeviceFreeSize, totalDeviceSize); RecyclerView.ViewHolder holder = listView.findViewHolderForAdapterPosition(storageUsageRow); if (holder != null) { stroageUsageView.setEnabled(listAdapter.isEnabled(holder)); } } else { listAdapter.notifyDataSetChanged(); } }
Example #20
Source File: FileStoryFragment.java From talk-android with MIT License | 5 votes |
static public FileStoryFragment getInstance(Story story, boolean isExpanded) { FileStoryFragment f = new FileStoryFragment(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { f.setSharedElementEnterTransition(new ChangeTransform()); } f.setSharedElementEnterTransition(new ChangeBounds()); } Bundle bundle = new Bundle(); bundle.putBoolean("isExpanded", isExpanded); bundle.putParcelable("story", Parcels.wrap(story)); f.setArguments(bundle); return f; }
Example #21
Source File: LinkStoryFragment.java From talk-android with MIT License | 5 votes |
static public LinkStoryFragment getInstance(Story story, boolean isExpanded) { LinkStoryFragment f = new LinkStoryFragment(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { f.setSharedElementEnterTransition(new ChangeTransform()); } f.setSharedElementEnterTransition(new ChangeBounds()); } Bundle bundle = new Bundle(); bundle.putBoolean("isExpanded", isExpanded); bundle.putParcelable("story", Parcels.wrap(story)); f.setArguments(bundle); return f; }
Example #22
Source File: FragmentTransitionLauncher.java From candybar-library with Apache License 2.0 | 5 votes |
public void prepare(android.support.v4.app.Fragment toFragment) { final Bundle transitionBundle = TransitionBundleFactory.createTransitionBundle(context, fromView, bitmap); if (Build.VERSION.SDK_INT >= 21) { toFragment.setSharedElementEnterTransition(new ChangeBounds()); toFragment.setSharedElementReturnTransition(new ChangeBounds()); } toFragment.setArguments(transitionBundle); }
Example #23
Source File: FragmentTransitionLauncher.java From candybar with Apache License 2.0 | 5 votes |
public void prepare(Fragment toFragment) { final Bundle transitionBundle = TransitionBundleFactory.createTransitionBundle(context, fromView, bitmap); if (Build.VERSION.SDK_INT >= 21) { toFragment.setSharedElementEnterTransition(new ChangeBounds()); toFragment.setSharedElementReturnTransition(new ChangeBounds()); } toFragment.setArguments(transitionBundle); }
Example #24
Source File: FragmentTransitionLauncher.java From candybar-library with Apache License 2.0 | 5 votes |
public void prepare(Fragment toFragment) { final Bundle transitionBundle = TransitionBundleFactory.createTransitionBundle(context, fromView, bitmap); if (Build.VERSION.SDK_INT >= 21) { toFragment.setSharedElementEnterTransition(new ChangeBounds()); toFragment.setSharedElementReturnTransition(new ChangeBounds()); } toFragment.setArguments(transitionBundle); }
Example #25
Source File: AutoSharedElementCallback.java From native-navigation with MIT License | 5 votes |
@TargetApi(TARGET_API) private Transition getDefaultTransition() { TransitionSet set = new TransitionSet(); set.addTransition(new ChangeBounds()); set.addTransition(new Fade()); set.addTransition(new ChangeImageTransform()); set.setInterpolator(new FastOutSlowInInterpolator()); return set; }
Example #26
Source File: FragmentSharedElementTransition.java From native-navigation with MIT License | 5 votes |
public FragmentSharedElementTransition() { addTransition(new ChangeBounds()); addTransition(new Fade()); addTransition(new ChangeImageTransform()); addTransition(new ChangeTransform()); setInterpolator(new FastOutSlowInInterpolator()); }
Example #27
Source File: TopicStoryFragment.java From talk-android with MIT License | 5 votes |
static public TopicStoryFragment getInstance(Story story, boolean isExpanded) { TopicStoryFragment f = new TopicStoryFragment(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { f.setSharedElementEnterTransition(new ChangeTransform()); } f.setSharedElementEnterTransition(new ChangeBounds()); } Bundle bundle = new Bundle(); bundle.putBoolean("isExpanded", isExpanded); bundle.putParcelable("story", Parcels.wrap(story)); f.setArguments(bundle); return f; }
Example #28
Source File: DetailsTransition.java From simple-stack with Apache License 2.0 | 4 votes |
private void init() { setOrdering(ORDERING_TOGETHER); addTransition(new ChangeBounds()). addTransition(new ChangeTransform()). addTransition(new ChangeImageTransform()); }
Example #29
Source File: LegendSignatureView.java From Telegram with GNU General Public License v2.0 | 4 votes |
public void setData(int index, long date, ArrayList<LineViewData> lines, boolean animateChanges) { int n = holdes.length; if (animateChanges) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { TransitionSet transition = new TransitionSet(); transition. addTransition(new Fade(Fade.OUT).setDuration(100)). addTransition(new ChangeBounds().setDuration(150)). addTransition(new Fade(Fade.IN).setDuration(100)); transition.setOrdering(TransitionSet.ORDERING_SEQUENTIAL); TransitionManager.beginDelayedTransition(this, transition); } } if (isTopHourChart) { time.setText(String.format(Locale.ENGLISH, "%02d:00", date)); } else { time.setText(formatData(new Date(date))); if (useHour) hourTime.setText(hourFormat.format(date)); } int sum = 0; for (int i = 0; i < n; i++) { if (lines.get(i).enabled) sum += lines.get(i).line.y[index]; } for (int i = 0; i < n; i++) { Holder h = holdes[i]; if (!lines.get(i).enabled) { h.root.setVisibility(View.GONE); } else { ChartData.Line l = lines.get(i).line; if (h.root.getMeasuredHeight() == 0) { h.root.requestLayout(); } h.root.setVisibility(View.VISIBLE); h.value.setText(formatWholeNumber(l.y[index])); h.signature.setText(l.name); if (l.colorKey != null && Theme.hasThemeKey(l.colorKey)) { h.value.setTextColor(Theme.getColor(l.colorKey)); } else { h.value.setTextColor(Theme.getCurrentTheme().isDark() ? l.colorDark : l.color); } h.signature.setTextColor(Theme.getColor(Theme.key_dialogTextBlack)); if (showPercentage && h.percentage != null) { h.percentage.setVisibility(VISIBLE); h.percentage.setTextColor(Theme.getColor(Theme.key_dialogTextBlack)); float v = lines.get(i).line.y[index] / (float) sum; if (v < 0.1f && v != 0f) { h.percentage.setText(String.format(Locale.ENGLISH, "%.1f%s", (100f * v), "%")); } else { h.percentage.setText(String.format(Locale.ENGLISH, "%d%s", Math.round(100 * v), "%")); } } } } if (zoomEnabled) { canGoZoom = sum > 0; chevron.setVisibility(sum > 0 ? View.VISIBLE : View.GONE); } else { canGoZoom = false; chevron.setVisibility(View.GONE); } }
Example #30
Source File: QuestionDetailActivity.java From AndroidPlusJava with GNU General Public License v3.0 | 4 votes |
@Override protected void init() { super.init(); String serialized = getIntent().getStringExtra(Constant.EXTRA_QUESTION); try { //反序列化 mQuestion = (Question) Question.parseAVObject(serialized); } catch (Exception e) { e.printStackTrace(); } mQuestionTitle.setText(mQuestion.getTitle()); if (mQuestion.getDescription() == null || mQuestion.getDescription().length() == 0) { mQuestionDescription.setVisibility(View.GONE); } else { mQuestionDescription.setVisibility(View.VISIBLE); mQuestionDescription.setText(mQuestion.getDescription()); } User currentUser = AVUser.getCurrentUser(User.class); isFavorite = currentUser.isFavouredQuestion(mQuestion.getObjectId()); mFavourQuestion.setSelected(isFavorite); //配置转场动画 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { mQuestionTitle.setTransitionName(getString(R.string.question_title_transition)); mQuestionDescription.setTransitionName(getString(R.string.question_des_transition)); ChangeBounds changeBounds = new ChangeBounds(); changeBounds.setPathMotion(new ArcMotion()); getWindow().setSharedElementEnterTransition(changeBounds); } setSupportActionBar(mToolBar); ActionBar supportActionBar = getSupportActionBar(); supportActionBar.setDisplayHomeAsUpEnabled(true); mCollapsingToolBar.setTitle(" "); String[] titles = getResources().getStringArray(R.array.answer_category); mViewPager.setAdapter(new QuestionDetailPagerAdapter(getSupportFragmentManager(), titles, mQuestion.getObjectId())); mTabLayout.setupWithViewPager(mViewPager); }