huyuguo преди 4 години
родител
ревизия
03407e2176

+ 2 - 2
app/build.gradle

@ -63,11 +63,11 @@ android {
63 63
    buildTypes {
64 64
        debug {
65 65
            //是否优化zip
66
            zipAlignEnabled true
66
            zipAlignEnabled false
67 67
            // 移除无用的resource文件
68 68
//            shrinkResources true
69 69
            //启用代码混淆  debug 模式下需要设置为false,否则无法看到局部变量的值
70
            minifyEnabled true
70
            minifyEnabled false
71 71
            //混淆规则配置文件
72 72
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
73 73
            signingConfig signingConfigs.release

+ 1 - 20
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

@ -552,15 +552,9 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
552 552
                                    if (center != null) {
553 553
                                        for (int i = 0; i < list.size(); i++) {
554 554
                                            String wei = list.get(i).getPoi_wei().trim();
555
//                                            String wei = "39.896712151452";
556 555
                                            String jing = list.get(i).getPoi_jing().trim();
557
//
558
559
560 556
                                            int position_jing = jing.length() - jing.indexOf(".") - 1;
561 557
                                            int position_wei = wei.length() - wei.indexOf(".") - 1;
562
563
564 558
                                            LatLng ll;
565 559
                                            if (position_jing > 13 || position_wei > 13) {
566 560
                                                ll = new LatLng(Double.parseDouble(wei), Double.parseDouble(jing));
@ -1761,9 +1755,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1761 1755
            //mLocationOption.setWifiActiveScan(false);
1762 1756
            mLocationOption.setWifiScan(true);
1763 1757
            mlocationClient.startLocation();
1764
1765 1758
        }
1766
1767 1759
    }
1768 1760
1769 1761
    @Override
@ -3024,7 +3016,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3024 3016
                }
3025 3017
                MobclickAgent.onEvent(getApplicationContext(), "0107");
3026 3018
                startActivity(new Intent(getApplicationContext(), NewSelectCityActivity.class));
3027
//                startActivityForResult(new Intent(getApplication(), SelectCityActivity.class), SEARCH_CODE);
3028 3019
                if (ll_tuijian.getVisibility() == View.VISIBLE) {
3029 3020
                    ll_tuijian.setVisibility(View.GONE);
3030 3021
                    rl_tuijian_tip.setVisibility(View.VISIBLE);
@ -3153,8 +3144,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3153 3144
                    windowLayout.setVisibility(View.GONE);
3154 3145
                    rl_control.setVisibility(View.VISIBLE);
3155 3146
                }
3156
//                windowLayout.setVisibility(View.GONE);
3157
//                rl_control.setVisibility(View.VISIBLE);
3158 3147
                if (null != current_chargePoint) {
3159 3148
                    resetMarker();
3160 3149
                }
@ -3975,7 +3964,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3975 3964
                }
3976 3965
            }, 500);
3977 3966
3978
//            aMap.moveCamera(CameraUpdateFactory.zoomTo(14));
3979 3967
            if (search_marker != null) {
3980 3968
                search_marker.remove();
3981 3969
            }
@ -3991,7 +3979,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3991 3979
        } else if (requestCode == SEARCH_CODE && resultCode == 102) {
3992 3980
            double jing = Double.valueOf(data.getStringExtra("jing"));
3993 3981
            double wei = Double.valueOf(data.getStringExtra("wei"));
3994
//            Log.e("---------!", "jing=" + Double.valueOf(data.getStringExtra("jing")) + "--wei=" + Double.valueOf(data.getStringExtra("wei")));
3995 3982
            final LatLng screenCity = new LatLng(wei, jing);
3996 3983
            aMap = mapView.getMap();
3997 3984
            Util.setMapCustomStyleFile(aMap, getApplicationContext());
@ -4001,12 +3988,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
4001 3988
                    aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(screenCity, 14.0f));
4002 3989
                }
4003 3990
            }, 500);
4004
4005
4006
//            aMap.moveCamera(CameraUpdateFactory.newLatLng(screenCity));
4007
4008
//            aMap.moveCamera(CameraUpdateFactory.zoomTo(14));
4009
4010 3991
        }
