当前位置: 首页>>代码示例>>Java>>正文


Java Scene.getSceneForLayout方法代码示例

本文整理汇总了Java中android.transition.Scene.getSceneForLayout方法的典型用法代码示例。如果您正苦于以下问题:Java Scene.getSceneForLayout方法的具体用法?Java Scene.getSceneForLayout怎么用?Java Scene.getSceneForLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.transition.Scene的用法示例。


在下文中一共展示了Scene.getSceneForLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.transition.Scene; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_customized_transition);

    ViewGroup container = (ViewGroup) findViewById(R.id.container);

    scenes = new Scene[]{
            Scene.getSceneForLayout(container, R.layout.activity_customized_transition_scene1, this),
            Scene.getSceneForLayout(container, R.layout.activity_customized_transition_scene2, this),
    };

    container.setOnClickListener(this);

    transition = new CircleViewTransition();
}
 
开发者ID:chartsai,项目名称:TransitionDemo,代码行数:17,代码来源:CustomizedTransitionActivity.java

示例2: onCreate

import android.transition.Scene; //导入方法依赖的package包/类
@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);
}
 
开发者ID:IanGClifton,项目名称:auid2,代码行数:22,代码来源:MainActivity.java

示例3: onCreateView

import android.transition.Scene; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_initialize, container, false);

    if (Is.greaterThanOrEqual(MARSHMALLOW)) {
        view.findViewById(R.id.tutorial_accept)
                .setOnClickListener(this);

        ViewGroup sceneRoot = (ViewGroup) view.findViewById(R.id.scene_root);
        sceneComplete = Scene.getSceneForLayout(sceneRoot, R.layout.scene_finished, getContext());

        if (hasPermissions()) {
            sceneComplete.enter();
        }
    } else {
        view.findViewById(R.id.tutorial_done)
                .setOnClickListener(this);
    }

    return view;
}
 
开发者ID:ToxicBakery,项目名称:Screenshot-Redaction,代码行数:23,代码来源:FragmentInitialize.java

示例4: onCreate

import android.transition.Scene; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.transition);

    mSceneRoot = (ViewGroup) findViewById(R.id.sceneRoot);

    TransitionInflater inflater = TransitionInflater.from(this);

    // Note that this is not the only way to create a Scene object, but that
    // loading them from layout resources cooperates with the
    // TransitionManager that we are also loading from resources, and which
    // uses the same layout resource files to determine the scenes to transition
    // from/to.
    mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_scene1, this);
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_scene2, this);
    mScene3 = Scene.getSceneForLayout(mSceneRoot, R.layout.transition_scene3, this);
    mTransitionManager = inflater.inflateTransitionManager(R.transition.transitions_mgr,
            mSceneRoot);
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:21,代码来源:Transitions.java

示例5: onCreateView

import android.transition.Scene; //导入方法依赖的package包/类
@Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_scenes, container, false);

    RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.select_scene);
    radioGroup.setOnCheckedChangeListener(this);
    mSceneRoot = (ViewGroup) view.findViewById(R.id.scene_root);

    // A Scene can be instantiated from a live view hierarchy.
    mScene1 = new Scene(mSceneRoot, mSceneRoot.findViewById(R.id.container));

    // You can also inflate a generate a Scene from a layout resource file.
    mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.scene2, getContext());

    // Another scene from a layout resource file.
    mScene3 = Scene.getSceneForLayout(mSceneRoot, R.layout.scene3, getContext());

    // We create a custom TransitionManager for Scene 3, in which ChangeBounds, Fade and
    // ChangeImageTransform take place at the same time.
    mTransitionManagerForScene3 = TransitionInflater.from(getContext()).inflateTransitionManager(R.anim.scene3_transition_manager, mSceneRoot);

    return view;
}
 
开发者ID:xu6148152,项目名称:binea_project_for_android,代码行数:23,代码来源:ScenesSample.java

示例6: setupViews

