当前位置: 首页>>代码示例>>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;未经允许,请勿转载。