Imitation Huawei Mall source code

Imitation Huawei Mall source code

Source code introduction: This is a project imitating Huawei Mall. Some functions are not implemented, such as several pages, login function and payment. Fragment, listview, gridview and asynchronous request are used. No third-party library is used when writing. HttpClient, database storage, internal cache and external cache are all written by myself. Please forgive me for any imperfections. Let's learn from each other~

Source code effect:

Source code snippet:

  1. package com.parfois.adapter;
  2.   
  3. import java.util.List;
  4.   
  5. import com.parfois.bean.Category;
  6. import com.parfois.vmall.R;
  7.   
  8. import android.content.Context;
  9. import android.view.View;
  10. import android.view.ViewGroup;
  11. import android.widget.BaseAdapter;
  12. import android.widget.TextView;
  13.   
  14. public   class CategoryLeftAdapter extends BaseAdapter {
  15. private Context context;
  16. private List<category> list;
  17. private TextView list_category_left_tvname;
  18.   
  19. public CategoryLeftAdapter(Context context, List<category> list) {
  20. this .context = context;
  21. this .list = list;
  22. }
  23.   
  24. public   int getCount() {
  25. return list.size();
  26. }
  27.   
  28. @Override  
  29. public Object getItem( int position) {
  30. return list.get(position);
  31. }
  32.   
  33. @Override  
  34. public   long getItemId( int position) {
  35. return position;
  36. }
  37.   
  38. @Override  
  39. public View getView( int position, View convertView, ViewGroup parent) {
  40. if (convertView == null ) {
  41. convertView=View.inflate(context, R.layout.listview_categoryleft_item, null );
  42. list_category_left_tvname=(TextView) convertView.findViewById(R.id.list_category_left_tvname);
  43. convertView.setTag(list_category_left_tvname);
  44. } else {
  45. list_category_left_tvname=(TextView) convertView.getTag();
  46. }
  47. list_category_left_tvname.setText(list.get(position).getName());
  48. if (position== 0 ){
  49. convertView.setBackgroundResource(R.drawable.left_arrow_onclick);
  50. }
  51. return convertView;
  52. }
  53.   
  54. }
  55. </category></category>

Download address: http://download..com/data/2108014

<<:  Cool horizontal elastic menu

>>:  What surprising technologies did Google kill off in 2015?

Recommend

The “universal” methodology for bidding advertising!

The editor has personally operated and placed adv...

How can I tell the authenticity of the wine I bought for my dad?

Image source: Tuchong Creative How can I tell the...

Snow White is real, and the magic mirror is really weird

Leviathan Press: According to the research of pha...

Double Eleven marketing sprint strategy!

On November 1, 2021 Double Eleven ushered in its ...

Which is easier to lose weight, eating less or exercising?

If you don't lose weight in April, you will r...

6 foods that the brain loves the most, essential for “brain supplements”!

Work, study, socializing, sports... no matter wha...

MoKee OpenSource 51.1 2015-07-25 Officially released!

MoKee OpenSource 51.1 2015-07-25 Official version...