use of android.view.ViewStub in project android_frameworks_base by AOSPA.
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;
}
use of android.view.ViewStub in project WordPress-Android by wordpress-mobile.
the class EditPostSettingsFragment method initLocation.
/*
* called when activity is created to initialize the location provider, show views related
* to location if enabled for this blog, and retrieve the current location if necessary
*/
private void initLocation(ViewGroup rootView) {
if (!mPost.supportsLocation())
return;
// show the location views if a provider was found and this is a post on a blog that has location enabled
View locationRootView = ((ViewStub) rootView.findViewById(R.id.stub_post_location_settings)).inflate();
TextView locationLabel = ((TextView) locationRootView.findViewById(R.id.locationLabel));
locationLabel.setText(getResources().getString(R.string.location).toUpperCase());
mLocationText = (TextView) locationRootView.findViewById(R.id.locationText);
mLocationText.setOnClickListener(this);
mLocationAddSection = locationRootView.findViewById(R.id.sectionLocationAdd);
mLocationSearchSection = locationRootView.findViewById(R.id.sectionLocationSearch);
mLocationViewSection = locationRootView.findViewById(R.id.sectionLocationView);
Button addLocation = (Button) locationRootView.findViewById(R.id.addLocation);
addLocation.setOnClickListener(this);
mButtonSearchLocation = (Button) locationRootView.findViewById(R.id.searchLocation);
mButtonSearchLocation.setOnClickListener(this);
mLocationEditText = (EditText) locationRootView.findViewById(R.id.searchLocationText);
mLocationEditText.setOnEditorActionListener(this);
mLocationEditText.addTextChangedListener(mLocationEditTextWatcher);
Button updateLocation = (Button) locationRootView.findViewById(R.id.updateLocation);
Button removeLocation = (Button) locationRootView.findViewById(R.id.removeLocation);
updateLocation.setOnClickListener(this);
removeLocation.setOnClickListener(this);
// if this post has location attached to it, look up the location address
if (mPost.hasLocation()) {
showLocationView();
PostLocation location = mPost.getLocation();
setLocation(location.getLatitude(), location.getLongitude());
} else {
showLocationAdd();
}
}
use of android.view.ViewStub in project android_frameworks_base by crdroidandroid.
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 crdroidandroid.
the class MediaExpandableNotificationRow method inflateGuts.
@Override
public boolean inflateGuts() {
if (getGuts() == null) {
View guts = mGutsStub.inflate();
ViewStub mediaGuts = (ViewStub) guts.findViewById(R.id.notification_guts_media_stub);
mediaGuts.inflate();
}
if (!mQueueEnabled) {
return true;
}
return !mQueue.isUserSelectingRow();
}
use of android.view.ViewStub in project android_frameworks_base by crdroidandroid.
the class PhoneStatusBar method initTickerView.
private void initTickerView() {
if (mTickerEnabled != 0 && (mTicker == null || mTickerView == null)) {
final ViewStub tickerStub = (ViewStub) mStatusBarView.findViewById(R.id.ticker_stub);
if (tickerStub != null) {
mTickerView = tickerStub.inflate();
mTicker = new MyTicker(mContext, mStatusBarView);
TickerView tickerView = (TickerView) mStatusBarView.findViewById(R.id.tickerText);
tickerView.mTicker = mTicker;
} else {
mTickerEnabled = 0;
}
}
}
Aggregations