Some bug fixes
This commit is contained in:
parent
c2143097f6
commit
d9334434a6
|
@ -192,6 +192,7 @@ public class InstanceHealthActivity extends BaseActivity {
|
|||
up.setTextColor(ContextCompat.getColor(getApplicationContext(), R.color.red));
|
||||
}
|
||||
uptime.setText(String.format("Uptime: %.2f %%", (instanceSocial.getUptime()*100)));
|
||||
if( instanceSocial.getChecked_at() != null)
|
||||
checked_at.setText(String.format("Checked at: %s", Helper.dateToString(instanceSocial.getChecked_at())));
|
||||
values.setText(String.format("version: %s \n %s users - %s statuses", instanceSocial.getVersion(), withSuffix(instanceSocial.getUsers()), withSuffix(instanceSocial.getStatuses())));
|
||||
instance_container.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -498,6 +498,8 @@ public class Helper {
|
|||
* @return String
|
||||
*/
|
||||
public static String dateToString(Date date) {
|
||||
if( date == null)
|
||||
return null;
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.getDefault());
|
||||
return dateFormat.format(date);
|
||||
}
|
||||
|
|
|
@ -87,15 +87,19 @@ public class NotificationsSyncJob extends Job {
|
|||
return jobRequests.iterator().next().getJobId();
|
||||
}
|
||||
|
||||
return new JobRequest.Builder(NotificationsSyncJob.NOTIFICATION_REFRESH)
|
||||
int jobRequestschedule = -1;
|
||||
try {
|
||||
jobRequestschedule = new JobRequest.Builder(NotificationsSyncJob.NOTIFICATION_REFRESH)
|
||||
.setPeriodic(TimeUnit.MINUTES.toMillis(Helper.MINUTES_BETWEEN_NOTIFICATIONS_REFRESH), TimeUnit.MINUTES.toMillis(5))
|
||||
.setUpdateCurrent(updateCurrent)
|
||||
.setRequiredNetworkType(JobRequest.NetworkType.METERED)
|
||||
.setRequirementsEnforced(false)
|
||||
.build()
|
||||
.schedule();
|
||||
}
|
||||
}catch (Exception ignored){}
|
||||
|
||||
return jobRequestschedule;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue