當前位置: 首頁>>代碼示例>>Java>>正文


Java TransitionManager.go方法代碼示例

本文整理匯總了Java中android.transition.TransitionManager.go方法的典型用法代碼示例。如果您正苦於以下問題:Java TransitionManager.go方法的具體用法?Java TransitionManager.go怎麽用?Java TransitionManager.go使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.transition.TransitionManager的用法示例。


在下文中一共展示了TransitionManager.go方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: goToEmptyScene

import android.transition.TransitionManager; //導入方法依賴的package包/類
public void goToEmptyScene(boolean withAnimation) {
    if (mCurrentScene == mEmptyScene) {
        return;
    }
    initIfNeeded();
    if (withAnimation) {
        mEmptyView.setAlpha(1.0f);
        transitionTo(mEmptyScene);
    } else {
        TransitionManager.go(mEmptyScene, null);
        // When transition is null, transition got stuck without calling endTransitions.
        TransitionManager.endTransitions(mEmptyScene.getSceneRoot());
        // Since Fade.OUT transition doesn't run, we need to set alpha manually.
        mEmptyView.setAlpha(0);
    }
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:17,代碼來源:TvTransitionManager.java

示例2: onCreate

import android.transition.TransitionManager; //導入方法依賴的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: onCheckedChanged

import android.transition.TransitionManager; //導入方法依賴的package包/類
@Override public void onCheckedChanged(final RadioGroup group, int checkedId) {
    switch (checkedId) {
        case R.id.select_scene_1: {
            // You can start an automatic transition with TransitionManager.go().
            TransitionManager.go(mScene1);
            break;
        }
        case R.id.select_scene_2: {
            TransitionSet set = new TransitionSet();
            Slide slide = new Slide(Gravity.LEFT);
            slide.addTarget(R.id.transition_title);
            set.addTransition(slide);
            set.addTransition(new ChangeBounds());
            set.setOrdering(TransitionSet.ORDERING_TOGETHER);
            set.setDuration(350);
            TransitionManager.go(mScene2, set);
            break;
        }
        case R.id.select_scene_3: {
            // You can also start a transition with a custom TransitionManager.
            mTransitionManagerForScene3.transitionTo(mScene3);
            break;
        }
    }
}
 
開發者ID:xu6148152,項目名稱:binea_project_for_android,代碼行數:26,代碼來源:ScenesSample.java

示例4: changeToConfirmScene

import android.transition.TransitionManager; //導入方法依賴的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

示例5: changeScene

import android.transition.TransitionManager; //導入方法依賴的package包/類
private void changeScene(int scene) {
    switch (scene) {
        case 2:
            scene3TransitionManager.transitionTo(scenes[2]);
            break;
        default:
            TransitionManager.go(scenes[scene]);
            break;
    }
}
 
開發者ID:chartsai,項目名稱:TransitionDemo,代碼行數:11,代碼來源:TransitionManagerActivity.java

示例6: onViewCreated

import android.transition.TransitionManager; //導入方法依賴的package包/類
@Override
public void onViewCreated(final View view, final Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    if (savedInstanceState == null) {
        mSceneCurrent = mSceneMessage;
        TransitionManager.go(mSceneMessage, mDefaultTransition);
    }
}
 
開發者ID:Doctoror,項目名稱:PainlessMusicPlayer,代碼行數:9,代碼來源:SearchFragment.java

示例7: goToScene

import android.transition.TransitionManager; //導入方法依賴的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

示例8: onClick

import android.transition.TransitionManager; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    if (mCurrentScene == mScene1) {
        TransitionManager.go(mScene2, mTransition);
        mCurrentScene = mScene2;
    } else {
        TransitionManager.go(mScene1, mTransition);
        mCurrentScene = mScene1;
    }
}
 
開發者ID:IanGClifton,項目名稱:auid2,代碼行數:11,代碼來源:MainActivity.java

示例9: animateFinished

import android.transition.TransitionManager; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
void animateFinished() {
    Transition slideFromEnd = new Slide(Gravity.END);
    TransitionManager.go(sceneComplete, slideFromEnd);

    sceneComplete.getSceneRoot()
            .findViewById(R.id.tutorial_done)
            .setOnClickListener(this);
}
 
開發者ID:ToxicBakery,項目名稱:Screenshot-Redaction,代碼行數:10,代碼來源:FragmentInitialize.java

示例10: onClick

import android.transition.TransitionManager; //導入方法依賴的package包/類
@Override public void onClick(View view) {
  if(!transitionFlag){
    TransitionManager.go(scene2);
  } else {
    TransitionManager.go(scene1);
  }

  transitionFlag = !transitionFlag;
}
 
開發者ID:SergioDim3nsions,項目名稱:BasicSceneExample,代碼行數:10,代碼來源:MainActivity.java

示例11: onAnimationEnd

import android.transition.TransitionManager; //導入方法依賴的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

示例12: onAnimationEnd

import android.transition.TransitionManager; //導入方法依賴的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

示例13: onCheckedChanged

import android.transition.TransitionManager; //導入方法依賴的package包/類
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
    View square = sceneRoot.findViewById(R.id.transition_square);
    switch (checkedId) {
        case R.id.select_scene_1: {
            square.setVisibility(View.VISIBLE);

            // You can start an automatic transition with TransitionManager.go().
            TransitionManager.go(mScene1);

            break;
        }
        case R.id.select_scene_2: {
            square.setVisibility(View.VISIBLE);
            TransitionManager.go(mScene2);
            break;
        }
        case R.id.select_scene_3: {
            square.setVisibility(View.VISIBLE);

            // You can also start a transition with a custom TransitionManager.
            mTransitionManagerForScene3.transitionTo(mScene3);

            break;
        }
        case R.id.select_scene_4: {

            // Alternatively, transition can be invoked dynamically without a Scene.
            // For this, we first call TransitionManager.beginDelayedTransition().
            TransitionManager.beginDelayedTransition(sceneRoot);
            // Then, we can just change view properties as usual.
            square.setVisibility(View.VISIBLE);
            ViewGroup.LayoutParams params = square.getLayoutParams();
            int newSize = getResources().getDimensionPixelSize(R.dimen.square_size_expanded);
            params.width = newSize;
            params.height = newSize;
            square.setLayoutParams(params);

            break;
        }
        case R.id.select_scene_5: {
            TransitionInflater transitionInflater = TransitionInflater.from(this);
            Transition transition = transitionInflater.inflateTransition(R.transition.changebounds_fadeout_sequential);
            TransitionManager.beginDelayedTransition(sceneRoot, transition);

            square.setVisibility(View.GONE);
            break;
        }
    }
}
 
開發者ID:zawadz88,項目名稱:AnimationShowcase,代碼行數:52,代碼來源:TransitionActivity.java

示例14: TransitionLayout

import android.transition.TransitionManager; //導入方法依賴的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: changeScene

import android.transition.TransitionManager; //導入方法依賴的package包/類
private void changeScene(int sceneNumber) {
    TransitionManager.go(scenes[sceneNumber], new CircleViewTransition());
}
 
開發者ID:chartsai,項目名稱:TransitionDemo,代碼行數:4,代碼來源:CustomizedTransitionActivity.java


注:本文中的android.transition.TransitionManager.go方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。