4011 3992
    }
4012 3993
@ -5253,7 +5234,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5253 5234
            fenshi_info_textview.setText("");
5254 5235
        }
5255 5236
5256
        if (belong_attribute!=null && belong_attribute.contains("私人")) {
5237
        if (belong_attribute != null && belong_attribute.contains("私人")) {
5257 5238
            private_telephone.setVisibility(View.VISIBLE);
5258 5239
            private_telephone.setOnClickListener(new View.OnClickListener() {
5259 5240
                @Override

+ 0 - 3
app/src/main/java/com/electric/chargingpile/activity/RecommendZhanActivity.java

@ -325,9 +325,6 @@ public class RecommendZhanActivity extends Activity implements View.OnClickListe
325 325
                canRefresh = true;
326 326
            }
327 327
        }
328
        LogUtils.e("+++++++");
329
//        center_jing = String.valueOf(cameraPosition.target.longitude);
330
//        center_wei = String.valueOf(cameraPosition.target.latitude);
331 328
    }
332 329
333 330
    @Override

+ 32 - 63
app/src/main/java/com/electric/chargingpile/activity/SearchActivity.java

@ -76,7 +76,6 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
76 76

77 77
    private View convertView = null;
78 78

79
    private boolean stype = true;
80 79
    InputMethodManager imm;
81 80
    private LinearLayout ll_menu;
82 81
    ListView historyList;
@ -93,7 +92,6 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
93 92
        super.onCreate(savedInstanceState);
94 93
        setContentView(R.layout.activity_search);
95 94
        BarColorUtil.initStatusBarColor(SearchActivity.this);
96
        stype = getIntent().getBooleanExtra("searchtype", true);
97 95
        initView();
98 96
    }
99 97

@ -190,17 +188,13 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
190 188
            }
191 189
        });
192 190
        String search_address = ProfileManager.getInstance().getSearchAddress(this);
193
        Log.e("222", search_address);
194 191
        if (search_address.equals("")) {
195
            Log.e(TAG, "默认");
196 192
            etSearch.setText("");
197 193
        } else {
198
            Log.e(TAG, search_address);
199 194
            etSearch.setText(search_address);
200 195
            etSearch.setSelection(etSearch.getText().length());
201 196
        }
202 197

203

