Search in sources :

Example 1 with AutoTransition

use of androidx.transition.AutoTransition in project uCrop by Yalantis.

the class UCropActivity method setupViews.

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));
    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);
        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();
    }
}
Also used : AutoTransition(androidx.transition.AutoTransition) ViewGroup(android.view.ViewGroup)

Example 2 with AutoTransition

use of androidx.transition.AutoTransition in project Signal-Android by WhisperSystems.

the class ContactSelectionListFragment method setChipGroupVisibility.

private void setChipGroupVisibility(int visibility) {
    if (!safeArguments().getBoolean(DISPLAY_CHIPS, requireActivity().getIntent().getBooleanExtra(DISPLAY_CHIPS, true))) {
        return;
    }
    AutoTransition transition = new AutoTransition();
    transition.setDuration(CHIP_GROUP_REVEAL_DURATION_MS);
    transition.excludeChildren(recyclerView, true);
    transition.excludeTarget(recyclerView, true);
    TransitionManager.beginDelayedTransition(constraintLayout, transition);
    ConstraintSet constraintSet = new ConstraintSet();
    constraintSet.clone(constraintLayout);
    constraintSet.setVisibility(R.id.chipGroupScrollContainer, visibility);
    constraintSet.applyTo(constraintLayout);
}
Also used : AutoTransition(androidx.transition.AutoTransition) ConstraintSet(androidx.constraintlayout.widget.ConstraintSet)

Example 3 with AutoTransition

use of androidx.transition.AutoTransition in project Signal-Android by WhisperSystems.

the class WebRtcCallView method fadeControls.

private void fadeControls(int visibility) {
    controlsVisible = visibility == VISIBLE;
    Transition transition = new AutoTransition().setOrdering(TransitionSet.ORDERING_TOGETHER).setDuration(TRANSITION_DURATION_MILLIS);
    TransitionManager.endTransitions(parent);
    if (controlsListener != null) {
        if (controlsVisible) {
            controlsListener.showSystemUI();
        } else {
            controlsListener.hideSystemUI();
        }
    }
    TransitionManager.beginDelayedTransition(parent, transition);
    ConstraintSet constraintSet = new ConstraintSet();
    constraintSet.clone(parent);
    for (View view : controlsToFade()) {
        constraintSet.setVisibility(view.getId(), visibility);
    }
    adjustParticipantsRecycler(constraintSet);
    constraintSet.applyTo(parent);
    layoutParticipants();
}
Also used : AutoTransition(androidx.transition.AutoTransition) Transition(androidx.transition.Transition) AutoTransition(androidx.transition.AutoTransition) ConstraintSet(androidx.constraintlayout.widget.ConstraintSet) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) AvatarImageView(org.thoughtcrime.securesms.components.AvatarImageView)

Example 4 with AutoTransition

use of androidx.transition.AutoTransition in project Signal-Android by WhisperSystems.

the class WebRtcCallView method layoutParticipants.

private void layoutParticipants() {
    Transition transition = new AutoTransition().setDuration(TRANSITION_DURATION_MILLIS);
    TransitionManager.beginDelayedTransition(participantsParent, transition);
    ConstraintSet constraintSet = new ConstraintSet();
    constraintSet.clone(participantsParent);
    constraintSet.setMargin(R.id.call_screen_participants_pager, ConstraintSet.BOTTOM, ViewUtil.dpToPx(withControlsHeight(pagerBottomMarginDp)));
    constraintSet.applyTo(participantsParent);
}
Also used : AutoTransition(androidx.transition.AutoTransition) Transition(androidx.transition.Transition) AutoTransition(androidx.transition.AutoTransition) ConstraintSet(androidx.constraintlayout.widget.ConstraintSet)

Example 5 with AutoTransition

use of androidx.transition.AutoTransition in project Signal-Android by WhisperSystems.

the class WebRtcCallView method fadeInNewUiState.

private void fadeInNewUiState(boolean useSmallMargins, boolean showSmallHeader) {
    Transition transition = new AutoTransition().setDuration(TRANSITION_DURATION_MILLIS);
    TransitionManager.beginDelayedTransition(parent, transition);
    ConstraintSet constraintSet = new ConstraintSet();
    constraintSet.clone(parent);
    for (View view : SetUtil.difference(allTimeVisibleViews, visibleViewSet)) {
        constraintSet.setVisibility(view.getId(), ConstraintSet.GONE);
    }
    for (View view : visibleViewSet) {
        constraintSet.setVisibility(view.getId(), ConstraintSet.VISIBLE);
        if (adjustableMarginsSet.contains(view)) {
            constraintSet.setMargin(view.getId(), ConstraintSet.END, ViewUtil.dpToPx(useSmallMargins ? SMALL_ONGOING_CALL_BUTTON_MARGIN_DP : LARGE_ONGOING_CALL_BUTTON_MARGIN_DP));
        }
    }
    adjustParticipantsRecycler(constraintSet);
    constraintSet.applyTo(parent);
    if (showSmallHeader) {
        smallHeaderConstraints.setVisibility(incomingRingStatus.getId(), visibleViewSet.contains(incomingRingStatus) ? View.VISIBLE : View.GONE);
        smallHeaderConstraints.applyTo(toolbar);
    } else {
        largeHeaderConstraints.setVisibility(incomingRingStatus.getId(), visibleViewSet.contains(incomingRingStatus) ? View.VISIBLE : View.GONE);
        largeHeaderConstraints.applyTo(toolbar);
    }
}
Also used : AutoTransition(androidx.transition.AutoTransition) Transition(androidx.transition.Transition) AutoTransition(androidx.transition.AutoTransition) ConstraintSet(androidx.constraintlayout.widget.ConstraintSet) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) AvatarImageView(org.thoughtcrime.securesms.components.AvatarImageView)

Aggregations

AutoTransition (androidx.transition.AutoTransition)11 ConstraintSet (androidx.constraintlayout.widget.ConstraintSet)8 Transition (androidx.transition.Transition)7 View (android.view.View)5 ImageView (android.widget.ImageView)5 TextView (android.widget.TextView)5 RecyclerView (androidx.recyclerview.widget.RecyclerView)5 AvatarImageView (org.thoughtcrime.securesms.components.AvatarImageView)4 ViewGroup (android.view.ViewGroup)2 Animator (android.animation.Animator)1 ArgbEvaluator (android.animation.ArgbEvaluator)1 ValueAnimator (android.animation.ValueAnimator)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 CompoundButton (android.widget.CompoundButton)1 RelativeLayout (android.widget.RelativeLayout)1 AnimatedVectorDrawableCompat (androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat)1 AlarmData (james.alarmio.data.AlarmData)1 SoundData (james.alarmio.data.SoundData)1 TimerData (james.alarmio.data.TimerData)1