Special handling for kindle fire - remove google tasks and addons tab

pull/14/head
Tim Su 13 years ago
parent e659651c18
commit c4c333be7c

@ -46,8 +46,10 @@ import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.core.LabsPreferences; import com.todoroo.astrid.core.LabsPreferences;
import com.todoroo.astrid.dao.Database; import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.data.Task; import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gtasks.GtasksPreferences;
import com.todoroo.astrid.helper.MetadataHelper; import com.todoroo.astrid.helper.MetadataHelper;
import com.todoroo.astrid.service.AddOnService; import com.todoroo.astrid.service.AddOnService;
import com.todoroo.astrid.service.MarketStrategy.AmazonMarketStrategy;
import com.todoroo.astrid.service.StartupService; import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsConstants; import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService; import com.todoroo.astrid.service.StatisticsService;
@ -225,6 +227,10 @@ public class EditPreferences extends TodorooPreferenceActivity {
!MilkUtilities.INSTANCE.isLoggedIn()) !MilkUtilities.INSTANCE.isLoggedIn())
continue; continue;
if (GtasksPreferences.class.getName().equals(resolveInfo.activityInfo.name)
&& AmazonMarketStrategy.isKindleFire())
continue;
Preference preference = new Preference(this); Preference preference = new Preference(this);
preference.setTitle(resolveInfo.activityInfo.loadLabel(pm)); preference.setTitle(resolveInfo.activityInfo.loadLabel(pm));
if (labsTitle.equals(preference.getTitle())) if (labsTitle.equals(preference.getTitle()))

@ -34,6 +34,8 @@ import com.todoroo.astrid.activity.TaskListFragment;
import com.todoroo.astrid.api.AstridApiConstants; import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.SyncAction; import com.todoroo.astrid.api.SyncAction;
import com.todoroo.astrid.gtasks.GtasksPreferences;
import com.todoroo.astrid.service.MarketStrategy.AmazonMarketStrategy;
import com.todoroo.astrid.service.SyncV2Service; import com.todoroo.astrid.service.SyncV2Service;
import com.todoroo.astrid.sync.SyncResultCallback; import com.todoroo.astrid.sync.SyncResultCallback;
import com.todoroo.astrid.sync.SyncV2Provider; import com.todoroo.astrid.sync.SyncV2Provider;
@ -192,11 +194,17 @@ public class SyncActionHelper {
String category = MetadataHelper.resolveActivityCategoryName( String category = MetadataHelper.resolveActivityCategoryName(
resolveInfo, pm); resolveInfo, pm);
if (MilkPreferences.class.getName().equals( if (MilkPreferences.class.getName().equals(
resolveInfo.activityInfo.name) resolveInfo.activityInfo.name)
&& !MilkUtilities.INSTANCE.isLoggedIn()) && !MilkUtilities.INSTANCE.isLoggedIn())
continue; continue;
if (GtasksPreferences.class.getName().equals(
resolveInfo.activityInfo.name)
&& AmazonMarketStrategy.isKindleFire())
continue;
if (category.equals(desiredCategory)) { if (category.equals(desiredCategory)) {
syncIntents.add(new IntentWithLabel(intent, syncIntents.add(new IntentWithLabel(intent,
resolveInfo.activityInfo.loadLabel(pm).toString())); resolveInfo.activityInfo.loadLabel(pm).toString()));

@ -57,6 +57,19 @@ public abstract class MarketStrategy {
return false; return false;
} }
@Override
public boolean showAddonMenu() {
return !isKindleFire();
}
/**
* @return true if the device is a kindle fire and needs special treatment
*/
public static boolean isKindleFire() {
return android.os.Build.MANUFACTURER.equals("Amazon") && //$NON-NLS-1$
android.os.Build.MODEL.equals("Kindle Fire"); //$NON-NLS-1$
}
} }
} }

Loading…
Cancel
Save