Search in sources :

Example 26 with ViewStub

use of android.view.ViewStub in project AndroidChromium by JackyAndroid.

the class EmptyBackgroundViewWrapper method inflateViewIfNecessary.

private void inflateViewIfNecessary() {
    if (mBackgroundView != null)
        return;
    mBackgroundView = (EmptyBackgroundViewTablet) ((ViewStub) mActivity.findViewById(R.id.empty_container_stub)).inflate();
    mBackgroundView.setTabModelSelector(mTabModelSelector);
    mBackgroundView.setTabCreator(mTabCreator);
    mBackgroundView.setMenuOnTouchListener(mMenuHandler);
    mBackgroundView.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {

        @Override
        public void onViewDetachedFromWindow(View v) {
            uninitialize();
        }

        @Override
        public void onViewAttachedToWindow(View v) {
        }
    });
}
Also used : ViewStub(android.view.ViewStub) OnAttachStateChangeListener(android.view.View.OnAttachStateChangeListener) View(android.view.View)

Example 27 with ViewStub

use of android.view.ViewStub in project AndroidChromium by JackyAndroid.

the class CustomTabBottomBarDelegate method getBottomBarView.

/**
     * Gets the {@link ViewGroup} of the bottom bar. If it has not been inflated, inflate it first.
     */
private ViewGroup getBottomBarView() {
    if (mBottomBarView == null) {
        ViewStub bottomBarStub = ((ViewStub) mActivity.findViewById(R.id.bottombar_stub));
        bottomBarStub.setLayoutResource(R.layout.custom_tabs_bottombar);
        mBottomBarView = (ViewGroup) bottomBarStub.inflate();
    }
    return mBottomBarView;
}
Also used : ViewStub(android.view.ViewStub)

Example 28 with ViewStub

use of android.view.ViewStub in project android_frameworks_base by DirtyUnicorns.

the class ViewStubTest method testInflatedLayoutParams.

@UiThreadTest
@MediumTest
public void testInflatedLayoutParams() throws Exception {
    final StubbedView activity = getActivity();
    final ViewStub stub = (ViewStub) activity.findViewById(R.id.viewStubWithId);
    final View swapped = stub.inflate();
    assertNotNull("The inflated view is null", swapped);
    assertEquals("Both stub and inflated should same width", stub.getLayoutParams().width, swapped.getLayoutParams().width);
    assertEquals("Both stub and inflated should same height", stub.getLayoutParams().height, swapped.getLayoutParams().height);
}
Also used : ViewStub(android.view.ViewStub) StubbedView(android.view.StubbedView) StubbedView(android.view.StubbedView) View(android.view.View) UiThreadTest(android.test.UiThreadTest) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 29 with ViewStub

use of android.view.ViewStub in project android_frameworks_base by DirtyUnicorns.

the class ViewStubTest method testInflated.

@UiThreadTest
@MediumTest
public void testInflated() throws Exception {
    final StubbedView activity = getActivity();
    final ViewStub stub = (ViewStub) activity.findViewById(R.id.viewStub);
    final View swapped = stub.inflate();
    assertNotNull("The inflated view is null", swapped);
}
Also used : ViewStub(android.view.ViewStub) StubbedView(android.view.StubbedView) StubbedView(android.view.StubbedView) View(android.view.View) UiThreadTest(android.test.UiThreadTest) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 30 with ViewStub

use of android.view.ViewStub in project android_frameworks_base by DirtyUnicorns.

the class NotificationsQuickSettingsContainer method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mQsContainer = (AutoReinflateContainer) findViewById(R.id.qs_auto_reinflate_container);
    mQsContainer.addInflateListener(this);
    mStackScroller = findViewById(R.id.notification_stack_scroller);
    mStackScrollerMargin = ((LayoutParams) mStackScroller.getLayoutParams()).bottomMargin;
    mKeyguardStatusBar = findViewById(R.id.keyguard_header);
    ViewStub userSwitcher = (ViewStub) findViewById(R.id.keyguard_user_switcher);
    userSwitcher.setOnInflateListener(this);
    mUserSwitcher = userSwitcher;
}
Also used : ViewStub(android.view.ViewStub)

Aggregations

ViewStub (android.view.ViewStub)79 View (android.view.View)46 UiThreadTest (android.test.UiThreadTest)18 MediumTest (android.test.suitebuilder.annotation.MediumTest)18 StubbedView (android.view.StubbedView)18 TextView (android.widget.TextView)8 StandaloneActionMode (com.actionbarsherlock.internal.view.StandaloneActionMode)7 ActionMode (com.actionbarsherlock.view.ActionMode)7 Context (android.content.Context)6 Resources (android.content.res.Resources)6 ContextThemeWrapper (android.view.ContextThemeWrapper)6 Animator (android.animation.Animator)5 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)5 ObjectAnimator (android.animation.ObjectAnimator)5 Paint (android.graphics.Paint)5 TypedValue (android.util.TypedValue)5 ActionMode (android.view.ActionMode)5 PopupWindow (android.widget.PopupWindow)5 FloatingActionMode (com.android.internal.view.FloatingActionMode)5 StandaloneActionMode (com.android.internal.view.StandaloneActionMode)5