import android.transition.Scene; //导入方法依赖的package包/类
private void setupViews() {
    stepButtons = new Button[4];
    scenes = new Scene[4];

    ViewGroup root = (ViewGroup) findViewById(R.id.scene_container);

    stepButtons[0] = (Button) findViewById(R.id.step1);
    stepButtons[1] = (Button) findViewById(R.id.step2);
    stepButtons[2] = (Button) findViewById(R.id.step3);
    stepButtons[3] = (Button) findViewById(R.id.step4);

    for (int i = 0; i < stepButtons.length; i++) {
        Button button = stepButtons[i];
        final int sceneNumber = i;
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                transitionTo(sceneNumber);
            }
        });
    }

    scenes[0] = Scene.getSceneForLayout(root, R.layout.activity_scene_scene1, this);
    scenes[1] = Scene.getSceneForLayout(root, R.layout.activity_scene_scene2, this);
    scenes[2] = Scene.getSceneForLayout(root, R.layout.activity_scene_scene3, this);
    scenes[3] = Scene.getSceneForLayout(root, R.layout.activity_scene_scene4, this);
}
 
开发者ID:chartsai,项目名称:TransitionDemo,代码行数:28,代码来源:BasicSceneActivity.java

示例7: onCreate

import android.transition.Scene; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_transition_manager);

    radioGroup = (RadioGroup) findViewById(R.id.select_scene);
    radioGroup.setOnCheckedChangeListener(this);
    scene1Button = (RadioButton) findViewById(R.id.select_scene_1);
    scene2Button = (RadioButton) findViewById(R.id.select_scene_2);
    scene3Button = (RadioButton) findViewById(R.id.select_scene_3);

    sceneRootView = (ViewGroup) findViewById(R.id.scene_root);

    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        scenes[0] = new Scene(sceneRootView, findViewById(R.id.container));
    } else {
        scenes[0] = new Scene(sceneRootView, (ViewGroup) findViewById(R.id.container));
    }

    scenes[1] = Scene.getSceneForLayout(sceneRootView, R.layout.activity_transition_manager_scene2, this);
    scenes[1].setExitAction(new Runnable() {
        @Override
        public void run() {
            setTitle("Leave scene 2");
        }
    });

    scenes[2] = Scene.getSceneForLayout(sceneRootView, R.layout.activity_transition_manager_scene3, this);
    scenes[2].setEnterAction(new Runnable() {
        @Override
        public void run() {
            setTitle("Now showing scene3");
        }
    });
    scene3TransitionManager = TransitionInflater.from(this).inflateTransitionManager(R.transition.transition_manager_scene3, sceneRootView);
}
 
开发者ID:chartsai,项目名称:TransitionDemo,代码行数:37,代码来源:TransitionManagerActivity.java

示例8: onCreate

import android.transition.Scene; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_live_demo);

    ViewGroup container = (ViewGroup) findViewById(R.id.container);

    scenes = new Scene[] {
            Scene.getSceneForLayout(container, R.layout.activity_live_scene1, this),
            Scene.getSceneForLayout(container, R.layout.activity_live_scene2, this),
    };

    setupViews();
}
 
开发者ID:chartsai,项目名称:TransitionDemo,代码行数:15,代码来源:LiveDemoActivity.java

示例9: onCreateView

import android.transition.Scene; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_search, container, false);
    mSceneRoot = (ViewGroup) view.findViewById(R.id.sceneRoot);
    mSceneMessage = new Scene(mSceneRoot, mSceneRoot.findViewById(R.id.container));
    mSceneResults = Scene.getSceneForLayout(mSceneRoot, R.layout.fragment_search_results,
            getActivity());
    return view;
}
 
开发者ID:Doctoror,项目名称:PainlessMusicPlayer,代码行数:12,代码来源:SearchFragment.java

示例10: onAnimationEnd

