Merge help and feedback into one menu item

This commit is contained in:
Jimmy Shih
2014-01-08 14:36:34 -08:00
parent 7f124aa76b
commit 33886cc2ad
15 changed files with 47 additions and 36 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

+3 -8
View File
@@ -86,13 +86,8 @@ limitations under the License.
android:orderInCategory="14" android:orderInCategory="14"
android:title="@string/menu_settings"/> android:title="@string/menu_settings"/>
<item <item
android:icon="@drawable/ic_menu_feedback" android:icon="@drawable/ic_menu_help_feedback"
android:id="@+id/track_detail_feedback" android:id="@+id/track_detail_help_feedback"
android:orderInCategory="15" android:orderInCategory="15"
android:title="@string/menu_feedback"/> android:title="@string/menu_help_feedback"/>
<item
android:icon="@drawable/ic_menu_help"
android:id="@+id/track_detail_help"
android:orderInCategory="16"
android:title="@string/menu_help"/>
</menu> </menu>
+3 -7
View File
@@ -55,11 +55,7 @@ limitations under the License.
android:id="@+id/track_list_settings" android:id="@+id/track_list_settings"
android:title="@string/menu_settings"/> android:title="@string/menu_settings"/>
<item <item
android:icon="@drawable/ic_menu_feedback" android:icon="@drawable/ic_menu_help_feedback"
android:id="@+id/track_list_feedback" android:id="@+id/track_list_help_feedback"
android:title="@string/menu_feedback"/> android:title="@string/menu_help_feedback"/>
<item
android:icon="@drawable/ic_menu_help"
android:id="@+id/track_list_help"
android:title="@string/menu_help"/>
</menu> </menu>
+6 -6
View File
@@ -1137,18 +1137,18 @@ limitations under the License.
Character limit: ~20 (1 line)"> Character limit: ~20 (1 line)">
Export all Export all
</string> </string>
<string name="menu_feedback"
translation_description="In the menu, to enter feedback.
Character limit: ~20 (1 line)">
Feedback
</string>
<string name="menu_help" <string name="menu_help"
translation_description="In the menu, to go to the help page. translation_description="In the menu, to go to the help page.
Character limit: ~20 (1 line)"> Character limit: ~20 (1 line)">
Help Help
</string> </string>
<string name="menu_help_feedback"
translation_description="In the menu, to go to the help and feedback page.
Character limit: ~20 (1 line)">
Help &amp; feedback
</string>
<string name="menu_import_all" <string name="menu_import_all"
translation_description="In the menu, to import all the tracks from the external storage. translation_description="In the menu, to import all the tracks from the external storage.
@@ -20,6 +20,8 @@ import com.google.android.apps.mytracks.fragments.AboutDialogFragment;
import com.google.android.apps.mytracks.fragments.AboutDialogFragment.AboutCaller; import com.google.android.apps.mytracks.fragments.AboutDialogFragment.AboutCaller;
import com.google.android.apps.mytracks.fragments.EulaDialogFragment; import com.google.android.apps.mytracks.fragments.EulaDialogFragment;
import com.google.android.apps.mytracks.fragments.EulaDialogFragment.EulaCaller; import com.google.android.apps.mytracks.fragments.EulaDialogFragment.EulaCaller;
import com.google.android.apps.mytracks.util.ApiAdapterFactory;
import com.google.android.apps.mytracks.util.SystemUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
import android.os.Bundle; import android.os.Bundle;
@@ -41,6 +43,11 @@ public class HelpActivity extends AbstractMyTracksActivity implements AboutCalle
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
String subtitle = getString(R.string.my_tracks_app_name) + " v"
+ SystemUtils.getMyTracksVersion(this);
ApiAdapterFactory.getApiAdapter()
.setTitleAndSubtitle(this, getString(R.string.menu_help), subtitle);
WebView webView = (WebView) findViewById(R.id.help_webview); WebView webView = (WebView) findViewById(R.id.help_webview);
String language = Locale.getDefault().getLanguage(); String language = Locale.getDefault().getLanguage();
if (language == null || language.equals("")) { if (language == null || language.equals("")) {
@@ -42,7 +42,6 @@ import com.google.android.apps.mytracks.util.ApiAdapterFactory;
import com.google.android.apps.mytracks.util.CalorieUtils; import com.google.android.apps.mytracks.util.CalorieUtils;
import com.google.android.apps.mytracks.util.CalorieUtils.ActivityType; import com.google.android.apps.mytracks.util.CalorieUtils.ActivityType;
import com.google.android.apps.mytracks.util.FileUtils; import com.google.android.apps.mytracks.util.FileUtils;
import com.google.android.apps.mytracks.util.GoogleFeedbackUtils;
import com.google.android.apps.mytracks.util.IntentUtils; import com.google.android.apps.mytracks.util.IntentUtils;
import com.google.android.apps.mytracks.util.PreferencesUtils; import com.google.android.apps.mytracks.util.PreferencesUtils;
import com.google.android.apps.mytracks.util.TrackIconUtils; import com.google.android.apps.mytracks.util.TrackIconUtils;
@@ -363,8 +362,9 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
boolean isSharedWithMe = track != null ? track.isSharedWithMe() : true; boolean isSharedWithMe = track != null ? track.isSharedWithMe() : true;
menu.findItem(R.id.track_detail_edit).setVisible(!isSharedWithMe); menu.findItem(R.id.track_detail_edit).setVisible(!isSharedWithMe);
menu.findItem(R.id.track_detail_feedback) menu.findItem(R.id.track_detail_help_feedback).setTitle(
.setVisible(ApiAdapterFactory.getApiAdapter().isGoogleFeedbackAvailable()); ApiAdapterFactory.getApiAdapter().isGoogleFeedbackAvailable() ? R.string.menu_help_feedback
: R.string.menu_help);
insertMarkerMenuItem = menu.findItem(R.id.track_detail_insert_marker); insertMarkerMenuItem = menu.findItem(R.id.track_detail_insert_marker);
insertPhotoMenuItem = menu.findItem(R.id.track_detail_insert_photo); insertPhotoMenuItem = menu.findItem(R.id.track_detail_insert_photo);
@@ -461,10 +461,7 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
intent = IntentUtils.newIntent(this, SettingsActivity.class); intent = IntentUtils.newIntent(this, SettingsActivity.class);
startActivity(intent); startActivity(intent);
return true; return true;
case R.id.track_detail_feedback: case R.id.track_detail_help_feedback:
GoogleFeedbackUtils.bindFeedback(this);
return true;
case R.id.track_detail_help:
intent = IntentUtils.newIntent(this, HelpActivity.class); intent = IntentUtils.newIntent(this, HelpActivity.class);
startActivity(intent); startActivity(intent);
return true; return true;
@@ -40,7 +40,6 @@ import com.google.android.apps.mytracks.settings.SettingsActivity;
import com.google.android.apps.mytracks.util.AnalyticsUtils; import com.google.android.apps.mytracks.util.AnalyticsUtils;
import com.google.android.apps.mytracks.util.ApiAdapterFactory; import com.google.android.apps.mytracks.util.ApiAdapterFactory;
import com.google.android.apps.mytracks.util.EulaUtils; import com.google.android.apps.mytracks.util.EulaUtils;
import com.google.android.apps.mytracks.util.GoogleFeedbackUtils;
import com.google.android.apps.mytracks.util.GoogleLocationUtils; import com.google.android.apps.mytracks.util.GoogleLocationUtils;
import com.google.android.apps.mytracks.util.IntentUtils; import com.google.android.apps.mytracks.util.IntentUtils;
import com.google.android.apps.mytracks.util.ListItemUtils; import com.google.android.apps.mytracks.util.ListItemUtils;
@@ -466,8 +465,9 @@ public class TrackListActivity extends AbstractSendToGoogleActivity
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.track_list, menu); getMenuInflater().inflate(R.menu.track_list, menu);
menu.findItem(R.id.track_list_feedback) menu.findItem(R.id.track_list_help_feedback).setTitle(
.setVisible(ApiAdapterFactory.getApiAdapter().isGoogleFeedbackAvailable()); ApiAdapterFactory.getApiAdapter().isGoogleFeedbackAvailable() ? R.string.menu_help_feedback
: R.string.menu_help);
searchMenuItem = menu.findItem(R.id.track_list_search); searchMenuItem = menu.findItem(R.id.track_list_search);
ApiAdapterFactory.getApiAdapter().configureSearchWidget(this, searchMenuItem, trackController); ApiAdapterFactory.getApiAdapter().configureSearchWidget(this, searchMenuItem, trackController);
@@ -568,10 +568,7 @@ public class TrackListActivity extends AbstractSendToGoogleActivity
intent = IntentUtils.newIntent(this, SettingsActivity.class); intent = IntentUtils.newIntent(this, SettingsActivity.class);
startActivity(intent); startActivity(intent);
return true; return true;
case R.id.track_list_feedback: case R.id.track_list_help_feedback:
GoogleFeedbackUtils.bindFeedback(this);
return true;
case R.id.track_list_help:
intent = IntentUtils.newIntent(this, HelpActivity.class); intent = IntentUtils.newIntent(this, HelpActivity.class);
startActivity(intent); startActivity(intent);
return true; return true;
@@ -172,4 +172,11 @@ public class Api11Adapter extends Api10Adapter {
public boolean hasDialogTitleDivider() { public boolean hasDialogTitleDivider() {
return true; return true;
} }
@Override
public void setTitleAndSubtitle(Activity activity, String title, String subtitle) {
ActionBar actionBar = activity.getActionBar();
actionBar.setTitle(title);
actionBar.setSubtitle(subtitle);
}
} }
@@ -155,6 +155,11 @@ public class Api8Adapter implements ApiAdapter {
return false; return false;
} }
@Override
public void setTitleAndSubtitle(Activity activity, String title, String subtitle) {
activity.setTitle(title + " " + subtitle);
}
@Override @Override
public boolean handleSearchKey(MenuItem menuItem) { public boolean handleSearchKey(MenuItem menuItem) {
// Return false and allow the framework to handle the search key. // Return false and allow the framework to handle the search key.
@@ -192,6 +192,13 @@ public interface ApiAdapter {
*/ */
public boolean hasDialogTitleDivider(); public boolean hasDialogTitleDivider();
/**
* Sets title and subtitle.
* <p>
* Due to changes in API level 11;
*/
public void setTitleAndSubtitle(Activity activity, String title, String subtitle);
/** /**
* Handles the search key press. Returns true if handled. * Handles the search key press. Returns true if handled.
* <p> * <p>