Add string resources

This commit is contained in:
Josephine Lim 2017-05-15 10:25:40 +02:00
parent e8f306a023
commit faa60dc824
2 changed files with 10 additions and 9 deletions

View file

@ -91,24 +91,23 @@ public class NearbyActivity extends BaseActivity {
protected void checkGps() {
LocationManager manager = (LocationManager)
getSystemService(LOCATION_SERVICE);
if(!manager.isProviderEnabled( LocationManager.GPS_PROVIDER )) {
LocationManager manager = (LocationManager) getSystemService(LOCATION_SERVICE);
if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
Timber.d("GPS is not enabled");
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setMessage("GPS is disabled in your device. Would you like to enable it?")
alertDialogBuilder.setMessage(R.string.gps_disabled)
.setCancelable(false)
.setPositiveButton("Enable GPS",
new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int id){
.setPositiveButton(R.string.enable_gps,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent callGPSSettingIntent = new Intent(
android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(callGPSSettingIntent);
}
});
alertDialogBuilder.setNegativeButton("Cancel",
new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int id){
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});

View file

@ -51,6 +51,8 @@
<string name="categories_search_text_hint">Search categories</string>
<string name="menu_save_categories">Save</string>
<string name="refresh_button">Refresh</string>
<string name="gps_disabled">GPS is disabled in your device. Would you like to enable it?</string>
<string name="enable_gps">Enable GPS</string>
<string name="contributions_subtitle_zero">No uploads yet</string>
<plurals name="contributions_subtitle">
<!--zero is not used in english. Category mentioned here for easy reference in future-->