Remove welcome screen

This commit is contained in:
Jimmy Shih
2013-04-17 17:17:00 -07:00
parent 9410ed0acc
commit ff2a6fd241
4 changed files with 1 additions and 118 deletions
-12
View File
@@ -3081,16 +3081,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) {
@@ -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();
}
}
@@ -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);
}