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


Java LayoutTransition类代码示例

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


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

示例1: onCreate

import android.animation.LayoutTransition; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_layout_animations);


    LayoutTransition layoutTransition = new LayoutTransition();

    ObjectAnimator appearingAnim = ObjectAnimator.ofFloat(null, "rotationY", 0f, 90f, 180f, 270f, 359.9999f);
    appearingAnim.addListener(new AnimatorListenerAdapter() {
        public void onAnimationEnd(Animator anim) {
            View view = (View) ((ObjectAnimator) anim).getTarget();
            view.setRotationY(0f);
        }
    });

    layoutTransition.setAnimator(LayoutTransition.APPEARING, appearingAnim);
    layoutTransition.setDuration(LayoutTransition.APPEARING, 2000L);
    layoutTransition.setStartDelay(LayoutTransition.APPEARING, 0);

    gridContainer.setLayoutTransition(layoutTransition);
}
 
开发者ID:zawadz88,项目名称:AnimationShowcase,代码行数:23,代码来源:CustomLayoutAnimationsActivity.java

示例2: onCreateView

import android.animation.LayoutTransition; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_reading_lists, container, false);
    unbinder = ButterKnife.bind(this, view);

    searchEmptyView.setEmptyText(R.string.search_reading_lists_no_results);
    readingListView.setLayoutManager(new LinearLayoutManager(getContext()));
    readingListView.setAdapter(adapter);
    readingListView.addItemDecoration(new DrawableItemDecoration(getContext(), R.attr.list_separator_drawable));

    WikipediaApp.getInstance().getBus().register(eventBusMethods);

    contentContainer.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
    emptyContainer.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
    ((ViewGroup)emptyContainer.getChildAt(0)).getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);

    swipeRefreshLayout.setColorSchemeResources(getThemedAttributeId(getContext(), R.attr.colorAccent));
    swipeRefreshLayout.setOnRefreshListener(ReadingListSyncAdapter::manualSyncWithRefresh);
    // TODO: remove when ready.
    if (!ReleaseUtil.isPreBetaRelease()) {
        swipeRefreshLayout.setEnabled(false);
    }
    return view;
}
 
开发者ID:wikimedia,项目名称:apps-android-wikipedia,代码行数:25,代码来源:ReadingListsFragment.java

示例3: ZenModeConditionSelection

import android.animation.LayoutTransition; //导入依赖的package包/类
public ZenModeConditionSelection(Context context, int zenMode) {
    super(context);
    mContext = context;
    mZenMode = zenMode;
    mConditions = new ArrayList<Condition>();
    setLayoutTransition(new LayoutTransition());
    final int p = mContext.getResources().getDimensionPixelSize(R.dimen.content_margin_left);
    setPadding(p, p, p, 0);
    mNoMan = INotificationManager.Stub.asInterface(
            ServiceManager.getService(Context.NOTIFICATION_SERVICE));
    final RadioButton b = newRadioButton(null);
    b.setText(mContext.getString(com.android.internal.R.string.zen_mode_forever));
    b.setChecked(true);
    for (int i = ZenModeConfig.MINUTE_BUCKETS.length - 1; i >= 0; --i) {
        handleCondition(ZenModeConfig.toTimeCondition(mContext,
                ZenModeConfig.MINUTE_BUCKETS[i], UserHandle.myUserId()));
    }
}
 
开发者ID:ric96,项目名称:lineagex86,代码行数:19,代码来源:ZenModeConditionSelection.java

示例4: initView

import android.animation.LayoutTransition; //导入依赖的package包/类
private void initView(Context context) {
    if (mIndicatorType == 0) {
        for (int i = 0; i < mPinLength; i++) {
            View dot = new View(context);
            emptyDot(dot);

            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(mDotDiameter,
                    mDotDiameter);
            params.setMargins(mDotSpacing, 0, mDotSpacing, 0);
            dot.setLayoutParams(params);

            addView(dot);
        }
    } else if (mIndicatorType == 2) {
        LayoutTransition layoutTransition = new LayoutTransition();
        layoutTransition.setDuration(DEFAULT_ANIMATION_DURATION);
        layoutTransition.setStartDelay(layoutTransition.APPEARING, 0);
        setLayoutTransition(layoutTransition);
    }
}
 
