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