Преглед на файлове

添加评论提醒dialog

hy преди 3 години
родител
ревизия
c75e35b96c

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

@ -4163,12 +4163,13 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
4163 4163
        DaoSession mDaoSession = daoMaster.newSession();
4164 4164
        zhan_listDao = mDaoSession.getZhan_listDao();
4165 4165
4166
        zhan_lists = zhan_listDao.queryRaw("where status = ? " + MainApplication.sql, new String[]{"4"});
4167 4166
        if (onResumeRefresh == true) {
4168 4167
            ToastUtil.showToast(getApplicationContext(), "共" + zhan_lists.size() + "个符合条件的站点", Toast.LENGTH_SHORT);
4169 4168
        }
4169
4170 4170
        new Thread() {
4171 4171
            public void run() {
4172
                zhan_lists = zhan_listDao.queryRaw("where status = ? " + MainApplication.sql, new String[]{"4"});
4172 4173
                List<ClusterItem> items = new ArrayList<ClusterItem>();
4173 4174
                if (zhan_lists != null && zhan_lists.size() > 0) {
4174 4175
                    for (int i = 0; i < zhan_lists.size(); i++) {

+ 8 - 3
app/src/main/java/com/electric/chargingpile/activity/ZhanCommentActivity.java

@ -43,6 +43,7 @@ import android.widget.TextView;
43 43
import android.widget.Toast;
44 44
45 45
import androidx.annotation.NonNull;
46
import androidx.appcompat.app.AppCompatActivity;
46 47
47 48
import com.blankj.utilcode.util.CacheUtils;
48 49
import com.electric.chargingpile.R;
@ -68,6 +69,7 @@ import com.electric.chargingpile.util.StatusConstants;
68 69
import com.electric.chargingpile.util.ToastUtil;
69 70
import com.electric.chargingpile.util.UploadUtil;
70 71
import com.electric.chargingpile.util.Util;
72
import com.electric.chargingpile.view.CommentHintDialog;
71 73
import com.electric.chargingpile.view.REditText;
72 74
import com.electric.chargingpile.view.RatingBarView;
73 75
@ -107,7 +109,7 @@ import okhttp3.Call;
107 109
import pub.devrel.easypermissions.AfterPermissionGranted;
108 110
import pub.devrel.easypermissions.EasyPermissions;
109 111
110
public class ZhanCommentActivity extends Activity implements View.OnClickListener, EasyPermissions.PermissionCallbacks {
112
public class ZhanCommentActivity extends AppCompatActivity implements View.OnClickListener, EasyPermissions.PermissionCallbacks {
111 113
    private static final String TAG = "ZhanCommentActivity";
112 114
    private static final int PIC_NUM = 1;
113 115
    private ProgressDialog insertDialog;
@ -131,7 +133,7 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
131 133
    List<String> list;
132 134
    private String select_s = "";
133 135
    private String select_ss = "";
134
    private TextView tv_grade, tv_point;
136
    private TextView tv_grade, tv_point,tv_zhan_name;
135 137
136 138
    private static String PHOTO_FILE_NAME = "";
137 139
    private static final String PHOTO_FILE_PATH = getPath(PhotoUtils.CACHE_DIR);
@ -214,6 +216,7 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
214 216
        insertDialog.setCanceledOnTouchOutside(false);
215 217
        rl_point = (RelativeLayout) findViewById(R.id.rl_point);
216 218
        tv_point = (TextView) findViewById(R.id.tv_point);
219
        tv_zhan_name = (TextView) findViewById(R.id.tv_zhan_name);
217 220
        animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.nn);
218 221
219 222
        relativeLayout = (RelativeLayout) findViewById(R.id.activity_zhan_comment);
@ -439,7 +442,9 @@ public class ZhanCommentActivity extends Activity implements View.OnClickListene
439 442
            }
440 443
        });
441 444
442
445
        tv_zhan_name.setOnClickListener(v->{
446
            CommentHintDialog.newInstart().show(getSupportFragmentManager());
447
        });
443 448
    }
444 449
445 450
    public void Init() {

+ 59 - 0
app/src/main/java/com/electric/chargingpile/view/CommentHintDialog.java

@ -0,0 +1,59 @@
1
package com.electric.chargingpile.view;
2
3
import android.os.Bundle;
4
import android.view.LayoutInflater;
5
import android.view.View;
6
import android.view.ViewGroup;
7
8
import androidx.annotation.NonNull;
9
import androidx.annotation.Nullable;
10
import androidx.fragment.app.DialogFragment;
11
import androidx.fragment.app.Fragment;
12
import androidx.fragment.app.FragmentManager;
13
import androidx.fragment.app.FragmentTransaction;
14
15
import com.electric.chargingpile.R;
16
17
import org.jetbrains.annotations.NotNull;
18
19
public class CommentHintDialog extends DialogFragment {
20
21
    public static CommentHintDialog newInstart(){
22
        return  new CommentHintDialog();
23
    }
24
25
    @Override
26
    public void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
27
        super.onCreate(savedInstanceState);
28
        setStyle(DialogFragment.STYLE_NORMAL, R.style.TransparentVideoDialogFragmentTheme);
29
30
    }
31
    @Nullable
32
    @org.jetbrains.annotations.Nullable
33
    @Override
34
    public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
35
        View rootView = LayoutInflater.from(requireContext()).inflate(R.layout.dialog_comment_hint, container, false);
36
        return rootView;
37
    }
38
39
    @Override
40
    public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
41
        super.onViewCreated(view, savedInstanceState);
42
        view.findViewById(R.id.closeImg).setOnClickListener(v->{
43
            dismissAllowingStateLoss();
44
        });
45
        view.findViewById(R.id.understood).setOnClickListener(v->{
46
            dismissAllowingStateLoss();
47
        });
48
    }
