private static final String KEY_MAKE_SURE_NETWORK_FOR_VIDEO = "key_make_sure_network_for_video";
74
    private static final String KEY_DEVICE_ID = "key_device_id";
74
    private static final String KEY_DEVICE_ID = "key_device_id";
75
    private static final String KEY_PUSH_ID = "key_push_id";
75
    private static final String KEY_PUSH_ID = "key_push_id";
76
    private static final String KEY_MAX_COUNT = "key_max_count";
76

77

77
    private static ProfileManager instance;
78
    private static ProfileManager instance;
78
    private String deviceId;
79
    private String deviceId;
680
    public String getPushID(Context context) {
681
    public String getPushID(Context context) {
681
        return PreferenceManager.getInstance(context).getString(KEY_PUSH_ID, "");
682
        return PreferenceManager.getInstance(context).getString(KEY_PUSH_ID, "");
682
    }
683
    }
684

685
    public void setMaxCount(Context context, int id) {
686
        PreferenceManager.getInstance(context).putInt(KEY_MAX_COUNT, id);
687
    }
688

689
    public int getMaxCount(Context context) {
690
        return PreferenceManager.getInstance(context).getInt(KEY_MAX_COUNT, 4);
691
    }
692

693

683
}
694
}

+ 116 - 0
app/src/main/java/com/electric/chargingpile/view/NotRegisterDialog.java

1
package com.electric.chargingpile.view;
2
3
import android.app.Dialog;
4
import android.content.Context;
5
import android.view.Display;
6
import android.view.LayoutInflater;
7
import android.view.View;
8
import android.view.ViewGroup;
9
import android.view.WindowManager;
10
import android.widget.FrameLayout;
11
import android.widget.ImageView;
12
import android.widget.RelativeLayout;
13
import android.widget.TextView;
14
15
import androidx.annotation.DrawableRes;
16
17
import com.electric.chargingpile.R;
18
import com.electric.chargingpile.util.DensityUtil;
19
import com.lidroid.xutils.db.annotation.Id;
20
21
public class NotRegisterDialog  {
22
    private Context context;
23
    private Dialog dialog;
24
    private Display display;
25
26
    private ImageView goIntent,neglect,close,logoDialog;
27
    private TextView content;
28
29
30
    public NotRegisterDialog(Context context) {
31
        this.context = context;
32
        WindowManager windowManager = (WindowManager) context
33
                .getSystemService(Context.WINDOW_SERVICE);
34
        display = windowManager.getDefaultDisplay();
35
    }
36
37
    public NotRegisterDialog builder() {
38
        // 获取Dialog布局
39
        View view = LayoutInflater.from(context).inflate(
40
                R.layout.dialog_not_login, null);
41
42
        // 获取自定义Dialog布局中的控件
43
        RelativeLayout  bgNotLogin = (RelativeLayout) view.findViewById(R.id.bgNotLogin);
44
        goIntent = view.findViewById(R.id.goIntent);
45
        neglect = view.findViewById(R.id.neglect);
46
        close   = view.findViewById(R.id.close);
47
        content = view.findViewById(R.id.content);
48
         logoDialog   = view.findViewById(R.id.logoDialog);
49
50
51
        // 定义Dialog布局和参数
52
        dialog = new Dialog(context, R.style.AlertDialogStyle);
53
        dialog.setContentView(view);
54
55
        // 调整dialog背景大小
56
        bgNotLogin.setLayoutParams(new FrameLayout.LayoutParams(
57
                DensityUtil.dip2px(context,  268),
58
                DensityUtil.dip2px(context, 296)
59
        ));
60
61
        return this;
62
    }
63
64
    public NotRegisterDialog setContent(String str){
65
        content.setText(str);
66
        return this;
67
    }
68
69
    public NotRegisterDialog setGoIntentImg(@DrawableRes int str){
70
        goIntent.setImageResource(str);
71
        return this;
72
    }
73
    public NotRegisterDialog setlogoDialogImg(@DrawableRes int str){
74
        logoDialog.setImageResource(str);
75
        return this;
76
    }
77
78
79
80
    public NotRegisterDialog setCancelable(boolean cancel) {
81
        dialog.setCancelable(cancel);
82
        dialog.setCanceledOnTouchOutside(cancel);
83
        return this;
84
    }
85
86
    public  NotRegisterDialog setGoRegister(View.OnClickListener listener){
87
        if (goIntent!=null){
88
            goIntent.setOnClickListener(view ->{
89
                listener.onClick(view);
90
                dialog.dismiss();
91
            });
92
        }
93
        return this;
94
    }
95
96
    public  NotRegisterDialog setCancle(View.OnClickListener listener){
97
        if (neglect!=null){
98
            neglect.setOnClickListener(view ->{
99
                listener.onClick(view);
100
                dialog.dismiss();
101
            });
102
        }
103
104
        return this;
105
    }
106
    public void show() {
107
        close.setOnClickListener(new View.OnClickListener() {
108
            @Override
109
            public void onClick(View view) {
110
                dialog.dismiss();
111
            }
112
        });
113
        dialog.show();
114
    }
115
116
}

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


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


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


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


