commit
221406da90
1 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
package net.osmand.plus.settings;
|
package net.osmand.plus.settings;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
@ -26,6 +27,7 @@ import net.osmand.plus.ApplicationMode;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.OsmandSettings.CommonPreference;
|
import net.osmand.plus.OsmandSettings.CommonPreference;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.UiUtilities;
|
||||||
import net.osmand.plus.base.MapViewTrackingUtilities;
|
import net.osmand.plus.base.MapViewTrackingUtilities;
|
||||||
import net.osmand.plus.helpers.FontCache;
|
import net.osmand.plus.helpers.FontCache;
|
||||||
import net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet;
|
import net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet;
|
||||||
|
@ -276,7 +278,8 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showDrivingRegionDialog() {
|
private void showDrivingRegionDialog() {
|
||||||
final AlertDialog.Builder b = new AlertDialog.Builder(getActivity());
|
Context themedContext = UiUtilities.getThemedContext(getActivity(), isNightMode());
|
||||||
|
AlertDialog.Builder b = new AlertDialog.Builder(themedContext);
|
||||||
|
|
||||||
b.setTitle(getString(R.string.driving_region));
|
b.setTitle(getString(R.string.driving_region));
|
||||||
|
|
||||||
|
@ -297,14 +300,13 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
|
||||||
|
|
||||||
final int selected = sel;
|
final int selected = sel;
|
||||||
final ArrayAdapter<OsmandSettings.DrivingRegion> singleChoiceAdapter =
|
final ArrayAdapter<OsmandSettings.DrivingRegion> singleChoiceAdapter =
|
||||||
new ArrayAdapter<OsmandSettings.DrivingRegion>(getActivity(), R.layout.single_choice_description_item, R.id.text1, drs) {
|
new ArrayAdapter<OsmandSettings.DrivingRegion>(themedContext, R.layout.single_choice_description_item, R.id.text1, drs) {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
|
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
|
||||||
View v = convertView;
|
View v = convertView;
|
||||||
if (v == null) {
|
if (v == null) {
|
||||||
LayoutInflater inflater = getActivity().getLayoutInflater();
|
v = LayoutInflater.from(parent.getContext()).inflate(R.layout.single_choice_description_item, parent, false);
|
||||||
v = inflater.inflate(R.layout.single_choice_description_item, parent, false);
|
|
||||||
}
|
}
|
||||||
OsmandSettings.DrivingRegion item = getItem(position);
|
OsmandSettings.DrivingRegion item = getItem(position);
|
||||||
AppCompatCheckedTextView title = (AppCompatCheckedTextView) v.findViewById(R.id.text1);
|
AppCompatCheckedTextView title = (AppCompatCheckedTextView) v.findViewById(R.id.text1);
|
||||||
|
|
Loading…
Reference in a new issue