Search in sources :

Example 31 with ListView

use of android.widget.ListView in project simplefacebook by androidquery.

the class FeedFragment method initView.

private void initView() {
    items = new FeedAdapter();
    items.setLoadable(true);
    aq.id(R.id.list);
    if (act.isRoot()) {
        ListView lv = aq.getListView();
        header = aq.inflate(null, R.layout.header_notification, null);
        lv.addHeaderView(header);
    }
    aq.adapter(items).scrolledBottom(this, "scrolledBottom").itemClicked(this, "itemClicked");
    if (header != null) {
        aq.id(header).clicked(this, "notiClicked");
    }
    selectedColor = getResources().getColor(R.color.selected);
}
Also used : AbsListView(android.widget.AbsListView) ListView(android.widget.ListView)

Example 32 with ListView

use of android.widget.ListView in project simplefacebook by androidquery.

the class CommentFragment method initView.

private void initView() {
    comments = new CommentAdapter();
    aq.id(R.id.list);
    ListView lv = aq.getListView();
    header = aq.inflate(null, R.layout.fragment_comment_header, null);
    lv.addHeaderView(header);
    aq.adapter(comments).scrolledBottom(this, "scrolledBottom").itemClicked(this, "itemClicked");
    aq.id(R.id.button_send).clicked(this, "send");
    aq.id(R.id.content_tb).clicked(this, "contentClicked");
    aq.id(R.id.content_name).clicked(this, "contentClicked");
    aq.id(R.id.edit_comment).clicked(this, "editClicked");
}
Also used : ListView(android.widget.ListView)

Example 33 with ListView

use of android.widget.ListView in project platform_frameworks_base by android.

the class MainActivity method onResume.

@Override
protected void onResume() {
    super.onResume();
    ListView lv = (ListView) findViewById(android.R.id.list);
    for (int i = 0; i < lv.getChildCount(); i++) {
        lv.getChildAt(i).animate().translationY(0).setDuration(DURATION);
    }
}
Also used : ListView(android.widget.ListView)

Example 34 with ListView

use of android.widget.ListView in project platform_frameworks_base by android.

the class FrameworkActionBar method createMenuPopup.

/**
     * Creates a Popup and adds it to the content frame. It also adds another {@link FrameLayout} to
     * the content frame which shall serve as the new content root.
     */
@Override
public void createMenuPopup() {
    if (!isOverflowPopupNeeded()) {
        return;
    }
    DisplayMetrics metrics = mBridgeContext.getMetrics();
    MenuBuilder menu = mActionBar.getMenuBuilder();
    OverflowMenuAdapter adapter = new OverflowMenuAdapter(menu, mActionBar.getPopupContext());
    ListView listView = new ListView(mActionBar.getPopupContext(), null, R.attr.dropDownListViewStyle);
    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(measureContentWidth(adapter), LayoutParams.WRAP_CONTENT);
    layoutParams.addRule(RelativeLayout.ALIGN_PARENT_END);
    if (mActionBar.isSplit()) {
        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        layoutParams.bottomMargin = getActionBarHeight() + mActionBar.getMenuPopupMargin();
    } else {
        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
        layoutParams.topMargin = getActionBarHeight() + mActionBar.getMenuPopupMargin();
    }
    layoutParams.setMarginEnd(getPixelValue("5dp", metrics));
    listView.setLayoutParams(layoutParams);
    listView.setAdapter(adapter);
    final TypedArray a = mActionBar.getPopupContext().obtainStyledAttributes(null, R.styleable.PopupWindow, R.attr.popupMenuStyle, 0);
    listView.setBackground(a.getDrawable(R.styleable.PopupWindow_popupBackground));
    listView.setDivider(a.getDrawable(R.attr.actionBarDivider));
    a.recycle();
    listView.setElevation(mActionBar.getMenuPopupElevation());
    assert mEnclosingLayout != null : "Unable to find view to attach ActionMenuPopup.";
    mEnclosingLayout.addView(listView);
}
Also used : ListView(android.widget.ListView) LayoutParams(android.view.ViewGroup.LayoutParams) TypedArray(android.content.res.TypedArray) RelativeLayout(android.widget.RelativeLayout) DisplayMetrics(android.util.DisplayMetrics) MenuBuilder(com.android.internal.view.menu.MenuBuilder)

Example 35 with ListView

use of android.widget.ListView in project platform_frameworks_base by android.

the class Preference_Delegate method inflatePreference.

/**
     * Inflates the parser and returns the ListView containing the Preferences.
     */
public static View inflatePreference(Context context, XmlPullParser parser, ViewGroup root) {
    PreferenceManager pm = new PreferenceManager(context);
    PreferenceInflater inflater = new BridgePreferenceInflater(context, pm);
    PreferenceScreen ps = (PreferenceScreen) inflater.inflate(parser, null, true);
    pm.setPreferences(ps);
    ListView preferenceView = createContainerView(context, root);
    ps.bind(preferenceView);
    return preferenceView;
}
Also used : ListView(android.widget.ListView)

Aggregations

ListView (android.widget.ListView)1139 View (android.view.View)739 AdapterView (android.widget.AdapterView)444 TextView (android.widget.TextView)389 ImageView (android.widget.ImageView)167 Intent (android.content.Intent)148 AbsListView (android.widget.AbsListView)135 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)97 ArrayAdapter (android.widget.ArrayAdapter)97 ArrayList (java.util.ArrayList)81 ViewGroup (android.view.ViewGroup)75 ListAdapter (android.widget.ListAdapter)71 OnClickListener (android.view.View.OnClickListener)65 LayoutInflater (android.view.LayoutInflater)63 Bundle (android.os.Bundle)57 Button (android.widget.Button)55 LinearLayout (android.widget.LinearLayout)50 SuppressLint (android.annotation.SuppressLint)34 DialogInterface (android.content.DialogInterface)34 ScrollView (android.widget.ScrollView)31