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