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

Tesla's new progress in localization: $145 million to purchase factory land

Tesla is reportedly seeking land for its Shanghai...

Which ocean satellites has my country independently developed?

my country has always attached great importance t...

Meizu and Xiaomi lack Lei Jun

[[128750]] Today, Meizu's official website an...

APP channel promotion: 3 major channels and experience sharing!

As the Matthew effect in the industry deepens, it...

How did I manage to attract one user with a small activity costing 1 yuan?

As a means with extremely strong explosive power ...

Why do I feel more tired than usual after lying down for a day on the weekend?

Review | Li Nannan Director of the Hunan Science ...