use of cn.eoe.app.entity.NavigationModel 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 cn.eoe.app.entity.NavigationModel in project android-app by eoecn.
the class MainActivity method initNav.
private void initNav() {
navs = new ArrayList<NavigationModel>();
NavigationModel nav1 = new NavigationModel(getResources().getString(R.string.menuGood), "");
NavigationModel nav2 = new NavigationModel(getResources().getString(R.string.menuNews), Constants.TAGS.NEWS_TAG);
NavigationModel nav3 = new NavigationModel(getResources().getString(R.string.menuStudio), Constants.TAGS.WIKI_TAG);
NavigationModel nav4 = new NavigationModel(getResources().getString(R.string.menuBlog), Constants.TAGS.BLOG_TAG);
Collections.addAll(navs, nav1, nav2, nav3, nav4);
}
Aggregations