开发者ID:amirarcane,项目名称:lock-screen,代码行数:21,代码来源:IndicatorDots.java

示例5: setGiftLayout

import android.animation.LayoutTransition; //导入依赖的package包/类
/**
 * @param giftLayoutParent 存放礼物控件的父容器
 * @param giftLayoutNums   礼物控件的数量
 * @return
 */
public GiftControl setGiftLayout(LinearLayout giftLayoutParent, @NonNull int giftLayoutNums) {
    if (giftLayoutNums <= 0) {
        throw new IllegalArgumentException("GiftFrameLayout数量必须大于0");
    }
    if (giftLayoutParent.getChildCount() > 0) {//如果父容器没有子孩子,就进行添加
        return this;
    }
    mGiftLayoutParent = giftLayoutParent;
    mGiftLayoutMaxNums = giftLayoutNums;
    LayoutTransition transition = new LayoutTransition();
    transition.setAnimator(LayoutTransition.CHANGE_APPEARING,
            transition.getAnimator(LayoutTransition.CHANGE_APPEARING));
    transition.setAnimator(LayoutTransition.APPEARING,
            transition.getAnimator(LayoutTransition.APPEARING));
    transition.setAnimator(LayoutTransition.DISAPPEARING,
            transition.getAnimator(LayoutTransition.CHANGE_APPEARING));
    transition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING,
            transition.getAnimator(LayoutTransition.DISAPPEARING));
    mGiftLayoutParent.setLayoutTransition(transition);

    return this;
}
 
开发者ID:DyncKathline,项目名称:LiveGiftLayout,代码行数:28,代码来源:GiftControl.java

示例6: register

import android.animation.LayoutTransition; //导入依赖的package包/类
@Override
public void register() {
    super.register();
    notificationLayout = (LinearLayout) getIconView();
    notificationLayout.setPadding(getIconPadding(), 0, getIconPadding(), 0);

    notificationLayout.removeAllViewsInLayout();
    notifications.clear();

    Boolean isIconAnimations = PreferenceUtils.getBooleanPreference(getContext(), PreferenceUtils.PreferenceIdentifier.STATUS_ICON_ANIMATIONS);
    isIconAnimations = isIconAnimations != null ? isIconAnimations : true;

    notificationLayout.setLayoutTransition(isIconAnimations ? new LayoutTransition() : null);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        Intent intent = new Intent(NotificationService.ACTION_GET_NOTIFICATIONS);
        intent.setClass(getContext(), NotificationService.class);
        getContext().startService(intent);
    }
}
 
开发者ID:TheAndroidMaster,项目名称:Status,代码行数:21,代码来源:NotificationsIconData.java

示例7: CreateFloatLayout

import android.animation.LayoutTransition; //导入依赖的package包/类
public static WindowManager.LayoutParams CreateFloatLayout(WindowManager wm, WebView fwv, View tview, FloatLinearLayout layout, float px, float py, boolean show, int width, int height) {
    WindowManager.LayoutParams wmParams = ParamsSet(px, py, fwv, width, height);
    layout.setLayoutTransition(new LayoutTransition());
    layout.setBackgroundColor(Color.parseColor("#303F9F"));
    layout.setOrientation(FloatLinearLayout.VERTICAL);
    layout.setPadding(0, 50, 0, 0);
    layout.setLayout_default_flags(wmParams.flags);
    layout.setTop(true);
    layout.setAddPosition(px, py);
    layout.setFloatLayoutParams(wmParams);
    layout.setAllowlongclick(false);
    layout.changeShowState(show);
    layout.addView(tview);
    layout.addView(fwv);
    if (show) {
        wm.addView(layout, wmParams);
        fwv.reload();
    }
    return wmParams;
}
 
