Featured lists turned off by default but can be turned on in labs

pull/14/head
Sam Bosley 13 years ago
parent 59fc9e98c9
commit 989fc0b2d8

@ -269,8 +269,10 @@ public class ActFmSyncV2Provider extends SyncV2Provider {
public void run() {
int time = Preferences.getInt(LAST_FEATURED_TAG_FETCH_TIME, 0);
try {
if (Preferences.getBoolean(R.string.p_show_featured_lists_labs, false)) {
time = actFmSyncService.fetchFeaturedLists(time);
Preferences.setInt(LAST_FEATURED_TAG_FETCH_TIME, time);
}
} catch (JSONException e) {
handler.handleException("actfm-sync", e, e.toString()); //$NON-NLS-1$
} catch (IOException e) {

@ -64,6 +64,9 @@
<!-- force tablets to use phone layout -->
<string name="p_force_phone_layout">force_phone_layout</string>
<!-- show featured lists -->
<string name="p_show_featured_lists_labs">show_featured_lists_labs</string>
<string-array name="TEA_reminder_random_hours">
<!-- values (in hours) associated with items above. -->
<item>1</item>

@ -663,6 +663,8 @@
<string name="EPr_force_phone_layout">Use phone layout</string>
<string name="EPr_show_featured_lists">Show featured lists</string>
<string name="EPr_swipe_lists_restart_alert">You will need to restart Astrid for this change to take effect</string>
<string-array name="EPr_swipe_lists_performance_mode">

@ -34,5 +34,9 @@
android:title="@string/EPr_force_phone_layout"
android:key="@string/p_force_phone_layout"
android:defaultValue="false"/>
<CheckBoxPreference
android:title="@string/EPr_show_featured_lists"
android:key="@string/p_show_featured_lists_labs"
android:defaultValue="false"/>
</PreferenceScreen>

@ -3,15 +3,20 @@ package com.todoroo.astrid.activity;
import android.content.Context;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.core.CoreFilterExposer;
import com.todoroo.astrid.ui.MainMenuPopover;
public class DefaultFilterMode implements FilterModeSpec {
@Override
public int[] getForbiddenMenuItems() {
if (Preferences.getBoolean(R.string.p_show_featured_lists_labs, false))
return new int[0];
else
return new int[] { MainMenuPopover.MAIN_MENU_ITEM_FEATURED_LISTS };
}
@Override

@ -83,6 +83,14 @@ public class AstridPreferences {
Preferences.setString(R.string.p_theme, ThemeService.THEME_WHITE);
}
setShowFriendsView();
setShowFeaturedLists();
editor.commit();
}
private static void setShowFriendsView() {
// Show friends view if necessary
boolean showFriends = false;
TodorooCursor<User> users = PluginServices.getUserDao().query(Query.select(User.ID).limit(1));
@ -92,7 +100,10 @@ public class AstridPreferences {
users.close();
}
Preferences.setBoolean(R.string.p_show_friends_view, showFriends);
}
private static void setShowFeaturedLists() {
// Show featured lists if necessary
boolean showFeaturedLists = false;
TodorooCursor<TagData> featLists = PluginServices.getTagDataService().query(Query.select(TagData.ID)
.where(Functions.bitwiseAnd(TagData.FLAGS, TagData.FLAG_FEATURED).gt(0)).limit(1));
@ -102,8 +113,6 @@ public class AstridPreferences {
featLists.close();
}
Preferences.setBoolean(R.string.p_show_featured_lists, showFeaturedLists);
editor.commit();
}
/* ======================================================================

Loading…
Cancel
Save