Analytic updates

pull/384/head
Alex Baker 10 years ago
parent f69d0ae901
commit 8734de28ca

@ -0,0 +1,19 @@
package org.tasks.analytics;
import javax.inject.Inject;
public class Tracker {
@Inject
public Tracker() {
}
public void showScreen(String screenName) {
}
public void setTrackingEnabled(boolean enabled) {
}
}

@ -2,5 +2,5 @@
<resources>
<bool name="sync_enabled">true</bool>
<bool name="location_enabled">true</bool>
<bool name="tasker_available">true</bool>
<bool name="google_play_store_available">true</bool>
</resources>

@ -12,7 +12,7 @@ import java.util.List;
import javax.inject.Inject;
import static com.google.api.client.util.Lists.newArrayList;
import static com.google.common.collect.Lists.newArrayList;
public class AddAttachmentDialog extends InjectingDialogFragment {

@ -2,7 +2,6 @@ package org.tasks.preferences;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.preference.Preference;
@ -10,6 +9,7 @@ import com.todoroo.astrid.core.OldTaskPreferences;
import com.todoroo.astrid.reminders.ReminderPreferences;
import org.tasks.R;
import org.tasks.analytics.Tracker;
import org.tasks.injection.InjectingPreferenceActivity;
import javax.inject.Inject;
@ -21,6 +21,8 @@ public class BasicPreferences extends InjectingPreferenceActivity {
private Bundle result;
@Inject Tracker tracker;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -31,8 +33,20 @@ public class BasicPreferences extends InjectingPreferenceActivity {
if (!getResources().getBoolean(R.bool.sync_enabled)) {
getPreferenceScreen().removePreference(findPreference(getString(R.string.synchronization)));
}
if (getResources().getBoolean(R.bool.tasker_available)) {
if (getResources().getBoolean(R.bool.google_play_store_available)) {
addPreferencesFromResource(R.xml.preferences_addons);
addPreferencesFromResource(R.xml.preferences_privacy);
findPreference(getString(R.string.p_collect_statistics)).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (newValue != null) {
tracker.setTrackingEnabled((boolean) newValue);
return true;
}
return false;
}
});
}
setupActivity(R.string.EPr_appearance_header, AppearancePreferences.class);
setupActivity(R.string.notifications, ReminderPreferences.class);

@ -5,5 +5,5 @@
<bool name="at_least_honeycomb_mr1">false</bool>
<bool name="sync_enabled">false</bool>
<bool name="location_enabled">false</bool>
<bool name="tasker_available">false</bool>
<bool name="google_play_store_available">false</bool>
</resources>

@ -45,20 +45,4 @@
android:targetPackage="org.tasks" />
</Preference>
<PreferenceCategory android:title="@string/privacy">
<Preference android:title="@string/privacy_policy">
<intent
android:action="android.intent.action.VIEW"
android:data="http://tasks.org/privacy.html" />
</Preference>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:defaultValue="true"
android:key="@string/p_collect_statistics"
android:summary="@string/send_anonymous_statistics_summary"
android:title="@string/send_anonymous_statistics" />
</PreferenceCategory>
</PreferenceScreen>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/privacy">
<Preference android:title="@string/privacy_policy">
<intent
android:action="android.intent.action.VIEW"
android:data="http://tasks.org/privacy.html" />
</Preference>
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:defaultValue="true"
android:key="@string/p_collect_statistics"
android:summary="@string/send_anonymous_statistics_summary"
android:title="@string/send_anonymous_statistics" />
</PreferenceCategory>
</PreferenceScreen>
Loading…
Cancel
Save