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


Java Fade.setDuration方法代碼示例

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


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

示例1: onCreate

import android.transition.Fade; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    Fade s = new Fade();
    s.setDuration(1000);
    getWindow().setEnterTransition(s);

    super.onCreate(savedInstanceState);

    /*setContentView(R.layout.newslayout);
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
                .add(R.id.newscontainer, new NewsFragment())
                .commit();
    }*/
    // ATTENTION: This was auto-generated to implement the App Indexing API.
    // See https://g.co/AppIndexing/AndroidStudio for more information.

}
 
開發者ID:NullPointersInc,項目名稱:Bella-Android,代碼行數:19,代碼來源:NewsActivity.java

示例2: handleTransitions

import android.transition.Fade; //導入方法依賴的package包/類
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
private void handleTransitions() {
    useSysTransition = getIntent().getBooleanExtra(KEY_USE_SYS_TRANSITION, false);
    if(useSysTransition) {
        ivDetail.setVisibility(View.VISIBLE);
        Fade fade = new Fade();
        fade.setDuration(500);
        getWindow().setEnterTransition(fade);
        getWindow().setExitTransition(fade);
        ChangeBounds changeBounds = new ChangeBounds();
        getWindow().setSharedElementEnterTransition(changeBounds);
    }
    entity = (TransitionsEntity) getIntent().getSerializableExtra(KEY_ENTITY);
    KLog.d(entity);
    GlideUtils.displayImage(this, ivDetail, entity.getUrl(), R.drawable.def_placeholder);
}
 
開發者ID:Sherchen,項目名稱:AnimationsDemo,代碼行數:17,代碼來源:DetailActivity.java

示例3: openTaskDetail

import android.transition.Fade; //導入方法依賴的package包/類
public void openTaskDetail(){
    Task clickedTask = adapter.getTask(mTaskViewPager.getCurrentItem());

    Fragment taskDetailFragment = new TaskDetailFragment();
    ((TaskDetailFragment)taskDetailFragment).setDisplayedTask(clickedTask);

    if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) {
        Explode explode = new Explode();
        explode.setDuration(300);
        Fade fade = new Fade();
        fade.setDuration(400);
        taskDetailFragment.setEnterTransition(fade);
        setExitTransition(explode);
        setReenterTransition(explode);
    }

    getActivity().getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.content_frame, taskDetailFragment)
            .addToBackStack(null)
            .commit();

}
 
開發者ID:gincos,項目名稱:BeHealthy,代碼行數:24,代碼來源:MainFragment.java

示例4: onCreate

import android.transition.Fade; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Force trigger System UI cover on this Activity
    hideSystemUI();
    showSystemUI();

    // Avoid flash while transition from former Activity
    postponeEnterTransition();
    getWindow().setStatusBarColor(Color.TRANSPARENT);
    getWindow().setNavigationBarColor(Color.TRANSPARENT);
    getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT);

    // Using the fade effect for Activity transition
    Fade fade = new Fade();
    fade.excludeTarget(android.R.id.statusBarBackground, true);
    fade.excludeTarget(android.R.id.navigationBarBackground, true);
    fade.excludeTarget(R.id.showing_image_view, true);
    fade.setDuration(TRANSITION_DURATION);
    applyTransitionToWindow(getWindow(), fade, true, true, true, true, true);

    setContentView(R.layout.activity_twitterized_image_showing);

    setupViews();
}
 
開發者ID:lekaha,項目名稱:TwitterizedPhotoView,代碼行數:27,代碼來源:TwitterizedImageShowingActivity.java

示例5: onCreate

import android.transition.Fade; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {

	super.onCreate(savedInstanceState);
	getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
	getWindow().setAllowEnterTransitionOverlap(true);
	getWindow().setAllowReturnTransitionOverlap(true);
	setContentView(R.layout.activity_animation);

	Fade fade = new Fade();
	fade.setDuration(5000);
	//fade.addTarget(findViewById(R.id.view));
	getWindow().setEnterTransition(fade);
	getWindow().setExitTransition(fade);

}
 
開發者ID:JamesKing9,項目名稱:learn-newFeatures_Android_5.0,代碼行數:17,代碼來源:FadeActivity.java

