merge from main

This commit is contained in:
Jimmy Shih
2012-03-23 14:48:06 -07:00
7 changed files with 101 additions and 224 deletions
+45 -69
View File
@@ -14,89 +14,65 @@ 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.
--> -->
<ScrollView <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent"
android:layout_height="wrap_content" android:layout_width="fill_parent" >
android:layout_width="fill_parent">
<LinearLayout <LinearLayout
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:orientation="vertical" android:orientation="vertical"
android:padding="10dp"> android:padding="8dp" >
<!-- Title --> <TextView
<LinearLayout android:drawableLeft="@drawable/arrow_icon"
android:drawablePadding="8dp"
android:gravity="center"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_width="wrap_content"
android:orientation="horizontal"> style="@android:style/TextAppearance.DeviceDefault.Medium"
<ImageView android:text="@string/about_copyright_notice" />
android:contentDescription="@string/my_tracks_app_name"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/arrow_icon"/>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/my_tracks_app_name"
android:textSize="30sp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:text="@string/about_copyright_notice"
android:textSize="16sp"/>
</LinearLayout>
</LinearLayout>
<!-- Team -->
<TextView <TextView
android:text="@string/about_team" android:layout_height="wrap_content"
style="@style/AboutLabel"/> android:layout_width="wrap_content"
<TextView style="@android:style/TextAppearance.DeviceDefault.Large"
android:text="@string/about_bart" android:text="@string/about_version" />
style="@style/AboutItem"/>
<TextView
android:text="@string/about_dylan"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_jimmy"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_leif"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_rodrigo"
style="@style/AboutItem"/>
<TextView
android:text="@string/about_sandor"
style="@style/AboutItem"/>
<!-- Version -->
<TextView
android:text="@string/about_version"
style="@style/AboutLabel"/>
<TextView <TextView
android:id="@+id/about_version" android:id="@+id/about_version"
style="@style/AboutItem"/> android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="48dp"
style="@android:style/TextAppearance.DeviceDefault.Medium" />
<!-- Support -->
<TextView <TextView
android:text="@string/about_support" android:layout_height="wrap_content"
style="@style/AboutLabel"/> android:layout_width="wrap_content"
<TextView style="@android:style/TextAppearance.DeviceDefault.Large"
android:text="@string/my_tracks_support_url" android:text="@string/about_support" />
style="@style/AboutUrl"/>
<!-- Privacy -->
<TextView <TextView
android:text="@string/about_privacy" android:autoLink="web"
style="@style/AboutLabel"/> android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="48dp"
style="@android:style/TextAppearance.DeviceDefault.Medium"
android:text="@string/my_tracks_support_url" />
<TextView <TextView
android:text="@string/my_tracks_privacy_url" android:layout_height="wrap_content"
style="@style/AboutUrl"/> android:layout_width="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Large"
android:text="@string/about_privacy" />
<TextView
android:autoLink="web"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="48dp"
style="@android:style/TextAppearance.DeviceDefault.Medium"
android:text="@string/my_tracks_privacy_url" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
-6
View File
@@ -16,12 +16,6 @@ limitations under the License.
--> -->
<resources> <resources>
<!-- DO NOT TRANSLATE ANY STRINGS IN THIS FILE. --> <!-- DO NOT TRANSLATE ANY STRINGS IN THIS FILE. -->
<string name="about_bart">Bart Niechwiej</string>
<string name="about_dylan">Dylan Casey</string>
<string name="about_jimmy">Jimmy Shih</string>
<string name="about_leif">Leif Wilden</string>
<string name="about_rodrigo">Rodrigo Damazio</string>
<string name="about_sandor">Sandor Dornbush</string>
<string name="color_mode_dynamic_percentage_default">25</string> <string name="color_mode_dynamic_percentage_default">25</string>
<string name="color_mode_fixed_medium_default">15</string> <string name="color_mode_fixed_medium_default">15</string>
<string name="color_mode_fixed_slow_default">9</string> <string name="color_mode_fixed_slow_default">9</string>
+18 -72
View File
@@ -44,13 +44,6 @@ limitations under the License.
Screenshot: about.png"> Screenshot: about.png">
Support: Support:
</string> </string>
<string name="about_team"
translation_description="In the 'About My Tracks' page, label for the team members. E.g.,
'Team: Bart Niechwiej'.
Screenshot: about.png">
Team:
</string>
<string name="about_version" <string name="about_version"
translation_description="In the 'About My Tracks' page, label for the version number. E.g., translation_description="In the 'About My Tracks' page, label for the version number. E.g.,
'Version: 1.1.11'. 'Version: 1.1.11'.
@@ -627,85 +620,38 @@ limitations under the License.
<!-- EULA --> <!-- EULA -->
<string name="eula_accept" <string name="eula_accept"
translation_description="In the 'Terms of service' dialog, the button to accept. translation_description="In the 'Terms of Service' dialog, the button to accept.">
Screenshot: eula.png">
Accept Accept
</string> </string>
<string name="eula_decline" <string name="eula_decline"
translation_description="In the 'Terms of service' dialog, the button to decline. translation_description="In the 'Terms of Service' dialog, the button to decline.">
Screenshot: eula.png">
Decline Decline
</string> </string>
<string name="eula_message_body" <string name="eula_date"
translation_description="The body in the Google mobile terms of service. See translation_description="The date in the 'Terms of Service'. See
http://m.google.com/toscountry."> http://m.google.com/toscountry.">
By using Google\'s mobile products and services ("Services"), you: March 1, 2012
</string> </string>
<string name="eula_message_date" <string name="eula_footer"
translation_description="The date in the Google mobile terms of service. See translation_description="The footer in the 'Terms of Service'. See
http://m.google.com/toscountry.">
December 1, 2010
</string>
<string name="eula_message_footer"
translation_description="The footer in the Google mobile terms of service. See
http://m.google.com/toscountry. http://m.google.com/toscountry.
%1$s: host name, 'm.google.com'"> %1$s: host name, 'm.google.com'">
The Services may contain third party content. Any required attribution or notice for the third Any required attribution or notice for the third party content may be found at
party content may be found at %1$s/legalnotices. %1$s/legalnotices.
</string> </string>
<string name="eula_message_header" <string name="eula_body"
translation_description="The header in the Google mobile terms of service. See translation_description="The body in the 'Terms of Service. See http://m.google.com/toscountry.
http://m.google.com/toscountry.">
Mobile Terms of Service
</string>
<string name="eula_message_item1"
translation_description="The first item in the Google mobile terms of service. See
http://m.google.com/toscountry.
%1$s: host name, 'm.google.com' %1$s: host name, 'm.google.com'">
%2$s: host name, 'm.google.com' By using Google\'s mobile products and services ("Services"), you agree to be bound by a) the
%3$s: host name, 'm.google.com' YouTube Terms of Use (%1$s/tos_youtube) for YouTube-related Services, b) the Google Maps Terms
%4$s: host name, 'm.google.com' and Conditions (%1$s/tos_maps) for mapping, local and location-based Services, c) the Google
%5$s: host name, 'm.google.com'"> Books Terms of Service (%1$s/tos_books) for Books-related Services, and e) the Google Terms of
Agree to be bound by these terms and a) the YouTube Terms of Use (%1$s/tos_youtube) for Service (%1$s/utos) for all other Services, as updated from time to time.
YouTube-related Services, b) the Google Maps Terms and Conditions (%2$s/tos_maps) for mapping,
local and location-based Services, c) the Google Buzz Terms and Conditions for Google
Buzz-related Services (%3$s/tos_buzz), d) the Google Books Terms of Service (%4$s/tos_books) for
Books-related Services, and e) the Google Terms of Service (%5$s/utos) for all other Services,
as updated from time to time. You may use the Services only as set forth in these agreements. Do
not manipulate while driving.
</string>
<string name="eula_message_item2"
translation_description="The second item in the Google mobile terms of service. See
http://m.google.com/toscountry.">
Acknowledge and agree that third parties may offer Services, and that you may be subject to
third party terms and that third parties may enforce terms against you. Google is not
responsible for third party changes to the Services.
</string>
<string name="eula_message_item3"
translation_description="The third item in the Google mobile terms of service. See
http://m.google.com/toscountry.
%1$s: host name, 'm.google.com'">
Consent to the collection, use, sharing, and onward transfer of your data, including but not
limited to voice and location data, as outlined in the Mobile Privacy Policy (%1$s/privacy).
Location data may be from mixed sources and may not be accurate. Use at your own risk.
</string>
<string name="eula_message_item4"
translation_description="The fourth item in the Google mobile terms of service. See
http://m.google.com/toscountry.">
Acknowledge that certain Services require phone service, data access or text messaging
capability. Except as otherwise noted, Google does not charge for the Services, but carrier
rates for phone, data and text messaging may apply.
</string> </string>
<string name="eula_title" <string name="eula_title"
translation_description="The title for the 'Terms of service' dialog, asking the user to accept translation_description="The title for the 'Terms of Service' dialog.">
or decline.
Screenshot: eula.png">
Terms of Service Terms of Service
</string> </string>
-27
View File
@@ -17,33 +17,6 @@ limitations under the License.
<resources> <resources>
<style name="ThemeSelector" parent="android:Theme" /> <style name="ThemeSelector" parent="android:Theme" />
<!-- About page label -->
<style name="AboutLabel">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:paddingBottom">2dp</item>
<item name="android:textSize">20sp</item>
</style>
<!-- About page item -->
<style name="AboutItem">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:paddingBottom">2dp</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:textSize">18sp</item>
</style>
<!-- About page url -->
<style name="AboutUrl">
<item name="android:autoLink">web</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:paddingBottom">2dp</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:textSize">18sp</item>
</style>
<!-- Button --> <!-- Button -->
<style name="Button"> <style name="Button">
<item name="android:layout_height">fill_parent</item> <item name="android:layout_height">fill_parent</item>
@@ -284,8 +284,8 @@ public class MyTracks extends TabActivity implements OnTouchListener {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
EulaUtils.setEulaValue(MyTracks.this); EulaUtils.setEulaValue(MyTracks.this);
Intent startIntent = new Intent(MyTracks.this, WelcomeActivity.class); startActivityForResult(
startActivityForResult(startIntent, Constants.WELCOME); new Intent(MyTracks.this, WelcomeActivity.class), Constants.WELCOME);
} }
}) })
.setTitle(R.string.eula_title) .setTitle(R.string.eula_title)
@@ -24,7 +24,6 @@ import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.TextView; import android.widget.TextView;
@@ -57,31 +56,31 @@ public class WelcomeActivity extends Activity {
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
AlertDialog.Builder builder;
switch (id) { switch (id) {
case DIALOG_ABOUT_ID: case DIALOG_ABOUT_ID:
LayoutInflater layoutInflator = LayoutInflater.from(this); View view = getLayoutInflater().inflate(R.layout.about, null);
View view = layoutInflator.inflate(R.layout.about, null); TextView aboutVersion = (TextView) view.findViewById(R.id.about_version);
TextView aboutVersionTextView = (TextView) view.findViewById(R.id.about_version); aboutVersion.setText(SystemUtils.getMyTracksVersion(this));
aboutVersionTextView.setText(SystemUtils.getMyTracksVersion(this));
return new AlertDialog.Builder(this)
builder = new AlertDialog.Builder(this); .setCancelable(true)
builder.setView(view); .setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() {
builder.setPositiveButton(R.string.generic_ok, null); @Override
builder.setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) {
@Override showDialog(DIALOG_EULA_ID);
public void onClick(DialogInterface dialog, int which) { }
showDialog(DIALOG_EULA_ID); })
} .setPositiveButton(R.string.generic_ok, null)
}); .setTitle(R.string.my_tracks_app_name)
return builder.create(); .setView(view)
.create();
case DIALOG_EULA_ID: case DIALOG_EULA_ID:
builder = new AlertDialog.Builder(this); return new AlertDialog.Builder(this)
builder.setTitle(R.string.eula_title); .setCancelable(true)
builder.setMessage(EulaUtils.getEulaMessage(this)); .setMessage(EulaUtils.getEulaMessage(this))
builder.setPositiveButton(R.string.generic_ok, null); .setPositiveButton(R.string.generic_ok, null)
builder.setCancelable(true); .setTitle(R.string.eula_title)
return builder.create(); .create();
default: default:
return null; return null;
} }
@@ -25,53 +25,42 @@ import java.util.Calendar;
/** /**
* Utilities for EULA. * Utilities for EULA.
*
* @author Jimmy Shih
*/ */
public class EulaUtils { public class EulaUtils {
private static final String EULA_PREFERENCE_FILE = "eula"; private static final String EULA_PREFERENCE_FILE = "eula";
// Accepting Google mobile terms of service // Accepting Google mobile terms of service
private static final String EULA_PREFERENCE_KEY = "eula.google_mobile_tos_accepted"; private static final String EULA_PREFERENCE_KEY = "eula.google_mobile_tos_accepted";
// Google's mobile page
private static final String HOST_NAME = "m.google.com"; private static final String HOST_NAME = "m.google.com";
private EulaUtils() {} private EulaUtils() {}
public static boolean getEulaValue(Context context) { public static boolean getEulaValue(Context context) {
SharedPreferences preferences = context.getSharedPreferences( SharedPreferences sharedPreferences = context.getSharedPreferences(
EULA_PREFERENCE_FILE, Context.MODE_PRIVATE); EULA_PREFERENCE_FILE, Context.MODE_PRIVATE);
return preferences.getBoolean(EULA_PREFERENCE_KEY, false); return sharedPreferences.getBoolean(EULA_PREFERENCE_KEY, false);
} }
public static void setEulaValue(Context context) { public static void setEulaValue(Context context) {
SharedPreferences preferences = context.getSharedPreferences( SharedPreferences sharedPreferences = context.getSharedPreferences(
EULA_PREFERENCE_FILE, Context.MODE_PRIVATE); EULA_PREFERENCE_FILE, Context.MODE_PRIVATE);
Editor editor = preferences.edit(); Editor editor = sharedPreferences.edit();
editor.putBoolean(EULA_PREFERENCE_KEY, true); editor.putBoolean(EULA_PREFERENCE_KEY, true);
ApiAdapterFactory.getApiAdapter().applyPreferenceChanges(editor); ApiAdapterFactory.getApiAdapter().applyPreferenceChanges(editor);
} }
public static String getEulaMessage(Context context) { public static String getEulaMessage(Context context) {
String item1 = String.format(context.getString(R.string.eula_message_item1), HOST_NAME, return context.getString(R.string.eula_date)
HOST_NAME, HOST_NAME, HOST_NAME, HOST_NAME);
String item3 = String.format(context.getString(R.string.eula_message_item3), HOST_NAME);
String footer = String.format(context.getString(R.string.eula_message_footer), HOST_NAME);
String copyright = "©" + Calendar.getInstance().get(Calendar.YEAR);
return context.getString(R.string.eula_message_date)
+ "\n\n" + "\n\n"
+ context.getString(R.string.eula_message_header) + context.getString(R.string.eula_body, HOST_NAME)
+ "\n\n" + "\n\n"
+ context.getString(R.string.eula_message_body) + context.getString(R.string.eula_footer, HOST_NAME)
+ "\n\n" + "\n\n"
+ "1. " + item1 + "©" + Calendar.getInstance().get(Calendar.YEAR);
+ "\n\n"
+ "2. " + context.getString(R.string.eula_message_item2)
+ "\n\n"
+ "3. " + item3
+ "\n\n"
+ "4. " + context.getString(R.string.eula_message_item4)
+ "\n\n"
+ footer
+ "\n\n"
+ copyright;
} }
} }