@@ -69,7 +69,7 @@ public class FragmentCurrent extends Fragment implements View.OnClickListener {
69
69
private View view ;
70
70
private EditText cropSearch ;
71
71
private ArrayList <ReportHistory > mapdataList ;
72
-
72
+ private ArrayList < ReportHistory > secondCurrentHistoryList ;
73
73
private static final int GPS_ENABLE_REQUEST_CODE = 2001 ;
74
74
private static final int PERMISSIONS_REQUEST_CODE = 100 ;
75
75
String [] REQUIRED_PERMISSIONS = {Manifest .permission .ACCESS_FINE_LOCATION , Manifest .permission .ACCESS_COARSE_LOCATION };
@@ -209,22 +209,24 @@ private void setMarker(){
209
209
210
210
public void search (String charText ) {
211
211
// 문자 입력시마다 리스트를 지우고 새로 뿌려준다.
212
+
213
+
212
214
currentHistoryList .clear ();
213
215
214
216
// 문자 입력이 없을때는 모든 데이터를 보여준다.
215
217
if (charText .length () == 0 ) {
216
- currentHistoryList .addAll (searchHistoryList );
218
+ currentHistoryList .addAll (secondCurrentHistoryList );
217
219
}
218
220
else
219
221
{
220
222
// 리스트의 모든 데이터를 검색한다.
221
- for (int i = 0 ;i < searchHistoryList .size (); i ++)
223
+ for (int i = 0 ;i < secondCurrentHistoryList .size (); i ++)
222
224
{
223
225
// arraylist의 모든 데이터에 입력받은 단어(charText)가 포함되어 있으면 true를 반환한다.
224
- if (searchHistoryList .get (i ).getCropName ().toLowerCase ().contains (charText ))
226
+ if (secondCurrentHistoryList .get (i ).getCropName ().toLowerCase ().contains (charText ))
225
227
{
226
228
// 검색된 데이터를 리스트에 추가한다.
227
- currentHistoryList .add (searchHistoryList .get (i ));
229
+ currentHistoryList .add (secondCurrentHistoryList .get (i ));
228
230
}
229
231
}
230
232
}
@@ -252,8 +254,9 @@ private void persingData(JSONObject jsonObject){
252
254
String symptom = obj .getString ("symptom" );
253
255
String pestName = obj .getString ("pest_name" );
254
256
String isSolved = obj .getString ("whether_to_solve" );
257
+ String imageUrl =obj .getString ("image_url" );
255
258
256
- mapdataList .add (new ReportHistory (productName ,details ,latitude ,longitude ,id ,address ,title ,date ,symptom ,pestName ,isSolved ));
259
+ mapdataList .add (new ReportHistory (imageUrl , productName ,details ,latitude ,longitude ,id ,address ,title ,date ,symptom ,pestName ,isSolved ));
257
260
}
258
261
259
262
}catch (JSONException e ) {
@@ -330,6 +333,8 @@ private void setCurrentHistoryList() {
330
333
currentHistoryView .setAdapter (currentHistoryAdapter );
331
334
332
335
336
+ secondCurrentHistoryList = new ArrayList <>();
337
+ secondCurrentHistoryList .addAll (currentHistoryList );
333
338
334
339
335
340
currentHistoryView .setOnItemClickListener (new AdapterView .OnItemClickListener () {
0 commit comments