• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ChangeBounds类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onResume

import android.support.transition.ChangeBounds; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();
    if (mTextView == null)
        return;

    mTextView.postDelayed(new Runnable() {
        @Override
        public void run() {
            if (mTextView != null) {
                TransitionSet transition = (TransitionSet) new TransitionSet().addTransition(new Fade(Fade.OUT)).addTransition(new ChangeBounds()).addTransition(new Fade(Fade.IN)).setDuration(1000);
                TransitionManager.beginDelayedTransition(logoContainer, transition);
                mTextView.setVisibility(View.VISIBLE);
            }
        }
    }, 1000);
}
 
开发者ID:salemoh,项目名称:GoldenQuranAndroid,代码行数:18,代码来源:LanguageActivity.java


示例2: hideWithFadeView

import android.support.transition.ChangeBounds; //导入依赖的package包/类
public static void hideWithFadeView(boolean on, ViewGroup rootView, View view) {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Fade fade = new Fade();
        fade.setDuration(500);

        ChangeBounds changeBounds = new ChangeBounds();
        changeBounds.setDuration(500);

        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(fade);
        transitionSet.addTransition(changeBounds);
        transitionSet.setOrdering(TransitionSet.ORDERING_TOGETHER);
        TransitionManager.beginDelayedTransition(rootView, transitionSet);
    }
    view.setVisibility(on ? View.GONE : View.VISIBLE);
}
 
开发者ID:active-citizen,项目名称:android.java,代码行数:17,代码来源:UIhelper.java


示例3: goneSlidingTabs

import android.support.transition.ChangeBounds; //导入依赖的package包/类
private void goneSlidingTabs(boolean on) {
    if (!isInvisible) {
        Fade fade = new Fade();
        fade.setDuration(500);

        ChangeBounds changeBounds = new ChangeBounds();
        changeBounds.setDuration(500);

        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(fade);
        transitionSet.addTransition(changeBounds);
        transitionSet.setOrdering(TransitionSet.ORDERING_TOGETHER);

        TransitionManager.beginDelayedTransition(getBinding().root, transitionSet);
        getBinding().slidingTabs.setVisibility(on ? View.GONE : View.VISIBLE);
    }
}
 
开发者ID:active-citizen,项目名称:android.java,代码行数:18,代码来源:FriendProfileTabFragmentVM.java


示例4: animateForViewGroupTransition

import android.support.transition.ChangeBounds; //导入依赖的package包/类
public static void animateForViewGroupTransition(ViewGroup viewGroup) {
    ChangeBounds changeBounds = new ChangeBounds();
    Fade fadeOut = new Fade(Fade.OUT);
    Fade fadeIn = new Fade(Fade.IN);
    TransitionSet transition = new TransitionSet();
    transition.setOrdering(TransitionSet.ORDERING_TOGETHER);
    transition.addTransition(fadeOut)
            .addTransition(changeBounds)
            .addTransition(fadeIn);

    TransitionManager.beginDelayedTransition(viewGroup);
}
 
开发者ID:fantasy1022,项目名称:FancyTrendView,代码行数:13,代码来源:UiUtils.java


示例5: onCreate

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

    mStaggerCB = (CheckBox) findViewById(R.id.staggerCB);

    mFirstButton = (Button) findViewById(R.id.firstButton);
    mSecondButton = (Button) findViewById(R.id.secondButton);
    mThirdButton = (Button) findViewById(R.id.thirdButton);
    mFourthButton = (Button) findViewById(R.id.fourthButton);

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

    // Create custom transition that 'staggers' the animations by offsetting
    // the individual start times
    mStaggeredTransition = new TransitionSet();
    Transition first = new ChangeBounds();
    Transition second = new ChangeBounds();
    Transition third = new ChangeBounds();
    Transition fourth = new ChangeBounds();

    first.addTarget(mFirstButton);
    second.setStartDelay(50).addTarget(mSecondButton);
    third.setStartDelay(100).addTarget(mThirdButton);
    fourth.setStartDelay(150).addTarget(mFourthButton);

    mStaggeredTransition.addTransition(first).addTransition(second).addTransition(third).
            addTransition(fourth);
}
 
