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


Java Scene类代码示例

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


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

示例1: buildScene

import android.transition.Scene; //导入依赖的package包/类
private Scene buildScene(ViewGroup sceneRoot, final TransitionLayout layout) {
    final Scene scene = new Scene(sceneRoot, (View) layout);
    scene.setEnterAction(new Runnable() {
        @Override
        public void run() {
            boolean wasEmptyScene = (mCurrentScene == mEmptyScene);
            setCurrentScene(scene, (ViewGroup) layout);
            layout.onEnterAction(wasEmptyScene);
        }
    });
    scene.setExitAction(new Runnable() {
        @Override
        public void run() {
            removeAllViewsFromOverlay();
            layout.onExitAction();
        }
    });
    return scene;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:20,代码来源:TvTransitionManager.java

示例2: 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

示例3: getContentScene

import android.transition.Scene; //导入依赖的package包/类
public Scene getContentScene() {
    if (mPlugins.isEmpty()) {
        return getOriginal().super_getContentScene();
    }

    final ListIterator<ActivityPlugin> iterator = mPlugins.listIterator(mPlugins.size());

    final CallFun0<Scene> superCall = new CallFun0<Scene>("getContentScene()") {

        @Override
        public Scene call() {
            if (iterator.hasPrevious()) {
                return iterator.previous().getContentScene(this);
            } else {
                return getOriginal().super_getContentScene();
            }
        }
    };
    return superCall.call();
}
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:21,代码来源:ActivityDelegate.java

示例4: 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

示例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_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

示例6: 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

示例7: 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

示例8: changeToConfirmScene

import android.transition.Scene; //导入依赖的package包/类
/**
 * 共享元素
 */
private void changeToConfirmScene() {
    final LayoutOrderConfirmationBinding confBinding = prepareConfirmationBinding();

    final Scene scene = new Scene(binding.content,
            ((ViewGroup) confBinding.getRoot()));

    scene.setEnterAction(onEnterConfirmScene(confBinding));

    final Transition transition = TransitionInflater.from(getContext())
            .inflateTransition(R.transition.transition_confirmation_view);

    TransitionManager.go(scene, transition);
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:17,代码来源:OrderDialogFragment.java

示例9: 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

示例10: 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

示例11: 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

示例12: getSceneType

import android.transition.Scene; //导入依赖的package包/类
/**
 * Returns the type of the given scene.
 */
@SceneType public int getSceneType(Scene scene) {
    if (scene == mChannelBannerScene) {
        return SCENE_TYPE_CHANNEL_BANNER;
    } else if (scene == mInputBannerScene) {
        return SCENE_TYPE_INPUT_BANNER;
    } else if (scene == mKeypadChannelSwitchScene) {
        return SCENE_TYPE_KEYPAD_CHANNEL_SWITCH;
    } else if (scene == mSelectInputScene) {
        return SCENE_TYPE_SELECT_INPUT;
    }
    return SCENE_TYPE_EMPTY;
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:16,代码来源:TvTransitionManager.java

示例13: setCurrentScene

import android.transition.Scene; //导入依赖的package包/类
private void setCurrentScene(Scene scene, ViewGroup sceneView) {
    if (mListener != null) {
        mListener.onSceneChanged(getSceneType(mCurrentScene), getSceneType(scene));
    }
    mCurrentScene = scene;
    mCurrentSceneView = sceneView;
    // TODO: Is this a still valid call?
    mMainActivity.updateKeyInputFocus();
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:10,代码来源:TvTransitionManager.java

示例14: 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

示例15: goToScene

import android.transition.Scene; //导入依赖的package包/类
private void goToScene(@NonNull final Scene scene) {
    if (mSceneCurrent != scene) {
        mSceneCurrent = scene;
        if (mListView != null) {
            mListView.clearOnScrollListeners();
        }
        TransitionManager.go(scene, mDefaultTransition);
    }
}
 
开发者ID:Doctoror,项目名称:PainlessMusicPlayer,代码行数:10,代码来源:SearchFragment.java


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