+ 5 - 0
app/src/main/res/drawable/bg_white_fillet30.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
    <solid android:color="@color/white"/>
4
    <corners android:radius="30dp"/>
5
</shape>

+ 72 - 0
app/src/main/res/layout/dialog_not_login.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    xmlns:app="http://schemas.android.com/apk/res-auto"
6
    tools:background="#f1f1"
7
    android:id="@+id/bgNotLogin"
8
    android:layout_height="match_parent">
9
10
    <androidx.constraintlayout.widget.ConstraintLayout
11
        android:layout_centerInParent="true"
12
        android:layout_width="268dp"
13
        android:background="@drawable/bg_white_fillet30"
14
        android:layout_height="296dp">
15
        <ImageView
16
            android:id="@+id/close"
17
            android:padding="5dp"
18
            android:src="@drawable/ic_black_bold"
19
            android:layout_marginTop="10dp"
20
            android:layout_marginEnd="20dp"
21
            app:layout_constraintEnd_toEndOf="parent"
22
            app:layout_constraintTop_toTopOf="parent"
23
            android:layout_width="wrap_content"
24
            android:layout_height="wrap_content"/>
25
        <ImageView
26
            android:id="@+id/logoDialog"
27
            android:layout_marginTop="15dp"
28
            app:layout_constraintTop_toTopOf="parent"
29
            app:layout_constraintEnd_toEndOf="parent"
30
            app:layout_constraintStart_toStartOf="parent"
31
            tools:src="@drawable/bg_not_login_dialog"
32
            android:layout_width="wrap_content"
33
            android:layout_height="wrap_content"/>
34
35
        <TextView
36
            android:lineSpacingMultiplier="1.2"
37
            android:layout_marginEnd="16dp"
38
            android:layout_marginStart="16dp"
39
            android:lineSpacingExtra="2dp"
40
            android:layout_marginTop="15dp"
41
            android:id="@+id/content"
42
            android:layout_width="match_parent"
43
            android:layout_height="wrap_content"
44
            tools:text="我知道你关注我很久了快来注册登录吧\n登录后可以在部分充电桩扫码充电认证车主还有充电优惠"
45
            android:textColor="#ff0e0e0e"
46
            android:textSize="14sp"
47
            app:layout_constraintEnd_toEndOf="parent"
48
            app:layout_constraintStart_toStartOf="parent"
49
            app:layout_constraintTop_toBottomOf="@id/logoDialog" />
50
51
        <ImageView
52
            app:layout_constraintBottom_toBottomOf="parent"
53
            android:id="@+id/neglect"
54
            app:layout_constraintStart_toStartOf="parent"
55
            app:layout_constraintTop_toBottomOf="@id/content"
56
            android:src="@drawable/ic_neglect"
57
            app:layout_constraintEnd_toStartOf="@id/goIntent"
58
            android:layout_width="wrap_content"
59
            android:layout_height="wrap_content"/>
60
61
        <ImageView
62
            app:layout_constraintBottom_toBottomOf="parent"
63
            app:layout_constraintEnd_toEndOf="parent"
64
            app:layout_constraintStart_toEndOf="@+id/neglect"
