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

Ibuprofen is banned? Attention! These 223 drugs are no longer produced or sold

Expert of this article: Zhang Xing, deputy chief ...

From 0 to 1, the entire private domain traffic operation and promotion plan!

Every time I attend an offline get out of class, ...

The goldfish has been wronged for so long, will it really eat to death?

Goldfish don’t die from being “overfed”, they die...

iPhone screen adaptation, history and current situation

The original iPhone In 2007, the first generation...

To spread toxic content, you must master the art of social copywriting (Part 1)

Today’s media is everyone, and today’s communicat...

APP promotion and operation is difficult, where are the pain points?

Do you often encounter the following scenarios: T...

Don't buy this kind of New Year flowers! It's illegal and poisonous

Review expert: Hu Jiayu, Master of Botany, Univer...

Elon Musk's "AI Demon Theory" is slandering the industry!

[[122220]] Translation/Chilongfei, Yang Hanshu, V...