显示问题
This commit is contained in:
12
ln_jq_app/android/app/proguard-rules.pro
vendored
12
ln_jq_app/android/app/proguard-rules.pro
vendored
@@ -61,28 +61,28 @@
|
|||||||
-dontwarn com.ta.**
|
-dontwarn com.ta.**
|
||||||
|
|
||||||
|
|
||||||
3D 地图 V5.0.0之前:
|
#3D 地图 V5.0.0之前:
|
||||||
-keep class com.amap.api.maps.**{*;}
|
-keep class com.amap.api.maps.**{*;}
|
||||||
-keep class com.autonavi.amap.mapcore.*{*;}
|
-keep class com.autonavi.amap.mapcore.*{*;}
|
||||||
-keep class com.amap.api.trace.**{*;}
|
-keep class com.amap.api.trace.**{*;}
|
||||||
|
|
||||||
3D 地图 V5.0.0之后:
|
#3D 地图 V5.0.0之后:
|
||||||
-keep class com.amap.api.maps.**{*;}
|
-keep class com.amap.api.maps.**{*;}
|
||||||
-keep class com.autonavi.**{*;}
|
-keep class com.autonavi.**{*;}
|
||||||
-keep class com.amap.api.trace.**{*;}
|
-keep class com.amap.api.trace.**{*;}
|
||||||
|
|
||||||
定位
|
#定位
|
||||||
-keep class com.amap.api.location.**{*;}
|
-keep class com.amap.api.location.**{*;}
|
||||||
-keep class com.amap.api.fence.**{*;}
|
-keep class com.amap.api.fence.**{*;}
|
||||||
-keep class com.autonavi.aps.amapapi.model.**{*;}
|
-keep class com.autonavi.aps.amapapi.model.**{*;}
|
||||||
|
|
||||||
搜索
|
#搜索
|
||||||
-keep class com.amap.api.services.**{*;}
|
-keep class com.amap.api.services.**{*;}
|
||||||
|
|
||||||
2D地图
|
#2D地图
|
||||||
-keep class com.amap.api.maps2d.**{*;}
|
-keep class com.amap.api.maps2d.**{*;}
|
||||||
-keep class com.amap.api.mapcore2d.**{*;}
|
-keep class com.amap.api.mapcore2d.**{*;}
|
||||||
|
|
||||||
导航
|
#导航
|
||||||
-keep class com.amap.api.navi.**{*;}
|
-keep class com.amap.api.navi.**{*;}
|
||||||
-keep class com.autonavi.**{*;}
|
-keep class com.autonavi.**{*;}
|
||||||
@@ -91,6 +91,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import io.flutter.plugin.platform.PlatformView;
|
import io.flutter.plugin.platform.PlatformView;
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
import okhttp3.Callback;
|
import okhttp3.Callback;
|
||||||
@@ -263,7 +264,20 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
|
|||||||
suggestionList.setDividerHeight(1);
|
suggestionList.setDividerHeight(1);
|
||||||
suggestionList.setDivider(new ColorDrawable(Color.LTGRAY));
|
suggestionList.setDivider(new ColorDrawable(Color.LTGRAY));
|
||||||
suggestionList.setPadding(dp2px(5), dp2px(5), dp2px(5), dp2px(5));
|
suggestionList.setPadding(dp2px(5), dp2px(5), dp2px(5), dp2px(5));
|
||||||
suggestionAdapter = new ArrayAdapter<>(context, android.R.layout.simple_list_item_1);
|
suggestionAdapter = new ArrayAdapter<String>(context, android.R.layout.simple_list_item_1, new ArrayList<>()) {
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||||
|
// 获取默认的 View
|
||||||
|
View view = super.getView(position, convertView, parent);
|
||||||
|
TextView text = view.findViewById(android.R.id.text1);
|
||||||
|
text.setTextColor(Color.parseColor("#333333"));
|
||||||
|
text.setTextSize(14);
|
||||||
|
view.setBackgroundColor(Color.TRANSPARENT);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
};
|
||||||
suggestionList.setAdapter(suggestionAdapter);
|
suggestionList.setAdapter(suggestionAdapter);
|
||||||
suggestionList.setVisibility(View.GONE);
|
suggestionList.setVisibility(View.GONE);
|
||||||
suggestionList.setOnItemClickListener((parent, view, position, id) -> {
|
suggestionList.setOnItemClickListener((parent, view, position, id) -> {
|
||||||
@@ -296,8 +310,8 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
|
|||||||
if (s.length() > 1) {
|
if (s.length() > 1) {
|
||||||
// 使用当前位置的城市进行搜索
|
// 使用当前位置的城市进行搜索
|
||||||
String city = currentLatLng != null ? "" : "";
|
String city = currentLatLng != null ? "" : "";
|
||||||
InputtipsQuery query = new InputtipsQuery(s.toString(), city);
|
InputtipsQuery query = new InputtipsQuery(s.toString(), "");
|
||||||
query.setCityLimit(true);
|
query.setCityLimit(false);
|
||||||
Inputtips inputtips = new Inputtips(mContext, query);
|
Inputtips inputtips = new Inputtips(mContext, query);
|
||||||
inputtips.setInputtipsListener(NativeMapView.this);
|
inputtips.setInputtipsListener(NativeMapView.this);
|
||||||
inputtips.requestInputtipsAsyn();
|
inputtips.requestInputtipsAsyn();
|
||||||
@@ -548,6 +562,9 @@ public class NativeMapView implements PlatformView, LocationSource, AMapLocation
|
|||||||
new Handler(Looper.getMainLooper()).post(() -> {
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
if (suggestionNames.size() > 0) {
|
if (suggestionNames.size() > 0) {
|
||||||
suggestionList.setVisibility(View.VISIBLE);
|
suggestionList.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
suggestionList.setBackgroundColor(Color.WHITE);
|
||||||
|
|
||||||
// 限制显示的高度
|
// 限制显示的高度
|
||||||
int height = Math.min(suggestionNames.size() * dp2px(45), dp2px(200));
|
int height = Math.min(suggestionNames.size() * dp2px(45), dp2px(200));
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||||
|
|||||||
Reference in New Issue
Block a user