mirror of
https://github.com/fergalmoran/chrometophone.git
synced 2025-12-22 09:41:51 +00:00
Parameterise PP country
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
2. Connect your Chrome and your phone.<br>3. Set your link action preference.<br><br>
|
2. Connect your Chrome and your phone.<br>3. Set your link action preference.<br><br>
|
||||||
By using this application, you agree to the <br>
|
By using this application, you agree to the <br>
|
||||||
<a href="{tos_link}">Terms of Service</a> and
|
<a href="{tos_link}">Terms of Service</a> and
|
||||||
<a href="http://m.google.com/privacy">Privacy Policy</a>
|
<a href="{pp_link}">Privacy Policy</a>.
|
||||||
</string>
|
</string>
|
||||||
<string name="help_text">
|
<string name="help_text">
|
||||||
Chrome to Phone lets you easily share links, maps, and currently selected phone numbers and text
|
Chrome to Phone lets you easily share links, maps, and currently selected phone numbers and text
|
||||||
@@ -52,6 +52,6 @@
|
|||||||
in the status bar which you can action manually. <br><br>
|
in the status bar which you can action manually. <br><br>
|
||||||
By using this application, you agree to the <br>
|
By using this application, you agree to the <br>
|
||||||
<a href="{tos_link}">Terms of Service</a> and
|
<a href="{tos_link}">Terms of Service</a> and
|
||||||
<a href="http://m.google.com/privacy">Privacy Policy</a>
|
<a href="{pp_link}">Privacy Policy</a>.
|
||||||
</string>
|
</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -15,12 +15,14 @@ public class HelpActivity extends Activity {
|
|||||||
setContentView(R.layout.help);
|
setContentView(R.layout.help);
|
||||||
|
|
||||||
TextView textView = (TextView) findViewById(R.id.help_text);
|
TextView textView = (TextView) findViewById(R.id.help_text);
|
||||||
String helpText = getString(R.string.help_text).replace("{tos_link}", getTosLink());
|
String helpText = getString(R.string.help_text)
|
||||||
|
.replace("{tos_link}", getTOSLink())
|
||||||
|
.replace("{pp_link}", getPPLink());
|
||||||
textView.setText(Html.fromHtml(helpText));
|
textView.setText(Html.fromHtml(helpText));
|
||||||
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTosLink() {
|
public static String getTOSLink() {
|
||||||
String link = "http://m.google.com/toscountry"; // default
|
String link = "http://m.google.com/toscountry"; // default
|
||||||
|
|
||||||
String country = Locale.getDefault().getCountry();
|
String country = Locale.getDefault().getCountry();
|
||||||
@@ -33,4 +35,18 @@ public class HelpActivity extends Activity {
|
|||||||
}
|
}
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getPPLink() {
|
||||||
|
String link = "http://m.google.com/privacy"; // default
|
||||||
|
|
||||||
|
String country = Locale.getDefault().getCountry();
|
||||||
|
if (country.equals("US")) {
|
||||||
|
link = "http://m.google.com/privacy";
|
||||||
|
} else if (country.equals("GB")) {
|
||||||
|
link = "http://m.google.co.uk/privacy";
|
||||||
|
} else if (country.equals("CA")) {
|
||||||
|
link = "http://m.google.ca/privacy";
|
||||||
|
}
|
||||||
|
return link;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,8 +142,9 @@ public class MainActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setIntroScreenContent() {
|
private void setIntroScreenContent() {
|
||||||
String introText =
|
String introText = getString(R.string.intro_text)
|
||||||
getString(R.string.intro_text).replace("{tos_link}", HelpActivity.getTosLink());
|
.replace("{tos_link}", HelpActivity.getTOSLink())
|
||||||
|
.replace("{pp_link}", HelpActivity.getPPLink());
|
||||||
TextView textView = (TextView) findViewById(R.id.intro_text);
|
TextView textView = (TextView) findViewById(R.id.intro_text);
|
||||||
textView.setText(Html.fromHtml(introText));
|
textView.setText(Html.fromHtml(introText));
|
||||||
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
|
|||||||
Reference in New Issue
Block a user