Move Help & Feedback back to navigation drawer

pull/281/head
Alex Baker 9 years ago
parent a2f1a976f1
commit 5776b9b828

@ -7,6 +7,6 @@
[![Build Status](https://travis-ci.org/tasks/tasks.svg?branch=master)](https://travis-ci.org/tasks/tasks) [![codecov.io](http://codecov.io/github/tasks/tasks/coverage.svg?branch=master)](http://codecov.io/github/tasks/tasks?branch=master)
Visit the wiki to
* [help with translations](https://github.com/abaker/tasks/wiki/Translations)
* [become a beta tester](https://github.com/abaker/tasks/wiki/Beta-Testing)
* [get started with development](https://github.com/abaker/tasks/wiki/Getting-Started-with-Development)
* [help with translations](https://github.com/tasks/tasks/wiki/Translations)
* [become a beta tester](https://github.com/tasks/tasks/wiki/Beta-Testing)
* [get started with development](https://github.com/tasks/tasks/wiki/Getting-Started-with-Development)

@ -182,6 +182,12 @@
</activity>
<!-- Activity for preferences -->
<activity
android:name=".preferences.HelpAndFeedbackActivity"
android:label="@string/help_and_feedback"
android:theme="@style/Tasks" />
<activity
android:name=".preferences.BasicPreferences"
android:label="@string/TLA_menu_settings"

@ -31,6 +31,7 @@ import org.tasks.filters.NavigationDrawerAction;
import org.tasks.filters.NavigationDrawerSubheader;
import org.tasks.filters.NavigationDrawerSeparator;
import org.tasks.preferences.BasicPreferences;
import org.tasks.preferences.HelpAndFeedbackActivity;
import java.util.List;
@ -252,6 +253,11 @@ public class FilterAdapter extends ArrayAdapter<FilterListItem> {
getResource(activity, R.attr.ic_action_settings),
new Intent(activity, BasicPreferences.class),
REQUEST_SETTINGS));
add(new NavigationDrawerAction(
activity.getResources().getString(R.string.help_and_feedback),
getResource(activity, R.attr.ic_action_help),
new Intent(activity, HelpAndFeedbackActivity.class),
0));
}
notifyDataSetChanged();

@ -26,6 +26,7 @@ import com.todoroo.astrid.tags.TaskToTagMetadata;
import org.tasks.R;
import org.tasks.injection.ForApplication;
import org.tasks.preferences.Preferences;
import org.tasks.preferences.ResourceResolver;
import java.util.ArrayList;
import java.util.List;
@ -41,16 +42,20 @@ import javax.inject.Inject;
public final class BuiltInFilterExposer {
private final Preferences preferences;
private ResourceResolver resourceResolver;
private final Context context;
@Inject
public BuiltInFilterExposer(@ForApplication Context context, Preferences preferences) {
public BuiltInFilterExposer(ResourceResolver resourceResolver, @ForApplication Context context, Preferences preferences) {
this.resourceResolver = resourceResolver;
this.context = context;
this.preferences = preferences;
}
public Filter getMyTasksFilter() {
return getMyTasksFilter(context.getResources());
Filter myTasksFilter = getMyTasksFilter(context.getResources());
myTasksFilter.icon = resourceResolver.getResource(R.attr.ic_action_inbox);
return myTasksFilter;
}
public List<Filter> getFilters() {

@ -36,6 +36,7 @@ import org.tasks.activities.PurgeDeletedActivity;
import org.tasks.preferences.AppearancePreferences;
import org.tasks.preferences.BackupPreferences;
import org.tasks.preferences.BasicPreferences;
import org.tasks.preferences.HelpAndFeedbackActivity;
import org.tasks.preferences.MiscellaneousPreferences;
import org.tasks.reminders.NotificationActivity;
import org.tasks.reminders.SnoozeActivity;
@ -84,7 +85,8 @@ import dagger.Provides;
AppearancePreferences.class,
BackupPreferences.class,
LocationPickerActivity.class,
NotificationActivity.class
NotificationActivity.class,
HelpAndFeedbackActivity.class
})
public class ActivityModule {

@ -18,7 +18,6 @@ public class BasicPreferences extends InjectingPreferenceActivity {
private static final String EXTRA_RESULT = "extra_result";
private static final int RC_PREFS = 10001;
@Inject DeviceInfo deviceInfo;
private Bundle result;
@Override
@ -45,18 +44,6 @@ public class BasicPreferences extends InjectingPreferenceActivity {
return true;
}
});
findPreference(getString(R.string.contact_developer)).setIntent(
new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "Tasks Support <support@tasks.org>", null)) {{
putExtra(Intent.EXTRA_SUBJECT, "Tasks Feedback");
putExtra(Intent.EXTRA_TEXT, deviceInfo.getDebugInfo());
}});
if (!deviceInfo.supportsBilling()) {
remove(R.string.TLA_menu_donate);
}
if (!deviceInfo.isPlayStoreAvailable()) {
remove(R.string.rate_tasks);
}
}
@Override
@ -78,8 +65,4 @@ public class BasicPreferences extends InjectingPreferenceActivity {
super.onActivityResult(requestCode, resultCode, data);
}
}
private void remove(int resId) {
getPreferenceScreen().removePreference(findPreference(getString(resId)));
}
}

@ -0,0 +1,38 @@
package org.tasks.preferences;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import org.tasks.R;
import org.tasks.injection.InjectingPreferenceActivity;
import javax.inject.Inject;
public class HelpAndFeedbackActivity extends InjectingPreferenceActivity {
@Inject DeviceInfo deviceInfo;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences_help);
findPreference(getString(R.string.contact_developer)).setIntent(
new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "Tasks Support <support@tasks.org>", null)) {{
putExtra(Intent.EXTRA_SUBJECT, "Tasks Feedback");
putExtra(Intent.EXTRA_TEXT, deviceInfo.getDebugInfo());
}});
if (!deviceInfo.supportsBilling()) {
remove(R.string.TLA_menu_donate);
}
if (!deviceInfo.isPlayStoreAvailable()) {
remove(R.string.rate_tasks);
}
}
private void remove(int resId) {
getPreferenceScreen().removePreference(findPreference(getString(resId)));
}
}

