Browse Source

用户隐私协议添加

huyuguo 5 years ago
parent
commit
04346a6eb5

+ 49 - 2
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

@ -322,6 +322,9 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
322 322
    public static RelativeLayout paoRl;
323 323
    public static LinearLayout rl_control;
324 324
    private RelativeLayout rela, ll_comment, rl_ad, rl_grade, rl_search, ll_paoxiang, rl_charging_notice;
325
    private ConstraintLayout rl_privacy_protocol;
326
    private  ImageView private_protocol_sure_and_go;
327
    private Button private_protocol_web;
325 328
    private RelativeLayout tv_notice, tv_citynotice, rl_mapList, ll_tab_find;
326 329
    private LinearLayout ll_paogo, ll_title, ll_open, tab_me, tab_screen;
327 330
    public static LinearLayout ll_tuijian, ll_top_right;
@ -395,6 +398,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
395 398
    };
396 399
    private Handler hand = new Handler() {
397 400
        public void handleMessage(android.os.Message msg) {
401
            SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
398 402
            switch (msg.what) {
399 403
                //获取站点评论数
400 404
                case 1:
@ -410,10 +414,10 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
410 414
                    break;
411 415
                //获取版本号及首页广告
412 416
                case 2:
417
                    boolean showedPrivateProtocol = sharedPreferencesUtil.hasKey("cdz_private_protocol");
413 418
                    try {
414 419
                        String data = JsonUtils.getKeyResult(msg.obj.toString(), "data");
415 420
//                        Log.e("data===!!!", msg.obj.toString());
416
417 421
                        if (!data.equals("")) {
418 422
419 423
                            String adin = JsonUtils.getKeyResult(data, "adin");
@ -425,6 +429,9 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
425 429
//                                        }
426 430
//                                    }, 2000);
427 431
//                                }
432
                                if (!showedPrivateProtocol) {
433
                                    rl_privacy_protocol.setVisibility(View.VISIBLE);
434
                                }
428 435
                            } else {
429 436
//                                Gson g = new Gson();
430 437
//                                List<Adin> ll = g.fromJson(adin, new TypeToken<List<Adin>>() {
@ -434,8 +441,15 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
434 441
                                System.out.print("size:" + listAdin.size());
435 442
                                if (listAdin.size() > 0) {
436 443
                                    sav.initData(listAdin);
437
                                    rl_ad.setVisibility(View.VISIBLE);
444
                                    if (!showedPrivateProtocol) {
445
                                        rl_privacy_protocol.setVisibility(View.VISIBLE);
446
                                    } else {
447
                                        rl_ad.setVisibility(View.VISIBLE);
448
                                    }
438 449
                                } else {
450
                                    if (!showedPrivateProtocol) {
451
                                        rl_privacy_protocol.setVisibility(View.VISIBLE);
452
                                    }
439 453
//                                    if (gestureguide == true) {
440 454
//                                        new Handler().postDelayed(new Runnable() {
441 455
//                                            public void run() {
@ -481,9 +495,15 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
481 495
//                                }, 5000);
482 496
//                                ProfileManager.getInstance().setFirstssyd(getActivity(), true);
483 497
//                            }
498
                            if (!showedPrivateProtocol) {
499
                                rl_privacy_protocol.setVisibility(View.VISIBLE);
500
                            }
484 501
                        }
485 502
                    } catch (Exception e) {
486 503
                        e.printStackTrace();
504
                        if (!showedPrivateProtocol) {
505
                            rl_privacy_protocol.setVisibility(View.VISIBLE);
506
                        }
487 507
                    }
488 508
489 509
@ -1173,6 +1193,10 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1173 1193
        new Handler().postDelayed(new Runnable() {
1174 1194
            @Override
1175 1195
            public void run() {
1196
                SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
1197
                if (!sharedPreferencesUtil.hasKey("cdz_private_protocol")) {
1198
                    return;
1199
                }
1176 1200
1177 1201
                if (MainApplication.isFirstExample == true) {
1178 1202
@ -1421,6 +1445,16 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1421 1445
        //首页广告关闭按钮
1422 1446
        iv_clear = (ImageView) findViewById(R.id.iv_clear);
1423 1447
        iv_clear.setOnClickListener(this);
1448
        // 首页隐私协议
1449
        rl_privacy_protocol = findViewById(R.id.rl_privacy_protocol);
1450
        rl_privacy_protocol.setOnClickListener(this);
1451
1452
        private_protocol_sure_and_go = findViewById(R.id.private_protocol_sure_and_go);
1453
        private_protocol_sure_and_go.setOnClickListener(this);
1454
1455
        private_protocol_web = findViewById(R.id.private_protocol_web);
1456
        private_protocol_web.setOnClickListener(this);
1457
1424 1458
        tv_citynotice = (RelativeLayout) findViewById(R.id.tv_citynotice);
1425 1459
        tv_citynotice.setOnClickListener(new View.OnClickListener() {
1426 1460
            @Override
@ -2325,6 +2359,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
2325 2359
                        hand.sendMessage(mes);
2326 2360
                    }
2327 2361
                    Toast.makeText(getApplication(), msg, Toast.LENGTH_SHORT).show();
2362
                    Toast.makeText(getApplication(), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", Toast.LENGTH_SHORT).show();
2328 2363
                } catch (Exception e) {
2329 2364
                }
2330 2365
            }
@ -3084,6 +3119,18 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
3084 3119
            case R.id.iv_clear:
3085 3120
                rl_ad.setVisibility(View.GONE);
3086 3121
                break;
3122
            case R.id.private_protocol_sure_and_go:
3123
                sharedPreferencesUtil.putBoolean("cdz_private_protocol", true);
3124
                rl_privacy_protocol.setVisibility(View.GONE);
3125
                break;
3126
            case R.id.private_protocol_web:
3127
                sharedPreferencesUtil.putBoolean("cdz_private_protocol", true);
3128
                rl_privacy_protocol.setVisibility(View.GONE);
3129
3130
                intent = new Intent(getApplication(), IntegralDescriptionActivity.class);
3131
                intent.putExtra("url", "http://evcharge.cc/pc/agreement.html");
3132
                startActivity(intent);
3133
                break;
3087 3134
            case R.id.rl_search:
3088 3135
                if (isListShow == false) {
3089 3136
                    windowLayout.setVisibility(View.GONE);

BIN
app/src/main/res/drawable-hdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-hdpi/private_protocol_btn.png


BIN
app/src/main/res/drawable-mdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-mdpi/private_protocol_btn.png


BIN
app/src/main/res/drawable-xhdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-xhdpi/private_protocol_btn.png


BIN
app/src/main/res/drawable-xxhdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-xxhdpi/private_protocol_btn.png


BIN
app/src/main/res/drawable-xxxhdpi/private_protocol_bg.png


BIN
app/src/main/res/drawable-xxxhdpi/private_protocol_btn.png


+ 82 - 37
app/src/main/res/layout/activity_main_map.xml

@ -1548,14 +1548,14 @@
1548 1548
    </LinearLayout>
1549 1549
    <!-- 推荐更详细哦 -->
1550 1550
    <ImageView
1551
        android:visibility="gone"
1552
        tools:visibility="visible"
1553 1551
        android:id="@+id/recommend_more_detail"
1552
        android:layout_width="wrap_content"
1553
        android:layout_height="wrap_content"
1554 1554
        android:layout_alignParentRight="true"
1555 1555
        android:layout_marginTop="44dp"
1556 1556
        android:layout_marginRight="5dp"
1557
        android:layout_width="wrap_content"
1558
        android:layout_height="wrap_content" android:src="@drawable/recommend_remind"/>
1557
        android:src="@drawable/recommend_remind"
1558
        android:visibility="gone" tools:visibility="visible"/>
1559 1559
1560 1560
    <LinearLayout
1561 1561
        android:id="@+id/rl_control"
@ -1683,39 +1683,6 @@
1683 1683
1684 1684
    </LinearLayout>
1685 1685
1686
    //首页弹出广告布局
1687
1688
    <com.zhy.autolayout.AutoRelativeLayout
1689
        android:id="@+id/rl_ad"
1690
        android:layout_width="match_parent"
1691
        android:layout_height="match_parent"
1692
        android:layout_centerHorizontal="true"
1693
        android:layout_centerVertical="true"
1694
        android:background="@drawable/bg_black2_0"
1695
        android:visibility="gone">
1696
1697
        <ImageView
1698
            android:id="@+id/iv_clear"
1699
            android:layout_width="wrap_content"
1700
            android:layout_height="wrap_content"
1701
            android:layout_below="@+id/imageView8"
1702
            android:layout_centerHorizontal="true"
1703
            android:layout_marginTop="35dp"
1704
            android:src="@drawable/icon_adbutton2_0" />
1705
1706
        <com.electric.chargingpile.view.SlideAdView
1707
            android:id="@+id/imageView8"
1708
            android:layout_width="297dp"
1709
            android:layout_height="396dp"
1710
            android:layout_alignParentTop="true"
1711
            android:layout_centerHorizontal="true"
1712
            android:layout_gravity="center"
1713
            android:layout_marginTop="105dp"
1714
            android:scaleType="fitXY" />
1715
1716
    </com.zhy.autolayout.AutoRelativeLayout>
1717
1718
1719 1686
    <ImageView
1720 1687
        android:id="@+id/iv_yindaoye"
1721 1688
        android:layout_width="match_parent"
@ -1802,5 +1769,83 @@
1802 1769
1803 1770
    </LinearLayout>
1804 1771
1772
    <!-- 首页弹出广告布局 -->
1773
    <com.zhy.autolayout.AutoRelativeLayout
1774
        android:id="@+id/rl_ad"
1775
        android:layout_width="match_parent"
1776
        android:layout_height="match_parent"
1777
        android:layout_centerHorizontal="true"
1778
        android:layout_centerVertical="true"
1779
        android:background="@drawable/bg_black2_0"
1780
        android:visibility="gone">
1781
1782
        <ImageView
1783
            android:id="@+id/iv_clear"
1784
            android:layout_width="wrap_content"
1785
            android:layout_height="wrap_content"
1786
            android:layout_below="@+id/imageView8"
1787
            android:layout_centerHorizontal="true"
1788
            android:layout_marginTop="35dp"
1789
            android:src="@drawable/icon_adbutton2_0" />
1790
1791
        <com.electric.chargingpile.view.SlideAdView
1792
            android:id="@+id/imageView8"
1793
            android:layout_width="297dp"
1794
            android:layout_height="396dp"
1795
            android:layout_alignParentTop="true"
1796
            android:layout_centerHorizontal="true"
1797
            android:layout_gravity="center"
1798
            android:layout_marginTop="105dp"
1799
            android:scaleType="fitXY" />
1800
1801
    </com.zhy.autolayout.AutoRelativeLayout>
1802
1803
    <!-- 首页首次启动弹出隐私协议 -->
1804
    <android.support.constraint.ConstraintLayout
1805
        android:id="@+id/rl_privacy_protocol"
1806
        android:layout_width="match_parent"
1807
        android:layout_height="match_parent"
1808
        android:visibility="gone"
1809
        android:background="@drawable/bg_black2_0">
1810
1811
        <android.support.constraint.ConstraintLayout
1812
            android:layout_width="wrap_content"
1813
            android:layout_height="wrap_content"
1814
            app:layout_constraintBottom_toBottomOf="parent"
1815
            app:layout_constraintLeft_toLeftOf="parent"
1816
            app:layout_constraintRight_toRightOf="parent"
1817
            app:layout_constraintTop_toTopOf="parent">
1818
            <ImageView android:layout_width="wrap_content"
1819
                android:layout_height="wrap_content"
1820
                android:src="@drawable/private_protocol_bg"
1821
                app:layout_constraintBottom_toBottomOf="parent"
1822
                app:layout_constraintLeft_toLeftOf="parent"
1823
                app:layout_constraintRight_toRightOf="parent"
1824
                app:layout_constraintTop_toTopOf="parent"/>
1825
1826
            <ImageView
1827
                android:id="@+id/private_protocol_sure_and_go"
1828
                android:layout_width="wrap_content"
1829
                android:layout_height="wrap_content"
1830
                android:layout_marginBottom="15dp"
1831
                android:src="@drawable/private_protocol_btn"
1832
                app:layout_constraintBottom_toBottomOf="parent"
1833
                app:layout_constraintLeft_toLeftOf="parent"
1834
                app:layout_constraintRight_toRightOf="parent"/>
1835
1836
            <Button
1837
                android:id="@+id/private_protocol_web"
1838
                android:layout_width="120dp"
1839
                android:layout_height="36dp"
1840
                android:layout_marginLeft="15dp"
1841
                android:layout_marginBottom="15dp"
1842
                android:background="@color/transparent"
1843
                app:layout_constraintBottom_toTopOf="@+id/private_protocol_sure_and_go"
1844
                app:layout_constraintLeft_toLeftOf="parent"/>
1845
1846
        </android.support.constraint.ConstraintLayout>
1847
1848
    </android.support.constraint.ConstraintLayout>
1849
1805 1850
1806 1851
</RelativeLayout>