mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
merge heads
This commit is contained in:
@@ -708,6 +708,10 @@ limitations under the License.
|
||||
%1$s name. E.g., 'Track 1'.">
|
||||
Name: %1$s
|
||||
</string>
|
||||
<string name="generic_no"
|
||||
translation_description="The text on a button to say no.">
|
||||
No
|
||||
</string>
|
||||
<string name="generic_ok"
|
||||
translation_description="The text on a button to say ok.">
|
||||
OK
|
||||
@@ -732,7 +736,11 @@ limitations under the License.
|
||||
translation_description="The title on an alert dialog indicating success.">
|
||||
Success
|
||||
</string>
|
||||
|
||||
<string name="generic_yes"
|
||||
translation_description="The text on a button to say yes.">
|
||||
Yes
|
||||
</string>
|
||||
|
||||
<!-- Gps -->
|
||||
<string name="gps_google_location_settings"
|
||||
translation_description="In Android, the Google location settings to modify location settings
|
||||
@@ -3081,16 +3089,4 @@ limitations under the License.
|
||||
completion suggestion for a waypoint.">
|
||||
waypoint
|
||||
</string>
|
||||
|
||||
<!-- Welcome -->
|
||||
<string name="welcome_message"
|
||||
translation_description="The message of the welcome dialog. Note that \n is the newline
|
||||
character.">
|
||||
Welcome to My Tracks. Use this app to record your GPS tracks, aggregate your stats over time,
|
||||
and share your paths with friends.\n\nHappy Exploring,\nThe My Tracks Team
|
||||
</string>
|
||||
<string name="welcome_title"
|
||||
translation_description="The title of the welcome dialog.">
|
||||
Welcome to My Tracks
|
||||
</string>
|
||||
</resources>
|
||||
|
||||
@@ -32,8 +32,6 @@ import com.google.android.apps.mytracks.fragments.EnableSyncDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.EnableSyncDialogFragment.EnableSyncCaller;
|
||||
import com.google.android.apps.mytracks.fragments.EulaDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.EulaDialogFragment.EulaCaller;
|
||||
import com.google.android.apps.mytracks.fragments.WelcomeDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.WelcomeDialogFragment.WelcomeCaller;
|
||||
import com.google.android.apps.mytracks.io.file.ImportActivity;
|
||||
import com.google.android.apps.mytracks.io.file.SaveActivity;
|
||||
import com.google.android.apps.mytracks.io.file.TrackFileFormat;
|
||||
@@ -98,7 +96,7 @@ import java.util.Locale;
|
||||
* @author Leif Hendrik Wilden
|
||||
*/
|
||||
public class TrackListActivity extends AbstractSendToGoogleActivity
|
||||
implements EulaCaller, WelcomeCaller, EnableSyncCaller, ConfirmCaller, DeleteOneTrackCaller {
|
||||
implements EulaCaller, EnableSyncCaller, ConfirmCaller, DeleteOneTrackCaller {
|
||||
|
||||
private static final String TAG = TrackListActivity.class.getSimpleName();
|
||||
private static final String START_GPS_KEY = "start_gps_key";
|
||||
@@ -692,13 +690,6 @@ public class TrackListActivity extends AbstractSendToGoogleActivity
|
||||
EulaDialogFragment.newInstance(false)
|
||||
.show(getSupportFragmentManager(), EulaDialogFragment.EULA_DIALOG_TAG);
|
||||
}
|
||||
} else if (EulaUtils.getShowWelcome(this)) {
|
||||
Fragment fragment = getSupportFragmentManager()
|
||||
.findFragmentByTag(WelcomeDialogFragment.WELCOME_DIALOG_TAG);
|
||||
if (fragment == null) {
|
||||
new WelcomeDialogFragment().show(
|
||||
getSupportFragmentManager(), WelcomeDialogFragment.WELCOME_DIALOG_TAG);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Before the welcome sequence, the empty view is not visible so that it
|
||||
@@ -719,12 +710,6 @@ public class TrackListActivity extends AbstractSendToGoogleActivity
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWelcomeDone() {
|
||||
EulaUtils.setShowWelcome(this);
|
||||
showStartupDialogs();
|
||||
}
|
||||
|
||||
private void checkGooglePlayServices() {
|
||||
int code = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
|
||||
if (code != ConnectionResult.SUCCESS) {
|
||||
|
||||
@@ -107,8 +107,8 @@ public class ConfirmDialogFragment extends DialogFragment {
|
||||
checkBox = (CheckBox) view.findViewById(R.id.confirm_dialog_check_box);
|
||||
|
||||
return new AlertDialog.Builder(fragmentActivity).setNegativeButton(
|
||||
android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
R.string.generic_no, null)
|
||||
.setPositiveButton(R.string.generic_yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
int confirmId = getArguments().getInt(KEY_CONFIRM_ID);
|
||||
|
||||
+2
-2
@@ -79,12 +79,12 @@ public class EnableSyncDialogFragment extends DialogFragment {
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
return new AlertDialog.Builder(fragmentActivity).setMessage(R.string.enable_sync_message)
|
||||
.setNegativeButton(R.string.generic_cancel, new OnClickListener() {
|
||||
.setNegativeButton(R.string.generic_no, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
caller.onEnableSyncDone(false);
|
||||
}
|
||||
}).setPositiveButton(R.string.generic_ok, new OnClickListener() {
|
||||
}).setPositiveButton(R.string.generic_yes, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
caller.onEnableSyncDone(true);
|
||||
|
||||
+3
-2
@@ -46,8 +46,8 @@ public class InstallEarthDialogFragment extends DialogFragment {
|
||||
fragmentActivity = getActivity();
|
||||
return new AlertDialog.Builder(fragmentActivity)
|
||||
.setMessage(R.string.track_detail_install_earth_message)
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
.setNegativeButton(R.string.generic_no, null)
|
||||
.setPositiveButton(R.string.generic_yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Intent intent = new Intent().setData(Uri.parse(SaveActivity.GOOGLE_EARTH_MARKET_URL));
|
||||
@@ -60,6 +60,7 @@ public class InstallEarthDialogFragment extends DialogFragment {
|
||||
}
|
||||
}
|
||||
})
|
||||
.setTitle(R.string.generic_confirm_title)
|
||||
.create();
|
||||
}
|
||||
}
|
||||
@@ -1,81 +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.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
|
||||
/**
|
||||
* A DialogFrament to show the welcome info.
|
||||
*
|
||||
* @author Jimmy Shih
|
||||
*/
|
||||
public class WelcomeDialogFragment extends DialogFragment {
|
||||
|
||||
/**
|
||||
* Interface for caller of this dialog fragment.
|
||||
*
|
||||
* @author Jimmy Shih
|
||||
*/
|
||||
public interface WelcomeCaller {
|
||||
|
||||
/**
|
||||
* Called when choose account is done.
|
||||
*/
|
||||
public void onWelcomeDone();
|
||||
}
|
||||
|
||||
public static final String WELCOME_DIALOG_TAG = "welcomeDialog";
|
||||
|
||||
private WelcomeCaller caller;
|
||||
private FragmentActivity fragmentActivity;
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
try {
|
||||
caller = (WelcomeCaller) activity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(
|
||||
activity.toString() + " must implement " + WelcomeCaller.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
fragmentActivity = getActivity();
|
||||
return new AlertDialog.Builder(fragmentActivity).setPositiveButton(
|
||||
R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
caller.onWelcomeDone();
|
||||
}
|
||||
}).setTitle(R.string.welcome_title).setMessage(R.string.welcome_message).create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface arg0) {
|
||||
caller.onWelcomeDone();
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public class GoogleSettingsActivity extends AbstractSettingsActivity {
|
||||
final String newValue = bundle.getString(ACCOUNT_NAME_KEY);
|
||||
alertDialog.setMessage(
|
||||
getString(R.string.settings_google_account_confirm_message, googleAccount));
|
||||
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, getString(android.R.string.ok),
|
||||
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, getString(R.string.generic_yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface d, int button) {
|
||||
|
||||
@@ -61,8 +61,8 @@ public class DialogUtils {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context)
|
||||
.setCancelable(true)
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.setNegativeButton(android.R.string.cancel, cancelListener)
|
||||
.setPositiveButton(android.R.string.ok, okListener)
|
||||
.setNegativeButton(R.string.generic_no, cancelListener)
|
||||
.setPositiveButton(R.string.generic_yes, okListener)
|
||||
.setTitle(R.string.generic_confirm_title);
|
||||
if (messageId != -1) {
|
||||
builder.setMessage(messageId);
|
||||
|
||||
@@ -30,7 +30,6 @@ public class EulaUtils {
|
||||
|
||||
// Accepting Google mobile terms of service
|
||||
private static final String ACCEPT_EULA_PREFERENCE_KEY = "eula.google_mobile_tos_accepted";
|
||||
private static final String SHOW_WELCOME_PREFERENCE_KEY = "showWelcome";
|
||||
private static final String SHOW_ENABLE_SYNC_PREFERENCE_KEY = "showEnableSync";
|
||||
|
||||
private EulaUtils() {}
|
||||
@@ -43,14 +42,6 @@ public class EulaUtils {
|
||||
setValue(context, ACCEPT_EULA_PREFERENCE_KEY, true);
|
||||
}
|
||||
|
||||
public static boolean getShowWelcome(Context context) {
|
||||
return getValue(context, SHOW_WELCOME_PREFERENCE_KEY, true);
|
||||
}
|
||||
|
||||
public static void setShowWelcome(Context context) {
|
||||
setValue(context, SHOW_WELCOME_PREFERENCE_KEY, false);
|
||||
}
|
||||
|
||||
public static boolean getShowEnableSync(Context context) {
|
||||
return getValue(context, SHOW_ENABLE_SYNC_PREFERENCE_KEY, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user