a437ef42 by chiangbt

update 3.27.10.49

1 parent 9502c15b
This file is too large to display.
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1},"path":"app-release.apk","properties":{"packageId":"com.pashanhoo.landsurvey","split":"","minSdkVersion":"21"}}]
\ No newline at end of file
package com.pashanhoo.landsurvey.search;
import android.content.Context;
import android.support.v4.view.AsyncLayoutInflater;
import android.widget.Filter;
import com.arlib.floatingsearchview.FloatingSearchView;
/**
* Created by jiangbotao on 2018/3/27.
*/
public class DataHelper {
public interface OnFindSuggestionsListener {
void onResults(String[] results);
}
public static void findSuggestions(FloatingSearchView.OnQueryChangeListener context, String query, final int limit, final long simulatedDelay, final OnFindSuggestionsListener listener){
new Filter(){
@Override
protected FilterResults performFiltering(CharSequence constraint) {
try {
Thread.sleep(simulatedDelay);
} catch (InterruptedException e) {
e.printStackTrace();
}
FilterResults results = new FilterResults();
return results;
}
@Override
protected void publishResults(CharSequence charSequence, FilterResults filterResults) {
}
}.filter(query);
}
}
package com.pashanhoo.landsurvey.search;
import android.annotation.SuppressLint;
import android.os.Parcel;
import com.arlib.floatingsearchview.suggestions.model.SearchSuggestion;
/**
* Created by jiangbotao on 2018/3/27.
*/
@SuppressLint("ParcelCreator")
public class POISuggestion implements SearchSuggestion {
private String name;
private String address;
private float lng;
private float lat;
private boolean mIsHistory = false;
public POISuggestion(String suggestion){
this.name = suggestion.toLowerCase();
}
public POISuggestion(String name, String address, String lonlat){
this.name = name;
this.address = address;
String[] position = lonlat.split(" ");
this.lng = Float.parseFloat((position[0]));
this.lat = Float.parseFloat(position[1]);
}
public POISuggestion(Parcel source) {
this.name = source.readString();
this.mIsHistory = source.readInt() != 0;
}
public void setIsHistory(boolean isHistory) {
this.mIsHistory = isHistory;
}
public boolean getIsHistory() {
return this.mIsHistory;
}
@Override
public String getBody() {
return name;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(name);
parcel.writeInt(mIsHistory ? 1 : 0);
}
public static final Creator<POISuggestion> CREATOR = new Creator<POISuggestion>() {
@Override
public POISuggestion createFromParcel(Parcel in) {
return new POISuggestion(in);
}
@Override
public POISuggestion[] newArray(int size) {
return new POISuggestion[size];
}
};
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public float getLng() {
return lng;
}
public void setLng(long lng) {
this.lng = lng;
}
public float getLat() {
return lat;
}
public void setLat(long lat) {
this.lat = lat;
}
}
......@@ -33,6 +33,7 @@
app:floatingSearch_searchHint="地名地址检索..."
app:floatingSearch_suggestionsListAnimDuration="250"
app:floatingSearch_showSearchKey="false"
app:floatingSearch_leftActionMode="showSearch"
app:floatingSearch_menu="@menu/menu_main"
app:floatingSearch_close_search_on_keyboard_dismiss="true"/>
......