Don't allow ideas tab on the nook

pull/14/head
Sam Bosley 12 years ago
parent 8289146d8d
commit ef3293c2e3

@ -3,11 +3,13 @@ package com.todoroo.astrid.core;
import android.content.res.Resources;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.PreferenceScreen;
import android.text.TextUtils;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.TodorooPreferenceActivity;
import com.todoroo.astrid.utility.Constants;
public class LabsPreferences extends TodorooPreferenceActivity {
@ -53,6 +55,11 @@ public class LabsPreferences extends TodorooPreferenceActivity {
} else if (r.getString(R.string.p_third_party_addons).equals(key)) {
setEnabledSummary(preference, value,
R.string.EPr_third_party_addons_desc_enabled, R.string.EPr_third_party_addons_desc_disabled);
} else if (r.getString(R.string.p_ideas_tab_enabled).equals(key)) {
if (!Constants.MARKET_STRATEGY.allowIdeasTab()) {
PreferenceScreen screen = getPreferenceScreen();
screen.removePreference(preference);
}
}
}

@ -21,5 +21,5 @@
<CheckBoxPreference
android:key="@string/p_ideas_tab_enabled"
android:title="@string/EPr_ideas_tab_enabled"
android:summary="EPr_ideas_tab_description" />
android:summary="@string/EPr_ideas_tab_description" />
</PreferenceScreen>

@ -115,6 +115,7 @@ import com.todoroo.astrid.ui.NestableViewPager;
import com.todoroo.astrid.ui.ReminderControlSet;
import com.todoroo.astrid.ui.TaskEditMoreControls;
import com.todoroo.astrid.ui.WebServicesView;
import com.todoroo.astrid.utility.Constants;
import com.todoroo.astrid.utility.Flags;
import com.todoroo.astrid.voice.VoiceInputAssistant;
import com.viewpagerindicator.TabPageIndicator;
@ -390,7 +391,7 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
boolean hasTitle = !TextUtils.isEmpty(model.getValue(Task.TITLE));
if(hasTitle && Preferences.getBoolean(R.string.p_ideas_tab_enabled, false))
if(hasTitle && Preferences.getBoolean(R.string.p_ideas_tab_enabled, false) && Constants.MARKET_STRATEGY.allowIdeasTab())
tabStyle = TAB_STYLE_ACTIVITY_WEB;
else
tabStyle = TAB_STYLE_ACTIVITY;

@ -32,6 +32,13 @@ public abstract class MarketStrategy {
return true;
}
/**
* @return true if ideas tab should be shown
*/
public boolean allowIdeasTab() {
return true;
}
public static class AndroidMarketStrategy extends MarketStrategy {
@Override
@ -101,6 +108,11 @@ public abstract class MarketStrategy {
return false;
}
@Override
public boolean allowIdeasTab() {
return false;
}
}
}

@ -3,6 +3,8 @@ package com.todoroo.astrid.service.abtesting;
import java.util.HashMap;
import java.util.Set;
import com.todoroo.astrid.utility.Constants;
/**
* Helper class to define options with their probabilities and descriptions
* @author Sam Bosley <sam@astrid.com>
@ -121,8 +123,11 @@ public class ABTests {
addTest(AB_TEST_REENGAGEMENT_ENABLED, new int[] { 1, 9 },
new int[] { 1, 9 }, new String[] { "reengagement-disabled", "reengagement-enabled" }); //$NON-NLS-1$ //$NON-NLS-2$
addTest(AB_TEST_IDEAS_TAB, new int[] { 1, 1 },
new int[] { 0, 1 }, new String[] { "ideas-tab-diabled", "ideas-tab-enabled" }); //$NON-NLS-1$ //$NON-NLS-2$
boolean allowIdeasTab = Constants.MARKET_STRATEGY.allowIdeasTab();
int[] noIdeasTab = new int[] { 1, 0 };
addTest(AB_TEST_IDEAS_TAB, allowIdeasTab ? new int[] { 1, 1 } : noIdeasTab,
allowIdeasTab ? new int[] { 0, 1 } : noIdeasTab, new String[] { "ideas-tab-diabled", "ideas-tab-enabled" }); //$NON-NLS-1$ //$NON-NLS-2$
}
public static final String AB_TEST_IDEAS_TAB = "ideasTab"; //$NON-NLS-1$

Loading…
Cancel
Save