Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-02-27 12:39:30 +01:00
commit b6413294b7
3 changed files with 46 additions and 10 deletions

View file

@ -15,6 +15,7 @@ import net.osmand.IndexConstants;
import net.osmand.Location;
import net.osmand.PlatformUtil;
import net.osmand.access.AccessibilityPlugin;
import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.access.AccessibleToast;
import net.osmand.data.FavouritePoint;
import net.osmand.plus.GPXUtilities.GPXFile;
@ -58,7 +59,12 @@ import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.text.format.DateFormat;
import android.util.TypedValue;
import android.view.accessibility.AccessibilityManager;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import android.widget.Toast;
import btools.routingapp.BRouterServiceConnection;
import btools.routingapp.IBRouterService;
@ -357,11 +363,32 @@ public class OsmandApplication extends Application implements ClientContext {
String voiceProvider = osmandSettings.VOICE_PROVIDER.get();
if (voiceProvider == null || OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(voiceProvider)) {
if (warningNoneProvider && voiceProvider == null) {
Builder builder = new AlertDialog.Builder(uiContext);
Builder builder = new AccessibleAlertBuilder(uiContext);
LinearLayout ll = new LinearLayout(uiContext);
ll.setOrientation(LinearLayout.VERTICAL);
final TextView tv = new TextView(uiContext);
tv.setPadding(7, 3, 7, 0);
tv.setText(R.string.voice_is_not_available_msg);
tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 19);
ll.addView(tv);
final CheckBox cb = new CheckBox(uiContext);
cb.setText(R.string.remember_choice);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
lp.setMargins(7, 10, 7, 0);
cb.setLayoutParams(lp);
ll.addView(cb);
builder.setCancelable(true);
builder.setNegativeButton(R.string.default_buttons_cancel, null);
builder.setNegativeButton(R.string.default_buttons_cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(cb.isChecked()) {
osmandSettings.VOICE_PROVIDER.set(OsmandSettings.VOICE_PROVIDER_NOT_USE);
}
}
});
builder.setPositiveButton(R.string.default_buttons_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(uiContext, SettingsActivity.class);
@ -369,8 +396,11 @@ public class OsmandApplication extends Application implements ClientContext {
uiContext.startActivity(intent);
}
});
builder.setTitle(R.string.voice_is_not_available_title);
builder.setMessage(R.string.voice_is_not_available_msg);
builder.setView(ll);
//builder.setMessage(R.string.voice_is_not_available_msg);
builder.show();
}

View file

@ -39,4 +39,9 @@ public class OsmAndDialogs {
public static final int DIALOG_SHARE_LOCATION = 204;
public static final int DIALOG_SAVE_DIRECTIONS = 206;
public static final int DIALOG_START_GPS = 207;
public static int getPluginDialogId(int pluginId, int dialogId) {
return (pluginId + 3) * 100 + dialogId;
}
}

View file

@ -72,12 +72,13 @@ public class EditingPOIActivity implements DialogProvider {
// private final static Log log = LogUtil.getLog(EditingPOIActivity.class);
/* dialog stuff */
private static final int DIALOG_CREATE_POI = 200;
private static final int DIALOG_EDIT_POI = 201;
protected static final int DIALOG_SUB_CATEGORIES = 202;
protected static final int DIALOG_POI_TYPES = 203;
private static final int DIALOG_DELETE_POI = 204;
private static final int DIALOG_OPENING_HOURS = 205;
public static final int DIALOG_PLUGIN = 600;
private static final int DIALOG_CREATE_POI = DIALOG_PLUGIN + 0;
private static final int DIALOG_EDIT_POI = DIALOG_PLUGIN + 1;
protected static final int DIALOG_SUB_CATEGORIES = DIALOG_PLUGIN + 2;
protected static final int DIALOG_POI_TYPES = DIALOG_PLUGIN + 3;
private static final int DIALOG_DELETE_POI = DIALOG_PLUGIN + 4;
private static final int DIALOG_OPENING_HOURS = DIALOG_PLUGIN + 5;
private static final String KEY_AMENITY_NODE = "amenity_node";
private static final String KEY_AMENITY = "amenity";