Skip to content

Commit

Permalink
modify_cal
Browse files Browse the repository at this point in the history
  • Loading branch information
CatWang committed Sep 24, 2017
1 parent a8df8b2 commit 04b66d3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,34 @@ public void onItemClick(View view, int position) {
Intent intent = new Intent(getContext(), EventDetailActivity.class);
intent.putExtra("id", "" + event.getEventID());
intent.putExtra("added", true);
Common.currentDate = mDate;
getContext().startActivity(intent);
}

@Override
public void onResume() {
super.onResume();

mDate = Common.currentDate;

if (mDate != null) {

String cur = HttpHelper.getDateString(mDate);

Calendar c = Calendar.getInstance();
c.setTime(mDate);
c.set(Calendar.DATE, c.get(Calendar.DATE) + 1);

String next = HttpHelper.getDateString(c);

String url = "?s=" + cur + "&e=" + next;
HttpHelper.get(handler, HttpHelper.EVENT_DATE_URL + url, true);
}
}

// @Override
// public void onStop() {
// super.onStop();
// Common.currentDate = null;
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void onClick(View v) {
View v_iew=inflater.inflate(R.layout.layout_social_link, null);
alter.setView(v_iew);

alter.setTitle("Link Facebook");
alter.setTitle("Link Twitter");
final TextView txtUsername = (TextView) v_iew.findViewById(R.id.link_social_input);
final TextView txtPwd = (TextView) v_iew.findViewById(R.id.link_social_pwd_input);

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/example/catwong/tita/util/Common.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.example.catwong.tita.util;

import java.util.Date;

/**
* Created by CatWong on 9/23/17.
*/

public class Common {
public final static CustomDateFormat dateFormat = CustomDateFormat.getsInstance();

public static Date currentDate = null;
}

0 comments on commit 04b66d3

Please sign in to comment.