androidx.transition.AutoTransition Java Examples
The following examples show how to use
androidx.transition.AutoTransition.
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: MainActivity.java From c3nav-android with Apache License 2.0 | 6 votes |
protected void showLogoScreen() { if (!splashScreenDone) { logoScreen.setVisibility(View.VISIBLE); skipSplash(false); } else if (logoScreenIsVisible || loginScreenIsActive) { TransitionManager.go(new Scene((ViewGroup) logoScreen.getParent()), new AutoTransition()); } else { TransitionManager.go(new Scene((ViewGroup) logoScreen.getParent()), new Slide(Gravity.RIGHT)); } logoScreen.setVisibility(View.VISIBLE); logoScreenMessage.setVisibility(View.GONE); authUsername.setVisibility(View.GONE); authPassword.setVisibility(View.GONE); authMessage.setVisibility(View.GONE); authLoginButton.setVisibility(View.GONE); logoScreenIsVisible = true; }
Example #2
Source File: MainActivity.java From c3nav-android with Apache License 2.0 | 6 votes |
protected void showLoginScreen(String message) { if (!logoScreenIsVisible) showLogoScreen(); logoScreenMessage.setText(R.string.auth_title); authMessage.setText(message); authUsername.setEnabled(true); authPassword.setEnabled(true); authLoginButton.setEnabled(true); if (loginScreenIsActive) return; logoScreen.postDelayed(new Runnable() { @Override public void run() { TransitionManager.go(new Scene((ViewGroup) logoScreen.getParent()), new AutoTransition()); logoScreenMessage.setVisibility(View.VISIBLE); authUsername.setVisibility(View.VISIBLE); authPassword.setVisibility(View.VISIBLE); authMessage.setVisibility(View.VISIBLE); authLoginButton.setVisibility(View.VISIBLE); } }, 500); loginScreenIsActive = true; }
Example #3
Source File: ContactSelectionListFragment.java From mollyim-android with GNU General Public License v3.0 | 5 votes |
private void setChipGroupVisibility(int visibility) { TransitionManager.beginDelayedTransition(constraintLayout, new AutoTransition().setDuration(CHIP_GROUP_REVEAL_DURATION_MS)); ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(constraintLayout); constraintSet.setVisibility(R.id.chipGroupScrollContainer, visibility); constraintSet.applyTo(constraintLayout); }
Example #4
Source File: WebRtcCallView.java From mollyim-android with GNU General Public License v3.0 | 5 votes |
private void fadeControls(int visibility) { Transition transition = new AutoTransition().setDuration(TRANSITION_DURATION_MILLIS); TransitionManager.beginDelayedTransition(parent, transition); ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(parent); for (View view : visibleViewSet) { constraintSet.setVisibility(view.getId(), visibility); } constraintSet.applyTo(parent); }
Example #5
Source File: UCropFragment.java From EasyPhotos with Apache License 2.0 | 5 votes |
public void setupViews(View view, Bundle args) { mActiveWidgetColor = args.getInt(UCrop.Options.EXTRA_UCROP_COLOR_WIDGET_ACTIVE, ContextCompat.getColor(getContext(), R.color.ucrop_color_widget_background)); mActiveControlsWidgetColor = args.getInt(UCrop.Options.EXTRA_UCROP_COLOR_WIDGET_ACTIVE, ContextCompat.getColor(getContext(), R.color.ucrop_color_widget_active)); mLogoColor = args.getInt(UCrop.Options.EXTRA_UCROP_LOGO_COLOR, ContextCompat.getColor(getContext(), R.color.ucrop_color_default_logo)); mShowBottomControls = !args.getBoolean(UCrop.Options.EXTRA_HIDE_BOTTOM_CONTROLS, false); mRootViewBackgroundColor = args.getInt(UCrop.Options.EXTRA_UCROP_ROOT_VIEW_BACKGROUND_COLOR, ContextCompat.getColor(getContext(), R.color.ucrop_color_crop_background)); initiateRootViews(view); callback.loadingProgress(true); if (mShowBottomControls) { ViewGroup wrapper = view.findViewById(R.id.controls_wrapper); wrapper.setVisibility(View.VISIBLE); wrapper.setBackgroundColor(mRootViewBackgroundColor); LayoutInflater.from(getContext()).inflate(R.layout.ucrop_controls, wrapper, true); mControlsTransition = new AutoTransition(); mControlsTransition.setDuration(CONTROLS_ANIMATION_DURATION); mWrapperStateAspectRatio = view.findViewById(R.id.state_aspect_ratio); mWrapperStateAspectRatio.setOnClickListener(mStateClickListener); mWrapperStateRotate = view.findViewById(R.id.state_rotate); mWrapperStateRotate.setOnClickListener(mStateClickListener); mWrapperStateScale = view.findViewById(R.id.state_scale); mWrapperStateScale.setOnClickListener(mStateClickListener); mLayoutAspectRatio = view.findViewById(R.id.layout_aspect_ratio); mLayoutRotate = view.findViewById(R.id.layout_rotate_wheel); mLayoutScale = view.findViewById(R.id.layout_scale_wheel); setupAspectRatioWidget(args, view); setupRotateWidget(view); setupScaleWidget(view); setupStatesWrapper(view); } }
Example #6
Source File: SingleCGroupAdapter.java From call_manage with MIT License | 5 votes |
/** * Animates the ContactHolder */ public void animate() { ConstraintLayout itemRoot = (ConstraintLayout) itemView; ConstraintSet set = new ConstraintSet(); set.clone(itemRoot); Transition transition = new AutoTransition(); transition.setInterpolator(new OvershootInterpolator()); TransitionManager.beginDelayedTransition(itemRoot, transition); int layoutId = mEditModeEnabled ? R.layout.item_contact_editable_modified : R.layout.item_contact_editable; set.load(mContext, layoutId); set.applyTo(itemRoot); }
Example #7
Source File: BottomNavigationMenuView.java From material-components-android with Apache License 2.0 | 5 votes |
public BottomNavigationMenuView(Context context, AttributeSet attrs) { super(context, attrs); final Resources res = getResources(); inactiveItemMaxWidth = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_item_max_width); inactiveItemMinWidth = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_item_min_width); activeItemMaxWidth = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_active_item_max_width); activeItemMinWidth = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_active_item_min_width); itemHeight = res.getDimensionPixelSize(R.dimen.design_bottom_navigation_height); itemTextColorDefault = createDefaultColorStateList(android.R.attr.textColorSecondary); set = new AutoTransition(); set.setOrdering(TransitionSet.ORDERING_TOGETHER); set.setDuration(ACTIVE_ANIMATION_DURATION_MS); set.setInterpolator(new FastOutSlowInInterpolator()); set.addTransition(new TextScale()); onClickListener = new OnClickListener() { @Override public void onClick(View v) { final BottomNavigationItemView itemView = (BottomNavigationItemView) v; MenuItem item = itemView.getItemData(); if (!menu.performItemAction(item, presenter, 0)) { item.setChecked(true); } } }; tempChildWidths = new int[BottomNavigationMenu.MAX_ITEM_COUNT]; ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); }
Example #8
Source File: UCropActivity.java From EasyPhotos with Apache License 2.0 | 4 votes |
private void setupViews(@NonNull Intent intent) { mStatusBarColor = intent.getIntExtra(UCrop.Options.EXTRA_STATUS_BAR_COLOR, ContextCompat.getColor(this, R.color.ucrop_color_statusbar)); mToolbarColor = intent.getIntExtra(UCrop.Options.EXTRA_TOOL_BAR_COLOR, ContextCompat.getColor(this, R.color.ucrop_color_toolbar)); mActiveWidgetColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_COLOR_WIDGET_ACTIVE, ContextCompat.getColor(this, R.color.ucrop_color_widget_background)); mActiveControlsWidgetColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_COLOR_CONTROLS_WIDGET_ACTIVE, ContextCompat.getColor(this, R.color.ucrop_color_active_controls_color)); mToolbarWidgetColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_WIDGET_COLOR_TOOLBAR, ContextCompat.getColor(this, R.color.ucrop_color_toolbar_widget)); mToolbarCancelDrawable = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_WIDGET_CANCEL_DRAWABLE, R.drawable.ucrop_ic_cross); mToolbarCropDrawable = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_WIDGET_CROP_DRAWABLE, R.drawable.ucrop_ic_done); mToolbarTitle = intent.getStringExtra(UCrop.Options.EXTRA_UCROP_TITLE_TEXT_TOOLBAR); mToolbarTitle = mToolbarTitle != null ? mToolbarTitle : getResources().getString(R.string.ucrop_label_edit_photo); mLogoColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_LOGO_COLOR, ContextCompat.getColor(this, R.color.ucrop_color_default_logo)); mShowBottomControls = !intent.getBooleanExtra(UCrop.Options.EXTRA_HIDE_BOTTOM_CONTROLS, false); mRootViewBackgroundColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_ROOT_VIEW_BACKGROUND_COLOR, ContextCompat.getColor(this, R.color.ucrop_color_crop_background)); setupAppBar(); initiateRootViews(); if (mShowBottomControls) { ViewGroup viewGroup = findViewById(R.id.ucrop_photobox); ViewGroup wrapper = viewGroup.findViewById(R.id.controls_wrapper); wrapper.setVisibility(View.VISIBLE); wrapper.setBackgroundColor(mRootViewBackgroundColor); LayoutInflater.from(this).inflate(R.layout.ucrop_controls, wrapper, true); mControlsTransition = new AutoTransition(); mControlsTransition.setDuration(CONTROLS_ANIMATION_DURATION); mWrapperStateAspectRatio = findViewById(R.id.state_aspect_ratio); mWrapperStateAspectRatio.setOnClickListener(mStateClickListener); mWrapperStateRotate = findViewById(R.id.state_rotate); mWrapperStateRotate.setOnClickListener(mStateClickListener); mWrapperStateScale = findViewById(R.id.state_scale); mWrapperStateScale.setOnClickListener(mStateClickListener); mLayoutAspectRatio = findViewById(R.id.layout_aspect_ratio); mLayoutRotate = findViewById(R.id.layout_rotate_wheel); mLayoutScale = findViewById(R.id.layout_scale_wheel); setupAspectRatioWidget(intent); setupRotateWidget(); setupScaleWidget(); setupStatesWrapper(); } }
Example #9
Source File: ViewPostDetailActivity.java From Infinity-For-Reddit with GNU Affero General Public License v3.0 | 4 votes |
public void delayTransition() { TransitionManager.beginDelayedTransition(mRecyclerView, new AutoTransition()); }
Example #10
Source File: UCropActivity.java From PictureSelector with Apache License 2.0 | 4 votes |
protected void setupViews(@NonNull Intent intent) { mStatusBarColor = intent.getIntExtra(UCrop.Options.EXTRA_STATUS_BAR_COLOR, ContextCompat.getColor(this, R.color.ucrop_color_statusbar)); mToolbarColor = intent.getIntExtra(UCrop.Options.EXTRA_TOOL_BAR_COLOR, ContextCompat.getColor(this, R.color.ucrop_color_toolbar)); mActiveWidgetColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_COLOR_WIDGET_ACTIVE, ContextCompat.getColor(this, R.color.ucrop_color_widget_background)); mActiveControlsWidgetColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_COLOR_CONTROLS_WIDGET_ACTIVE, ContextCompat.getColor(this, R.color.ucrop_color_active_controls_color)); mToolbarWidgetColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_WIDGET_COLOR_TOOLBAR, ContextCompat.getColor(this, R.color.ucrop_color_toolbar_widget)); mToolbarCancelDrawable = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_WIDGET_CANCEL_DRAWABLE, R.drawable.ucrop_ic_cross); mToolbarCropDrawable = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_WIDGET_CROP_DRAWABLE, R.drawable.ucrop_ic_done); mToolbarTitle = intent.getStringExtra(UCrop.Options.EXTRA_UCROP_TITLE_TEXT_TOOLBAR); mToolbarTitle = mToolbarTitle != null ? mToolbarTitle : getResources().getString(R.string.ucrop_label_edit_photo); mLogoColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_LOGO_COLOR, ContextCompat.getColor(this, R.color.ucrop_color_default_logo)); mShowBottomControls = !intent.getBooleanExtra(UCrop.Options.EXTRA_HIDE_BOTTOM_CONTROLS, false); mRootViewBackgroundColor = intent.getIntExtra(UCrop.Options.EXTRA_UCROP_ROOT_VIEW_BACKGROUND_COLOR, ContextCompat.getColor(this, R.color.ucrop_color_crop_background)); setupAppBar(); initiateRootViews(); if (mShowBottomControls) { ViewGroup viewGroup = findViewById(R.id.ucrop_photobox); ViewGroup wrapper = viewGroup.findViewById(R.id.controls_wrapper); wrapper.setVisibility(View.VISIBLE); wrapper.setBackgroundColor(mRootViewBackgroundColor); LayoutInflater.from(this).inflate(R.layout.ucrop_controls, wrapper, true); mControlsTransition = new AutoTransition(); mControlsTransition.setDuration(CONTROLS_ANIMATION_DURATION); mWrapperStateAspectRatio = findViewById(R.id.state_aspect_ratio); mWrapperStateAspectRatio.setOnClickListener(mStateClickListener); mWrapperStateRotate = findViewById(R.id.state_rotate); mWrapperStateRotate.setOnClickListener(mStateClickListener); mWrapperStateScale = findViewById(R.id.state_scale); mWrapperStateScale.setOnClickListener(mStateClickListener); mLayoutAspectRatio = findViewById(R.id.layout_aspect_ratio); mLayoutRotate = findViewById(R.id.layout_rotate_wheel); mLayoutScale = findViewById(R.id.layout_scale_wheel); setupAspectRatioWidget(intent); setupRotateWidget(); setupScaleWidget(); setupStatesWrapper(); } }