Pārlūkot izejas kodu

修改重复点击弹窗问题

调味吧台
liup pirms 5 mēnešiem
vecāks
revīzija
04a7c0e479
4 mainītis faili ar 43 papildinājumiem un 0 dzēšanām
  1. +6
    -0
      .idea/inspectionProfiles/Project_Default.xml
  2. +18
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java
  3. +1
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/AddGoodDialog.java
  4. +18
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodsEditView.java

+ 6
- 0
.idea/inspectionProfiles/Project_Default.xml Parādīt failu

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AndroidLintUnsafeImplicitIntentLaunch" enabled="false" level="ERROR" enabled_by_default="false" />
</profile>
</component>

+ 18
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/GoodPeiFangActivity.java Parādīt failu

@@ -436,6 +436,10 @@ public class GoodPeiFangActivity extends BaseActivity {
.show();
break;
case R.id.add_sp://增加商品
if(isFastClick()){
ToastUtils.info("请勿快速点击!");
return;
}
if(goodstypes.isEmpty()){
ToastUtils.info("请先创建至少一个分类");
return;
@@ -474,6 +478,20 @@ public class GoodPeiFangActivity extends BaseActivity {
}
}

/**
* 判断重复点击
*/
private long lastTime;

public boolean isFastClick(){
long curTime = System.currentTimeMillis();
if(curTime - lastTime < 1000){
return true;
}
lastTime = curTime;
return false;
}

@Override
public void onDestroy() {
viewBinding.goodEditView.destroy();


+ 1
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/AddGoodDialog.java Parādīt failu

@@ -129,6 +129,7 @@ public class AddGoodDialog extends DialogFragment {

Map<String,String> mapTypes = new LinkedHashMap<>();
private void initData(){
url = "";
for (BPA_GOODSTYPE item:QueryDB.GetGoodsTypeALL())
{
mapTypes.put(item.name,item.id);


+ 18
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/GoodsEditView.java Parādīt failu

@@ -421,6 +421,10 @@ public class GoodsEditView extends LinearLayout {

@Override
protected void onCopy(int position, BPA_GOODSRECIPENAME bean) {
if(isFast2Click()){
ToastUtils.info("请勿快速点击!");
return;
}
if(copyRecipeDialog == null){
copyRecipeDialog = new CopyRecipeDialog();
}
@@ -463,6 +467,20 @@ public class GoodsEditView extends LinearLayout {
viewBinding.recyclerDetail.setAdapter(groupAdapter);
}

/**
* 判断重复点击
*/
private long lastTime2;

public boolean isFast2Click(){
long curTime = System.currentTimeMillis();
if(curTime - lastTime2 < 1000){
return true;
}
lastTime2 = curTime;
return false;
}

/**
* 销毁
*/


Notiek ielāde…
Atcelt
Saglabāt