|
|
|
|
@ -16,6 +16,7 @@ import android.widget.TextView;
|
|
|
|
|
|
|
|
|
|
import com.timsu.astrid.R;
|
|
|
|
|
import com.todoroo.andlib.service.Autowired;
|
|
|
|
|
import com.todoroo.andlib.utility.DateUtilities;
|
|
|
|
|
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
|
|
|
|
|
import com.todoroo.astrid.actfm.sync.ActFmSyncService;
|
|
|
|
|
import com.todoroo.astrid.actfm.sync.ActFmSyncThread;
|
|
|
|
|
@ -182,8 +183,12 @@ public class PersonViewFragment extends TaskListFragment {
|
|
|
|
|
protected void initiateAutomaticSyncImpl() {
|
|
|
|
|
if (!isCurrentTaskListFragment())
|
|
|
|
|
return;
|
|
|
|
|
if (user != null) {
|
|
|
|
|
long pushedAt = user.getValue(User.PUSHED_AT);
|
|
|
|
|
if(DateUtilities.now() - pushedAt > DateUtilities.ONE_HOUR / 2)
|
|
|
|
|
refreshData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void reloadUserData() {
|
|
|
|
|
user = userDao.fetch(extras.getLong(EXTRA_USER_ID_LOCAL), User.PROPERTIES);
|
|
|
|
|
@ -196,7 +201,6 @@ public class PersonViewFragment extends TaskListFragment {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void refreshData() {
|
|
|
|
|
if (user != null) {
|
|
|
|
|
emptyView.setText(R.string.DLG_loading);
|
|
|
|
|
Runnable callback = new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
@ -215,7 +219,6 @@ public class PersonViewFragment extends TaskListFragment {
|
|
|
|
|
};
|
|
|
|
|
ActFmSyncThread.getInstance().enqueueMessage(new BriefMe<User>(User.class, user.getValue(User.UUID), user.getValue(User.PUSHED_AT)), callback);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getEmptyDisplayString() {
|
|
|
|
|
String userName = user != null ? user.getDisplayName() : null;
|
|
|
|
|
|