Browse Source

修复翻转问题

master-new-炒锅
liup 3 days ago
parent
commit
045cfbb458
4 changed files with 47 additions and 17 deletions
  1. +11
    -0
      .idea/other.xml
  2. +3
    -3
      app/release/output-metadata.json
  3. +31
    -12
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  4. +2
    -2
      build.gradle

+ 11
- 0
.idea/other.xml View File

@@ -14,6 +14,17 @@
<option name="screenX" value="720" />
<option name="screenY" value="1280" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="34" />
<option name="brand" value="OPPO" />
<option name="codename" value="OP573DL1" />
<option name="id" value="OP573DL1" />
<option name="manufacturer" value="OPPO" />
<option name="name" value="CPH2557" />
<option name="screenDensity" value="480" />
<option name="screenX" value="1080" />
<option name="screenY" value="2400" />
</PersistentDeviceSelectionData>
<PersistentDeviceSelectionData>
<option name="api" value="28" />
<option name="brand" value="DOCOMO" />


+ 3
- 3
app/release/output-metadata.json View File

@@ -11,9 +11,9 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 122,
"versionName": "1.2.2",
"outputFile": "boluo-xiaochao-v122-202412131549-release.apk"
"versionCode": 124,
"versionName": "1.2.4",
"outputFile": "boluo-xiaochao-v124-202412311629-release.apk"
}
],
"elementType": "File"

+ 31
- 12
app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java View File

@@ -158,6 +158,8 @@ public class Home1Fragment extends BaseFragment {
@BindView(R.id.rl_goods_detail)
RelativeLayout rl_goods_detail;

private boolean isOnTouch = false;

private Handler handler = new Handler(Looper.getMainLooper()){
@Override
public void handleMessage(@NonNull Message msg) {
@@ -189,6 +191,9 @@ public class Home1Fragment extends BaseFragment {
}
}
handler.sendEmptyMessageDelayed(1,500);
}else if(msg.what == 2){
ExecuteTheRecipe.WritePLC("翻转反转", false, null);
ExecuteTheRecipe.WritePLC("翻转正转", false, null);
}
}
};
@@ -563,25 +568,31 @@ public class Home1Fragment extends BaseFragment {
NewToastUtil.getInstance().showToastError("PLC未准备就绪!!!","PLC not connected");
return false;
}

if(!isOnTouch){
handler.removeMessages(2);
isOnTouch = true;
}
int jd = (int) nifty_slider3.getValue();
ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() {
@Override
public void onSuccess() {
if (jd == 0) {
ExecuteTheRecipe.WritePLC("翻转正转", false, null);
} else {
ExecuteTheRecipe.WritePLC("翻转正转", true, null);
}
}

}
@Override
public void onFailure(String ErrorMsg) {
}
});
if (jd == 0) {
ExecuteTheRecipe.WritePLC("翻转正转", false, null);
} else {
ExecuteTheRecipe.WritePLC("翻转正转", true, null);
}
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
isOnTouch = false;
Log.e("鼠标", "松开: ");
ExecuteTheRecipe.WritePLC("翻转反转", false, null);
ExecuteTheRecipe.WritePLC("翻转正转", false, null);
handler.sendEmptyMessageDelayed(2,100);
}
return false;
}
@@ -600,24 +611,32 @@ public class Home1Fragment extends BaseFragment {
NewToastUtil.getInstance().showToastError("PLC未准备就绪!!!","PLC not connected");
return false;
}
if(!isOnTouch){
handler.removeMessages(2);
isOnTouch = true;
}
int jd = (int) nifty_slider3.getValue();
ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() {
@Override
public void onSuccess() {
if (jd == 0) {
ExecuteTheRecipe.WritePLC("翻转反转", false, null);
} else {
ExecuteTheRecipe.WritePLC("翻转反转", true, null);
}

}

@Override
public void onFailure(String ErrorMsg) {
}
});
if (jd == 0) {
ExecuteTheRecipe.WritePLC("翻转反转", false, null);
} else {
ExecuteTheRecipe.WritePLC("翻转反转", true, null);
}
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
isOnTouch = false;
Log.e("鼠标", "松开: ");
ExecuteTheRecipe.WritePLC("翻转正转", false, null);
ExecuteTheRecipe.WritePLC("翻转反转", false, null);
handler.sendEmptyMessageDelayed(2,100);
}
return false;
}


+ 2
- 2
build.gradle View File

@@ -35,8 +35,8 @@ task clean(type: Delete) {

ext { // 统一版本入口
//App版本号
versionCode = 122
versionName = "1.2.2"
versionCode = 124
versionName = "1.2.4"

// 支持Android版本
buildToolsVersion = "33.0.0"


Loading…
Cancel
Save