Skip to content

Commit

Permalink
add more details to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhaotailang committed Feb 13, 2017
1 parent 1d61ce1 commit 04e422a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ API of ZhiHuDaily comes from repository [ZhihuDailyPurify](https://github.com/iz
![screenshot](https://github.com/marktony/ZhiHuDaily/blob/master/art/screenshot.png)

## Open the project in Android Studio
To open this project in Android Studio, begin by checking out of the branches, and then open the `PaperPlane` dictionary in Android Studio. The following series of steps illustrate how to open the `PaperPlane/` branch.
To open this project in Android Studio, begin by checking out of the branches, and then open the `PaperPlane/` dictionary in Android Studio. The following series of steps illustrate how to open the `PaperPlane` branch.

Clone the repository:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ interface View extends BaseView<Presenter> {

void showResults(ArrayList<DoubanMomentNews.posts> list);

void showPickDialog();

}

interface Presenter extends BasePresenter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ public void OnItemClick(View v, int position) {
}
}

@Override
public void showPickDialog() {

Calendar now = Calendar.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ interface View extends BaseView<Presenter> {

void showResults(ArrayList<ZhihuDailyNews.Question> list);

void showPickDialog();

}

interface Presenter extends BasePresenter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,29 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
@Override
public void onClick(View view) {
if (tabLayout.getSelectedTabPosition() == 0) {
showPickDialog();
Calendar now = Calendar.getInstance();
now.set(mYear, mMonth, mDay);
DatePickerDialog dialog = DatePickerDialog.newInstance(new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
Calendar temp = Calendar.getInstance();
temp.clear();
temp.set(year, monthOfYear, dayOfMonth);
presenter.loadPosts(temp.getTimeInMillis(), true);
}
}, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH));

dialog.setMaxDate(Calendar.getInstance());
Calendar minDate = Calendar.getInstance();
// 2013.5.20是知乎日报api首次上线
minDate.set(2013, 5, 20);
dialog.setMinDate(minDate);
dialog.vibrate(false);

dialog.show(getActivity().getFragmentManager(), "DatePickerDialog");
} else if (tabLayout.getSelectedTabPosition() == 2) {
ViewPager p = (ViewPager) getActivity().findViewById(R.id.view_pager);
MainPagerAdapter ad = (MainPagerAdapter) p.getAdapter();
Expand Down Expand Up @@ -224,32 +246,4 @@ public void OnItemClick(View v, int position) {
}
}

@Override
public void showPickDialog() {
Calendar now = Calendar.getInstance();
now.set(mYear, mMonth, mDay);
DatePickerDialog dialog = DatePickerDialog.newInstance(new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePickerDialog view, int year, int monthOfYear, int dayOfMonth) {
mYear = year;
mMonth = monthOfYear;
mDay = dayOfMonth;
Calendar temp = Calendar.getInstance();
temp.clear();
temp.set(year, monthOfYear, dayOfMonth);
presenter.loadPosts(temp.getTimeInMillis(), true);
}
}, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH));

dialog.setMaxDate(Calendar.getInstance());
Calendar minDate = Calendar.getInstance();
// 2013.5.20是知乎日报api首次上线
minDate.set(2013, 5, 20);
dialog.setMinDate(minDate);
dialog.vibrate(false);

dialog.show(getActivity().getFragmentManager(), "DatePickerDialog");

}

}

0 comments on commit 04e422a

Please sign in to comment.