65
            android:id="@+id/goIntent"
66
            app:layout_constraintTop_toBottomOf="@id/content"
67
            tools:src="@drawable/ic_go_login"
68
            android:layout_width="wrap_content"
69
            android:layout_height="wrap_content"/>
70
    </androidx.constraintlayout.widget.ConstraintLayout>
71
72
</RelativeLayout>

dudu/cdzApp - Gogs: Go Git Service

442 Commits (32504077ae10c5aaf1b15057cdeeab93c849259d)

Author SHA1 Message Date
  hy 32504077ae 完成未登录用户提示框的弹出逻辑及展示 5 years ago
  hy 55806a5142 为站点列表添加停车费展示 5 years ago
  hy 446b8d515b 修改首页tab样式 5 years ago
  hy 5b57ae0a9e 删除无用so,添加高德sdk的so 5 years ago
  hy 4c85721583 删除无用so,并且升级依赖库的版本,将极光推送依赖模式改为远程依赖 5 years ago
  huyuguo 7b1da8f139 代码修改 5 years ago
  huyuguo 73124baf8e Update MainMapActivity.java 5 years ago
  huyuguo b972df88df Update build.gradle 5 years ago
  huyuguo 305093d510 webview图片保存功能添加 5 years ago
  huyuguo 381b82b3d2 开发完成 5 years ago
  huyuguo 1784adb651 代码修改 5 years ago
  huyuguo f2a095d83e web页面跳转原生功能添加 5 years ago
  huyuguo 11142fa722 加入车主群开发完成 5 years ago
  huyuguo b967a6bcb0 扫码充电图标更新 5 years ago
  huyuguo d240eb2b8a 上报停车位功能去除 5 years ago
  huyuguo 416615eb11 站点列表开发完成 5 years ago
  huyuguo 752114f660 列表更新为附近 5 years ago
  huyuguo d9a4593012 城市切换修改完成 5 years ago
  huyuguo 2f57a882f5 个人信息跳过添加完成 5 years ago
  huyuguo 3a5a14c12a 充电状态修改完成 5 years ago
  huyuguo 8ee6f76217 Update AndroidManifest.xml 5 years ago
  huyuguo f6c3209481 冗余代码删除 5 years ago
  huyuguo 5c68143e90 代码修改 6 years ago
  huyuguo c1b0b52f17 代码优化 6 years ago
  huyuguo 8fae6e118f 代码修改 6 years ago
  huyuguo 4811a8baed 代码提交 6 years ago
  huyuguo 9ed947b87c 首页导航权限设置 6 years ago
  huyuguo 461f765c97 注册隐私政策添加 6 years ago
  huyuguo 2eba1d95a9 相机权限设置 6 years ago
  huyuguo 3158c4254a 隐私政策和权限设置调整 6 years ago
  huyuguo fbc89da2d5 代码更新 6 years ago
  huyuguo e3e960f2f7 代码修改 6 years ago
  huyuguo 5c679057b2 消息推送修改 6 years ago
  huyuguo dccf7f6734 代码修改 6 years ago
  huyuguo f8edf7d85c 代码优化 6 years ago
  huyuguo 6b63b7703f 收藏夹修改 6 years ago
  huyuguo 6a256dfb15 代码提交 6 years ago
  huyuguo 9ad1e8d95a 优质评价添加完成 6 years ago
  huyuguo 041a09647c 代码修改 6 years ago
  huyuguo 243cec858a 代码修改 6 years ago
  huyuguo 6824f6d6df 代码修改 6 years ago
  huyuguo 1922051b91 需求完善 6 years ago
  huyuguo 29465fb852 站点列表修改 6 years ago
  huyuguo 9b113d9fa2 我的收藏修改 6 years ago
  huyuguo a1dbf269a8 代码整理 6 years ago
  huyuguo 2e20fd70e1 个人信息修改完成 6 years ago
  huyuguo 63b52c4d3c 代码提交 6 years ago
  huyuguo dc6f6c4427 车主认证开发 6 years ago
  huyuguo c2143716ef 车主认证开发 6 years ago
  huyuguo ad7d3228bc 车主认证图片上传 6 years ago