示例6: onCreate

import android.transition.Fade; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    if(BuildUtil.isLargeThanAPI21()){
        Fade fade = new Fade();
        Explode explode = new Explode();
        fade.setDuration(100);
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(fade);
        getWindow().setExitTransition(fade);
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about_us);

    getSupportActionBar().setTitle("關於我們");
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
開發者ID:583462423,項目名稱:ihandsw,代碼行數:17,代碼來源:AboutUsActivity.java

示例7: newInstance

import android.transition.Fade; //導入方法依賴的package包/類
public static FullScreenImageFragment newInstance(ArrayList<Poster> imageList, int position) {
    Bundle args = new Bundle();
    args.putParcelableArrayList(ARG_IMAGE_LIST, imageList);
    args.putInt(ARA_SELECT_POSITION, position);
    FullScreenImageFragment fragment = new FullScreenImageFragment();
    fragment.setArguments(args);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Fade fade = new Fade();
        fade.setDuration(500);
        fragment.setEnterTransition(fade);
    }
    return fragment;
}
 
開發者ID:prakh25,項目名稱:MovieApp,代碼行數:14,代碼來源:FullScreenImageFragment.java

示例8: performTransition

import android.transition.Fade; //導入方法依賴的package包/類
private void performTransition()
{
    if (isDestroyed())
    {
        return;
    }
    Fragment previousFragment = mFragmentManager.findFragmentById(R.id.fragment_container);
    Fragment nextFragment = Fragment2.newInstance();

    FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();

    // 1. Exit for Previous Fragment
    Fade exitFade = new Fade();
    exitFade.setDuration(FADE_DEFAULT_TIME);
    previousFragment.setExitTransition(exitFade);

    // 2. Shared Elements Transition
    TransitionSet enterTransitionSet = new TransitionSet();
    enterTransitionSet.addTransition(TransitionInflater.from(this).inflateTransition(android.R.transition.move));
    enterTransitionSet.setDuration(MOVE_DEFAULT_TIME);
    enterTransitionSet.setStartDelay(FADE_DEFAULT_TIME);
    nextFragment.setSharedElementEnterTransition(enterTransitionSet);

    // 3. Enter Transition for New Fragment
    Fade enterFade = new Fade();
    enterFade.setStartDelay(MOVE_DEFAULT_TIME + FADE_DEFAULT_TIME);
    enterFade.setDuration(FADE_DEFAULT_TIME);
    nextFragment.setEnterTransition(enterFade);

    View logo = ButterKnife.findById(this, R.id.fragment1_logo);
    fragmentTransaction.addSharedElement(logo, logo.getTransitionName());
    fragmentTransaction.replace(R.id.fragment_container, nextFragment);
    fragmentTransaction.commitAllowingStateLoss();
}
 
開發者ID:Bynder,項目名稱:FragmentTransitionExample,代碼行數:35,代碼來源:MainActivity.java

示例9: onCreate

import android.transition.Fade; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    Fade s = new Fade();
    s.setDuration(1000);
    getWindow().setEnterTransition(s);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.framelayout);
    Window window = getWindow();
    mWeatherView = (WeatherView) findViewById(R.id.weather);
    S = getIntent().getStringExtra("city");
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
                .add(R.id.container, new ForecastFragment())
                .commit();
    }
    // ATTENTION: This was auto-generated to implement the App Indexing API.
    // See https://g.co/AppIndexing/AndroidStudio for more information.

    mWeatherView.setWeather(Constants.weatherStatus.RAIN)
            .setCurrentLifeTime(2000)
            .setCurrentFadeOutTime(1000)
            .setCurrentParticles(43)
            .setFPS(60)
            .setCurrentAngle(-5)
            .setOrientationMode(Constants.orientationStatus.ENABLE)
            .startAnimation();

    window.setStatusBarColor(getResources().getColor(R.color.blue_900));

}
 
開發者ID:NullPointersInc,項目名稱:Bella-Android,代碼行數:32,代碼來源:WeatherActivity.java

示例10: initData

