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

[Qiu Ming Stock Talk] Wen Qiu Ming's Band Master Practical Class

[Qiu Ming Stock Talk] Introduction to the resourc...

Xiaomi MIUI 6: Lei Jun's dilemma and ambition

Xiaomi released its MIUI 6 in the form of a lolli...

Do “sleep-aiding foods” really help you sleep?

This is the 4373rd article of Da Yi Xiao Hu Sleep...

4 tips to teach you how to make short video advertising materials

All advertisements are inseparable from creatives...

Is it reliable to use hot water to scald tableware?

Friends, is there anyone around? Do you like to s...

How to optimize conversion rate through channel conversion model?

Advertising guru John Wanamaker once said, "...

WeChat "death code" has now become a blackmail tool in their hands

More than a month ago, a new iOS messaging app bu...

Last night, their story went viral!

Last night (3rd) "2021 China Moved People&qu...