import android.transition.Scene; //导入方法依赖的package包/类
@TargetApi(19)
@Override
public void onAnimationEnd(Animation animation) {
    // This method is called at the end of the animation for the fragment transaction,
    // which is perfect time to start our Transition.
    Log.i(TAG, "Fragment animation ended. Starting a Transition.");
    final Scene scene = Scene.getSceneForLayout((ViewGroup) getView(),
            R.layout.fragment_detail_content, getActivity());
    TransitionManager.go(scene);
    // Note that we need to bind views with data after we call TransitionManager.go().
    bind(scene.getSceneRoot());
}
 
开发者ID:sifeier,项目名称:One,代码行数:13,代码来源:DetailFragment.java

示例11: onAnimationEnd

import android.transition.Scene; //导入方法依赖的package包/类
@Override
public void onAnimationEnd(Animation animation) {
    // This method is called at the end of the animation for the fragment transaction,
    // which is perfect time to start our Transition.
    Log.i(TAG, "Fragment animation ended. Starting a Transition.");
    final Scene scene = Scene.getSceneForLayout((ViewGroup) getView(),
            R.layout.fragment_detail_content, getActivity());
    TransitionManager.go(scene);
    // Note that we need to bind views with data after we call TransitionManager.go().
    bind(scene.getSceneRoot());
}
 
开发者ID:vivekgidmare,项目名称:android-FragmentTransition,代码行数:12,代码来源:DetailFragment.java

示例12: onCreate

import android.transition.Scene; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main_activity);

  container = (ViewGroup) findViewById(R.id.main_container);
  webSiteForm = Scene.getSceneForLayout(container, R.layout.scene_link, this);
  pictureForm = Scene.getSceneForLayout(container, R.layout.scene_picture, this);
  contactForm = Scene.getSceneForLayout(container, R.layout.scene_contact, this);
  eventForm   = Scene.getSceneForLayout(container, R.layout.scene_event, this);
}
 
开发者ID:mikailsheikh,项目名称:cogitolearning-examples,代码行数:13,代码来源:MainActivity.java

示例13: onCreate

import android.transition.Scene; //导入方法依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_transition);

    radioGroup.setOnCheckedChangeListener(this);


    // A Scene can be instantiated from a live view hierarchy.
    mScene1 = new Scene(sceneRoot, (ViewGroup) sceneRoot.findViewById(R.id.container));

    // You can also inflate a generate a Scene from a layout resource file.
    mScene2 = Scene.getSceneForLayout(sceneRoot, R.layout.scene2, this);


    // Another scene from a layout resource file.
    mScene3 = Scene.getSceneForLayout(sceneRoot, R.layout.scene3, this);


    // We create a custom TransitionManager for Scene 3, in which ChangeBounds and Fade
    // take place at the same time.
    mTransitionManagerForScene3 = TransitionInflater.from(this)
            .inflateTransitionManager(R.transition.scene3_transition_manager, sceneRoot);
}
 
开发者ID:zawadz88,项目名称:AnimationShowcase,代码行数:26,代码来源:TransitionActivity.java

示例14: TransitionLayout

