forked from upstream-mirrors/OpenTracks
Add menu items to Help and Feedback page
This commit is contained in:
@@ -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>
|
|
||||||
@@ -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>
|
|
||||||
@@ -26,6 +26,13 @@ limitations under the License.
|
|||||||
</ScrollView>
|
</ScrollView>
|
||||||
<View style="@style/BottomButtonDivider" />
|
<View style="@style/BottomButtonDivider" />
|
||||||
<LinearLayout style="@style/BottomButtonBar" >
|
<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>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
|
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
<Button
|
<!-- android:icon="@drawable/ic_menu_feedback" -->
|
||||||
android:id="@+id/help_ok"
|
<item
|
||||||
android:layout_gravity="left"
|
android:id="@+id/help_play_store"
|
||||||
android:text="@string/generic_ok"
|
android:title="@string/menu_help_play_store"/>
|
||||||
style="@style/BottomButton" />
|
<item
|
||||||
<Button
|
android:id="@+id/help_eula"
|
||||||
android:id="@+id/help_about"
|
android:title="@string/menu_help_eula"/>
|
||||||
android:layout_gravity="right"
|
<item
|
||||||
android:text="@string/help_about"
|
android:id="@+id/help_forum"
|
||||||
style="@style/BottomButton" />
|
android:title="@string/menu_help_forum"/>
|
||||||
</merge>
|
</menu>
|
||||||
@@ -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_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="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&hl=%1$s</string>
|
<string name="my_tracks_help_url">http://support.google.com/gmm/bin/topic.py?topic=2391064&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_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="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="permission_notification_value">com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS</string>
|
||||||
<string name="sensor_type_value_ant">ANT</string>
|
<string name="sensor_type_value_ant">ANT</string>
|
||||||
|
|||||||
@@ -16,32 +16,6 @@ limitations under the License.
|
|||||||
-->
|
-->
|
||||||
<resources>
|
<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 -->
|
<!-- Activity Type -->
|
||||||
<string name="activity_type_airplane"
|
<string name="activity_type_airplane"
|
||||||
translation_description="When entering an 'Activity type', in the auto-complete text box, the
|
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
|
Any required attribution or notice for the third party content may be found at
|
||||||
%1$s/legalnotices.
|
%1$s/legalnotices.
|
||||||
</string>
|
</string>
|
||||||
<string name="eula_title"
|
|
||||||
translation_description="The title for the 'Terms of Service' dialog.">
|
|
||||||
Terms of Service
|
|
||||||
</string>
|
|
||||||
|
|
||||||
<!-- Export -->
|
<!-- Export -->
|
||||||
<string name="export_all_option"
|
<string name="export_all_option"
|
||||||
@@ -1137,18 +1107,42 @@ 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_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"
|
<string name="menu_help_feedback"
|
||||||
translation_description="In the menu, to go to the help and feedback page.
|
translation_description="In the menu, to go to the help and feedback page.
|
||||||
|
|
||||||
Character limit: ~20 (1 line)">
|
Character limit: ~20 (1 line)">
|
||||||
Help & feedback
|
Help & feedback
|
||||||
</string>
|
</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"
|
<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.
|
||||||
|
|
||||||
|
|||||||
@@ -16,17 +16,19 @@
|
|||||||
|
|
||||||
package com.google.android.apps.mytracks;
|
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;
|
||||||
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.ApiAdapterFactory;
|
||||||
|
import com.google.android.apps.mytracks.util.GoogleFeedbackUtils;
|
||||||
import com.google.android.apps.mytracks.util.SystemUtils;
|
import com.google.android.apps.mytracks.util.SystemUtils;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
|
|
||||||
@@ -37,7 +39,7 @@ import java.util.Locale;
|
|||||||
*
|
*
|
||||||
* @author Sandor Dornbush
|
* @author Sandor Dornbush
|
||||||
*/
|
*/
|
||||||
public class HelpActivity extends AbstractMyTracksActivity implements AboutCaller, EulaCaller {
|
public class HelpActivity extends AbstractMyTracksActivity implements EulaCaller {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -57,15 +59,11 @@ public class HelpActivity extends AbstractMyTracksActivity implements AboutCalle
|
|||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
webView.setWebViewClient(new WebViewClient());
|
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) {
|
public void onClick(View v) {
|
||||||
finish();
|
GoogleFeedbackUtils.bindFeedback(HelpActivity.this);
|
||||||
}
|
|
||||||
});
|
|
||||||
findViewById(R.id.help_about).setOnClickListener(new OnClickListener() {
|
|
||||||
public void onClick(View v) {
|
|
||||||
new AboutDialogFragment().show(
|
|
||||||
getSupportFragmentManager(), AboutDialogFragment.ABOUT_DIALOG_TAG);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -76,9 +74,33 @@ public class HelpActivity extends AbstractMyTracksActivity implements AboutCalle
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAboutLicense() {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
EulaDialogFragment.newInstance(true)
|
getMenuInflater().inflate(R.menu.help, menu);
|
||||||
.show(getSupportFragmentManager(), EulaDialogFragment.EULA_DIALOG_TAG);
|
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
|
@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);
|
Linkify.addLinks(message, Linkify.WEB_URLS);
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setMessage(message)
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setMessage(message)
|
||||||
.setTitle(R.string.eula_title);
|
.setTitle(R.string.menu_help_eula);
|
||||||
|
|
||||||
if (hasAccepted) {
|
if (hasAccepted) {
|
||||||
builder.setPositiveButton(R.string.generic_ok, null);
|
builder.setPositiveButton(R.string.generic_ok, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user