Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
392589291f
9 changed files with 41 additions and 36 deletions
|
@ -14,6 +14,7 @@ import android.os.Build;
|
|||
import android.os.IBinder;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
|
@ -175,6 +176,12 @@ public class AndroidUtils {
|
|||
return res;
|
||||
}
|
||||
|
||||
public static void setSnackbarTextColor(Snackbar snackbar, @ColorRes int colorId) {
|
||||
View view = snackbar.getView();
|
||||
TextView tv = (TextView) view.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(view.getContext(), colorId));
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void setBackground(Context ctx, View view, boolean night, int lightResId, int darkResId) {
|
||||
|
|
|
@ -19,9 +19,9 @@ import android.view.MenuItem;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.Location;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.LockableViewPager;
|
||||
|
@ -444,9 +444,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
}
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
}
|
||||
|
@ -491,9 +489,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
|
|||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -20,8 +20,8 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.Location;
|
||||
import net.osmand.data.Amenity;
|
||||
import net.osmand.data.FavouritePoint;
|
||||
|
@ -206,9 +206,7 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
|
|||
updateAdapter();
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.MapMarkersHelper;
|
||||
import net.osmand.plus.MapMarkersHelper.MapMarker;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -169,9 +169,7 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel
|
|||
}
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ import android.view.MotionEvent;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.MapMarkersHelper;
|
||||
|
@ -184,9 +184,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
});
|
||||
|
@ -252,9 +250,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter<MapMarkerItemV
|
|||
notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import android.widget.CompoundButton;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.data.LatLon;
|
||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||
import net.osmand.plus.GpxSelectionHelper;
|
||||
|
@ -328,9 +329,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
updateDisplayedData();
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
}
|
||||
|
@ -417,9 +416,7 @@ public class MapMarkersGroupsAdapter extends RecyclerView.Adapter<RecyclerView.V
|
|||
app.getMapMarkersHelper().syncWithMarkers(group);
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ import android.support.v7.widget.RecyclerView;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.MapMarkersHelper.MapMarker;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -157,9 +157,7 @@ public class MapMarkersHistoryAdapter extends RecyclerView.Adapter<RecyclerView.
|
|||
app.getMapMarkersHelper().moveMapMarkerToHistory(marker);
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(app, R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -611,9 +611,7 @@ public class TrackPointFragment extends OsmandExpandableListFragment {
|
|||
super.onDismissed(transientBottomBar, event);
|
||||
}
|
||||
});
|
||||
View snackBarView = snackbar.getView();
|
||||
TextView tv = (TextView) snackBarView.findViewById(android.support.design.R.id.snackbar_action);
|
||||
tv.setTextColor(ContextCompat.getColor(getContext(), R.color.color_dialog_buttons_dark));
|
||||
AndroidUtils.setSnackbarTextColor(snackbar, R.color.color_dialog_buttons_dark);
|
||||
snackbar.show();
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ import net.osmand.search.core.ObjectType;
|
|||
import net.osmand.search.core.SearchResult;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -97,7 +98,22 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
|||
|
||||
showResult(sr);
|
||||
} else {
|
||||
dialogFragment.completeQueryWithObject(item.getSearchResult());
|
||||
if ((sr.objectType == ObjectType.CITY || sr.objectType == ObjectType.VILLAGE)
|
||||
&& sr.file != null && sr.object instanceof City) {
|
||||
City c = (City) sr.object;
|
||||
if (c.getStreets().isEmpty()) {
|
||||
try {
|
||||
sr.file.preloadStreets(c, null);
|
||||
if (c.getStreets().isEmpty()) {
|
||||
showResult(sr);
|
||||
return;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
dialogFragment.completeQueryWithObject(sr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -198,6 +214,7 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
|||
FavouritePoint fav = (FavouritePoint) object;
|
||||
pointDescription = fav.getPointDescription();
|
||||
break;
|
||||
case VILLAGE:
|
||||
case CITY:
|
||||
String cityName = searchResult.localeName;
|
||||
String typeNameCity = QuickSearchListItem.getTypeName(app, searchResult);
|
||||
|
|
Loading…
Reference in a new issue