Remove getLong from old preferences

pull/189/head
Alex Baker 10 years ago
parent 7326f6f00f
commit 06ba4e9441

@ -215,14 +215,4 @@ public class Preferences {
editor.putInt(key, value);
editor.commit();
}
// --- preference fetching (long)
/** Gets a long preference
* @return default if value is unset otherwise the value
*/
public static long getLong(String key, long defValue) {
Context context = ContextManager.getContext();
return getPrefs(context).getLong(key, defValue);
}
}

@ -15,11 +15,13 @@ import android.view.ViewGroup.OnHierarchyChangeListener;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.andlib.utility.TodorooPreferenceActivity;
import com.todoroo.astrid.utility.Flags;
import org.tasks.R;
import org.tasks.injection.InjectingTodorooPreferenceActivity;
import org.tasks.preferences.Preferences;
import javax.inject.Inject;
import static org.tasks.date.DateTimeUtils.newDate;
@ -30,7 +32,7 @@ import static org.tasks.date.DateTimeUtils.newDate;
* @author timsu
*
*/
public class BackupPreferences extends TodorooPreferenceActivity {
public class BackupPreferences extends InjectingTodorooPreferenceActivity {
static final String PREF_BACKUP_LAST_DATE = "backupDate"; //$NON-NLS-1$
@ -38,6 +40,8 @@ public class BackupPreferences extends TodorooPreferenceActivity {
private int statusColor = Color.BLACK;
@Inject Preferences preferences;
@Override
public int getPreferenceResource() {
return R.xml.preferences_backup;
@ -105,8 +109,8 @@ public class BackupPreferences extends TodorooPreferenceActivity {
String subtitle = ""; //$NON-NLS-1$
// last backup was error
final long last = Preferences.getLong(PREF_BACKUP_LAST_DATE, 0);
final String error = Preferences.getStringValue(PREF_BACKUP_LAST_ERROR);
final long last = preferences.getLong(PREF_BACKUP_LAST_DATE, 0);
final String error = preferences.getStringValue(PREF_BACKUP_LAST_ERROR);
if(error != null) {
status = r.getString(R.string.backup_status_failed);
subtitle = r.getString(R.string.backup_status_failed_subtitle);

Loading…
Cancel
Save