Search in sources :

Example 6 with ViewStub

use of android.view.ViewStub in project Klyph by jonathangerbaud.

the class KlyphPlacePickerFragment method onActivityCreated.

@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    ViewGroup view = (ViewGroup) getView();
    if (showSearchBox) {
        ViewStub stub = (ViewStub) view.findViewById(R.id.com_facebook_placepickerfragment_search_box_stub);
        if (stub != null) {
            View stubView = stub.inflate();
            searchBox = (EditText) stubView.findViewById(R.id.com_facebook_picker_search_text);
            // Put the list under the search box
            RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
            layoutParams.addRule(RelativeLayout.BELOW, R.id.search_box);
            ListView listView = (ListView) view.findViewById(R.id.com_facebook_picker_list_view);
            listView.setLayoutParams(layoutParams);
            // If we need to, put the search box under the title bar.
            if (view.findViewById(R.id.com_facebook_picker_title_bar) != null) {
                layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
                layoutParams.addRule(RelativeLayout.BELOW, R.id.com_facebook_picker_title_bar);
                searchBox.setLayoutParams(layoutParams);
            }
            searchBox.addTextChangedListener(new SearchTextWatcher());
            if (!TextUtils.isEmpty(searchText)) {
                searchBox.setText(searchText);
            }
        }
    }
}
Also used : ViewStub(android.view.ViewStub) ListView(android.widget.ListView) ViewGroup(android.view.ViewGroup) RelativeLayout(android.widget.RelativeLayout) View(android.view.View) ListView(android.widget.ListView)

Example 7 with ViewStub

use of android.view.ViewStub in project Klyph by jonathangerbaud.

the class GraphObjectAdapter method createGraphObjectView.

protected View createGraphObjectView(T graphObject) {
    View result = inflater.inflate(getGraphObjectRowLayoutId(graphObject), null);
    ViewStub checkboxStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_checkbox_stub);
    if (checkboxStub != null) {
        if (!getShowCheckbox()) {
            checkboxStub.setVisibility(View.GONE);
        } else {
            CheckBox checkBox = (CheckBox) checkboxStub.inflate();
            updateCheckboxState(checkBox, false);
        }
    }
    ViewStub profilePicStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_profile_pic_stub);
    if (!getShowPicture()) {
        profilePicStub.setVisibility(View.GONE);
    } else {
        ImageView imageView = (ImageView) profilePicStub.inflate();
        imageView.setVisibility(View.VISIBLE);
    }
    return result;
}
Also used : ViewStub(android.view.ViewStub) View(android.view.View)

Example 8 with ViewStub

use of android.view.ViewStub in project MasteringAndroidDataBinding by LyndonChin.

the class ViewStubActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mBinding = DataBindingUtil.setContentView(this, R.layout.activity_view_stub);
    mBinding.viewStub.setOnInflateListener(new ViewStub.OnInflateListener() {

        @Override
        public void onInflate(ViewStub stub, View inflated) {
            ViewStubBinding binding = DataBindingUtil.bind(inflated);
            User user = new User("liang", "fei");
            binding.setUser(user);
        }
    });
}
Also used : ViewStub(android.view.ViewStub) User(com.liangfeizc.databinding.model.User) View(android.view.View) ViewStubBinding(com.liangfeizc.databinding.databinding.ViewStubBinding) ActivityViewStubBinding(com.liangfeizc.databinding.databinding.ActivityViewStubBinding)

Example 9 with ViewStub

use of android.view.ViewStub in project phonegap-facebook-plugin by Wizcorp.

the class GraphObjectAdapter method createGraphObjectView.

protected View createGraphObjectView(T graphObject) {
    View result = inflater.inflate(getGraphObjectRowLayoutId(graphObject), null);
    ViewStub checkboxStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_checkbox_stub);
    if (checkboxStub != null) {
        if (!getShowCheckbox()) {
            checkboxStub.setVisibility(View.GONE);
        } else {
            CheckBox checkBox = (CheckBox) checkboxStub.inflate();
            updateCheckboxState(checkBox, false);
        }
    }
    ViewStub profilePicStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_profile_pic_stub);
    if (!getShowPicture()) {
        profilePicStub.setVisibility(View.GONE);
    } else {
        ImageView imageView = (ImageView) profilePicStub.inflate();
        imageView.setVisibility(View.VISIBLE);
    }
    return result;
}
Also used : ViewStub(android.view.ViewStub) View(android.view.View)

Example 10 with ViewStub

use of android.view.ViewStub in project phonegap-facebook-plugin by Wizcorp.

the class PickerFragment method inflateTitleBar.

private void inflateTitleBar(ViewGroup view) {
    ViewStub stub = (ViewStub) view.findViewById(R.id.com_facebook_picker_title_bar_stub);
    if (stub != null) {
        View titleBar = stub.inflate();
        final RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
        layoutParams.addRule(RelativeLayout.BELOW, R.id.com_facebook_picker_title_bar);
        listView.setLayoutParams(layoutParams);
        if (titleBarBackground != null) {
            titleBar.setBackgroundDrawable(titleBarBackground);
        }
        doneButton = (Button) view.findViewById(R.id.com_facebook_picker_done_button);
        if (doneButton != null) {
            doneButton.setOnClickListener(new View.OnClickListener() {

                @Override
                public void onClick(View v) {
                    logAppEvents(true);
                    appEventsLogged = true;
                    if (onDoneButtonClickedListener != null) {
                        onDoneButtonClickedListener.onDoneButtonClicked(PickerFragment.this);
                    }
                }
            });
            if (getDoneButtonText() != null) {
                doneButton.setText(getDoneButtonText());
            }
            if (doneButtonBackground != null) {
                doneButton.setBackgroundDrawable(doneButtonBackground);
            }
        }
        titleTextView = (TextView) view.findViewById(R.id.com_facebook_picker_title);
        if (titleTextView != null) {
            if (getTitleText() != null) {
                titleTextView.setText(getTitleText());
            }
        }
    }
}
Also used : ViewStub(android.view.ViewStub) View(android.view.View)

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