Search in sources :

Example 21 with TransitionInflater

use of android.transition.TransitionInflater in project android_frameworks_base by ResurrectionRemix.

the class ResourceLoadingTest method sendMessage.

public void sendMessage(View view) {
    if (mTransitionManager == null) {
        try {
            TransitionInflater inflater = TransitionInflater.from(this);
            mTransitionManager = inflater.inflateTransitionManager(R.transition.my_transition_mgr, mSceneRoot);
            Scene loadedScene = new Scene(mSceneRoot);
            System.out.println("loadedScene = " + loadedScene);
            Transition loadedTransition = inflater.inflateTransition(R.transition.my_transition);
            System.out.println("loadedTransition = " + loadedTransition);
        } catch (Exception e) {
            System.out.println("Problem loading scene resource: " + e);
        }
    }
    if (mCurrentScene == RESULTS_SCREEN) {
        Scene scene = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this);
        mTransitionManager.transitionTo(scene);
        mCurrentScene = SEARCH_SCREEN;
    } else {
        Scene scene = Scene.getSceneForLayout(mSceneRoot, R.layout.results_screen, this);
        mTransitionManager.transitionTo(scene);
        mCurrentScene = RESULTS_SCREEN;
    }
}
Also used : Transition(android.transition.Transition) TransitionInflater(android.transition.TransitionInflater) Scene(android.transition.Scene)

Example 22 with TransitionInflater

use of android.transition.TransitionInflater in project android_frameworks_base by ResurrectionRemix.

the class PopupWindow method getTransition.

private Transition getTransition(int resId) {
    if (resId != 0 && resId != R.transition.no_transition) {
        final TransitionInflater inflater = TransitionInflater.from(mContext);
        final Transition transition = inflater.inflateTransition(resId);
        if (transition != null) {
            final boolean isEmpty = transition instanceof TransitionSet && ((TransitionSet) transition).getTransitionCount() == 0;
            if (!isEmpty) {
                return transition;
            }
        }
    }
    return null;
}
Also used : TransitionSet(android.transition.TransitionSet) Transition(android.transition.Transition) TransitionInflater(android.transition.TransitionInflater)

Example 23 with TransitionInflater

use of android.transition.TransitionInflater in project android_frameworks_base by DirtyUnicorns.

the class PhoneWindow method getTransition.

private Transition getTransition(Transition currentValue, Transition defaultValue, int id) {
    if (currentValue != defaultValue) {
        return currentValue;
    }
    int transitionId = getWindowStyle().getResourceId(id, -1);
    Transition transition = defaultValue;
    if (transitionId != -1 && transitionId != R.transition.no_transition) {
        TransitionInflater inflater = TransitionInflater.from(getContext());
        transition = inflater.inflateTransition(transitionId);
        if (transition instanceof TransitionSet && ((TransitionSet) transition).getTransitionCount() == 0) {
            transition = null;
        }
    }
    return transition;
}
Also used : TransitionSet(android.transition.TransitionSet) Transition(android.transition.Transition) TransitionInflater(android.transition.TransitionInflater)

Example 24 with TransitionInflater

use of android.transition.TransitionInflater in project android_frameworks_base by DirtyUnicorns.

the class PopupWindow method getTransition.

private Transition getTransition(int resId) {
    if (resId != 0 && resId != R.transition.no_transition) {
        final TransitionInflater inflater = TransitionInflater.from(mContext);
        final Transition transition = inflater.inflateTransition(resId);
        if (transition != null) {
            final boolean isEmpty = transition instanceof TransitionSet && ((TransitionSet) transition).getTransitionCount() == 0;
            if (!isEmpty) {
                return transition;
            }
        }
    }
    return null;
}
Also used : TransitionSet(android.transition.TransitionSet) Transition(android.transition.Transition) TransitionInflater(android.transition.TransitionInflater)

Example 25 with TransitionInflater

use of android.transition.TransitionInflater in project android_frameworks_base by crdroidandroid.

the class PhoneWindow method getTransition.

private Transition getTransition(Transition currentValue, Transition defaultValue, int id) {
    if (currentValue != defaultValue) {
        return currentValue;
    }
    int transitionId = getWindowStyle().getResourceId(id, -1);
    Transition transition = defaultValue;
    if (transitionId != -1 && transitionId != R.transition.no_transition) {
        TransitionInflater inflater = TransitionInflater.from(getContext());
        transition = inflater.inflateTransition(transitionId);
        if (transition instanceof TransitionSet && ((TransitionSet) transition).getTransitionCount() == 0) {
            transition = null;
        }
    }
    return transition;
}
Also used : TransitionSet(android.transition.TransitionSet) Transition(android.transition.Transition) TransitionInflater(android.transition.TransitionInflater)

Aggregations

TransitionInflater (android.transition.TransitionInflater)29 Transition (android.transition.Transition)19 TransitionSet (android.transition.TransitionSet)15 TextView (android.widget.TextView)9 ImageView (android.widget.ImageView)6 TransitionManager (android.transition.TransitionManager)5 View (android.view.View)5 MenuView (com.android.internal.view.menu.MenuView)5 DecorContentParent (com.android.internal.widget.DecorContentParent)5 Scene (android.transition.Scene)4 Context (android.content.Context)1 Resources (android.content.res.Resources)1 Bitmap (android.graphics.Bitmap)1 Drawable (android.graphics.drawable.Drawable)1 Nullable (androidx.annotation.Nullable)1 Toolbar (androidx.appcompat.widget.Toolbar)1 DataSource (com.bumptech.glide.load.DataSource)1 GlideException (com.bumptech.glide.load.engine.GlideException)1 RequestListener (com.bumptech.glide.request.RequestListener)1 CustomTarget (com.bumptech.glide.request.target.CustomTarget)1