Before you begin, Let’s talk about Android lifecycle first . Learn about Android’s four major components,And to be familiar with Android development tool -Android Studio.
when you push a new Activity or back Activity, it’s due to the stack to manage the Activity status, but how to push a new Activity?
Intent intent = new Intent(ReorderFour.this, ReorderTwo.class);
- tabbar interface is a activity contains one or more fragments.
- fragments lifecycle is rely one activity.
ok,after you see my screenshots, you can know , i use the ViewpagerIndicator to make a tabbar Activity . it can manager fragments. you can easy to change every fragment you need.
1. use the fastjson to make json parse.
2. use the butterknife replace the frequent findViewById.
3. use the ViewPagerIndicator to achieve a tabbarActivity interface.
4. use the android-smart-image-view to make the image cache.
5. use the android-async-http to make http request.
6. use the recycleView-v7 replace the android system listView.
7. use the bga-refreshlayout to make the pull refresh cool header.
8. finally, use cn.bingoogolapple:bga-adapter to make the recycleView cell Item can right move delete, long press event ,ItemChildClickListener ,and so on . all in all, bga-adapter is perfect !
For your convenience, i encapsulated a tableview like iOS UITableView , you can use the group style or plain style decide by youself; you can find it in the package com.lvj.bookoneday->widget.view
- I create two java interface : TableViewDelete, TableViewDataSoucre. that you can easy
implements there’s methods .
- when you use the activity or fragment need tableView layout , you can easy and fast
layout ,and implements TableViewDelegate, TableViewDatasource.
you know, when your app ask a request, may be have two Design Patterns . it named “block”（anonymous inner classes） ,”delegate”(delegate is named by iOS. on java, it’s interface or ask “OOP” thoughts).
there is a abstract class named BaseDataService. if you have a new request . you just extend BaseDataService and @Override three methods. “getAPIRequestMethodName
, setRequestParams,parseResponse”. look these screenshots. And on your Activity or Fragments , you just implemets RequestCallBackDelegate , and you can use your son of BaseDataService to make some request.
For more info about the tableView how to work, you can find my open source on my Github Android-TableView,welcome make you suggestion. if you like this project, on my github, I hope you can click on the star in the upper right corner to give me more encouragement. thank you!