import android.transition.Scene; //导入方法依赖的package包/类
public TransitionLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    if (!isInEditMode()) {
        Resources res = getResources();
        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.TransitionLayout);
        if (res != null && ta != null) {
            int transitionManagerId = ta.getResourceId(R.styleable.TransitionLayout_transitionManager, 0);
            if (transitionManagerId > 0) {
                transitionManager = TransitionInflater.from(context).inflateTransitionManager(transitionManagerId, this);
            }
            int[] phases = null;
            Scene[] scenes = null;
            String scenesStr = ta.getString(R.styleable.TransitionLayout_scenes);
            if (scenesStr != null) {
                String[] layouts = scenesStr.split(",");
                scenes = new Scene[layouts.length];
                for (int i = 0; i < layouts.length; i++) {
                    String layout = layouts[i].trim();
                    int id = res.getIdentifier(layout, "layout", context.getPackageName());
                    scenes[i] = Scene.getSceneForLayout(this, id, context);
                }
            }
            String phaseStr = ta.getString(R.styleable.TransitionLayout_transitionPhases);
            if (phaseStr != null) {
                String[] phasesStr = phaseStr.split(",");
                phases = new int[phasesStr.length];
                for (int i = 0; i < phasesStr.length; i++) {
                    String phase = phasesStr[i].trim();
                    phases[i] = Integer.parseInt(phase);
                }
            }
            if (scenes != null && phases != null && scenes.length == phases.length + 1) {
                mScenes = new SparseArray<>(scenes.length);
                for (int i = 0; i < phases.length; i++) {
                    mScenes.put(phases[i], scenes[i + 1]);
                }

            } else {
                throw new RuntimeException("Either scenes or phases aren't defined, or the counts do not match");
            }
            ta.recycle();
            if (transitionManager != null) {
                TransitionManager.go(scenes[0], TransitionInflater.from(context).inflateTransition(R.transition.none));
            }
        }
    }
}
 
开发者ID:StylingAndroid,项目名称:PresenterLite,代码行数:48,代码来源:TransitionLayout.java

示例15: setupTransitions

import android.transition.Scene; //导入方法依赖的package包/类
private void setupTransitions() {
//        Slide slide = new Slide(Gravity.BOTTOM);
//        slide.excludeTarget(android.R.id.statusBarBackground, true);
//        getWindow().setEnterTransition(slide);
//        getWindow().setSharedElementsUseOverlay(false);

        mTransitionManager = new TransitionManager();
        ViewGroup transitionRoot = detailContainer;

        // Expanded scene
        mExpandedScene = Scene.getSceneForLayout(transitionRoot,
                R.layout.activity_album_detail_expanded, this);

        mExpandedScene.setEnterAction(new Runnable() {
            @Override
            public void run() {
                ButterKnife.bind(AlbumDetailActivity.this);
                populate();
                mCurrentScene = mExpandedScene;
            }
        });

        TransitionSet expandTransitionSet = new TransitionSet();
        expandTransitionSet.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
        ChangeBounds changeBounds = new ChangeBounds();
        changeBounds.setDuration(200);
        expandTransitionSet.addTransition(changeBounds);

        Fade fadeLyrics = new Fade();
        fadeLyrics.addTarget(R.id.lyrics);
        fadeLyrics.setDuration(150);
        expandTransitionSet.addTransition(fadeLyrics);

        // Collapsed scene
        mCollapsedScene = Scene.getSceneForLayout(transitionRoot,
                R.layout.activity_album_detail, this);

        mCollapsedScene.setEnterAction(new Runnable() {
            @Override
            public void run() {
                ButterKnife.bind(AlbumDetailActivity.this);
                populate();
                mCurrentScene = mCollapsedScene;
            }
        });

        TransitionSet collapseTransitionSet = new TransitionSet();
        collapseTransitionSet.setOrdering(TransitionSet.ORDERING_SEQUENTIAL);

        Fade fadeOutLyrics = new Fade();
        fadeOutLyrics.addTarget(R.id.lyrics);
        fadeOutLyrics.setDuration(150);
        collapseTransitionSet.addTransition(fadeOutLyrics);

        ChangeBounds resetBounds = new ChangeBounds();
        resetBounds.setDuration(200);
        collapseTransitionSet.addTransition(resetBounds);

        mTransitionManager.setTransition(mExpandedScene, mCollapsedScene, collapseTransitionSet);
        mTransitionManager.setTransition(mCollapsedScene, mExpandedScene, expandTransitionSet);
        mCollapsedScene.enter();

//        postponeEnterTransition();
    }
 
开发者ID:treehouse,项目名称:android-animations-transitions,代码行数:65,代码来源:AlbumDetailActivity.java


注:本文中的android.transition.Scene.getSceneForLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。