Browse Source

用户隐私协议添加

huyuguo 5 years ago
parent
commit
04346a6eb5

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

322
    public static RelativeLayout paoRl;
322
    public static RelativeLayout paoRl;
323
    public static LinearLayout rl_control;
323
    public static LinearLayout rl_control;
324
    private RelativeLayout rela, ll_comment, rl_ad, rl_grade, rl_search, ll_paoxiang, rl_charging_notice;
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
    private RelativeLayout tv_notice, tv_citynotice, rl_mapList, ll_tab_find;
328
    private RelativeLayout tv_notice, tv_citynotice, rl_mapList, ll_tab_find;
326
    private LinearLayout ll_paogo, ll_title, ll_open, tab_me, tab_screen;
329
    private LinearLayout ll_paogo, ll_title, ll_open, tab_me, tab_screen;
327
    public static LinearLayout ll_tuijian, ll_top_right;
330
    public static LinearLayout ll_tuijian, ll_top_right;
395
    };
398
    };
396
    private Handler hand = new Handler() {
399
    private Handler hand = new Handler() {
397
        public void handleMessage(android.os.Message msg) {
400
        public void handleMessage(android.os.Message msg) {
401
            SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
398
            switch (msg.what) {
402
            switch (msg.what) {
399
                //获取站点评论数
403
                //获取站点评论数
400
                case 1:
404
                case 1:
410
                    break;
414
                    break;
411
                //获取版本号及首页广告
415
                //获取版本号及首页广告
412
                case 2:
416
                case 2:
417
                    boolean showedPrivateProtocol = sharedPreferencesUtil.hasKey("cdz_private_protocol");
413
                    try {
418
                    try {
414
                        String data = JsonUtils.getKeyResult(msg.obj.toString(), "data");
419
                        String data = JsonUtils.getKeyResult(msg.obj.toString(), "data");
415
//                        Log.e("data===!!!", msg.obj.toString());
420
//                        Log.e("data===!!!", msg.obj.toString());
416
417
                        if (!data.equals("")) {
421
                        if (!data.equals("")) {
418
422
419
                            String adin = JsonUtils.getKeyResult(data, "adin");
423
                            String adin = JsonUtils.getKeyResult(data, "adin");
425
//                                        }
429
//                                        }
426
//                                    }, 2000);
430
//                                    }, 2000);
427
//                                }
431
//                                }
432
                                if (!showedPrivateProtocol) {
433
                                    rl_privacy_protocol.setVisibility(View.VISIBLE);
434
                                }
428
                            } else {
435
                            } else {
429
//                                Gson g = new Gson();
436
//                                Gson g = new Gson();
430
//                                List<Adin> ll = g.fromJson(adin, new TypeToken<List<Adin>>() {
437
//                                List<Adin> ll = g.fromJson(adin, new TypeToken<List<Adin>>() {
434
                                System.out.print("size:" + listAdin.size());
441
                                System.out.print("size:" + listAdin.size());
435
                                if (listAdin.size() > 0) {
442
                                if (listAdin.size() > 0) {
436
                                    sav.initData(listAdin);
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
                                } else {
449
                                } else {
450
                                    if (!showedPrivateProtocol) {
451
                                        rl_privacy_protocol.setVisibility(View.VISIBLE);
452
                                    }
439
//                                    if (gestureguide == true) {
453
//                                    if (gestureguide == true) {
440
//                                        new Handler().postDelayed(new Runnable() {
454
//                                        new Handler().postDelayed(new Runnable() {
441
//                                            public void run() {
455
//                                            public void run() {
481
//                                }, 5000);
495
//                                }, 5000);
482
//                                ProfileManager.getInstance().setFirstssyd(getActivity(), true);
496
//                                ProfileManager.getInstance().setFirstssyd(getActivity(), true);
483
//                            }
497
//                            }
498
                            if (!showedPrivateProtocol) {
499
                                rl_privacy_protocol.setVisibility(View.VISIBLE);
500
                            }
484
                        }
501
                        }
485
                    } catch (Exception e) {
502
                    } catch (Exception e) {
486
                        e.printStackTrace();
503
                        e.printStackTrace();
504
                        if (!showedPrivateProtocol) {
505
                            rl_privacy_protocol.setVisibility(View.VISIBLE);
506
                        }
487
                    }
507
                    }
488
508
489
509
1173
        new Handler().postDelayed(new Runnable() {
1193
        new Handler().postDelayed(new Runnable() {
1174
            @Override
1194
            @Override
1175
            public void run() {
1195
            public void run() {
1196
                SharedPreferencesUtil sharedPreferencesUtil = new SharedPreferencesUtil(getApplication());
1197
                if (!sharedPreferencesUtil.hasKey("cdz_private_protocol")) {
1198
                    return;
1199
                }
1176
1200
1177
                if (MainApplication.isFirstExample == true) {
1201
                if (MainApplication.isFirstExample == true) {
1178
1202
1421
        //首页广告关闭按钮
1445
        //首页广告关闭按钮
1422
        iv_clear = (ImageView) findViewById(R.id.iv_clear);
1446
        iv_clear = (ImageView) findViewById(R.id.iv_clear);
1423
        iv_clear.setOnClickListener(this);
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
        tv_citynotice = (RelativeLayout) findViewById(R.id.tv_citynotice);
1458
        tv_citynotice = (RelativeLayout) findViewById(R.id.tv_citynotice);
1425
        tv_citynotice.setOnClickListener(new View.OnClickListener() {
1459
        tv_citynotice.setOnClickListener(new View.OnClickListener() {
1426
            @Override
1460
            @Override
2325
                        hand.sendMessage(mes);
2359
                        hand.sendMessage(mes);
2326
                    }
2360
                    }
2327
                    Toast.makeText(getApplication(), msg, Toast.LENGTH_SHORT).show();
2361
                    Toast.makeText(getApplication(), msg, Toast.LENGTH_SHORT).show();
2362
                    Toast.makeText(getApplication(), "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", Toast.LENGTH_SHORT).show();
2328
                } catch (Exception e) {
2363
                } catch (Exception e) {
2329
                }
2364
                }
2330
            }
2365
            }
3084
            case R.id.iv_clear:
3119
            case R.id.iv_clear:
3085
                rl_ad.setVisibility(View.GONE);
3120
                rl_ad.setVisibility(View.GONE);
3086
                break;
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
            case R.id.rl_search:
3134
            case R.id.rl_search:
3088
                if (isListShow == false) {
3135
                if (isListShow == false) {
3089
                    windowLayout.setVisibility(View.GONE);
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
    </LinearLayout>
1548
    </LinearLayout>
1549
    <!-- 推荐更详细哦 -->
1549
    <!-- 推荐更详细哦 -->
1550
    <ImageView
1550
    <ImageView
1551
        android:visibility="gone"
1552
        tools:visibility="visible"
1553
        android:id="@+id/recommend_more_detail"
1551
        android:id="@+id/recommend_more_detail"
1552
        android:layout_width="wrap_content"
1553
        android:layout_height="wrap_content"
1554
        android:layout_alignParentRight="true"
1554
        android:layout_alignParentRight="true"
1555
        android:layout_marginTop="44dp"
1555
        android:layout_marginTop="44dp"
1556
        android:layout_marginRight="5dp"
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
    <LinearLayout
1560
    <LinearLayout
1561
        android:id="@+id/rl_control"
1561
        android:id="@+id/rl_control"
1683
1683
1684
    </LinearLayout>
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
    <ImageView
1686
    <ImageView
1720
        android:id="@+id/iv_yindaoye"
1687
        android:id="@+id/iv_yindaoye"
1721
        android:layout_width="match_parent"
1688
        android:layout_width="match_parent"
1802
1769
1803
    </LinearLayout>
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
</RelativeLayout>
1851
</RelativeLayout>