Search in sources :

Example 6 with Scene

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

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 7 with Scene

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

the class PhoneWindow method setContentView.

@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
    // before this happens.
    if (mContentParent == null) {
        installDecor();
    } else if (!hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
        mContentParent.removeAllViews();
    }
    if (hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
        view.setLayoutParams(params);
        final Scene newScene = new Scene(mContentParent, view);
        transitionTo(newScene);
    } else {
        mContentParent.addView(view, params);
    }
    mContentParent.requestApplyInsets();
    final Callback cb = getCallback();
    if (cb != null && !isDestroyed()) {
        cb.onContentChanged();
    }
    mContentParentExplicitlySet = true;
}
Also used : Scene(android.transition.Scene)

Example 8 with Scene

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

the class PhoneWindow method setContentView.

@Override
public void setContentView(int layoutResID) {
    // before this happens.
    if (mContentParent == null) {
        installDecor();
    } else if (!hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
        mContentParent.removeAllViews();
    }
    if (hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
        final Scene newScene = Scene.getSceneForLayout(mContentParent, layoutResID, getContext());
        transitionTo(newScene);
    } else {
        mLayoutInflater.inflate(layoutResID, mContentParent);
    }
    mContentParent.requestApplyInsets();
    final Callback cb = getCallback();
    if (cb != null && !isDestroyed()) {
        cb.onContentChanged();
    }
    mContentParentExplicitlySet = true;
}
Also used : Scene(android.transition.Scene)

Example 9 with Scene

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

the class PhoneWindow method setContentView.

@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
    // before this happens.
    if (mContentParent == null) {
        installDecor();
    } else if (!hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
        mContentParent.removeAllViews();
    }
    if (hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
        view.setLayoutParams(params);
        final Scene newScene = new Scene(mContentParent, view);
        transitionTo(newScene);
    } else {
        mContentParent.addView(view, params);
    }
    mContentParent.requestApplyInsets();
    final Callback cb = getCallback();
    if (cb != null && !isDestroyed()) {
        cb.onContentChanged();
    }
    mContentParentExplicitlySet = true;
}
Also used : Scene(android.transition.Scene)

Example 10 with Scene

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

the class PhoneWindow method setContentView.

@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
    // before this happens.
    if (mContentParent == null) {
        installDecor();
    } else if (!hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
        mContentParent.removeAllViews();
    }
    if (hasFeature(FEATURE_CONTENT_TRANSITIONS)) {
        view.setLayoutParams(params);
        final Scene newScene = new Scene(mContentParent, view);
        transitionTo(newScene);
    } else {
        mContentParent.addView(view, params);
    }
    mContentParent.requestApplyInsets();
    final Callback cb = getCallback();
    if (cb != null && !isDestroyed()) {
        cb.onContentChanged();
    }
    mContentParentExplicitlySet = true;
}
Also used : Scene(android.transition.Scene)

Aggregations

Scene (android.transition.Scene)26 View (android.view.View)12 ChangeBounds (android.transition.ChangeBounds)8 Transition (android.transition.Transition)8 TransitionSet (android.transition.TransitionSet)8 AutoTransition (android.transition.AutoTransition)4 Crossfade (android.transition.Crossfade)4 Fade (android.transition.Fade)4 TransitionInflater (android.transition.TransitionInflater)4 LayoutInflater (android.view.LayoutInflater)4 SurfaceView (android.view.SurfaceView)4 TextureView (android.view.TextureView)4 ViewGroup (android.view.ViewGroup)4 ViewTreeObserver (android.view.ViewTreeObserver)4 AdapterView (android.widget.AdapterView)4 Button (android.widget.Button)4 LinearLayout (android.widget.LinearLayout)4 LayoutParams (android.widget.LinearLayout.LayoutParams)4 ListView (android.widget.ListView)4 TextView (android.widget.TextView)4