|
281
|
|
json = response.body().string();
|
|
282
|
|
Message msg = new Message();
|
|
283
|
|
msg.obj = json;
|
|
284
|
|
msg.what = 5;
|
|
285
|
|
handler.sendMessage(msg);
|
|
286
|
|
Log.e("url", json);
|
|
287
|
|
} catch (Exception e) {
|
|
288
|
|
e.printStackTrace();
|
|
289
|
|
Message msg = new Message();
|
|
290
|
|
msg.what = 3;
|
|
291
|
|
handler.sendMessage(msg);
|
|
292
|
|
}
|
|
|
128
|
SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);
|
|
|
129
|
Cursor cursor = sqLiteDatabase.rawQuery(sql, null);
|
|
|
130
|
while (cursor.moveToNext()) {
|
|
|
131
|
String id = cursor.getString(cursor.getColumnIndex("id"));
|
|
|
132
|
String status = cursor.getString(cursor.getColumnIndex("status"));
|
|
|
133
|
map.put(id, status);
|
|
293
|
134
|
}
|
|
|
135
|
cursor.close();
|
|
|
136
|
db.close();
|
|
294
|
137
|
} catch (Exception e) {
|
|
295
|
138
|
e.printStackTrace();
|
|
296
|
|
Message msg = new Message();
|
|
297
|
|
msg.what = 3;
|
|
298
|
|
handler.sendMessage(msg);
|
|
299
|
139
|
}
|
|
|
140
|
|
|
|
141
|
for (CollectData d : tmpList) {
|
|
|
142
|
if (map.get(d.getZhan_id()) != null) {
|
|
|
143
|
mCollectDataList.add(d);
|
|
|
144
|
}
|
|
|
145
|
}
|
|
|
146
|
return mCollectDataList;
|
|
300
|
147
|
}
|
|
301
|
148
|
|
|
302
|
|
@Override
|
|
303
|
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
|
|
149
|
public void onCollectItemClick(int currPos) {
|
|
|
150
|
this.currPos = currPos;
|
|
304
|
151
|
Intent intent = new Intent(this, NewZhanDetailsActivity.class);
|
|
305
|
|
currPos = i;
|
|
306
|
|
intent.putExtra("zhan_id", mCollect.get(i).getZhan_id());
|
|
|
152
|
intent.putExtra("zhan_id", mCollectDataList.get(currPos).getZhan_id());
|
|
307
|
153
|
startActivityForResult(intent, 3);
|
|
308
|
154
|
MainApplication.details_flag = "2";
|
|
309
|
155
|
}
|
|
310
|
156
|
|
|
311
|
|
@Override
|
|
312
|
|
public boolean onItemLongClick(AdapterView<?> adapterView, View view,
|
|
313
|
|
final int i, long l) {
|
|
314
|
|
//
|
|
315
|
|
// String[] str = new String[] { "删除记录", "取消" };
|
|
316
|
|
// Builder dialog = new Builder(MyCollectActivity.this)
|
|
317
|
|
// .setTitle("请选择").setItems(str,
|
|
318
|
|
// new DialogInterface.OnClickListener() {
|
|
319
|
|
// public void onClick(DialogInterface dialog,
|
|
320
|
|
// int which) {
|
|
321
|
|
// switch (which) {
|
|
322
|
|
// case 0:
|
|
323
|
|
// SharedPreferencesHelper sharedPreferencesHelper = new SharedPreferencesHelper(
|
|
324
|
|
// MyCollectActivity.this);
|
|
325
|
|
// sharedPreferencesHelper.removeData(list
|
|
326
|
|
// .get(i).getZhan_name());
|
|
327
|
|
// list.remove(i);
|
|
328
|
|
// Toast.makeText(MyCollectActivity.this,
|
|
329
|
|
// "该站信息已删除", Toast.LENGTH_SHORT)
|
|
330
|
|
// .show();
|
|
331
|
|
// adapter.notifyDataSetChanged();
|
|
332
|
|
// break;
|
|
333
|
|
// case 1:
|
|
334
|
|
// dialog.dismiss();
|
|
335
|
|
// break;
|
|
336
|
|
// default:
|
|
337
|
|
// System.out.println("default...");
|
|
338
|
|
// break;
|
|
339
|
|
// }
|
|
340
|
|
// }
|
|
341
|
|
// });
|
|
342
|
|
// dialog.create();
|
|
343
|
|
// dialog.show();
|
|
|
157
|
public void onCollectItemLongClick(int currPos) {
|
|
344
|
158
|
new AlertDialog(MyCollectActivity.this).builder().setTitle("删除该条收藏")
|
|
345
|
159
|
.setMsg("删除后将无法在我的收藏中查看该站信息,请确认是否删除?")
|
|
346
|
160
|
.setPositiveButton("删除记录", new View.OnClickListener() {
|
|
347
|
161
|
@Override
|
|
348
|
162
|
public void onClick(View v) {
|
|
349
|
|
sharedPreferencesHelper = new SharedPreferencesHelper(
|
|
350
|
|
MyCollectActivity.this);
|
|
|
163
|
sharedPreferencesHelper = new SharedPreferencesHelper(MyCollectActivity.this);
|
|
351
|
164
|
DatabaseHandler db = new DatabaseHandler(MyCollectActivity.this, "");
|
|
352
|
|
db.del(mCollect.get(i).getZhan_id());
|
|
353
|
|
sharedPreferencesHelper.removeData(mCollect
|
|
354
|
|
.get(i).getZhan_name());
|
|
355
|
|
currPos = i;
|
|
356
|
|
mCollect.remove(i);
|
|
357
|
|
Toast.makeText(MyCollectActivity.this,
|
|
358
|
|
"删除记录成功", Toast.LENGTH_SHORT)
|
|
359
|
|
.show();
|
|
360
|
|
// adapter.notifyDataSetChanged();
|
|
361
|
|
// DatabaseHandler db = new DatabaseHandler(MyCollectActivity.this,"");
|
|
362
|
|
Cursor c = db.query();
|
|
363
|
|
System.err.println(c.getCount());
|
|
364
|
|
if (c.getCount() <= 0) {
|
|
365
|
|
// Toast.makeText(this,"没有",Toast.LENGTH_SHORT).show();
|
|
366
|
|
collectListView.setVisibility(View.GONE);
|
|
367
|
|
ll_collect.setBackgroundResource(R.drawable.bg_collection2_0);
|
|
|
165
|
db.del(mCollectDataList.get(currPos).getZhan_id());
|
|
|
166
|
sharedPreferencesHelper.removeData(mCollectDataList.get(currPos).getZhan_name());
|
|
|
167
|
mCollectDataList.remove(currPos);
|
|
|
168
|
Toast.makeText(MyCollectActivity.this, "删除记录成功", Toast.LENGTH_SHORT).show();
|
|
368
|
169
|
|
|
369
|
|
return;
|
|
370
|
|
}
|
|
371
|
|
String[] from = {"zhan_name", "zhan_address", "fast_num", "slow_num"};
|
|
372
|
|
int[] to = {R.id.item_collect_title, R.id.collect_item_address, R.id.item_collect_descriptionOR, R.id.item_collect_descriptionTR};
|
|
373
|
|
mCollect.clear();
|
|
374
|
|
while (c.moveToNext()) {
|
|
375
|
|
collectData = new CollectData();
|
|
376
|
|
collectData.setZhan_id(c.getString(c
|
|
377
|
|
.getColumnIndex("zhan_id")));
|
|
378
|
|
collectData.setZhan_name(c.getString(c
|
|
379
|
|
.getColumnIndex("zhan_name")));
|
|
380
|
|
collectData.setZhan_address(c.getString(c
|
|
381
|
|
.getColumnIndex("zhan_address")));
|
|
382
|
|
collectData.setFast_num(c.getString(c
|
|
383
|
|
.getColumnIndex("fast_num")));
|
|
384
|
|
collectData.setSlow_num(c.getString(c
|
|
385
|
|
.getColumnIndex("slow_num")));
|
|
386
|
|
mCollect.add(collectData);
|
|
387
|
|
}
|
|
388
|
|
SimpleCursorAdapter adapter = new SimpleCursorAdapter(MyCollectActivity.this, R.layout.item_collect, c, from, to);
|
|
389
|
|
collectListView.setAdapter(adapter);
|
|
390
|
|
// Log.d("listSize",list.size()+"");
|
|
391
|
|
// getData();
|
|
392
|
|
// if (list.size() == 0){
|
|
393
|
|
// ImageView emptyView = new ImageView(MyCollectActivity.this);
|
|
394
|
|
// emptyView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
|
|
395
|
|
// emptyView.setImageResource(R.drawable.bg_collection2_0);
|
|
396
|
|
// ll_collect.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
|
|
397
|
|
// emptyView.setVisibility(View.GONE);
|
|
398
|
|
// ((ViewGroup)collectListView.getParent()).addView(emptyView);
|
|
399
|
|
// collectListView.setEmptyView(emptyView);
|
|
400
|
|
// }
|
|
|
170
|
List<CollectData> list = getCollectList();
|
|
|
171
|
myCollectAdapter.setData(list);
|
|
401
|
172
|
}
|
|
402
|
173
|
}).setNegativeButton("取消", new View.OnClickListener() {
|
|
403
|
174
|
@Override
|
|
404
|
175
|
public void onClick(View v) {
|
|
405
|
|
|
|
406
|
176
|
}
|
|
407
|
177
|
}).show();
|
|
408
|
|
|
|
409
|
|
return true;
|
|
410
|
178
|
}
|
|
411
|
179
|
|
|
412
|
180
|
@Override
|
|
413
|
181
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
414
|
|
|
|
415
|
182
|
//先判断是哪个页面返回过来的
|
|
416
|
183
|
switch (requestCode) {
|
|
417
|
184
|
case 3:
|
|
418
|
|
|
|
419
|
185
|
//再判断返回过来的情况,是成功还是失败还是其它的什么……
|
|
420
|
186
|
switch (resultCode) {
|
|
421
|
|
case 0:
|
|
422
|
|
Log.e("!!!", "没删除");
|
|
423
|
|
//没删除
|
|
424
|
|
// Log.e("!!!", "成功了");
|
|
425
|
|
// sharedPreferencesHelper = new SharedPreferencesHelper(
|
|
426
|
|
// MyCollectActivity.this);
|
|
427
|
|
// sharedPreferencesHelper.removeData(list
|
|
428
|
|
// .get(currPos).getZhan_name());
|
|
429
|
|
// list.remove(currPos);
|
|
430
|
|
// adapter.notifyDataSetChanged();
|
|
431
|
|
break;
|
|
432
|
|
case 1:
|
|
433
|
|
//删除
|
|
434
|
|
// String d = getIntent().getStringExtra("data");
|
|
|
187
|
case 1: // 删除
|
|
|
188
|
sharedPreferencesHelper = new SharedPreferencesHelper(MyCollectActivity.this);
|
|
|
189
|
sharedPreferencesHelper.removeData(mCollectDataList.get(currPos).getZhan_name());
|
|
|
190
|
mCollectDataList.remove(currPos);
|
|
435
|
191
|
|
|
436
|
|
Log.e("!!!", "删除");
|
|
437
|
|
// Log.e("!!!", d);
|
|
438
|
|
sharedPreferencesHelper = new SharedPreferencesHelper(
|
|
439
|
|
MyCollectActivity.this);
|
|
440
|
|
sharedPreferencesHelper.removeData(mCollect.get(currPos).getZhan_name());
|
|
441
|
|
mCollect.remove(currPos);
|
|
442
|
|
DatabaseHandler db = new DatabaseHandler(MyCollectActivity.this, "");
|
|
443
|
|
Cursor c = db.query();
|
|
444
|
|
System.err.println(c.getCount());
|
|
445
|
|
if (c.getCount() <= 0) {
|
|
446
|
|
collectListView.setVisibility(View.GONE);
|
|
447
|
|
ll_collect.setBackgroundResource(R.drawable.bg_collection2_0);
|
|
448
|
|
return;
|
|
449
|
|
}
|
|
450
|
|
String[] from = {"zhan_name", "zhan_address", "fast_num", "slow_num"};
|
|
451
|
|
int[] to = {R.id.item_collect_title, R.id.collect_item_address, R.id.item_collect_descriptionOR, R.id.item_collect_descriptionTR};
|
|
452
|
|
mCollect.clear();
|
|
453
|
|
while (c.moveToNext()) {
|
|
454
|
|
collectData = new CollectData();
|
|
455
|
|
collectData.setZhan_id(c.getString(c
|
|
456
|
|
.getColumnIndex("zhan_id")));
|
|
457
|
|
collectData.setZhan_name(c.getString(c
|
|
458
|
|
.getColumnIndex("zhan_name")));
|
|
459
|
|
collectData.setZhan_address(c.getString(c
|
|
460
|
|
.getColumnIndex("zhan_address")));
|
|
461
|
|
collectData.setFast_num(c.getString(c
|
|
462
|
|
.getColumnIndex("fast_num")));
|
|
463
|
|
collectData.setSlow_num(c.getString(c
|
|
464
|
|
.getColumnIndex("slow_num")));
|
|
465
|
|
mCollect.add(collectData);
|
|
466
|
|
}
|
|
467
|
|
SimpleCursorAdapter adapter = new SimpleCursorAdapter(MyCollectActivity.this, R.layout.item_collect, c, from, to);
|
|
468
|
|
collectListView.setAdapter(adapter);
|
|
469
|
|
/// adapter.notifyDataSetChanged();
|
|
470
|
|
// if (list.size() == 0) {
|
|
471
|
|
// ImageView emptyView = new ImageView(MyCollectActivity.this);
|
|
472
|
|
// emptyView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
|
|
473
|
|
// emptyView.setImageResource(R.drawable.bg_collection2_0);
|
|
474
|
|
// ll_collect.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
|
|
475
|
|
// emptyView.setVisibility(View.GONE);
|
|
476
|
|
// ((ViewGroup) collectListView.getParent()).addView(emptyView);
|
|
477
|
|
// collectListView.setEmptyView(emptyView);
|
|
478
|
|
// }
|
|
479
|
|
break;
|
|
|
192
|
List<CollectData> list = getCollectList();
|
|
|
193
|
myCollectAdapter.setData(list);
|
|
480
|
194
|
}
|
|
481
|
195
|
break;
|
|
482
|
|
// case REQUEST_B:
|
|
483
|
|
// //同上……
|
|
484
|
|
// break;
|
|
485
|
196
|
}
|
|
486
|
197
|
}
|
|
487
|
198
|
|
|
|
@ -0,0 +1,99 @@
|
|
|
1
|
package com.electric.chargingpile.adapter;
|
|
|
2
|
|
|
|
3
|
import android.content.Context;
|
|
|
4
|
import android.view.LayoutInflater;
|
|
|
5
|
import android.view.View;
|
|
|
6
|
import android.view.ViewGroup;
|
|
|
7
|
import android.widget.AdapterView;
|
|
|
8
|
import android.widget.LinearLayout;
|
|
|
9
|
import android.widget.TextView;
|
|
|
10
|
|
|
|
11
|
import androidx.annotation.NonNull;
|
|
|
12
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
13
|
|
|
|
14
|
import com.electric.chargingpile.R;
|
|
|
15
|
import com.electric.chargingpile.data.CollectData;
|
|
|
16
|
|
|
|
17
|
import java.util.ArrayList;
|
|
|
18
|
import java.util.List;
|
|
|
19
|
|
|
|
20
|
public class MyCollectAdapter extends RecyclerView.Adapter<MyCollectAdapter.MyCollectHolder> {
|
|
|
21
|
private Context mContext;
|
|
|
22
|
private LayoutInflater mLayoutInflater;
|
|
|
23
|
private List<CollectData> mCollect = new ArrayList<CollectData>();
|
|
|
24
|
|
|
|
25
|
public MyCollectAdapter(Context context, List<CollectData> list) {
|
|
|
26
|
mContext = context;
|
|
|
27
|
this.mCollect.addAll(list);
|
|
|
28
|
mLayoutInflater = LayoutInflater.from(context);
|
|
|
29
|
}
|
|
|
30
|
|
|
|
31
|
@NonNull
|
|
|
32
|
@Override
|
|
|
33
|
public MyCollectHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
|
34
|
View view = LayoutInflater.from(mContext).inflate(R.layout.item_collect, null);
|
|
|
35
|
return new MyCollectAdapter.MyCollectHolder(view);
|
|
|
36
|
}
|
|
|
37
|
|
|
|
38
|
@Override
|
|
|
39
|
public void onBindViewHolder(@NonNull MyCollectHolder holder, int position) {
|
|
|
40
|
CollectData collectData = mCollect.get(position);
|
|
|
41
|
holder.name.setText(collectData.getZhan_name());
|
|
|
42
|
holder.address.setText(collectData.getZhan_address());
|
|
|
43
|
|
|
|
44
|
holder.item.setOnClickListener(new View.OnClickListener() {
|
|
|
45
|
@Override
|
|
|
46
|
public void onClick(View v) {
|
|
|
47
|
if (onItemClickListener!=null) {
|
|
|
48
|
onItemClickListener.onItemClick(null, null, position, 0);
|
|
|
49
|
}
|
|
|
50
|
}
|
|
|
51
|
});
|
|
|
52
|
|
|
|
53
|
holder.item.setOnLongClickListener(new View.OnLongClickListener() {
|
|
|
54
|
@Override
|
|
|
55
|
public boolean onLongClick(View v) {
|
|
|
56
|
if (onItemLongClickListener != null) {
|
|
|
57
|
onItemLongClickListener.onItemLongClick(null, null, position, 0);
|
|
|
58
|
}
|
|
|
59
|
return true;
|
|
|
60
|
}
|
|
|
61
|
});
|
|
|
62
|
}
|
|
|
63
|
|
|
|
64
|
@Override
|
|
|
65
|
public int getItemCount() {
|
|
|
66
|
return mCollect.size();
|
|
|
67
|
}
|
|
|
68
|
|
|
|
69
|
public void setData(List<CollectData> list) {
|
|
|
70
|
mCollect.clear();
|
|
|
71
|
mCollect.addAll(list);
|
|
|
72
|
notifyDataSetChanged();
|
|
|
73
|
}
|
|
|
74
|
|
|
|
75
|
public class MyCollectHolder extends RecyclerView.ViewHolder {
|
|
|
76
|
private final TextView name;
|
|
|
77
|
private final TextView address;
|
|
|
78
|
private final LinearLayout item;
|
|
|
79
|
|
|
|
80
|
public MyCollectHolder(View itemView) {
|
|
|
81
|
super(itemView);
|
|
|
82
|
item = itemView.findViewById(R.id.item);
|
|
|
83
|
name = itemView.findViewById(R.id.name);
|
|
|
84
|
address = itemView.findViewById(R.id.address);
|
|
|
85
|
}
|
|
|
86
|
}
|
|
|
87
|
|
|
|
88
|
AdapterView.OnItemClickListener onItemClickListener;
|
|
|
89
|
AdapterView.OnItemLongClickListener onItemLongClickListener;
|
|
|
90
|
|
|
|
91
|
public void setOnItemClickListener(AdapterView.OnItemClickListener onItemClickListener) {
|
|
|
92
|
this.onItemClickListener = onItemClickListener;
|
|
|
93
|
}
|
|
|
94
|
|
|
|
95
|
public void setOnItemLongClickListener(AdapterView.OnItemLongClickListener onItemLongClickListener) {
|
|
|
96
|
this.onItemLongClickListener = onItemLongClickListener;
|
|
|
97
|
}
|
|
|
98
|
|
|
|
99
|
}
|
|
|
@ -1,9 +1,8 @@
|
|
1
|
|
<com.zhy.autolayout.AutoLinearLayout
|
|
2
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
4
|
|
android:layout_width="match_parent"
|
|
5
|
|
android:layout_height="match_parent"
|
|
|
1
|
<com.zhy.autolayout.AutoLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
2
|
xmlns:tools="http://schemas.android.com/tools"
|
|
6
|
3
|
android:id="@+id/ll_collect"
|
|
|
4
|
android:layout_width="match_parent"
|
|
|
5
|
android:layout_height="match_parent"
|
|
7
|
6
|
android:background="@drawable/bg_collection2_0"
|
|
8
|
7
|
android:orientation="vertical">
|
|
9
|
8
|
|
|
|
@ -12,6 +11,7 @@
|
|
12
|
11
|
android:layout_width="match_parent"
|
|
13
|
12
|
android:layout_height="130px"
|
|
14
|
13
|
android:background="@color/title_background">
|
|
|
14
|
|
|
15
|
15
|
<ImageView
|
|
16
|
16
|
android:id="@+id/iv_back"
|
|
17
|
17
|
android:layout_width="wrap_content"
|
|
|
@ -19,55 +19,58 @@
|
|
19
|
19
|
android:layout_alignParentLeft="true"
|
|
20
|
20
|
android:layout_centerVertical="true"
|
|
21
|
21
|
android:contentDescription="@null"
|
|
22
|
|
android:paddingBottom="4dp"
|
|
23
|
22
|
android:paddingLeft="44px"
|
|
24
|
|
android:paddingRight="44px"
|
|
25
|
23
|
android:paddingTop="4dp"
|
|
|
24
|
android:paddingRight="44px"
|
|
|
25
|
android:paddingBottom="4dp"
|
|
26
|
26
|
android:src="@drawable/icon_lvback1119" />
|
|
|
27
|
|
|
27
|
28
|
<TextView
|
|
28
|
29
|
android:layout_width="wrap_content"
|
|
29
|
30
|
android:layout_height="match_parent"
|
|
|
31
|
android:layout_centerInParent="true"
|
|
|
32
|
android:gravity="center"
|
|
30
|
33
|
android:text="我的收藏"
|
|
31
|
34
|
android:textColor="#222222"
|
|
32
|
|
android:textSize="16sp"
|
|
33
|
|
android:gravity="center"
|
|
34
|
|
android:layout_centerInParent="true"
|
|
35
|
|
/>
|
|
|
35
|
android:textSize="16sp" />
|
|
36
|
36
|
|
|
37
|
37
|
<ImageView
|
|
38
|
38
|
android:id="@+id/tv_share"
|
|
39
|
39
|
android:layout_width="wrap_content"
|
|
40
|
40
|
android:layout_height="match_parent"
|
|
41
|
|
android:paddingRight="16dp"
|
|
|
41
|
android:layout_alignParentEnd="true"
|
|
|
42
|
android:layout_alignParentRight="true"
|
|
|
43
|
android:layout_centerVertical="true"
|
|
|
44
|
android:gravity="center"
|
|
42
|
45
|
android:paddingLeft="16dp"
|
|
|
46
|
android:paddingRight="16dp"
|
|
43
|
47
|
android:src="@drawable/icon_more1124"
|
|
44
|
|
android:gravity="center"
|
|
45
|
48
|
android:textColor="@color/titleone"
|
|
46
|
|
android:layout_centerVertical="true"
|
|
47
|
|
android:layout_alignParentRight="true"
|
|
48
|
|
android:layout_alignParentEnd="true"
|
|
49
|
|
android:visibility="gone"/>
|
|
|
49
|
android:visibility="gone" />
|
|
50
|
50
|
|
|
51
|
51
|
|
|
52
|
52
|
</com.zhy.autolayout.AutoRelativeLayout>
|
|
|
53
|
|
|
53
|
54
|
<View
|
|
54
|
55
|
android:layout_width="match_parent"
|
|
55
|
56
|
android:layout_height="0.5dp"
|
|
56
|
|
android:background="@color/ui_titleline"/>
|
|
|
57
|
android:background="@color/ui_titleline" />
|
|
57
|
58
|
|
|
|
59
|
<ImageView
|
|
|
60
|
android:id="@+id/no_data"
|
|
|
61
|
android:visibility="gone"
|
|
|
62
|
tools:visibility="visible"
|
|
|
63
|
android:layout_width="match_parent"
|
|
|
64
|
android:layout_height="match_parent"
|
|
|
65
|
android:background="@drawable/bg_collection2_0" />
|
|
58
|
66
|
|
|
59
|
|
<ListView
|
|
|
67
|
<androidx.recyclerview.widget.RecyclerView
|
|
60
|
68
|
android:id="@+id/collect_listView"
|
|
61
|
69
|
android:layout_width="match_parent"
|
|
62
|
70
|
android:layout_height="match_parent"
|
|
63
|
|
android:background="@color/background"
|
|
64
|
|
android:divider="@color/Line"
|
|
65
|
|
android:dividerHeight="0.5dp"
|
|
66
|
71
|
android:layout_below="@+id/rl_title"
|
|
|
72
|
android:layout_alignParentStart="true"
|
|
67
|
73
|
android:layout_alignParentLeft="true"
|
|
68
|
|
android:layout_alignParentStart="true">
|
|
69
|
|
</ListView>
|
|
70
|
|
|
|
71
|
|
|
|
|
74
|
android:background="@color/background" />
|
|
72
|
75
|
|
|
73
|
76
|
</com.zhy.autolayout.AutoLinearLayout>
|
|
|
@ -1,111 +1,59 @@
|
|
1
|
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
2
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
3
|
xmlns:tools="http://schemas.android.com/tools"
|
|
3
|
4
|
android:layout_width="match_parent"
|
|
4
|
|
android:layout_height="match_parent"
|
|
5
|
|
android:background="@color/bg_row">
|
|
6
|
|
|
|
7
|
|
|
|
8
|
|
<ImageView
|
|
9
|
|
android:layout_width="45dp"
|
|
10
|
|
android:layout_height="45dp"
|
|
11
|
|
android:id="@+id/item_collect_imageView"
|
|
12
|
|
android:src="@drawable/icon_listzhan76"
|
|
13
|
|
android:layout_marginLeft="8dp"
|
|
14
|
|
android:layout_marginTop="16dp"
|
|
15
|
|
android:layout_marginBottom="16dp"
|
|
16
|
|
android:layout_alignParentTop="true"
|
|
17
|
|
android:layout_alignParentLeft="true"
|
|
18
|
|
android:layout_alignParentStart="true" />
|
|
19
|
|
|
|
20
|
|
<TextView
|
|
21
|
|
android:layout_width="wrap_content"
|
|
22
|
|
android:layout_height="wrap_content"
|
|
23
|
|
android:text="Medium Text"
|
|
24
|
|
android:textColor="@color/ui_65"
|
|
25
|
|
android:textSize="15sp"
|
|
26
|
|
android:layout_marginLeft="10dp"
|
|
27
|
|
android:id="@+id/item_collect_title"
|
|
28
|
|
android:maxLines="1"
|
|
29
|
|
android:layout_marginTop="18dp"
|
|
30
|
|
android:layout_toRightOf="@+id/item_collect_imageView"
|
|
31
|
|
android:layout_toEndOf="@+id/item_collect_imageView" />
|
|
32
|
|
|
|
33
|
|
<TextView
|
|
34
|
|
android:layout_width="wrap_content"
|
|
35
|
|
android:layout_height="wrap_content"
|
|
36
|
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
|
37
|
|
android:textSize="13sp"
|
|
38
|
|
android:textColor="@color/hintColor"
|
|
39
|
|
android:layout_marginTop="10dp"
|
|
40
|
|
android:drawableLeft="@drawable/icon_fast612"
|
|
41
|
|
android:gravity="center"
|
|
42
|
|
android:drawablePadding="3dp"
|
|
43
|
|
android:visibility="gone"
|
|
44
|
|
android:id="@+id/item_collect_descriptionO"
|
|
45
|
|
android:layout_below="@+id/item_collect_title"
|
|
46
|
|
android:layout_alignLeft="@+id/item_collect_title"
|
|
47
|
|
android:layout_alignStart="@+id/item_collect_title" />
|
|
48
|
|
|
|
49
|
|
<TextView
|
|
50
|
|
android:layout_width="wrap_content"
|
|
51
|
|
android:layout_height="wrap_content"
|
|
52
|
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
53
|
|
android:text="Medium Text"
|
|
54
|
|
android:textColor="@color/hintColor"
|
|
55
|
|
android:layout_marginTop="5dp"
|
|
56
|
|
android:textSize="13sp"
|
|
57
|
|
android:maxEms="35"
|
|
58
|
|
android:singleLine="true"
|
|
59
|
|
android:ellipsize="end"
|
|
60
|
|
android:id="@+id/collect_item_address"
|
|
61
|
|
android:layout_below="@+id/item_collect_title"
|
|
62
|
|
android:layout_alignLeft="@+id/item_collect_descriptionO"
|
|
63
|
|
android:layout_alignStart="@+id/item_collect_descriptionO" />
|
|
64
|
|
|
|
65
|
|
<TextView
|
|
66
|
|
android:layout_width="wrap_content"
|
|
67
|
|
android:layout_height="wrap_content"
|
|
68
|
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
|
69
|
|
android:textColor="@color/hintColor"
|
|
70
|
|
android:textSize="13sp"
|
|
71
|
|
android:drawableLeft="@drawable/icon_slow612"
|
|
72
|
|
android:drawablePadding="3dp"
|
|
73
|
|
android:layout_marginLeft="15dp"
|
|
74
|
|
android:visibility="gone"
|
|
75
|
|
android:gravity="center"
|
|
76
|
|
android:id="@+id/textView16"
|
|
77
|
|
android:layout_alignTop="@+id/item_collect_descriptionOR"
|
|
78
|
|
android:layout_toRightOf="@+id/item_collect_descriptionOR"
|
|
79
|
|
android:layout_toEndOf="@+id/item_collect_descriptionOR" />
|
|
80
|
|
|
|
81
|
|
<TextView
|
|
82
|
|
android:layout_width="wrap_content"
|
|
83
|
|
android:layout_height="18dp"
|
|
84
|
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
85
|
|
android:text="1"
|
|
86
|
|
android:visibility="gone"
|
|
87
|
|
android:textSize="14sp"
|
|
88
|
|
android:textColor="@color/hintColor"
|
|
89
|
|
android:layout_marginLeft="5dp"
|
|
90
|
|
android:gravity="center"
|
|
91
|
|
android:id="@+id/item_collect_descriptionOR"
|
|
92
|
|
android:layout_alignTop="@+id/item_collect_descriptionO"
|
|
93
|
|
android:layout_toRightOf="@+id/item_collect_descriptionO"
|
|
94
|
|
android:layout_toEndOf="@+id/item_collect_descriptionO" />
|
|
95
|
|
|
|
96
|
|
<TextView
|
|
97
|
|
android:layout_width="wrap_content"
|
|
98
|
|
android:layout_height="18dp"
|
|
99
|
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
100
|
|
android:text="3"
|
|
101
|
|
android:textColor="@color/hintColor"
|
|
102
|
|
android:textSize="14sp"
|
|
103
|
|
android:gravity="center"
|
|
104
|
|
android:visibility="gone"
|
|
105
|
|
android:layout_marginLeft="5dp"
|
|
106
|
|
android:id="@+id/item_collect_descriptionTR"
|
|
107
|
|
android:layout_alignTop="@+id/textView16"
|
|
108
|
|
android:layout_toRightOf="@+id/textView16"
|
|
109
|
|
android:layout_toEndOf="@+id/textView16" />
|
|
110
|
|
|
|
111
|
|
</RelativeLayout>
|
|
|
5
|
android:layout_height="wrap_content"
|
|
|
6
|
android:background="@color/bg_row"
|
|
|
7
|
android:orientation="vertical">
|
|
|
8
|
|
|
|
9
|
<LinearLayout
|
|
|
10
|
android:id="@+id/item"
|
|
|
11
|
android:layout_width="match_parent"
|
|
|
12
|
android:layout_height="wrap_content">
|
|
|
13
|
|
|
|
14
|
<ImageView
|
|
|
15
|
android:layout_width="45dp"
|
|
|
16
|
android:layout_height="45dp"
|
|
|
17
|
android:layout_marginLeft="8dp"
|
|
|
18
|
android:layout_marginTop="16dp"
|
|
|
19
|
android:layout_marginBottom="16dp"
|
|
|
20
|
android:src="@drawable/icon_listzhan76" />
|
|
|
21
|
|
|
|
22
|
<LinearLayout
|
|
|
23
|
android:layout_width="match_parent"
|
|
|
24
|
android:layout_height="match_parent"
|
|
|
25
|
android:layout_marginRight="15dp"
|
|
|
26
|
android:orientation="vertical">
|
|
|
27
|
|
|
|
28
|
<TextView
|
|
|
29
|
android:id="@+id/name"
|
|
|
30
|
android:layout_width="match_parent"
|
|
|
31
|
android:layout_height="wrap_content"
|
|
|
32
|
android:layout_marginLeft="10dp"
|
|
|
33
|
android:layout_marginTop="18dp"
|
|
|
34
|
android:maxLines="1"
|
|
|
35
|
tools:text="名称"
|
|
|
36
|
android:textColor="@color/ui_65"
|
|
|
37
|
android:textSize="15sp" />
|
|
|
38
|
|
|
|
39
|
<TextView
|
|
|
40
|
android:id="@+id/address"
|
|
|
41
|
android:layout_width="wrap_content"
|
|
|
42
|
android:layout_height="wrap_content"
|
|
|
43
|
android:layout_marginLeft="10dp"
|
|
|
44
|
android:layout_marginTop="5dp"
|
|
|
45
|
android:ellipsize="end"
|
|
|
46
|
android:maxEms="35"
|
|
|
47
|
android:singleLine="true"
|
|
|
48
|
tools:text="地址"
|
|
|
49
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
|
50
|
android:textColor="@color/hintColor"
|
|
|
51
|
android:textSize="13sp" />
|
|
|
52
|
</LinearLayout>
|
|
|
53
|
</LinearLayout>
|
|
|
54
|
|
|
|
55
|
<View
|
|
|
56
|
android:layout_width="match_parent"
|
|
|
57
|
android:layout_height="1dp"
|
|
|
58
|
android:background="@color/lineColor" />
|
|
|
59
|
</LinearLayout>
|