import android.transition.Fade; //導入方法依賴的package包/類
@Override
public void initData(Bundle savedInstanceState) {
    if (savedInstanceState != null){
        videoInfo = (VideoListInfo.Video) savedInstanceState.getSerializable(Constants.VIDEO_INFO);
    }
    initMedia();
    if (videoInfo.getData().getConsumption() !=null ){
        initRecyclerView();
        mPresenter.getRelaRelateVideoInfo(videoInfo.getData().getId());
        mPresenter.getShareInfo(videoInfo.getData().getId());
    }else {
        mPresenter.getVideoData(videoInfo.getData().getId());
    }
    dragBottomView.setDismissedListener(this);
    replyDragBottomView.setDismissedListener(this);
    if (supportsTransitions()){
        Slide slide = new Slide(Gravity.BOTTOM);
        slide.setDuration(500L);
        slide.excludeTarget(android.R.id.statusBarBackground, true);
        slide.excludeTarget(android.R.id.navigationBarBackground, true);
        slide.excludeTarget(R.id.rl_screen, true);
        slide.excludeTarget(R.id.detail_player, true);
        getWindow().setEnterTransition(slide);
        getWindow().getEnterTransition().excludeTarget(R.id.frameLayout,true);
        getWindow().getEnterTransition().excludeTarget(R.id.fl_loading,true);
        Fade fade = new Fade();
        fade.setDuration(500L);
        getWindow().setReturnTransition(fade);
    }

}
 
開發者ID:Zweihui,項目名稱:Aurora,代碼行數:32,代碼來源:VideoDetailActivity.java

示例11: setupWindowTransitions

import android.transition.Fade; //導入方法依賴的package包/類
private void setupWindowTransitions(){
    if(TransitionHelper.isSysTransitionEnable()) {
        Fade fade = new Fade();
        fade.setDuration(500);
        getWindow().setExitTransition(fade);
        getWindow().setReenterTransition(fade);
    }
}
 
開發者ID:Sherchen,項目名稱:AnimationsDemo,代碼行數:9,代碼來源:HomeActivity.java

示例12: setUpWindowAnimations

import android.transition.Fade; //導入方法依賴的package包/類
private void setUpWindowAnimations() {
    if (android.os.Build.VERSION.SDK_INT >= 21) {
        Fade fade = new Fade(2);
        fade.setDuration(3000);
        getWindow().setExitTransition(fade);
    }
}
 
開發者ID:vikasdesale,項目名稱:News24x7-news-from-every-part-of-the-world,代碼行數:8,代碼來源:HomeActivity.java

示例13: setupWindowAnimations

import android.transition.Fade; //導入方法依賴的package包/類
private void setupWindowAnimations() {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Fade fade = new Fade();
        fade.setDuration(1000);
        getWindow().setEnterTransition(fade);
        Toast.makeText(this, "Animation", Toast.LENGTH_SHORT).show();
        Explode slide = new Explode();
        slide.setDuration(1000);
        getWindow().setReenterTransition(slide);
    }


}
 
開發者ID:HitRoxxx,項目名稱:FloatingNew,代碼行數:14,代碼來源:SelectedApplication.java

示例14: buildEnterTransition

import android.transition.Fade; //導入方法依賴的package包/類
private Visibility buildEnterTransition() {
    Fade enterTransition = new Fade();
    enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
    // This view will not be affected by enter transition animation
    enterTransition.excludeTarget(R.id.square_red, true);
    return enterTransition;
}
 
開發者ID:shenhuanet,項目名稱:AndroidOpen,代碼行數:8,代碼來源:TransitionActivity1.java

示例15: onInit

import android.transition.Fade; //導入方法依賴的package包/類
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onInit(Bundle savedInstanceState) {
    Fade fade = new Fade();
    fade.setInterpolator(new DecelerateInterpolator());
    fade.setDuration(500);//動畫持續時間
    getWindow().setEnterTransition(fade);

    Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fm_content);

    if (fragment == null)
    {
        getSupportFragmentManager().beginTransaction().add(R.id.fm_content, new NormalFragment()).commit();
    }
}
 
開發者ID:Yuphee,項目名稱:LoadManager,代碼行數:16,代碼來源:AnimActivity.java


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