@ -201,7 +201,11 @@ public class NavigationDrawerFragment extends InjectingFragment {
}
} else if (item instanceof NavigationDrawerAction) {
NavigationDrawerAction action = (NavigationDrawerAction) item;
startActivityForResult(action.intent, action.requestCode);
if (action.requestCode > 0) {
startActivityForResult(action.intent, action.requestCode);
} else {
startActivity(action.intent);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 969 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 805 B

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

@ -17,8 +17,7 @@
<ImageView
android:id="@+id/icon"
android:alpha="0.87"
android:src="?attr/ic_action_settings"
android:alpha="0.54"
android:layout_width="56dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"

@ -45,6 +45,8 @@
<attr name="ic_action_alarm" format="reference" />
<attr name="ic_action_reload" format="reference" />
<attr name="ic_action_calendar_month" format="reference"/>
<attr name="ic_action_help" format="reference"/>
<attr name="ic_action_inbox" format="reference"/>
<attr name="drawer_text" format="color"/>
<attr name="importance_background_selected" format="reference"/>
<attr name="fab_icon" format="reference"/>

@ -58,6 +58,8 @@
<item name="ic_action_reload">@drawable/ic_action_reload</item>
<item name="ic_action_calendar_month">@drawable/ic_action_calendar_month</item>
<item name="fab_icon">@drawable/ic_action_add_light</item>
<item name="ic_action_inbox">@drawable/ic_action_inbox</item>
<item name="ic_action_help">@drawable/ic_action_help</item>
</style>
<style name="Tasks.Dark">
@ -92,6 +94,8 @@
<item name="ic_action_cancel">@drawable/ic_action_cancel_white</item>
<item name="asDueDateColor">#c3c3c3</item>
<item name="fab_icon">@drawable/ic_action_add_black</item>
<item name="ic_action_inbox">@drawable/ic_action_inbox_white</item>
<item name="ic_action_help">@drawable/ic_action_help_white</item>
</style>
<style name="ActionBar.TitleText" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">

@ -41,46 +41,4 @@
android:targetPackage="org.tasks" />
</Preference>
<PreferenceCategory android:title="@string/help_and_feedback">
<Preference
android:key="@string/TLA_menu_donate"
android:title="@string/TLA_menu_donate">
<intent
android:targetClass="org.tasks.activities.DonationActivity"
android:targetPackage="org.tasks" />
</Preference>
<Preference android:title="@string/source_code">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/abaker/tasks" />
</Preference>
<Preference android:title="@string/translations">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/abaker/tasks/wiki/Translations" />
</Preference>
<Preference android:title="@string/report_an_issue">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/abaker/tasks/issues" />
</Preference>
<Preference
android:key="@string/rate_tasks"
android:title="@string/rate_tasks">
<intent
android:action="android.intent.action.VIEW"
android:data="market://details?id=org.tasks" />
</Preference>
<Preference
android:key="@string/contact_developer"
android:title="@string/contact_developer" />
</PreferenceCategory>
</PreferenceScreen>

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<Preference
android:key="@string/TLA_menu_donate"
android:title="@string/TLA_menu_donate">
<intent
android:targetClass="org.tasks.activities.DonationActivity"
android:targetPackage="org.tasks" />
</Preference>
<Preference android:title="@string/source_code">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/tasks/tasks" />
</Preference>
<Preference android:title="@string/translations">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/tasks/tasks/wiki/Translations" />
</Preference>
<Preference android:title="@string/report_an_issue">
<intent
android:action="android.intent.action.VIEW"
android:data="https://github.com/tasks/tasks/issues" />
</Preference>
<Preference
android:key="@string/rate_tasks"
android:title="@string/rate_tasks">
<intent
android:action="android.intent.action.VIEW"
android:data="market://details?id=org.tasks" />
</Preference>
<Preference
android:key="@string/contact_developer"
android:title="@string/contact_developer" />
</PreferenceScreen>
Loading…
Cancel
Save