use of android.widget.SimpleAdapter in project android-app by eoecn.
the class UserCollectListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreateView(inflater, container, savedInstanceState);
mContext = inflater.getContext();
View view = inflater.inflate(R.layout.user_collect_list, null);
mlv = (ListView) view.findViewById(R.id.user_listview_collect);
mlist = new ArrayList<Map<String, Object>>();
getData();
mAdapter = new SimpleAdapter(inflater.getContext(), mlist, R.layout.user_collect_list_item, new String[] { "name", "content" }, new int[] { R.id.user_textview_collectTitle, R.id.user_textview_collectContent });
mlv.setAdapter(mAdapter);
mlv.setOnItemClickListener(this);
return view;
}
use of android.widget.SimpleAdapter in project android-app by eoecn.
the class UserIntroFragment method initGridView.
private void initGridView() {
getData();
mAdapter = new SimpleAdapter(mContext, mList, R.layout.user_gridview_item_medal, new String[] { "img" }, new int[] { R.id.user_imageview_medal }) {
@Override
public void setViewImage(ImageView v, String value) {
// TODO Auto-generated method stub
super.setViewImage(v, value);
ImageUtil.setThumbnailView(value, v, mContext, new imageCallback(), false);
}
class imageCallback implements ImageCallback {
@Override
public void loadImage(Bitmap bitmap, String imagePath) {
// TODO Auto-generated method stub
try {
ImageView img = (ImageView) gvGrid.findViewWithTag(imagePath);
img.setImageBitmap(bitmap);
} catch (NullPointerException ex) {
Log.e("error", "ImageView = null");
}
}
}
};
gvGrid.setAdapter(mAdapter);
}
use of android.widget.SimpleAdapter in project android-app by eoecn.
the class MainActivity method initListView.
private void initListView() {
lvAdapter = new SimpleAdapter(this, getData(), R.layout.behind_list_show, new String[] { LIST_TEXT, LIST_IMAGEVIEW }, new int[] { R.id.textview_behind_title, R.id.imageview_behind_icon }) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub.
View view = super.getView(position, convertView, parent);
if (position == mTag) {
view.setBackgroundResource(R.drawable.back_behind_list);
lvTitle.setTag(view);
} else {
view.setBackgroundColor(Color.TRANSPARENT);
}
return view;
}
};
lvTitle.setAdapter(lvAdapter);
lvTitle.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
NavigationModel navModel = navs.get(position);
mAboveTitle.setText(navModel.getName());
current_page = navModel.getTags();
if (lvTitle.getTag() != null) {
if (lvTitle.getTag() == view) {
MainActivity.this.showContent();
return;
}
((View) lvTitle.getTag()).setBackgroundColor(Color.TRANSPARENT);
}
lvTitle.setTag(view);
view.setBackgroundResource(R.drawable.back_behind_list);
imgQuery.setVisibility(View.VISIBLE);
switch(position) {
case 0:
imgQuery.setVisibility(View.GONE);
new MyTask().execute(topDao);
break;
case 1:
new MyTask().execute(newsDao);
break;
case 2:
new MyTask().execute(wikiDao);
break;
case 3:
new MyTask().execute(blogsDao);
break;
}
}
});
}
use of android.widget.SimpleAdapter in project AndroidDynamicLoader by mmin18.
the class ListApkFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
try {
AssetManager asset = getActivity().getAssets();
for (String s : asset.list("apks")) {
addItem(s, "apks/" + s);
}
} catch (Exception e) {
}
SimpleAdapter adapter = new SimpleAdapter(getActivity(), data, android.R.layout.simple_list_item_1, new String[] { "title" }, new int[] { android.R.id.text1 });
setListAdapter(adapter);
}
use of android.widget.SimpleAdapter in project AndroidDynamicLoader by mmin18.
the class ActivityLoader method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addItem("[ Launch SampleActivity ]", null);
addItem("[ Default.apk ]", null);
try {
AssetManager asset = getAssets();
for (String s : asset.list("apks")) {
addItem(s, "apks/" + s);
}
} catch (Exception e) {
}
SimpleAdapter adapter = new SimpleAdapter(this, data, android.R.layout.simple_list_item_1, new String[] { "title" }, new int[] { android.R.id.text1 });
setListAdapter(adapter);
}
Aggregations