开发者ID:google,项目名称:android-ui-toolkit-demos,代码行数:31,代码来源:MainActivity.java


示例6: onBindViewHolder

import android.support.transition.ChangeBounds; //导入依赖的package包/类
@Override
public void onBindViewHolder(final ViewHolder holder, int position) {
    ShoppingListItem item = data.get(position);

    // Reset values used by animation
    holder.itemView.getLayoutParams().height = LinearLayout.LayoutParams.WRAP_CONTENT;
    holder.resetBackgroundColor();
    holder.resetTextColor();
    holder.isExpanded = expandedItemKeys.contains(item.key);

    holder.nameTextView.setText(item.name);
    holder.createdByTextView.setText(context.getString(R.string.shopping_list_item_created_by, item.createdBy));
    holder.priceTextView.setVisibility((item.price > 0) ? View.VISIBLE : View.GONE);

    holder.descriptionTextView.setVisibility((item.description.length() > 0) ? View.VISIBLE : View.GONE);
    holder.descriptionTextView.setText(item.description);

    holder.urgentImageView.setVisibility((item.urgent) ? View.VISIBLE : View.GONE);

    holder.data = item;

    String formattedPrice = currencyFormatter.format((double) item.price / 100.0);
    if (viewSize == VIEW_SIZE_COMPACT) {
        holder.detailsView.setVisibility((holder.isExpanded) ? View.VISIBLE : View.GONE);
        holder.priceTextView.setText(context.getString(R.string.shopping_list_item_price_compact, formattedPrice));

        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                boolean expand = holder.detailsView.getVisibility() == View.GONE;
                holder.isExpanded = expand;

                if (expand) {
                    expandedItemKeys.add(holder.data.key);
                } else {
                    expandedItemKeys.remove(holder.data.key);
                }

                holder.detailsView.setVisibility((expand) ? View.VISIBLE : View.GONE);

                ChangeBounds transition = new ChangeBounds();
                transition.setDuration(200);
                TransitionManager.beginDelayedTransition(recyclerView, transition);

                holder.itemView.setActivated(expand);
            }
        });
    } else if (viewSize == VIEW_SIZE_COZY) {
        holder.priceTextView.setText(context.getString(R.string.shopping_list_item_price_cozy, formattedPrice));
        holder.itemView.setOnClickListener(null);
    }
}
 
开发者ID:david-szabo97,项目名称:Android-Open-Shopping-List,代码行数:53,代码来源:ShoppingListAdapter.java


示例7: onCreate

import android.support.transition.ChangeBounds; //导入依赖的package包/类
@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, 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.

    /* Same as:

    mTransitionManagerForScene3 = TransitionInflater.from(this)
            .inflateTransitionManager(R.transition.scene3_transition_manager, sceneRoot);

    + in transition/scene3_transition_manager.xml

            <transitionManager xmlns:android="http://schemas.android.com/apk/res/android">
                <transition
                    android:toScene="@layout/scene3"
                    android:transition="@transition/changebounds_fadein_together"/>
            </transitionManager>

    + in transition/changebounds_fadein_together.xml

    <transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
        <changeBounds/>
        <fade android:fadingMode="fade_in">
            <targets>
                <target android:targetId="@id/transition_title" />
            </targets>
        </fade>
    </transitionSet>
    */

    TransitionSet scene3Transitions = new TransitionSet();
    scene3Transitions
            .addTransition(new ChangeBounds())
            .addTransition(new Fade(Fade.IN).addTarget(R.id.transition_title));
    mTransitionManagerForScene3 = new TransitionManager();
    mTransitionManagerForScene3.setTransition(mScene3, scene3Transitions);
}
 
开发者ID:zawadz88,项目名称:AnimationShowcase,代码行数:55,代码来源:SupportTransitionActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IDataSourceProvider类代码示例发布时间:2022-05-23
下一篇:
Java MultiReducer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap