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
limitations under the License.
-->
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent" >
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical"
android:padding="10dp">
android:padding="8dp" >
<!-- Title -->
<LinearLayout
<TextView
android:drawableLeft="@drawable/arrow_icon"
android:drawablePadding="8dp"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal">
<ImageView
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>
android:layout_width="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Medium"
android:text="@string/about_copyright_notice" />
<!-- Team -->
<TextView
android:text="@string/about_team"
style="@style/AboutLabel"/>
<TextView
android:text="@string/about_bart"
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"/>
android:layout_height="wrap_content"
android:layout_width="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Large"
android:text="@string/about_version" />
<TextView
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
android:text="@string/about_support"
style="@style/AboutLabel"/>
<TextView
android:text="@string/my_tracks_support_url"
style="@style/AboutUrl"/>
android:layout_height="wrap_content"
android:layout_width="wrap_content"
style="@android:style/TextAppearance.DeviceDefault.Large"
android:text="@string/about_support" />
<!-- Privacy -->
<TextView
android:text="@string/about_privacy"
style="@style/AboutLabel"/>
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_support_url" />
<TextView
android:text="@string/my_tracks_privacy_url"
style="@style/AboutUrl"/>
android:layout_height="wrap_content"
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>
</ScrollView>
-6
View File
@@ -16,12 +16,6 @@ limitations under the License.
-->
<resources>
<!-- 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_fixed_medium_default">15</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">
Support:
</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"
translation_description="In the 'About My Tracks' page, label for the version number. E.g.,
'Version: 1.1.11'.
@@ -627,85 +620,38 @@ limitations under the License.
<!-- EULA -->
<string name="eula_accept"
translation_description="In the 'Terms of service' dialog, the button to accept.
Screenshot: eula.png">
translation_description="In the 'Terms of Service' dialog, the button to accept.">
Accept
</string>
<string name="eula_decline"
translation_description="In the 'Terms of service' dialog, the button to decline.
Screenshot: eula.png">
translation_description="In the 'Terms of Service' dialog, the button to decline.">
Decline
</string>
<string name="eula_message_body"
translation_description="The body in the Google mobile terms of service. See
<string name="eula_date"
translation_description="The date in the 'Terms of Service'. See
http://m.google.com/toscountry.">
By using Google\'s mobile products and services ("Services"), you:
March 1, 2012
</string>
<string name="eula_message_date"
translation_description="The date in the Google mobile 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
<string name="eula_footer"
translation_description="The footer in the 'Terms of Service'. See
http://m.google.com/toscountry.
%1$s: host name, 'm.google.com'">
The Services may contain third party content. Any required attribution or notice for the third
party content may be found at %1$s/legalnotices.
Any required attribution or notice for the third party content may be found at
%1$s/legalnotices.
</string>
<string name="eula_message_header"
translation_description="The header in the Google mobile terms of service. See
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.
<string name="eula_body"
translation_description="The body in the 'Terms of Service. See http://m.google.com/toscountry.
%1$s: host name, 'm.google.com'
%2$s: host name, 'm.google.com'
%3$s: host name, 'm.google.com'
%4$s: host name, 'm.google.com'
%5$s: host name, 'm.google.com'">
Agree to be bound by these terms and a) the YouTube Terms of Use (%1$s/tos_youtube) for
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.
%1$s: host name, 'm.google.com'">
By using Google\'s mobile products and services ("Services"), you agree to be bound by a) the
YouTube Terms of Use (%1$s/tos_youtube) for YouTube-related Services, b) the Google Maps Terms
and Conditions (%1$s/tos_maps) for mapping, local and location-based Services, c) the Google
Books Terms of Service (%1$s/tos_books) for Books-related Services, and e) the Google Terms of
Service (%1$s/utos) for all other Services, as updated from time to time.
</string>
<string name="eula_title"
translation_description="The title for the 'Terms of service' dialog, asking the user to accept
or decline.
Screenshot: eula.png">
translation_description="The title for the 'Terms of Service' dialog.">
Terms of Service
</string>
-27
View File
@@ -17,33 +17,6 @@ limitations under the License.
<resources>
<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 -->
<style name="Button">
<item name="android:layout_height">fill_parent</item>
@@ -284,8 +284,8 @@ public class MyTracks extends TabActivity implements OnTouchListener {
@Override
public void onClick(DialogInterface dialog, int which) {
EulaUtils.setEulaValue(MyTracks.this);
Intent startIntent = new Intent(MyTracks.this, WelcomeActivity.class);
startActivityForResult(startIntent, Constants.WELCOME);
startActivityForResult(
new Intent(MyTracks.this, WelcomeActivity.class), Constants.WELCOME);
}
})
.setTitle(R.string.eula_title)
@@ -24,7 +24,6 @@ import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
@@ -57,31 +56,31 @@ public class WelcomeActivity extends Activity {
@Override
protected Dialog onCreateDialog(int id) {
AlertDialog.Builder builder;
switch (id) {
case DIALOG_ABOUT_ID:
LayoutInflater layoutInflator = LayoutInflater.from(this);
View view = layoutInflator.inflate(R.layout.about, null);
TextView aboutVersionTextView = (TextView) view.findViewById(R.id.about_version);
aboutVersionTextView.setText(SystemUtils.getMyTracksVersion(this));
builder = new AlertDialog.Builder(this);
builder.setView(view);
builder.setPositiveButton(R.string.generic_ok, null);
builder.setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
showDialog(DIALOG_EULA_ID);
}
});
return builder.create();
View view = getLayoutInflater().inflate(R.layout.about, null);
TextView aboutVersion = (TextView) view.findViewById(R.id.about_version);
aboutVersion.setText(SystemUtils.getMyTracksVersion(this));
return new AlertDialog.Builder(this)
.setCancelable(true)
.setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
showDialog(DIALOG_EULA_ID);
}
})
.setPositiveButton(R.string.generic_ok, null)
.setTitle(R.string.my_tracks_app_name)
.setView(view)
.create();
case DIALOG_EULA_ID:
builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.eula_title);
builder.setMessage(EulaUtils.getEulaMessage(this));
builder.setPositiveButton(R.string.generic_ok, null);
builder.setCancelable(true);
return builder.create();
return new AlertDialog.Builder(this)
.setCancelable(true)
.setMessage(EulaUtils.getEulaMessage(this))
.setPositiveButton(R.string.generic_ok, null)
.setTitle(R.string.eula_title)
.create();
default:
return null;
}
@@ -25,53 +25,42 @@ import java.util.Calendar;
/**
* Utilities for EULA.
*
* @author Jimmy Shih
*/
public class EulaUtils {
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";
// Google's mobile page
private static final String HOST_NAME = "m.google.com";
private EulaUtils() {}
public static boolean getEulaValue(Context context) {
SharedPreferences preferences = context.getSharedPreferences(
SharedPreferences sharedPreferences = context.getSharedPreferences(
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) {
SharedPreferences preferences = context.getSharedPreferences(
SharedPreferences sharedPreferences = context.getSharedPreferences(
EULA_PREFERENCE_FILE, Context.MODE_PRIVATE);
Editor editor = preferences.edit();
Editor editor = sharedPreferences.edit();
editor.putBoolean(EULA_PREFERENCE_KEY, true);
ApiAdapterFactory.getApiAdapter().applyPreferenceChanges(editor);
}
public static String getEulaMessage(Context context) {
String item1 = String.format(context.getString(R.string.eula_message_item1), HOST_NAME,
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)
return context.getString(R.string.eula_date)
+ "\n\n"
+ context.getString(R.string.eula_message_header)
+ "\n\n"
+ context.getString(R.string.eula_message_body)
+ "\n\n"
+ "1. " + item1
+ "\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;
+ context.getString(R.string.eula_body, HOST_NAME)
+ "\n\n"
+ context.getString(R.string.eula_footer, HOST_NAME)
+ "\n\n"
+ "©" + Calendar.getInstance().get(Calendar.YEAR);
}
}