开发者ID:XFY9326,项目名称:FloatText,代码行数:21,代码来源:FloatWebSettingMethod.java

示例8: setupTransition

import android.animation.LayoutTransition; //导入依赖的package包/类
private void setupTransition(LayoutTransition transition) {
    CheckBox customAnimCB = (CheckBox) findViewById(R.id.customAnimCB);
    CheckBox appearingCB = (CheckBox) findViewById(R.id.appearingCB);
    CheckBox disappearingCB = (CheckBox) findViewById(R.id.disappearingCB);
    CheckBox changingAppearingCB = (CheckBox) findViewById(R.id.changingAppearingCB);
    CheckBox changingDisappearingCB = (CheckBox) findViewById(R.id.changingDisappearingCB);
    transition.setAnimator(LayoutTransition.APPEARING, appearingCB.isChecked() ?
            (customAnimCB.isChecked() ? customAppearingAnim : defaultAppearingAnim) : null);
    transition.setAnimator(LayoutTransition.DISAPPEARING, disappearingCB.isChecked() ?
            (customAnimCB.isChecked() ? customDisappearingAnim : defaultDisappearingAnim) : null);
    transition.setAnimator(LayoutTransition.CHANGE_APPEARING, changingAppearingCB.isChecked() ?
            (customAnimCB.isChecked() ? customChangingAppearingAnim :
                    defaultChangingAppearingAnim) : null);
    transition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING,
            changingDisappearingCB.isChecked() ?
                    (customAnimCB.isChecked() ? customChangingDisappearingAnim :
                            defaultChangingDisappearingAnim) : null);
}
 
开发者ID:REBOOTERS,项目名称:AndroidAnimationExercise,代码行数:19,代码来源:LayoutAnimationsActivity.java

示例9: prepareLayoutWithoutChildren

import android.animation.LayoutTransition; //导入依赖的package包/类
/***
 * This function is used to prepare the layout after the initialize funciton but is called when the developer PROGRAMATICALLY adds
 * the accordion from the class. Hence, the accordion does not have the UI elements (children) yet
 * @param context
 */
private void prepareLayoutWithoutChildren(Context context) {
    initializeViewWithoutChildren(context);
    partition.setVisibility(isPartitioned ? VISIBLE : INVISIBLE);
    heading.setText(headingString);
    paragraph.setVisibility(VISIBLE);
    //paragraph.getViewTreeObserver().addOnGlobalLayoutListener(globalLayoutListener);
    if (isAnimated) {
        headingLayout.setLayoutTransition(new LayoutTransition());
    } else {
        headingLayout.setLayoutTransition(null);

    }

    if (isExpanded)
        expand();
    else
        collapse();

    setOnClickListenerOnHeading();

}
 
开发者ID:riyagayasen,项目名称:Android_accordion_view,代码行数:27,代码来源:AccordionView.java

示例10: initView

import android.animation.LayoutTransition; //导入依赖的package包/类
private void initView(Context context) {
    ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR);
    if (mIndicatorType == 0) {
        for (int i = 0; i < mPinLength; i++) {
            View dot = new View(context);
            emptyDot(dot);

            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(mDotDiameter,
                    mDotDiameter);
            params.setMargins(mDotSpacing, 0, mDotSpacing, 0);
            dot.setLayoutParams(params);

            addView(dot);
        }
    } else if (mIndicatorType == 2) {
        setLayoutTransition(new LayoutTransition());
    }
}
 
开发者ID:aritraroy,项目名称:PinLockView,代码行数:19,代码来源:IndicatorDots.java

示例11: setHeaderVisible

import android.animation.LayoutTransition; //导入依赖的package包/类
/**
 * Sets the {@link TableView} header visible or hides it.
 *
 * @param visible Whether the {@link TableView} header shall be visible or not.
 */
