diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index eb2873e7..1e2d92c1 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -26,5 +26,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 748d2c48..940adac2 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -55,17 +55,19 @@ dependencies {
//测试相关
testImplementation 'junit:junit:4.13-beta-2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.1'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
- implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
//支持包
- implementation 'com.google.android.material:material:1.0.0'
- implementation 'androidx.appcompat:appcompat:1.0.0'
- implementation 'androidx.recyclerview:recyclerview:1.0.0'
- implementation 'com.google.android.material:material:1.0.0'
+ implementation 'androidx.appcompat:appcompat:1.6.0-alpha01'
+ implementation 'com.google.android.material:material:1.6.0-beta01'
+// implementation 'com.google.android.material:material:1.0.0'
+// implementation 'androidx.appcompat:appcompat:1.0.0'
+ implementation 'androidx.recyclerview:recyclerview:1.2.1'
+ //implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
- implementation 'androidx.vectordrawable:vectordrawable:1.0.0'
+ implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
// QMUI框架 link: http://qmuiteam.com/android
// 本App 搭建的基础框架,基本使用控件功能请看官网的功能列表
@@ -105,11 +107,11 @@ dependencies {
implementation 'com.orhanobut:logger:2.2.0'
// leak 内存泄漏检测
- debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
- releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
- // Optional, if you use support library fragments:
- debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
- implementation files('libs/commons-codec-1.6.jar')
+// debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
+// releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
+// // Optional, if you use support library fragments:
+// debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
+// implementation files('libs/commons-codec-1.6.jar')
//MQTT
implementation files('libs\\org.eclipse.paho.android.service-1.1.1.jar')
@@ -134,5 +136,5 @@ dependencies {
implementation 'com.yanzhenjie:permission:2.0.0-rc12'
//滑动快
-// implementation 'io.github.litao0621:nifty-slider:1.0.2'
+ implementation 'io.github.litao0621:nifty-slider:1.4.0'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 6e0ab20a..bcefbb90 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -30,7 +30,7 @@
tools:node="merge">
+ android:exported="false" tools:ignore="Instantiatable"/>
@@ -42,28 +42,31 @@
android:exported="false" />
+ android:exported="false"
+ tools:ignore="Instantiatable" />
+ android:exported="false"
+ tools:ignore="Instantiatable"/>
+ android:exported="false" tools:ignore="Instantiatable"/>
+ android:exported="false" tools:ignore="Instantiatable"/>
+ android:exported="false" tools:ignore="Instantiatable"/>
+ android:exported="false"
+ tools:ignore="Instantiatable" />
+ android:exported="false" tools:ignore="Instantiatable"/>
+ android:exported="false" tools:ignore="Instantiatable"/>
@@ -95,7 +98,8 @@
+ android:theme="@style/AppTheme.Launcher"
+ android:exported="true">
diff --git a/app/src/main/java/com/bonait/bnframework/MainApplication.java b/app/src/main/java/com/bonait/bnframework/MainApplication.java
index 58a48d9c..7e88fac7 100644
--- a/app/src/main/java/com/bonait/bnframework/MainApplication.java
+++ b/app/src/main/java/com/bonait/bnframework/MainApplication.java
@@ -43,7 +43,6 @@ import com.orhanobut.logger.FormatStrategy;
import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy;
import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
-import com.squareup.leakcanary.LeakCanary;
import org.litepal.LitePal;
@@ -384,10 +383,10 @@ public class MainApplication extends Application {
private void initLeakCanary(boolean flag) {
if (flag) {
// leak 内存检测注册
- if (LeakCanary.isInAnalyzerProcess(this)) {
- return;
- }
- LeakCanary.install(this);
+// if (LeakCanary.isInAnalyzerProcess(this)) {
+// return;
+// }
+// LeakCanary.install(this);
}
}
diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
index 777c562c..c1481e0f 100644
--- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
+++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
@@ -4,7 +4,10 @@ package com.bonait.bnframework.modules.home.fragment;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
+import android.content.res.ColorStateList;
+import android.graphics.Canvas;
import android.graphics.Color;
+import android.graphics.RectF;
import android.os.Bundle;
import androidx.annotation.NonNull;
@@ -46,6 +49,9 @@ import com.bonait.bnframework.modules.home.fragment.mode.MyStatus;
import com.bonait.bnframework.modules.home.fragment.mode.huoli_control;
import com.bonait.bnframework.modules.home.fragment.mode.imagebutton_control;
import com.capton.colorfulprogressbar.ColorfulProgressbar;
+import com.litao.slider.NiftySlider;
+import com.litao.slider.SliderEffect;
+import com.litao.slider.Utils;
import com.orhanobut.logger.Logger;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
@@ -90,10 +96,6 @@ public class Home1Fragment extends BaseFragment {
imagebutton_control zhuandong_control_left;//左转
@BindView(R.id.zhuandong_control_Rift)
imagebutton_control zhuandong_control_Rift;//右转
- @BindView(R.id.jb_dw)
- SeekBar jb_dw;//
- @BindView(R.id.zd_dw)
- SeekBar zd_dw;//
@BindView(R.id.chaoguo_wendu)
QMUILinkTextView chaoguo_wendu;//
@BindView(R.id.chaoguo_weizhi)
@@ -101,6 +103,12 @@ public class Home1Fragment extends BaseFragment {
@BindView(R.id.plc_zhuangtai)
QMUILinkTextView plc_zhuangtai;//
+ @BindView(R.id.nifty_slider2)
+ NiftySlider nifty_slider2;//
+
+ @BindView(R.id.nifty_slider3)
+ NiftySlider nifty_slider3;//
+
public boolean Status = false;
/**
* 当前制作商品信息
@@ -128,6 +136,20 @@ public class Home1Fragment extends BaseFragment {
HuoLiClicked();
MakeThread();
ControlClicked();
+
+ nifty_slider2.setOnValueChangeListener(new NiftySlider.OnValueChangeListener() {
+ @Override
+ public void onValueChange(@NonNull NiftySlider niftySlider, float v, boolean b) {
+ nifty_slider2.setThumbText((int)v+"");
+ }
+ });
+
+ nifty_slider3.setOnValueChangeListener(new NiftySlider.OnValueChangeListener() {
+ @Override
+ public void onValueChange(@NonNull NiftySlider niftySlider, float v, boolean b) {
+ nifty_slider3.setThumbText((int)v+"");
+ }
+ });
}
/**
@@ -207,7 +229,7 @@ public class Home1Fragment extends BaseFragment {
@Override
public void clickListener(View v, Object data) {
boolean status=(boolean) data;
- int jd= jb_dw.getProgress();
+ int jd=(int) nifty_slider2.getValue();
ToastUtils.info("点击按钮:搅拌"+status+".搅拌频率:"+jd);
ExecuteTheRecipe.WritePLC("搅拌速度", jd, new IWriteCallBack() {
@Override
@@ -236,7 +258,7 @@ public class Home1Fragment extends BaseFragment {
public void clickListener(View v, Object data) {
boolean status=(boolean) data;
ToastUtils.info("点击按钮:炒锅正转"+status);
- int jd= zd_dw.getProgress();
+ int jd= (int) nifty_slider3.getValue();
ToastUtils.info("点击按钮:搅拌"+status+".转动频率:"+jd);
ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() {
@Override
@@ -264,7 +286,7 @@ public class Home1Fragment extends BaseFragment {
public void clickListener(View v, Object data) {
boolean status=(boolean) data;
ToastUtils.info("点击按钮:炒锅反转"+status);
- int jd= zd_dw.getProgress();
+ int jd= (int) nifty_slider3.getValue();
ToastUtils.info("点击按钮:搅拌"+status+".转动频率:"+jd);
ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() {
@Override
diff --git a/app/src/main/res/layout/fragment_home1.xml b/app/src/main/res/layout/fragment_home1.xml
index 64aba5b9..ff889d6f 100644
--- a/app/src/main/res/layout/fragment_home1.xml
+++ b/app/src/main/res/layout/fragment_home1.xml
@@ -207,28 +207,39 @@ android:orientation="vertical">
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent">
-
-
+
+
+
+
+
+
+
+
+
+ android:value="22"
+ android:valueFrom="0"
+ android:valueTo="60"
+ app:trackHeight="26dp"
+ app:trackColor="@color/pro1"
+ app:trackColorInactive="@color/pro2"
+ app:thumbRadius="13dp"
+ app:thumbTextSize="12sp"
+ app:thumbText="22"
+ android:hapticFeedbackEnabled="true"
+ app:thumbTextColor="@color/we_read_theme_color"
+ app:thumbColor="@color/we_read_thumb_color"
+ app:thumbTextBold="true"
+ android:stepSize="1"
+ app:thumbWithinTrackBounds="true"
+ app:enableDrawHalo="false"/>
+
@@ -282,16 +293,29 @@ android:orientation="vertical">
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="match_parent">
-
+ android:value="22"
+ android:valueFrom="0"
+ android:valueTo="60"
+ app:trackHeight="26dp"
+ app:trackColor="@color/pro1"
+ app:trackColorInactive="@color/pro2"
+ app:thumbRadius="13dp"
+ app:thumbTextSize="12sp"
+ app:thumbText="22"
+ android:hapticFeedbackEnabled="true"
+ app:thumbTextColor="@color/we_read_theme_color"
+ app:thumbColor="@color/we_read_thumb_color"
+ app:thumbTextBold="true"
+ android:stepSize="1"
+ app:thumbWithinTrackBounds="true"
+ app:enableDrawHalo="false"/>
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 522109f2..6d923faf 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -123,4 +123,10 @@
#FF01579B
#FF40C4FF
#FF00B0FF
+
+ #444138
+ #fbf7eb
+
+ #744CAF50
+ #17000000
diff --git a/build.gradle b/build.gradle
index 69a277e2..183319a8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -8,7 +8,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.0'
+ classpath 'com.android.tools.build:gradle:7.4.1'
//classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -35,10 +35,10 @@ ext { // 统一版本入口
versionName = "1.0.0"
// 支持Android版本
- buildToolsVersion = "28.0.3"
+ buildToolsVersion = "33.0.0"
minSdkVersion = 23
- targetSdkVersion = 28
- compileSdkVersion = 28
+ targetSdkVersion = 33
+ compileSdkVersion = 33
// 支持包
supportVersion = "28.0.0"