Search in sources :

Example 1 with ViewGroup

use of android.view.ViewGroup in project Launcher3 by chislon.

the class PagedView method onAttachedToWindow.

protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    // Hook up the page indicator
    ViewGroup parent = (ViewGroup) getParent();
    if (mPageIndicator == null && mPageIndicatorViewId > -1) {
        mPageIndicator = (PageIndicator) parent.findViewById(mPageIndicatorViewId);
        mPageIndicator.removeAllMarkers(mAllowPagedViewAnimations);
        ArrayList<PageIndicator.PageMarkerResources> markers = new ArrayList<PageIndicator.PageMarkerResources>();
        for (int i = 0; i < getChildCount(); ++i) {
            markers.add(getPageIndicatorMarker(i));
        }
        mPageIndicator.addMarkers(markers, mAllowPagedViewAnimations);
        OnClickListener listener = getPageIndicatorClickListener();
        if (listener != null) {
            mPageIndicator.setOnClickListener(listener);
        }
        mPageIndicator.setContentDescription(getPageIndicatorDescription());
    }
}
Also used : ViewGroup(android.view.ViewGroup) ArrayList(java.util.ArrayList)

Example 2 with ViewGroup

use of android.view.ViewGroup in project Launcher3 by chislon.

the class FolderIcon method isDropEnabled.

public boolean isDropEnabled() {
    final ViewGroup cellLayoutChildren = (ViewGroup) getParent();
    final ViewGroup cellLayout = (ViewGroup) cellLayoutChildren.getParent();
    final Workspace workspace = (Workspace) cellLayout.getParent();
    return !workspace.isSmall();
}
Also used : ViewGroup(android.view.ViewGroup)

Example 3 with ViewGroup

use of android.view.ViewGroup in project Launcher3 by chislon.

the class LauncherTransitionable method closeFolder.

void closeFolder(Folder folder) {
    folder.getInfo().opened = false;
    ViewGroup parent = (ViewGroup) folder.getParent().getParent();
    if (parent != null) {
        FolderIcon fi = (FolderIcon) mWorkspace.getViewForTag(folder.mInfo);
        shrinkAndFadeInFolderIcon(fi);
    }
    folder.animateClosed();
    // Notify the accessibility manager that this folder "window" has disappeard and no
    // longer occludeds the workspace items
    getDragLayer().sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
Also used : ViewGroup(android.view.ViewGroup)

Example 4 with ViewGroup

use of android.view.ViewGroup in project cw-omnibus by commonsguy.

the class EditorFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    int position = getArguments().getInt(KEY_POSITION, -1);
    View result;
    if (position == 2) {
        ViewGroup doctorNo = new NoAssistFrameLayout(getActivity());
        inflater.inflate(R.layout.editor, doctorNo);
        result = doctorNo;
    } else {
        result = inflater.inflate(R.layout.editor, container, false);
    }
    EditText editor = (EditText) result.findViewById(R.id.editor);
    editor.setHint(getTitle(getActivity(), position));
    if (position == 1) {
        editor.setTransformationMethod(PasswordTransformationMethod.getInstance());
    }
    return (result);
}
Also used : EditText(android.widget.EditText) ViewGroup(android.view.ViewGroup) View(android.view.View)

Example 5 with ViewGroup

use of android.view.ViewGroup in project cw-omnibus by commonsguy.

the class ActionBarView method setMenu.

public void setMenu(Menu menu, MenuPresenter.Callback cb) {
    if (menu == mOptionsMenu)
        return;
    if (mOptionsMenu != null) {
        mOptionsMenu.removeMenuPresenter(mActionMenuPresenter);
        mOptionsMenu.removeMenuPresenter(mExpandedMenuPresenter);
    }
    MenuBuilder builder = (MenuBuilder) menu;
    mOptionsMenu = builder;
    if (mMenuView != null) {
        final ViewGroup oldParent = (ViewGroup) mMenuView.getParent();
        if (oldParent != null) {
            oldParent.removeView(mMenuView);
        }
    }
    if (mActionMenuPresenter == null) {
        mActionMenuPresenter = new ActionMenuPresenter(mContext);
        mActionMenuPresenter.setCallback(cb);
        mActionMenuPresenter.setId(R.id.abs__action_menu_presenter);
        mExpandedMenuPresenter = new ExpandedActionViewMenuPresenter();
    }
    ActionMenuView menuView;
    final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
    if (!mSplitActionBar) {
        mActionMenuPresenter.setExpandedActionViewsExclusive(getResources_getBoolean(getContext(), R.bool.abs__action_bar_expanded_action_views_exclusive));
        configPresenters(builder);
        menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
        final ViewGroup oldParent = (ViewGroup) menuView.getParent();
        if (oldParent != null && oldParent != this) {
            oldParent.removeView(menuView);
        }
        addView(menuView, layoutParams);
    } else {
        mActionMenuPresenter.setExpandedActionViewsExclusive(false);
        // Allow full screen width in split mode.
        mActionMenuPresenter.setWidthLimit(getContext().getResources().getDisplayMetrics().widthPixels, true);
        // No limit to the item count; use whatever will fit.
        mActionMenuPresenter.setItemLimit(Integer.MAX_VALUE);
        // Span the whole width
        layoutParams.width = LayoutParams.MATCH_PARENT;
        configPresenters(builder);
        menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
        if (mSplitView != null) {
            final ViewGroup oldParent = (ViewGroup) menuView.getParent();
            if (oldParent != null && oldParent != mSplitView) {
                oldParent.removeView(menuView);
            }
            menuView.setVisibility(getAnimatedVisibility());
            mSplitView.addView(menuView, layoutParams);
        } else {
            // We'll add this later if we missed it this time.
            menuView.setLayoutParams(layoutParams);
        }
    }
    mMenuView = menuView;
}
Also used : ViewGroup(android.view.ViewGroup) ActionMenuView(com.actionbarsherlock.internal.view.menu.ActionMenuView) SubMenuBuilder(com.actionbarsherlock.internal.view.menu.SubMenuBuilder) MenuBuilder(com.actionbarsherlock.internal.view.menu.MenuBuilder) ActionMenuPresenter(com.actionbarsherlock.internal.view.menu.ActionMenuPresenter)

Aggregations

ViewGroup (android.view.ViewGroup)2280 View (android.view.View)1268 TextView (android.widget.TextView)439 ImageView (android.widget.ImageView)279 ArrayList (java.util.ArrayList)198 ViewParent (android.view.ViewParent)184 ListView (android.widget.ListView)156 Paint (android.graphics.Paint)125 FrameLayout (android.widget.FrameLayout)121 LayoutInflater (android.view.LayoutInflater)115 AdapterView (android.widget.AdapterView)115 LinearLayout (android.widget.LinearLayout)110 AbsListView (android.widget.AbsListView)106 Animator (android.animation.Animator)94 Drawable (android.graphics.drawable.Drawable)93 RecyclerView (android.support.v7.widget.RecyclerView)91 AnimatedView (carbon.animation.AnimatedView)88 ComponentView (carbon.component.ComponentView)88 RippleView (carbon.drawable.ripple.RippleView)88 ShadowView (carbon.shadow.ShadowView)88