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());
}
}
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();
}
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);
}
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);
}
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;
}
Aggregations