[2.14.0]录包工具修复空间预警弹窗问题

This commit is contained in:
xuxinchao
2023-02-21 17:57:34 +08:00
parent 81e22becd3
commit 803764c97e
4 changed files with 46 additions and 23 deletions

View File

@@ -22,6 +22,8 @@ public class SpaceWarningDialog extends Dialog {
private TextView tvCancel;//取消
private Activity mActivity;
private ClickListener clickListener;
public SpaceWarningDialog(@NonNull Activity activity) {
super(activity, R.style.bad_case_dialog);
mActivity = activity;
@@ -49,8 +51,11 @@ public class SpaceWarningDialog extends Dialog {
//清理磁盘
tvCleanDisk.setOnClickListener(v -> {
//跳转录包管理页面
if(mActivity!=null){
CallerDevaToolsManager.INSTANCE.showBadCaseManagerView(mActivity);
// if(mActivity!=null){
// CallerDevaToolsManager.INSTANCE.showBadCaseManagerView(mActivity);
// }
if(clickListener!=null){
clickListener.showBadCaseManagerView();
}
dismiss();
});
@@ -61,6 +66,10 @@ public class SpaceWarningDialog extends Dialog {
});
}
public void setClickListener(ClickListener clickListener){
this.clickListener = clickListener;
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
@@ -71,4 +80,8 @@ public class SpaceWarningDialog extends Dialog {
super.onDetachedFromWindow();
}
public interface ClickListener{
void showBadCaseManagerView();
}
}

View File

@@ -80,17 +80,4 @@
android:progressDrawable="@drawable/space_warning_progress_bg"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="378px"
android:text="100G"
android:textColor="#FFFF6200"
android:textSize="43px"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -64,13 +64,14 @@
<TextView
android:id="@+id/tvBagTime"
android:layout_width="wrap_content"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
android:textSize="26dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
android:layout_marginEnd="30dp"
android:gravity="start"
/>
<TextView

View File

@@ -194,6 +194,9 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
private var bagManagerEntity: BagManagerEntity = BagManagerEntity()
private var spaceWarningDialog: SpaceWarningDialog ?=null
private var isShowWarningDialog = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
@@ -407,13 +410,32 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
super.onBagManagerResult(bagManager)
//判断磁盘是否已满,展示预警弹窗
UiThreadHandler.post{
if(bagManager.spaceInfoRespCount>0){
for(spaceInfo in bagManager.spaceInfoRespList){
for(bagSpaceInfo in spaceInfo.bagDirsSpaceInfoList){
if(bagSpaceInfo.free == 0L){
//磁盘空间已满
val spaceWarningDialog = SpaceWarningDialog(context as Activity)
spaceWarningDialog.show()
if(bagManager.reqType == 1){
if(bagManager.spaceInfoRespCount>0){
for(spaceInfo in bagManager.spaceInfoRespList){
for(bagSpaceInfo in spaceInfo.bagDirsSpaceInfoList){
if(bagSpaceInfo.free == 0L){
//磁盘空间已满
if(!isShowWarningDialog){
if(spaceWarningDialog == null){
spaceWarningDialog = SpaceWarningDialog(context as Activity)
spaceWarningDialog?.setClickListener(object:SpaceWarningDialog.ClickListener{
override fun showBadCaseManagerView() {
if(mBadCaseManagerView == null){
toggleBagManagerView()
}
}
})
}
spaceWarningDialog?.let {
if(!it.isShowing){
it.show()
}
}
isShowWarningDialog = true
}
}
}
}
}