49
50
    public void show(FragmentManager fragmentManager){
51
        FragmentTransaction ft = fragmentManager.beginTransaction();
52
        Fragment prev = fragmentManager.findFragmentByTag(CommentHintDialog.class.getName());
53
        if (prev != null) {
54
            ft.remove(prev);
55
        }
56
        show(fragmentManager,CommentHintDialog.class.getName());
57
        fragmentManager.executePendingTransactions();
58
    }
59
}

BIN
app/src/main/res/drawable-xhdpi/bg_w_1.9.png


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


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

@ -0,0 +1,5 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
    <solid android:color="@color/lvse_style" /><!--填充色-->
4
    <corners android:radius="20dp" />
5
</shape>

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

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

+ 2 - 0
app/src/main/res/layout/activity_zhan_comment.xml

@ -36,6 +36,8 @@
36 36
        android:background="@color/title_background">
37 37
38 38
        <TextView
39
            android:drawablePadding="5dp"
40
            android:drawableEnd="@drawable/ic_comm_hint"
39 41
            android:id="@+id/tv_zhan_name"
40 42
            android:layout_width="wrap_content"
41 43
            android:layout_height="wrap_content"

+ 80 - 0
app/src/main/res/layout/dialog_comment_hint.xml

@ -0,0 +1,80 @@
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
    tools:background="#f1f1"
5
    android:gravity="center"
6
    android:layout_height="match_parent"
7
    xmlns:app="http://schemas.android.com/apk/res-auto"
8
    xmlns:tools="http://schemas.android.com/tools">
9
10
    <androidx.constraintlayout.widget.ConstraintLayout
11
12
        android:layout_width="268dp"
13
        android:background="@drawable/bg_comment_hint"
14
        android:layout_height="wrap_content">
15
16
        <ImageView
17
            android:layout_marginEnd="24dp"
18
            android:layout_marginTop="16dp"
19
            android:id="@+id/closeImg"
20
            android:layout_width="wrap_content"
21
            android:layout_height="wrap_content"
22
            android:src="@drawable/icon_black_close"
23
            app:layout_constraintEnd_toEndOf="parent"
24
            app:layout_constraintTop_toTopOf="parent" />
25
26
        <ImageView
27
            android:id="@+id/titleImg"
28
            android:layout_marginTop="20dp"
29
            android:layout_width="wrap_content"
30
            android:layout_height="wrap_content"
31
            app:layout_constraintEnd_toEndOf="parent"
32
            app:layout_constraintStart_toStartOf="parent"
33
            app:layout_constraintTop_toBottomOf="@+id/closeImg"
34
            android:src="@drawable/ic_logout_dialog" />
35
36
        <TextView
37
            android:textStyle="bold"
38
            android:id="@+id/hintText"
39
            android:layout_marginTop="20dp"
40
            app:layout_constraintEnd_toEndOf="parent"
41
            app:layout_constraintStart_toStartOf="parent"
42
            app:layout_constraintTop_toBottomOf="@+id/titleImg"
43
            android:layout_width="wrap_content"
44
            android:layout_height="wrap_content"
45
            android:text="评论发布小贴士"
46
            android:textColor="#ff0e0e0e"
47
            android:textSize="18sp"
48
            />
49
50
        <TextView
51
            android:layout_marginEnd="16dp"
52
            android:layout_marginStart="16dp"
53
            android:layout_marginTop="20dp"
54
            app:layout_constraintTop_toBottomOf="@+id/hintText"
55
            app:layout_constraintEnd_toEndOf="parent"
56
            app:layout_constraintStart_toStartOf="parent"
57
            android:layout_width="match_parent"
58
            android:layout_height="wrap_content"
59
            android:text="充电桩APP鼓励并支持对车主有帮助的评价,以下几种评价的账户会被禁言:\n\n1.有违法违规、低俗的内容\n\n2.含有网址、广告图片、微信号、手机号、QQ号等营销信息\n\n3.多次无实际内容的评价或内容基本相同的评价"
60
            android:textColor="#ff0e0e0e"
61
            android:textSize="14sp"
62
            android:id="@+id/contentText"
63
            />
64
65
        <TextView
66
            android:id="@+id/understood"
67
            app:layout_constraintBottom_toBottomOf="parent"
68
            android:layout_marginBottom="16dp"
69
            android:layout_marginTop="16dp"
70
            app:layout_constraintEnd_toEndOf="parent"
71
            app:layout_constraintStart_toStartOf="parent"
72
            app:layout_constraintTop_toBottomOf="@+id/contentText"
73
            android:gravity="center"
74
            android:background="@drawable/bg_btn_greenfull_style"
75
            android:text="我知道了"
76
            android:textColor="@color/white"
77
            android:layout_width="110dp"
78
            android:layout_height="40dp"/>
79
    </androidx.constraintlayout.widget.ConstraintLayout>
80
</RelativeLayout>

+ 1 - 0
app/src/main/res/values/color.xml

@ -149,6 +149,7 @@
149 149
    <color name="editcolor">#333333</color>
150 150
    <color name="juhuang">#ff9a00</color>
151 151
    <color name="lvse">#01b637</color>
152
    <color name="lvse_style">#3EC34C</color>
152 153
    <color name="status_blue">#487FFF</color>
153 154
    <color name="juse">#ff9e05</color>
154 155
    <color name="ogreen">#c5ecd0</color>