public void setHeaderVisible(boolean visible, int animationDuration) {
    if (visible && !isHeaderVisible()) {
        if (animationDuration > 0) {
            final Animator moveInAnimator = ObjectAnimator.ofPropertyValuesHolder((Object) null, PropertyValuesHolder.ofFloat("y", 0));
            moveInAnimator.setDuration(animationDuration);
            layoutTransition.setAnimator(LayoutTransition.APPEARING, moveInAnimator);
            setLayoutTransition(layoutTransition);
        } else {
            setLayoutTransition(null);
        }
        addView(tableHeaderView, 0);
    } else if (!visible && isHeaderVisible()) {
        if (animationDuration > 0) {
            final Animator moveOutAnimator = ObjectAnimator.ofPropertyValuesHolder((Object) null, PropertyValuesHolder.ofFloat("y", -tableHeaderView.getHeight()));
            moveOutAnimator.setDuration(animationDuration);
            layoutTransition.setAnimator(LayoutTransition.DISAPPEARING, moveOutAnimator);
            setLayoutTransition(layoutTransition);
        } else {
            setLayoutTransition(null);
        }
        removeView(tableHeaderView);
    }
}
 
开发者ID:ISchwarz23,项目名称:SortableTableView,代码行数:29,代码来源:TableView.java

示例12: enableLayoutTransitions

import android.animation.LayoutTransition; //导入依赖的package包/类
private void enableLayoutTransitions() {
    LayoutTransition transition = getLayoutTransition();
    transition.enableTransitionType(LayoutTransition.APPEARING);
    transition.enableTransitionType(LayoutTransition.DISAPPEARING);
    transition.enableTransitionType(LayoutTransition.CHANGE_APPEARING);
    transition.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
}
 
开发者ID:RunasSudo,项目名称:FLauncher,代码行数:8,代码来源:PageIndicator.java

示例13: setupLayoutTransition

import android.animation.LayoutTransition; //导入依赖的package包/类
private void setupLayoutTransition() {
    // We want to show layout transitions when pages are deleted, to close the gap.
    mLayoutTransition = new LayoutTransition();
    mLayoutTransition.enableTransitionType(LayoutTransition.DISAPPEARING);
    mLayoutTransition.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
    mLayoutTransition.disableTransitionType(LayoutTransition.APPEARING);
    mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_APPEARING);
    setLayoutTransition(mLayoutTransition);
}
 
开发者ID:RunasSudo,项目名称:FLauncher,代码行数:10,代码来源:Workspace.java

示例14: init

import android.animation.LayoutTransition; //导入依赖的package包/类
private void init(Context context, AttributeSet attrs, int defStyleAttr,
                  int defStyleRes) {
    mFirstModeChange = true;
    mContext = context;
    if (attrs != null) {
        TypedArray types = mContext.obtainStyledAttributes(attrs,
                R.styleable.OForm);
        mModel = types.getString(R.styleable.OForm_modelName);
        mEditable = types.getBoolean(R.styleable.OForm_editableMode,
                false);
        autoUIGenerate = types.getBoolean(R.styleable.OForm_autoUIGenerate, true);
        icon_tint_color = types.getColor(R.styleable.OForm_controlIconTint, -1);
        types.recycle();
    }
    initForm();
    LayoutTransition transition = new LayoutTransition();
    setLayoutTransition(transition);
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:19,代码来源:OForm.java

示例15: init

import android.animation.LayoutTransition; //导入依赖的package包/类
private void init() {
    setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mPresenter.toggleIsExtended();
        }
    });

    //TODO-beauty: Fix AbilityCard animation so that the image on the card doesn't just jump
    // but animates smoothly like the rest of the card

    LayoutTransition transition = new LayoutTransition();
    transition.enableTransitionType(LayoutTransition.CHANGING);
    transition.setDuration(300);
    setLayoutTransition(transition);

    inflate(getContext(), R.layout.item_ability_info, this);
}
 
开发者ID:dbdkmezz,项目名称:true-sight-dota,代码行数:19,代码来源:AbilityCardView.java


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