Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-07-09 13:19:16 +02:00
commit 927ce1a4e2
5 changed files with 38 additions and 4 deletions

View file

@ -168,7 +168,8 @@ public class MapPoiTypes {
public Map<String, PoiType> getAllTranslatedNames(boolean skipNonEditable) { public Map<String, PoiType> getAllTranslatedNames(boolean skipNonEditable) {
Map<String, PoiType> translation = new HashMap<String, PoiType>(); Map<String, PoiType> translation = new HashMap<String, PoiType>();
for (PoiCategory pc : categories) { for (int i = 0; i < categories.size(); i++) {
PoiCategory pc = categories.get(i);
if (skipNonEditable && pc.isNotEditableOsm()) { if (skipNonEditable && pc.isNotEditableOsm()) {
continue; continue;
} }

View file

@ -15,7 +15,6 @@
android:id="@+id/map_quick_actions_button" android:id="@+id/map_quick_actions_button"
android:layout_width="@dimen/map_button_size" android:layout_width="@dimen/map_button_size"
android:layout_height="@dimen/map_button_size" android:layout_height="@dimen/map_button_size"
android:background="@drawable/btn_circle_blue"
android:contentDescription="@string/configure_screen_quick_action" android:contentDescription="@string/configure_screen_quick_action"
android:layout_gravity="bottom|right" android:layout_gravity="bottom|right"
android:visibility="gone" android:visibility="gone"

View file

@ -38,7 +38,7 @@ public class AudioVideoNoteRecordingMenuFullScreenFragment extends Fragment {
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
if (!dismissing) { if (!dismissing && menu != null) {
menu.finishRecording(); menu.finishRecording();
} }
} }

View file

@ -27,6 +27,8 @@ import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
@ -329,6 +331,22 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
listView.setAdapter(this.adapter); listView.setAdapter(this.adapter);
} }
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView absListView, int i) {
View currentFocus = getActivity().getCurrentFocus();
if (currentFocus != null) {
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0);
}
}
@Override
public void onScroll(AbsListView absListView, int i, int i1, int i2) {
}
});
return v; return v;
} }

View file

@ -3,6 +3,7 @@ package net.osmand.plus.views;
import android.content.Context; import android.content.Context;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.PointF; import android.graphics.PointF;
import android.graphics.drawable.Drawable;
import android.os.Vibrator; import android.os.Vibrator;
import android.support.annotation.DimenRes; import android.support.annotation.DimenRes;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
@ -73,7 +74,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
quickActionButton = (ImageButton) mapActivity.findViewById(R.id.map_quick_actions_button); quickActionButton = (ImageButton) mapActivity.findViewById(R.id.map_quick_actions_button);
setQuickActionButtonMargin(); setQuickActionButtonMargin();
isLayerOn = quickActionRegistry.isQuickActionOn(); isLayerOn = quickActionRegistry.isQuickActionOn();
quickActionButton.setImageResource(R.drawable.map_quick_action); setUpQuickActionBtnResources(app.getDaynightHelper().isNightModeForMapControls());
quickActionButton.setContentDescription(mapActivity.getString(R.string.configure_screen_quick_action)); quickActionButton.setContentDescription(mapActivity.getString(R.string.configure_screen_quick_action));
quickActionButton.setOnClickListener(new View.OnClickListener() { quickActionButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -293,6 +294,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
contextMarker.draw(canvas); contextMarker.draw(canvas);
} }
setUpQuickActionBtnVisibility(); setUpQuickActionBtnVisibility();
setUpQuickActionBtnResources(settings.isNightMode());
} }
private void setUpQuickActionBtnVisibility() { private void setUpQuickActionBtnVisibility() {
@ -306,6 +308,20 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
quickActionButton.setVisibility(hideQuickButton ? View.GONE : View.VISIBLE); quickActionButton.setVisibility(hideQuickButton ? View.GONE : View.VISIBLE);
} }
private void setUpQuickActionBtnResources(boolean nightMode) {
Drawable icon;
int backgroundId;
if (nightMode) {
backgroundId = R.drawable.btn_circle_night;
icon = app.getIconsCache().getIcon(R.drawable.map_quick_action, 0);
} else {
backgroundId = R.drawable.btn_circle_trans;
icon = app.getIconsCache().getIcon(R.drawable.map_quick_action, R.color.icon_color);
}
quickActionButton.setBackgroundResource(backgroundId);
quickActionButton.setImageDrawable(icon);
}
@Override @Override
public void destroyLayer() { public void destroyLayer() {