Search in sources :

Example 61 with LayoutTransition

use of android.animation.LayoutTransition in project platform_frameworks_base by android.

the class FragmentBreadCrumbs method setActivity.

/**
     * Attach the bread crumbs to their activity.  This must be called once
     * when creating the bread crumbs.
     */
public void setActivity(Activity a) {
    mActivity = a;
    mInflater = (LayoutInflater) a.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    mContainer = (LinearLayout) mInflater.inflate(com.android.internal.R.layout.fragment_bread_crumbs, this, false);
    addView(mContainer);
    a.getFragmentManager().addOnBackStackChangedListener(this);
    updateCrumbs();
    setLayoutTransition(new LayoutTransition());
}
Also used : LayoutTransition(android.animation.LayoutTransition)

Example 62 with LayoutTransition

use of android.animation.LayoutTransition in project platform_frameworks_base by android.

the class NavigationBarView method updateLayoutTransitionsEnabled.

private void updateLayoutTransitionsEnabled() {
    boolean enabled = !mWakeAndUnlocking && mLayoutTransitionsEnabled;
    ViewGroup navButtons = (ViewGroup) getCurrentView().findViewById(R.id.nav_buttons);
    LayoutTransition lt = navButtons.getLayoutTransition();
    if (lt != null) {
        if (enabled) {
            lt.enableTransitionType(LayoutTransition.APPEARING);
            lt.enableTransitionType(LayoutTransition.DISAPPEARING);
            lt.enableTransitionType(LayoutTransition.CHANGE_APPEARING);
            lt.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
        } else {
            lt.disableTransitionType(LayoutTransition.APPEARING);
            lt.disableTransitionType(LayoutTransition.DISAPPEARING);
            lt.disableTransitionType(LayoutTransition.CHANGE_APPEARING);
            lt.disableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) LayoutTransition(android.animation.LayoutTransition)

Example 63 with LayoutTransition

use of android.animation.LayoutTransition in project platform_frameworks_base by android.

the class NavigationBarView method setDisabledFlags.

public void setDisabledFlags(int disabledFlags, boolean force) {
    if (!force && mDisabledFlags == disabledFlags)
        return;
    mDisabledFlags = disabledFlags;
    final boolean disableHome = ((disabledFlags & View.STATUS_BAR_DISABLE_HOME) != 0);
    // Always disable recents when alternate car mode UI is active.
    boolean disableRecent = mUseCarModeUi || ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
    final boolean disableBack = ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0) && ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0);
    final boolean disableSearch = ((disabledFlags & View.STATUS_BAR_DISABLE_SEARCH) != 0);
    ViewGroup navButtons = (ViewGroup) getCurrentView().findViewById(R.id.nav_buttons);
    if (navButtons != null) {
        LayoutTransition lt = navButtons.getLayoutTransition();
        if (lt != null) {
            if (!lt.getTransitionListeners().contains(mTransitionListener)) {
                lt.addTransitionListener(mTransitionListener);
            }
        }
    }
    if (inLockTask() && disableRecent && !disableHome) {
        // Don't hide recents when in lock task, it is used for exiting.
        // Unless home is hidden, then in DPM locked mode and no exit available.
        disableRecent = false;
    }
    getBackButton().setVisibility(disableBack ? View.INVISIBLE : View.VISIBLE);
    getHomeButton().setVisibility(disableHome ? View.INVISIBLE : View.VISIBLE);
    getRecentsButton().setVisibility(disableRecent ? View.INVISIBLE : View.VISIBLE);
}
Also used : ViewGroup(android.view.ViewGroup) LayoutTransition(android.animation.LayoutTransition)

Example 64 with LayoutTransition

use of android.animation.LayoutTransition in project mosby by sockeqwe.

the class LabelLayout method init.

private void init() {
    View.inflate(getContext(), R.layout.view_label_layout, this);
    LayoutTransition transition = new LayoutTransition();
    transition.enableTransitionType(LayoutTransition.CHANGING);
    this.setLayoutTransition(transition);
    adapter = new LabelAdapter(getContext());
    popUpWindow = new ListPopupWindow(getContext());
    popUpWindow.setAnchorView(this);
    popUpWindow.setAdapter(adapter);
    popUpWindow.setWidth(DimensUtils.dpToPx(getContext(), 140));
    popUpWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {

        @Override
        public void onDismiss() {
            showLabel();
        }
    });
    popUpWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Label label = (Label) adapter.getItem(position);
            if (!label.getName().equals(mail.getLabel())) {
                presenter.setLabel(mail, label.getName());
                popUpWindow.dismiss();
            }
        }
    });
    setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            loadData(false);
        }
    });
}
Also used : PopupWindow(android.widget.PopupWindow) ListPopupWindow(android.support.v7.widget.ListPopupWindow) Label(com.hannesdorfmann.mosby3.sample.mail.model.mail.Label) LayoutTransition(android.animation.LayoutTransition) BindView(butterknife.BindView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListPopupWindow(android.support.v7.widget.ListPopupWindow) AdapterView(android.widget.AdapterView)

Example 65 with LayoutTransition

use of android.animation.LayoutTransition in project mosby by sockeqwe.

the class LoginFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    loginButton.setMode(ActionProcessButton.Mode.ENDLESS);
    int startDelay = getResources().getInteger(android.R.integer.config_mediumAnimTime) + 100;
    LayoutTransition transition = new LayoutTransition();
    transition.enableTransitionType(LayoutTransition.CHANGING);
    transition.setStartDelay(LayoutTransition.APPEARING, startDelay);
    transition.setStartDelay(LayoutTransition.CHANGE_APPEARING, startDelay);
    loginForm.setLayoutTransition(transition);
}
Also used : LayoutTransition(android.animation.LayoutTransition)

Aggregations

LayoutTransition (android.animation.LayoutTransition)89 ViewGroup (android.view.ViewGroup)37 View (android.view.View)19 AnimationThread (android.animation.AnimationThread)18 Result (com.android.ide.common.rendering.api.Result)18 AdapterView (android.widget.AdapterView)13 ListView (android.widget.ListView)13 AbsListView (android.widget.AbsListView)12 ExpandableListView (android.widget.ExpandableListView)12 ActionMenuView (android.widget.ActionMenuView)10 ActionMenuItemView (com.android.internal.view.menu.ActionMenuItemView)10 IconMenuItemView (com.android.internal.view.menu.IconMenuItemView)10 ListMenuItemView (com.android.internal.view.menu.ListMenuItemView)10 MenuView (com.android.internal.view.menu.MenuView)10 Paint (android.graphics.Paint)8 TypedArray (android.content.res.TypedArray)7 LayoutParams (android.view.ViewGroup.LayoutParams)7 MarginLayoutParams (android.view.ViewGroup.MarginLayoutParams)7 TransitionListener (android.animation.LayoutTransition.TransitionListener)6 BridgeContext (com.android.layoutlib.bridge.android.BridgeContext)6