Commit b7a2f022 authored by mayu's avatar mayu

Number of followers increase/decrease on clicking follow in body

parent 01b4b434
...@@ -244,6 +244,8 @@ public class BodyFragment extends BackHandledFragment { ...@@ -244,6 +244,8 @@ public class BodyFragment extends BackHandledFragment {
body.setBodyUserFollows(!body.getBodyUserFollows()); body.setBodyUserFollows(!body.getBodyUserFollows());
new updateDbBody().execute(body); new updateDbBody().execute(body);
followButton.setBackgroundColor(getResources().getColor(body.getBodyUserFollows() ? R.color.colorAccent : R.color.colorWhite)); followButton.setBackgroundColor(getResources().getColor(body.getBodyUserFollows() ? R.color.colorAccent : R.color.colorWhite));
if (body.getBodyUserFollows()) followButton.setText( body.getBodyFollowersCount() + 1 );
else {followButton.setText( body.getBodyFollowersCount() + 1 );}
} }
} }
......
...@@ -122,14 +122,15 @@ public class NotificationIntentService extends JobIntentService { ...@@ -122,14 +122,15 @@ public class NotificationIntentService extends JobIntentService {
long timediff = getDateDiff(new Date(), event.getEventStartTime(), TimeUnit.MINUTES); long timediff = getDateDiff(new Date(), event.getEventStartTime(), TimeUnit.MINUTES);
if (timediff <= 30 && timediff > 0) { // Change this to 30*10000 for testing if (timediff <= 30 && timediff > 0) { // Change this to 30*10000 for testing
NOTIFICATION_ID = event.getEventID().hashCode(); NOTIFICATION_ID = event.getEventID().hashCode();
final NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), getResources().getString(R.string.default_notification_channel_id)); final NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext(), getResources().getString(R.string.default_notification_channel_id));
builder.setContentTitle(event.getEventName()) builder.setContentTitle(event.getEventName())
.setAutoCancel(true) .setAutoCancel(true)
.setColor(getResources().getColor(R.color.colorAccent)) .setColor(getResources().getColor(R.color.colorAccent))
.setContentText("Event is about to start in " + getDateDiff(new Date(), event.getEventStartTime(), TimeUnit.MINUTES) + ((getDateDiff(new Date(), event.getEventStartTime(), TimeUnit.MINUTES) == 1) ? " minute." : " minutes.")) .setContentText("Event is about to start in " + getDateDiff(new Date(), event.getEventStartTime(), TimeUnit.MINUTES) + ((getDateDiff(new Date(), event.getEventStartTime(), TimeUnit.MINUTES) == 1) ? " minute." : " minutes."))
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.lotus_white)) .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.lotus_white))
.setSmallIcon(R.drawable.lotus_white); .setSmallIcon(R.drawable.lotus_white)
// .addAction (R.drawable.common_google_signin_btn_icon_dark,"Hello", null)
;
Intent intent = new Intent(getApplicationContext(), MainActivity.class); Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.setAction(ACTION_OPEN_EVENT); intent.setAction(ACTION_OPEN_EVENT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment