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

Is the perfect world of IoT secure enough?

Introduction: Security challenges are increasing ...

Tips for Weibo promotion and traffic generation

Weibo can be said to be a big brother-level platf...

Shi Yuzhu's 34 hidden marketing secrets are worth 1 billion!

(one) The lady above is the Duchess of Del Carpio...

15 Free Ways to Promote Your Business Online

I have been engaged in the Internet industry for ...

TLAttributedLabel Image and text mashup

Source code introduction: TLAttributedLabel image...

How can new brands break the curse of “explosion means peak performance”?

Nowadays, various new brands have emerged. Young ...

From 0 to 1, how to carry out overseas operations and promotion?

Establish a promotion and operation system around...

Don't eat fruit like this anymore, or you may get mentally disturbed...

As soon as spring comes, all kinds of fruits begi...

Some tips for iOS development

1. In iOS development, when we communicate with p...