mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-05 02:53:06 +02:00
Break TOS into paragraphs to match the existing strings in the
translation console. Thus we do not need to retranslate the TOS.
This commit is contained in:
@@ -266,7 +266,7 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
case DIALOG_EULA_ID:
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.eula_title);
|
||||
builder.setMessage(R.string.eula_message);
|
||||
builder.setMessage(EulaUtil.getEulaMessage(this));
|
||||
builder.setPositiveButton(R.string.eula_accept, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks;
|
||||
|
||||
import com.google.android.apps.mytracks.util.EulaUtil;
|
||||
import com.google.android.apps.mytracks.util.SystemUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
@@ -77,7 +78,7 @@ public class WelcomeActivity extends Activity {
|
||||
case DIALOG_EULA_ID:
|
||||
builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.eula_title);
|
||||
builder.setMessage(R.string.eula_message);
|
||||
builder.setMessage(EulaUtil.getEulaMessage(this));
|
||||
builder.setPositiveButton(R.string.generic_ok, null);
|
||||
builder.setCancelable(true);
|
||||
return builder.create();
|
||||
|
||||
@@ -15,19 +15,30 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks.util;
|
||||
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
|
||||
/**
|
||||
* Utilities for the EULA preference value.
|
||||
* Utilities for EULA.
|
||||
*/
|
||||
public class EulaUtil {
|
||||
private static final String EULA_PREFERENCE_FILE = "eula";
|
||||
|
||||
|
||||
// Accepting Google mobile terms of service
|
||||
private static final String EULA_PREFERENCE_KEY = "eula.google_mobile_tos_accepted";
|
||||
|
||||
private static final String COPYRIGHT = "©2011";
|
||||
private static final String LEGAL_NOTICES_URL = "m.google.com/legalnotices";
|
||||
private static final String PRIVACY_URL = "m.google.com/privacy";
|
||||
private static final String YOUTUBE_TOS_URL = "m.google.com/tos_youtube";
|
||||
private static final String MAPS_TOS_URL = "m.google.com/tos_maps";
|
||||
private static final String BUZZ_TOS_URL = "m.google.com/tos_buzz";
|
||||
private static final String BOOKS_TOS_URL = "m.google.com/tos_books";
|
||||
private static final String GOOGLE_TOS_URL = "m.google.com/utos";
|
||||
|
||||
private EulaUtil() {}
|
||||
|
||||
public static boolean getEulaValue(Context context) {
|
||||
@@ -43,4 +54,30 @@ public class EulaUtil {
|
||||
editor.putBoolean(EULA_PREFERENCE_KEY, true);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
|
||||
public static String getEulaMessage(Context context) {
|
||||
String item1 = String.format(context.getString(R.string.eula_message_item1), YOUTUBE_TOS_URL,
|
||||
MAPS_TOS_URL, BUZZ_TOS_URL, BOOKS_TOS_URL, GOOGLE_TOS_URL);
|
||||
String item3 = String.format(context.getString(R.string.eula_message_item3), PRIVACY_URL);
|
||||
String footer = String.format(
|
||||
context.getString(R.string.eula_message_footer), LEGAL_NOTICES_URL);
|
||||
|
||||
return context.getString(R.string.eula_message_date)
|
||||
+ "\n\n"
|
||||
+ context.getString(R.string.eula_message_header)
|
||||
+ "\n\n"
|
||||
+ context.getString(R.string.eula_message_body)
|
||||
+ "\n\n"
|
||||
+ item1
|
||||
+ "\n\n"
|
||||
+ context.getString(R.string.eula_message_item2)
|
||||
+ "\n\n"
|
||||
+ item3
|
||||
+ "\n\n"
|
||||
+ context.getString(R.string.eula_message_item4)
|
||||
+ "\n\n"
|
||||
+ footer
|
||||
+ "\n\n"
|
||||
+ COPYRIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user