Search in sources :

Example 31 with ViewStub

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;
}
Also used : ViewStub(android.view.ViewStub)

Example 32 with ViewStub

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();
    }
}
Also used : ViewStub(android.view.ViewStub) PostLocation(org.wordpress.android.fluxc.model.post.PostLocation) Button(android.widget.Button) AppCompatButton(android.support.v7.widget.AppCompatButton) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) NetworkImageView(com.android.volley.toolbox.NetworkImageView)

Example 33 with ViewStub

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);
}
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 34 with ViewStub

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();
}
Also used : ViewStub(android.view.ViewStub) View(android.view.View)

Example 35 with ViewStub

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;
        }
    }
}
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