Commit 216ca52fecb9e58a653ebccfb5edefbcd369c323
1 parent
ab7bb5bf35
Exists in
master
未制作解析的作业不能反馈
Showing
4 changed files
with
18 additions
and
15 deletions
 
Show diff stats
.idea/deploymentTargetDropDown.xml
| ... | ... | @@ -3,20 +3,7 @@ | 
| 3 | 3 | <component name="deploymentTargetDropDown"> | 
| 4 | 4 | <value> | 
| 5 | 5 | <entry key="app"> | 
| 6 | - <State> | |
| 7 | - <runningDeviceTargetSelectedWithDropDown> | |
| 8 | - <Target> | |
| 9 | - <type value="RUNNING_DEVICE_TARGET" /> | |
| 10 | - <deviceKey> | |
| 11 | - <Key> | |
| 12 | - <type value="SERIAL_NUMBER" /> | |
| 13 | - <value value="951f9ace" /> | |
| 14 | - </Key> | |
| 15 | - </deviceKey> | |
| 16 | - </Target> | |
| 17 | - </runningDeviceTargetSelectedWithDropDown> | |
| 18 | - <timeTargetWasSelectedWithDropDown value="2024-10-11T03:36:34.174716500Z" /> | |
| 19 | - </State> | |
| 6 | + <State /> | |
| 20 | 7 | </entry> | 
| 21 | 8 | </value> | 
| 22 | 9 | </component> | ... | ... | 
app/src/main/java/com/hjx/parent/HomeworkDetailActivity.java
| ... | ... | @@ -14,6 +14,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter; | 
| 14 | 14 | import com.chad.library.adapter.base.BaseViewHolder; | 
| 15 | 15 | import com.hjx.parent.databinding.ActivityHomeworkDetailBinding; | 
| 16 | 16 | import com.hjx.parent.dialog.EditHomeworkDialog; | 
| 17 | +import com.hjx.parent.dialog.MsgConfirmDialog; | |
| 17 | 18 | import com.hjx.parent.rx.BaseRxActivity; | 
| 18 | 19 | import com.prws.common.bean.ResponseResult; | 
| 19 | 20 | import com.prws.common.bean.Student; | 
| ... | ... | @@ -32,6 +33,7 @@ public class HomeworkDetailActivity extends BaseRxActivity<ActivityHomeworkDetai | 
| 32 | 33 | |
| 33 | 34 | private Adapter mAdapter = new Adapter(); | 
| 34 | 35 | private EditHomeworkDialog mDialog; | 
| 36 | + private MsgConfirmDialog noAnalyseDialog; | |
| 35 | 37 | |
| 36 | 38 | @Override | 
| 37 | 39 | public void initView(Bundle savedInstanceState) { | 
| ... | ... | @@ -39,6 +41,9 @@ public class HomeworkDetailActivity extends BaseRxActivity<ActivityHomeworkDetai | 
| 39 | 41 | mData = (HomeworkList) getIntent().getSerializableExtra("data"); | 
| 40 | 42 | student = (Student) getIntent().getSerializableExtra("student"); | 
| 41 | 43 | mDialog = new EditHomeworkDialog(this, mData); | 
| 44 | + noAnalyseDialog = new MsgConfirmDialog.Builder(this) | |
| 45 | + .setNegative("").setPositive("好的") | |
| 46 | + .setMessage("尚未完成解析制作,\n请先去好记星平板端制作解析").build(); | |
| 42 | 47 | binding.tvTitle.setText(mData.getName()); | 
| 43 | 48 | |
| 44 | 49 | binding.recyclerView.setAdapter(mAdapter); | 
| ... | ... | @@ -46,6 +51,10 @@ public class HomeworkDetailActivity extends BaseRxActivity<ActivityHomeworkDetai | 
| 46 | 51 | |
| 47 | 52 | binding.btnFeedback.setOnClickListener(v -> { | 
| 48 | 53 | if (mAdapter.getData().size() == 0) return; | 
| 54 | + if (mData.getCompleteFlag() == 0) { | |
| 55 | + noAnalyseDialog.show(); | |
| 56 | + return; | |
| 57 | + } | |
| 49 | 58 | Intent intent = new Intent(this, HomeworkSelectActivity.class); | 
| 50 | 59 | intent.putExtra("data", mData); | 
| 51 | 60 | intent.putExtra("student", student); | ... | ... | 
app/src/main/java/com/hjx/parent/dialog/MsgConfirmDialog.java
| 1 | 1 | package com.hjx.parent.dialog; | 
| 2 | 2 | |
| 3 | 3 | import android.content.Context; | 
| 4 | +import android.view.View; | |
| 4 | 5 | |
| 5 | 6 | import androidx.annotation.NonNull; | 
| 6 | 7 | |
| ... | ... | @@ -41,6 +42,12 @@ public class MsgConfirmDialog extends BaseDialog<DialogMessageConfirmBinding>{ | 
| 41 | 42 | dismiss(); | 
| 42 | 43 | } | 
| 43 | 44 | }); | 
| 45 | + if (positive == null || positive.length() == 0) { | |
| 46 | + binding.btnPositive.setVisibility(View.GONE); | |
| 47 | + } | |
| 48 | + if (negative == null || negative.length() == 0) { | |
| 49 | + binding.btnNegative.setVisibility(View.GONE); | |
| 50 | + } | |
| 44 | 51 | } | 
| 45 | 52 | |
| 46 | 53 | public void show(Function10<Boolean> positiveClick, Function10<Boolean> negativeClick) { | ... | ... | 
app/src/main/res/layout/dialog_message_confirm.xml
| ... | ... | @@ -43,7 +43,6 @@ | 
| 43 | 43 | android:layout_height="1dp"/> | 
| 44 | 44 | <LinearLayout | 
| 45 | 45 | android:orientation="horizontal" | 
| 46 | - android:weightSum="2" | |
| 47 | 46 | android:layout_width="match_parent" | 
| 48 | 47 | android:layout_height="44dp"> | 
| 49 | 48 | <TextView | 
| ... | ... | @@ -60,6 +59,7 @@ | 
| 60 | 59 | android:background="#EEE" | 
| 61 | 60 | android:layout_marginVertical="3dp" | 
| 62 | 61 | android:layout_width="1dp" | 
| 62 | + android:layout_marginStart="1dp" | |
| 63 | 63 | android:layout_height="match_parent"/> | 
| 64 | 64 | <TextView | 
| 65 | 65 | android:id="@+id/btnPositive" | ... | ... |