Add menu items to Help and Feedback page

This commit is contained in:
Jimmy Shih
2014-01-08 15:46:41 -08:00
parent 33886cc2ad
commit 68f84c5d39
9 changed files with 87 additions and 224 deletions
-29
View File
@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- In v14, postive button on the right. -->
<Button
android:id="@+id/help_about"
android:layout_gravity="left"
android:text="@string/help_about"
style="@style/BottomButton" />
<Button
android:id="@+id/help_ok"
android:layout_gravity="right"
android:text="@string/generic_ok"
style="@style/BottomButton" />
</merge>
-49
View File
@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/ScrollView" >
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical"
android:padding="8dp" >
<TextView
android:drawableLeft="@drawable/ic_launcher_my_tracks"
android:text="@string/about_copyright_notice"
style="@style/TextMedium.WithIcon" />
<TextView
android:text="@string/about_version"
style="@style/TextLarge" />
<TextView
android:id="@+id/about_version"
style="@style/AboutValue" />
<TextView
android:text="@string/about_support"
style="@style/TextLarge" />
<TextView
android:autoLink="web"
android:text="@string/my_tracks_support_url"
style="@style/AboutValue" />
<TextView
android:text="@string/about_privacy"
style="@style/TextLarge" />
<TextView
android:autoLink="web"
android:text="@string/my_tracks_privacy_url"
style="@style/AboutValue" />
</LinearLayout>
</ScrollView>
+8 -1
View File
@@ -26,6 +26,13 @@ limitations under the License.
</ScrollView>
<View style="@style/BottomButtonDivider" />
<LinearLayout style="@style/BottomButtonBar" >
<include layout="@layout/help_buttons" />
<Button
android:id="@+id/help_feedback"
android:layout_gravity="center"
android:text="@string/menu_feedback"
android:textAllCaps="true"
android:textColor="@android:color/white"
android:textSize="14sp"
style="@style/BottomButton" />
</LinearLayout>
</LinearLayout>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2012 Google Inc.
Copyright 2014 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -14,15 +14,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<Button
android:id="@+id/help_ok"
android:layout_gravity="left"
android:text="@string/generic_ok"
style="@style/BottomButton" />
<Button
android:id="@+id/help_about"
android:layout_gravity="right"
android:text="@string/help_about"
style="@style/BottomButton" />
</merge>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- android:icon="@drawable/ic_menu_feedback" -->
<item
android:id="@+id/help_play_store"
android:title="@string/menu_help_play_store"/>
<item
android:id="@+id/help_eula"
android:title="@string/menu_help_eula"/>
<item
android:id="@+id/help_forum"
android:title="@string/menu_help_forum"/>
</menu>
-2
View File
@@ -79,9 +79,7 @@ Google은 이용자에 대한 위치정보의 이용∙제공사실을 위치정
<string name="marker_statistics_icon_url">http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png</string>
<string name="marker_waypoint_icon_url">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string>
<string name="my_tracks_help_url">http://support.google.com/gmm/bin/topic.py?topic=2391064&amp;hl=%1$s</string>
<string name="my_tracks_privacy_url">www.google.com/policies/privacy/</string>
<string name="my_tracks_recording_service_name">My Tracks Recording Service</string>
<string name="my_tracks_support_url">groups.google.com/a/googleproductforums.com/forum/#!categories/maps/mytracks</string>
<string name="my_tracks_web_url">www.google.com/mobile/mytracks</string>
<string name="permission_notification_value">com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS</string>
<string name="sensor_type_value_ant">ANT</string>
+27 -33
View File
@@ -16,32 +16,6 @@ limitations under the License.
-->
<resources>
<!-- About -->
<string name="about_copyright_notice"
translation_description="In the 'About My Tracks' page, the copyright notice.">
Copyright 2013 Google Inc.
</string>
<string name="about_license"
translation_description="In the 'About My Tracks' page, the button on the bottom to open the
'Terms of service' dialog.">
License
</string>
<string name="about_privacy"
translation_description="In the 'About My Tracks' page, label for the privacy link. E.g.,
'Privacy: m.google.com/privacy'.">
Privacy:
</string>
<string name="about_support"
translation_description="In the 'About My Tracks' page, label for the support link. E.g.,
'Support: mytracks.appspot.com'.">
Support:
</string>
<string name="about_version"
translation_description="In the 'About My Tracks' page, label for the version number. E.g.,
'Version: 1.1.11'.">
Version:
</string>
<!-- Activity Type -->
<string name="activity_type_airplane"
translation_description="When entering an 'Activity type', in the auto-complete text box, the
@@ -601,10 +575,6 @@ limitations under the License.
Any required attribution or notice for the third party content may be found at
%1$s/legalnotices.
</string>
<string name="eula_title"
translation_description="The title for the 'Terms of Service' dialog.">
Terms of Service
</string>
<!-- Export -->
<string name="export_all_option"
@@ -1027,7 +997,7 @@ limitations under the License.
</string>
<string name="marker_delete_all_confirm_message"
translation_description="When deleting all markers, the confirmation message.">
All markers for this track will be permanently deleted from the device.
All markers for this track will be permanently deleted from the device.
</string>
<string name="marker_delete_one_confirm_message"
translation_description="When deleting one marker, the confirmation message.">
@@ -1039,7 +1009,7 @@ limitations under the License.
</string>
<string name="marker_delete_multiple_confirm_message"
translation_description="When deleting multiple markers, the confirmation message.">
The selected markers will be permanently deleted from the device.
The selected markers will be permanently deleted from the device.
</string>
<string name="marker_label_end"
translation_description="When inserting a marker to indicate the end of a track, the marker's
@@ -1074,7 +1044,7 @@ limitations under the License.
%1$d totalt. E.g., '5'.">
%1$d of %2$d
</string>
<!-- Marker Detail -->
<string name="marker_detail_statistics_title"
translation_description="In the marker detail page, the title for the statistics section
@@ -1137,18 +1107,42 @@ limitations under the License.
Character limit: ~20 (1 line)">
Export all
</string>
<string name="menu_feedback"
translation_description="In the menu, to enter feedback.
Character limit: ~20 (1 line)">
Feedback
</string>
<string name="menu_help"
translation_description="In the menu, to go to the help page.
Character limit: ~20 (1 line)">
Help
</string>
<string name="menu_help_eula"
translation_description="In the menu, to go to the terms of service page.
Character limit: ~20 (1 line)">
Terms of service
</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_help_forum"
translation_description="In the menu, to go to the help forum.
Character limit: ~20 (1 line)">
Help forum
</string>
<string name="menu_help_play_store"
translation_description="In the menu, to go to the My Tracks Google Play Store page.
Character limit: ~20 (1 line)">
View in Google Play Store
</string>
<string name="menu_import_all"
translation_description="In the menu, to import all the tracks from the external storage.
@@ -16,17 +16,19 @@
package com.google.android.apps.mytracks;
import com.google.android.apps.mytracks.fragments.AboutDialogFragment;
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.EulaCaller;
import com.google.android.apps.mytracks.util.ApiAdapterFactory;
import com.google.android.apps.mytracks.util.GoogleFeedbackUtils;
import com.google.android.apps.mytracks.util.SystemUtils;
import com.google.android.maps.mytracks.R;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
@@ -37,7 +39,7 @@ import java.util.Locale;
*
* @author Sandor Dornbush
*/
public class HelpActivity extends AbstractMyTracksActivity implements AboutCaller, EulaCaller {
public class HelpActivity extends AbstractMyTracksActivity implements EulaCaller {
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -47,7 +49,7 @@ public class HelpActivity extends AbstractMyTracksActivity implements AboutCalle
+ SystemUtils.getMyTracksVersion(this);
ApiAdapterFactory.getApiAdapter()
.setTitleAndSubtitle(this, getString(R.string.menu_help), subtitle);
WebView webView = (WebView) findViewById(R.id.help_webview);
String language = Locale.getDefault().getLanguage();
if (language == null || language.equals("")) {
@@ -57,15 +59,11 @@ public class HelpActivity extends AbstractMyTracksActivity implements AboutCalle
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
findViewById(R.id.help_ok).setOnClickListener(new OnClickListener() {
findViewById(R.id.help_feedback).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
findViewById(R.id.help_about).setOnClickListener(new OnClickListener() {
public void onClick(View v) {
new AboutDialogFragment().show(
getSupportFragmentManager(), AboutDialogFragment.ABOUT_DIALOG_TAG);
GoogleFeedbackUtils.bindFeedback(HelpActivity.this);
}
});
}
@@ -76,9 +74,33 @@ public class HelpActivity extends AbstractMyTracksActivity implements AboutCalle
}
@Override
public void onAboutLicense() {
EulaDialogFragment.newInstance(true)
.show(getSupportFragmentManager(), EulaDialogFragment.EULA_DIALOG_TAG);
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.help, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Intent intent;
switch (item.getItemId()) {
case R.id.help_play_store:
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.google.android.maps.mytracks"));
startActivity(intent);
return true;
case R.id.help_eula:
EulaDialogFragment.newInstance(true)
.show(getSupportFragmentManager(), EulaDialogFragment.EULA_DIALOG_TAG);
return true;
case R.id.help_forum:
intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(
"http://groups.google.com/a/googleproductforums.com/forum/#!categories/maps/mytracks/"));
startActivity(intent);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
@@ -1,80 +0,0 @@
/*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.android.apps.mytracks.fragments;
import com.google.android.apps.mytracks.util.SystemUtils;
import com.google.android.maps.mytracks.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.TextView;
/**
* A DialogFragment to show information about My Tracks.
*
* @author Jimmy Shih
*/
public class AboutDialogFragment extends AbstractMyTracksDialogFragment {
/**
* Interface for caller of this dialog fragment.
*
* @author Jimmy Shih
*/
public interface AboutCaller {
/**
* Called when about license is invoked.
*/
public void onAboutLicense();
}
public static final String ABOUT_DIALOG_TAG = "aboutDialog";
private AboutCaller caller;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
caller = (AboutCaller) activity;
} catch (ClassCastException e) {
throw new ClassCastException(
activity.toString() + " must implement " + AboutCaller.class.getSimpleName());
}
}
@Override
protected Dialog createDialog() {
FragmentActivity fragmentActivity = getActivity();
View view = fragmentActivity.getLayoutInflater().inflate(R.layout.about, null);
TextView aboutVersion = (TextView) view.findViewById(R.id.about_version);
aboutVersion.setText(SystemUtils.getMyTracksVersion(fragmentActivity));
return new AlertDialog.Builder(fragmentActivity).setNegativeButton(
R.string.about_license, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
caller.onAboutLicense();
}
}).setPositiveButton(R.string.generic_ok, null).setTitle(R.string.help_about).setView(view)
.create();
}
}
@@ -90,7 +90,7 @@ public class EulaDialogFragment extends AbstractMyTracksDialogFragment {
Linkify.addLinks(message, Linkify.WEB_URLS);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setMessage(message)
.setTitle(R.string.eula_title);
.setTitle(R.string.menu_help_eula);
if (hasAccepted) {
builder.setPositiveButton(R.string.generic_ok, null);