204 198
        lvContent.setOnScrollListener(new AbsListView.OnScrollListener() {
205 199
            @Override
206 200
            public void onScrollStateChanged(AbsListView view, int scrollState) {
@ -231,6 +225,7 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
231 225
        adapter = new SearchAdapter(this, list);
232 226
        lvContent.setAdapter(adapter);
233 227

228
        // 点击历史记录
234 229
        historyList.setOnItemClickListener(new OnItemClickListener() {
235 230
            @Override
236 231
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
@ -250,47 +245,38 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
250 245
        });
251 246

252 247
        lvContent.setOnItemClickListener(new OnItemClickListener() {
253

254 248
            @Override
255
            public void onItemClick(AdapterView<?> parent, View view,
256
                                    int position, long id) {
257
                if (stype) {
258
                    DBOpenHandler db = new DBOpenHandler(SearchActivity.this, "");
259
                    db.queryOne(etSearch.getText().toString());
260
                    ContentValues values = new ContentValues();
261
                    values.put("time", System.currentTimeMillis());
262
                    values.put("keyword", list.get(position).get("name"));
263
                    values.put("type", list.get(position).get("address"));
264
                    values.put("jing", list.get(position).get("jing"));
265
                    values.put("wei", list.get(position).get("wei"));
266
                    db.insert(values);
267

268
                    Cursor c = db.query();
269
                    System.err.println(c.getCount());
270
                    if (c.getCount() <= 0) {
271
                        return;
272
                    }
273
                    String[] from = {"keyword", "type"};
274
                    int[] to = {R.id.search_name, R.id.search_address};
275
                    SimpleCursorAdapter historyAdapter = new SimpleCursorAdapter(SearchActivity.this, R.layout.history_item, c, from, to, 0);
276
                    historyList.setAdapter(historyAdapter);
277
                    Intent intent = new Intent();
278
                    intent.putExtra("zhan_name", list.get(position).get("name"));
279
                    intent.putExtra("jing", list.get(position).get("jing"));
280
                    intent.putExtra("wei", list.get(position).get("wei"));
281
                    ProfileManager.getInstance().setSearchAddress(getApplicationContext(), list.get(position).get("name"));
282
                    setResult(101, intent);
283
                    View v = getWindow().peekDecorView();
284
                    if (v != null) {
285
                        imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
286
                    }
287
                    finish();
288
                } else {
289
                    Intent intent = new Intent(SearchActivity.this,
290
                            ZhanDetailsNew.class);
291
                    intent.putExtra("zhan", mList.get(position));
292
                    startActivity(intent);
249
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
250
                DBOpenHandler db = new DBOpenHandler(SearchActivity.this, "");
251
                db.queryOne(etSearch.getText().toString());
252
                ContentValues values = new ContentValues();
253
                values.put("time", System.currentTimeMillis());
254
                values.put("keyword", list.get(position).get("name"));
255
                values.put("type", list.get(position).get("address"));
256
                values.put("jing", list.get(position).get("jing"));
257
                values.put("wei", list.get(position).get("wei"));
258
                db.insert(values);
259

260
                Cursor c = db.query();
261
                System.err.println(c.getCount());
262
                if (c.getCount() <= 0) {
263
                    return;
293 264
                }
265
                String[] from = {"keyword", "type"};
266
                int[] to = {R.id.search_name, R.id.search_address};
267
                SimpleCursorAdapter historyAdapter = new SimpleCursorAdapter(SearchActivity.this, R.layout.history_item, c, from, to, 0);
268
                historyList.setAdapter(historyAdapter);
269
                Intent intent = new Intent();
270
                intent.putExtra("zhan_name", list.get(position).get("name"));
271
                intent.putExtra("jing", list.get(position).get("jing"));
272
                intent.putExtra("wei", list.get(position).get("wei"));
273
                ProfileManager.getInstance().setSearchAddress(getApplicationContext(), list.get(position).get("name"));
274
                setResult(101, intent);
275
                View v = getWindow().peekDecorView();
276
                if (v != null) {
277
                    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
278
                }
279
                finish();
294 280
            }
295 281
        });
296 282
        try {
@ -499,24 +485,7 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
499 485
            viewHolder.name.setText(list.get(position).get("name"));
500 486
            viewHolder.address.setText(list.get(position).get("address"));
501 487

502
            if (stype) {
503
                viewHolder.zhan.setVisibility(View.GONE);
504
            } else {
505
                viewHolder.zhan.setVisibility(View.VISIBLE);
506
                if (!TextUtils.isEmpty(list.get(position).get("url"))) {
507
                    ImageLoader.getInstance().init(ImageLoaderConfiguration.createDefault(SearchActivity.this));
508
                    DisplayImageOptions.Builder builder = new DisplayImageOptions.Builder();
509
                    builder.cacheInMemory(true);
510
                    builder.cacheOnDisc(true);
511
                    builder.showStubImage(R.drawable.image_default);
512
                    builder.showImageForEmptyUri(R.drawable.image_default);
513
                    builder.showImageOnFail(R.drawable.image_default);
514
                    builder.displayer(new RoundedBitmapDisplayer(0));
515
                    ImageLoader.getInstance().displayImage(list.get(position).get("url"), viewHolder.zhan, builder.build());
516
                } else {
517
                    viewHolder.zhan.setImageResource(R.drawable.image_default);
518
                }
519
            }
488
            viewHolder.zhan.setVisibility(View.GONE);
520 489
            return convertView;
521 490
        }
522 491


+ 15 - 50
app/src/main/res/layout/activity_main_map.xml

@ -8,9 +8,7 @@
8 8
    android:focusable="true"
9 9
    tools:context="com.electric.chargingpile.activity.MainMapActivity">
10 10
11
12
    //标题搜索栏布局
13
11
    <!-- 标题搜索栏布局 -->
14 12
    <LinearLayout
15 13
        android:id="@+id/ll_title"
16 14
        android:layout_width="match_parent"
@ -18,7 +16,6 @@
18 16
        android:layout_alignParentTop="true"
19 17
        android:background="@color/white">
20 18
21
22 19
        <ImageView
23 20
            android:id="@+id/iv_right"
24 21
            android:layout_width="wrap_content"
@ -113,7 +110,6 @@
113 110
                android:src="@drawable/icon_edit_delete2_0" />
114 111
        </RelativeLayout>
115 112
116
117 113
        <TextView
118 114
            android:id="@+id/fragment_right_title"
119 115
            android:layout_width="wrap_content"
@ -269,9 +265,7 @@
269 265
            android:fadingEdge="none"
270 266
            android:listSelector="@color/transparent"
271 267
            android:visibility="visible"></ListView>
272
273
        //列表页内容为空时的提示
274
268
        <!-- 列表页内容为空时的提示 -->
275 269
        <TextView
276 270
            android:id="@+id/tv_tishi"
277 271
            android:layout_width="wrap_content"
@ -284,13 +278,8 @@
284 278
            android:textColor="@color/ui_68"
285 279
            android:textSize="15sp"
286 280
            android:visibility="gone" />
287
288
289 281
    </com.zhy.autolayout.AutoRelativeLayout>
290
291
292
    //底部tab布局
293
282
    <!-- 底部tab布局 -->
294 283
    <LinearLayout
295 284
        android:id="@+id/ll_tab"
296 285
        android:layout_width="match_parent"
@ -300,7 +289,6 @@
300 289
        android:orientation="horizontal"
301 290
        android:visibility="visible">
302 291
303
304 292
        <LinearLayout
305 293
            android:id="@+id/tab_main"
306 294
            android:layout_width="0dp"
@ -325,7 +313,6 @@
325 313
                android:text="首页"
326 314
                android:textColor="@color/ui_64"
327 315
                android:textSize="10sp" />
328
329 316
        </LinearLayout>
330 317
331 318
        <LinearLayout
@ -402,7 +389,6 @@
402 389
                android:src="@drawable/icon_havemessage1201"
403 390
                android:visibility="gone" />
404 391
405
406 392
            <TextView
407 393
                android:id="@+id/tv_find"
408 394
                android:layout_width="wrap_content"
@ -467,9 +453,7 @@
467 453
        </LinearLayout>
468 454
469 455
    </LinearLayout>
470
471
    //点击站点弹出框布局
472
456
    <!-- 点击站点弹出框布局 -->
473 457
    <com.zhy.autolayout.AutoLinearLayout
474 458
        android:id="@+id/linearLayout"
475 459
        android:layout_width="fill_parent"
@ -554,8 +538,6 @@
554 538
                        android:gravity="center"
555 539
                        android:textColor="#ffa900"
556 540
                        android:textSize="14sp" />
557
558
559 541
                </com.zhy.autolayout.AutoRelativeLayout>
560 542
561 543
@ -1173,32 +1155,35 @@
1173 1155
                android:layout_width="match_parent"
1174 1156
                android:layout_height="wrap_content"
1175 1157
                android:orientation="horizontal">
1158
1176 1159
                <TextView
1177 1160
                    android:id="@+id/window_tv_zhan_cost"
1178 1161
                    android:layout_width="0dp"
1179
                    android:layout_weight="1"
1180 1162
                    android:layout_height="wrap_content"
1181 1163
                    android:layout_marginLeft="15dp"
1182
                    android:layout_marginBottom="5dp"
1183 1164
                    android:layout_marginTop="20dp"
1165
                    android:layout_marginBottom="5dp"
1166
                    android:layout_weight="1"
1184 1167
                    android:text=""
1185 1168
                    android:textColor="@color/ui_62"
1186 1169
                    android:textSize="14sp"
1187 1170
                    tools:text="可使用本APP扫码支付" />
1171
1188 1172
                <LinearLayout
1189
                    android:visibility="gone"
1190
                    tools:visibility="visible"
1191 1173
                    android:id="@+id/private_telephone"
1192 1174
                    android:layout_width="wrap_content"
1175
                    android:layout_height="wrap_content"
1176
                    android:visibility="gone"
1193 1177
                    tools:background="#00ff00"
1194
                    android:layout_height="wrap_content">
1178
                    tools:visibility="visible">
1179
1195 1180
                    <ImageView
1181
                        android:layout_width="wrap_content"
1182
                        android:layout_height="wrap_content"
1183
                        android:layout_marginLeft="15dp"
1196 1184
                        android:layout_marginTop="20dp"
1197 1185
                        android:layout_marginRight="15dp"
1198 1186
                        android:layout_marginBottom="5dp"
1199
                        android:layout_marginLeft="15dp"
1200
                        android:layout_width="wrap_content"
1201
                        android:layout_height="wrap_content"
1202 1187
                        android:src="@drawable/icon_detail_tel" />
1203 1188
                </LinearLayout>
1204 1189
            </LinearLayout>
@ -1460,8 +1445,6 @@
1460 1445
        android:visibility="gone" />
1461 1446
1462 1447
    <!-- 地图状态控制布局 -->
1463
1464
1465 1448
    <!-- 站点提示框布局 -->
1466 1449
1467 1450
    <RelativeLayout
@ -1556,7 +1539,6 @@
1556 1539
            android:layout_marginTop="12dp"
1557 1540
            android:paddingRight="15dp"
1558 1541
            android:src="@drawable/icon_example_main" />
1559
1560 1542
    </LinearLayout>
1561 1543
    <!-- 推荐更详细哦 -->
1562 1544
    <ImageView
@ -1665,8 +1647,6 @@
1665 1647
                android:src="@drawable/icon_tuijian"
1666 1648
                android:visibility="visible"
1667 1649
                tools:visibility="visible" />
1668
1669
1670 1650
        </RelativeLayout>
1671 1651
1672 1652
        <RelativeLayout
@ -1699,11 +1679,7 @@
1699 1679
                android:layout_centerVertical="true"
1700 1680
                android:layout_marginRight="15dp"
1701 1681
                android:src="@drawable/icon_tuijian_tip_close" />
1702
1703
1704 1682
        </RelativeLayout>
1705
1706
1707 1683
    </LinearLayout>
1708 1684
1709 1685
    <ImageView
@ -1733,8 +1709,6 @@
1733 1709
                android:layout_alignParentRight="true"
1734 1710
                android:layout_marginRight="12dp"
1735 1711
                android:src="@drawable/icon_tuijian_close" />
1736
1737
1738 1712
        </RelativeLayout>
1739 1713
1740 1714
        <LinearLayout
@ -1784,12 +1758,8 @@
1784 1758
                    android:text="点击这里反馈"
1785 1759
                    android:textColor="#2883ff"
1786 1760
                    android:textSize="14sp" />
1787
1788
1789 1761
            </LinearLayout>
1790 1762
        </RelativeLayout>
1791
1792
1793 1763
    </LinearLayout>
1794 1764
1795 1765
    <!-- 首页弹出广告布局 start -->
@ -1823,7 +1793,6 @@
1823 1793
1824 1794
    </com.zhy.autolayout.AutoRelativeLayout>
1825 1795
    <!-- 首页弹出广告布局 end -->
1826
1827 1796
    <!-- 首页首次启动弹出隐私协议 start -->
1828 1797
    <androidx.constraintlayout.widget.ConstraintLayout
1829 1798
        android:id="@+id/rl_privacy_protocol"
@ -1868,11 +1837,7 @@
1868 1837
                android:background="@color/transparent"
1869 1838
                app:layout_constraintBottom_toTopOf="@+id/private_protocol_sure_and_go"
1870 1839
                app:layout_constraintLeft_toLeftOf="parent" />
1871
1872 1840
        </androidx.constraintlayout.widget.ConstraintLayout>
1873
1874 1841
    </androidx.constraintlayout.widget.ConstraintLayout>
1875 1842
    <!-- 首页首次启动弹出隐私协议 end -->
1876
1877
1878 1843
</RelativeLayout>