@@ -26,5 +26,10 @@ | |||||
<option name="name" value="Google" /> | <option name="name" value="Google" /> | ||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" /> | <option name="url" value="https://dl.google.com/dl/android/maven2/" /> | ||||
</remote-repository> | </remote-repository> | ||||
<remote-repository> | |||||
<option name="id" value="MavenRepo" /> | |||||
<option name="name" value="MavenRepo" /> | |||||
<option name="url" value="https://repo.maven.apache.org/maven2/" /> | |||||
</remote-repository> | |||||
</component> | </component> | ||||
</project> | </project> |
@@ -55,17 +55,19 @@ dependencies { | |||||
//测试相关 | //测试相关 | ||||
testImplementation 'junit:junit:4.13-beta-2' | 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.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 | // QMUI框架 link: http://qmuiteam.com/android | ||||
// 本App 搭建的基础框架,基本使用控件功能请看官网的功能列表 | // 本App 搭建的基础框架,基本使用控件功能请看官网的功能列表 | ||||
@@ -105,11 +107,11 @@ dependencies { | |||||
implementation 'com.orhanobut:logger:2.2.0' | implementation 'com.orhanobut:logger:2.2.0' | ||||
// leak 内存泄漏检测 | // 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 | //MQTT | ||||
implementation files('libs\\org.eclipse.paho.android.service-1.1.1.jar') | 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 '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' | |||||
} | } |
@@ -30,7 +30,7 @@ | |||||
tools:node="merge"> | tools:node="merge"> | ||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.fragment.SystemCsPLCFragment" | android:name=".modules.home.fragment.from.fragment.SystemCsPLCFragment" | ||||
android:exported="false" /> | |||||
android:exported="false" tools:ignore="Instantiatable"/> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.FileActivity" | android:name=".modules.home.fragment.from.FileActivity" | ||||
android:exported="false" /> | android:exported="false" /> | ||||
@@ -42,28 +42,31 @@ | |||||
android:exported="false" /> | android:exported="false" /> | ||||
<activity | <activity | ||||
android:name=".modules.home.fragment.mode.fragment_gx" | android:name=".modules.home.fragment.mode.fragment_gx" | ||||
android:exported="false" /> | |||||
android:exported="false" | |||||
tools:ignore="Instantiatable" /> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.fragment.SystemCsFltlFragment" | android:name=".modules.home.fragment.from.fragment.SystemCsFltlFragment" | ||||
android:exported="false" /> | |||||
android:exported="false" | |||||
tools:ignore="Instantiatable"/> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.fragment.SystemCsMonitorFragment" | android:name=".modules.home.fragment.from.fragment.SystemCsMonitorFragment" | ||||
android:exported="false" /> | |||||
android:exported="false" tools:ignore="Instantiatable"/> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.fragment.SystemCsControlFragment" | android:name=".modules.home.fragment.from.fragment.SystemCsControlFragment" | ||||
android:exported="false" /> | |||||
android:exported="false" tools:ignore="Instantiatable"/> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.fragment.SystemSeasoningsetFragment" | android:name=".modules.home.fragment.from.fragment.SystemSeasoningsetFragment" | ||||
android:exported="false" /> | |||||
android:exported="false" tools:ignore="Instantiatable"/> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.fragment.SystemSystemsetFragment" | android:name=".modules.home.fragment.from.fragment.SystemSystemsetFragment" | ||||
android:exported="false" /> | |||||
android:exported="false" | |||||
tools:ignore="Instantiatable" /> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.fragment.SystemDeviceinFragment" | android:name=".modules.home.fragment.from.fragment.SystemDeviceinFragment" | ||||
android:exported="false" /> | |||||
android:exported="false" tools:ignore="Instantiatable"/> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.fragment.systeminternetfragment" | android:name=".modules.home.fragment.from.fragment.systeminternetfragment" | ||||
android:exported="false" /> | |||||
android:exported="false" tools:ignore="Instantiatable"/> | |||||
<activity | <activity | ||||
android:name=".modules.home.fragment.from.CpxzActivity" | android:name=".modules.home.fragment.from.CpxzActivity" | ||||
android:exported="false" /> | android:exported="false" /> | ||||
@@ -95,7 +98,8 @@ | |||||
<activity | <activity | ||||
android:name=".modules.welcome.activity.WelcomeActivity" | android:name=".modules.welcome.activity.WelcomeActivity" | ||||
android:theme="@style/AppTheme.Launcher"> | |||||
android:theme="@style/AppTheme.Launcher" | |||||
android:exported="true"> | |||||
<intent-filter> | <intent-filter> | ||||
<action android:name="android.intent.action.MAIN" /> | <action android:name="android.intent.action.MAIN" /> | ||||
@@ -43,7 +43,6 @@ import com.orhanobut.logger.FormatStrategy; | |||||
import com.orhanobut.logger.Logger; | import com.orhanobut.logger.Logger; | ||||
import com.orhanobut.logger.PrettyFormatStrategy; | import com.orhanobut.logger.PrettyFormatStrategy; | ||||
import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager; | import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager; | ||||
import com.squareup.leakcanary.LeakCanary; | |||||
import org.litepal.LitePal; | import org.litepal.LitePal; | ||||
@@ -384,10 +383,10 @@ public class MainApplication extends Application { | |||||
private void initLeakCanary(boolean flag) { | private void initLeakCanary(boolean flag) { | ||||
if (flag) { | if (flag) { | ||||
// leak 内存检测注册 | // leak 内存检测注册 | ||||
if (LeakCanary.isInAnalyzerProcess(this)) { | |||||
return; | |||||
} | |||||
LeakCanary.install(this); | |||||
// if (LeakCanary.isInAnalyzerProcess(this)) { | |||||
// return; | |||||
// } | |||||
// LeakCanary.install(this); | |||||
} | } | ||||
} | } | ||||
@@ -4,7 +4,10 @@ package com.bonait.bnframework.modules.home.fragment; | |||||
import android.app.Activity; | import android.app.Activity; | ||||
import android.content.Context; | import android.content.Context; | ||||
import android.content.Intent; | import android.content.Intent; | ||||
import android.content.res.ColorStateList; | |||||
import android.graphics.Canvas; | |||||
import android.graphics.Color; | import android.graphics.Color; | ||||
import android.graphics.RectF; | |||||
import android.os.Bundle; | import android.os.Bundle; | ||||
import androidx.annotation.NonNull; | 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.huoli_control; | ||||
import com.bonait.bnframework.modules.home.fragment.mode.imagebutton_control; | import com.bonait.bnframework.modules.home.fragment.mode.imagebutton_control; | ||||
import com.capton.colorfulprogressbar.ColorfulProgressbar; | 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.orhanobut.logger.Logger; | ||||
import com.qmuiteam.qmui.widget.QMUITopBar; | import com.qmuiteam.qmui.widget.QMUITopBar; | ||||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | ||||
@@ -90,10 +96,6 @@ public class Home1Fragment extends BaseFragment { | |||||
imagebutton_control zhuandong_control_left;//左转 | imagebutton_control zhuandong_control_left;//左转 | ||||
@BindView(R.id.zhuandong_control_Rift) | @BindView(R.id.zhuandong_control_Rift) | ||||
imagebutton_control 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) | @BindView(R.id.chaoguo_wendu) | ||||
QMUILinkTextView chaoguo_wendu;// | QMUILinkTextView chaoguo_wendu;// | ||||
@BindView(R.id.chaoguo_weizhi) | @BindView(R.id.chaoguo_weizhi) | ||||
@@ -101,6 +103,12 @@ public class Home1Fragment extends BaseFragment { | |||||
@BindView(R.id.plc_zhuangtai) | @BindView(R.id.plc_zhuangtai) | ||||
QMUILinkTextView 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; | public boolean Status = false; | ||||
/** | /** | ||||
* 当前制作商品信息 | * 当前制作商品信息 | ||||
@@ -128,6 +136,20 @@ public class Home1Fragment extends BaseFragment { | |||||
HuoLiClicked(); | HuoLiClicked(); | ||||
MakeThread(); | MakeThread(); | ||||
ControlClicked(); | 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 | @Override | ||||
public void clickListener(View v, Object data) { | public void clickListener(View v, Object data) { | ||||
boolean status=(boolean) data; | boolean status=(boolean) data; | ||||
int jd= jb_dw.getProgress(); | |||||
int jd=(int) nifty_slider2.getValue(); | |||||
ToastUtils.info("点击按钮:搅拌"+status+".搅拌频率:"+jd); | ToastUtils.info("点击按钮:搅拌"+status+".搅拌频率:"+jd); | ||||
ExecuteTheRecipe.WritePLC("搅拌速度", jd, new IWriteCallBack() { | ExecuteTheRecipe.WritePLC("搅拌速度", jd, new IWriteCallBack() { | ||||
@Override | @Override | ||||
@@ -236,7 +258,7 @@ public class Home1Fragment extends BaseFragment { | |||||
public void clickListener(View v, Object data) { | public void clickListener(View v, Object data) { | ||||
boolean status=(boolean) data; | boolean status=(boolean) data; | ||||
ToastUtils.info("点击按钮:炒锅正转"+status); | ToastUtils.info("点击按钮:炒锅正转"+status); | ||||
int jd= zd_dw.getProgress(); | |||||
int jd= (int) nifty_slider3.getValue(); | |||||
ToastUtils.info("点击按钮:搅拌"+status+".转动频率:"+jd); | ToastUtils.info("点击按钮:搅拌"+status+".转动频率:"+jd); | ||||
ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() { | ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() { | ||||
@Override | @Override | ||||
@@ -264,7 +286,7 @@ public class Home1Fragment extends BaseFragment { | |||||
public void clickListener(View v, Object data) { | public void clickListener(View v, Object data) { | ||||
boolean status=(boolean) data; | boolean status=(boolean) data; | ||||
ToastUtils.info("点击按钮:炒锅反转"+status); | ToastUtils.info("点击按钮:炒锅反转"+status); | ||||
int jd= zd_dw.getProgress(); | |||||
int jd= (int) nifty_slider3.getValue(); | |||||
ToastUtils.info("点击按钮:搅拌"+status+".转动频率:"+jd); | ToastUtils.info("点击按钮:搅拌"+status+".转动频率:"+jd); | ||||
ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() { | ExecuteTheRecipe.WritePLC("转动速度", jd, new IWriteCallBack() { | ||||
@Override | @Override | ||||
@@ -207,28 +207,39 @@ android:orientation="vertical"> | |||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_weight="1" | android:layout_weight="1" | ||||
android:layout_height="match_parent"> | android:layout_height="match_parent"> | ||||
<com.bonait.bnframework.common.myprogress.MyProgress | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
app:circleProgressRadus="50dp" | |||||
app:horizonalProgressHeight="10dp" | |||||
app:textProgressSize="10sp" | |||||
app:colorProgress="#fd9112" | |||||
app:colorSecondProgress="#1592ff" | |||||
/> | |||||
<SeekBar android:id="@+id/jb_dw" | |||||
android:visibility="gone" | |||||
<!-- <com.bonait.bnframework.common.myprogress.MyProgress--> | |||||
<!-- android:layout_width="match_parent"--> | |||||
<!-- android:layout_height="wrap_content"--> | |||||
<!-- app:circleProgressRadus="50dp"--> | |||||
<!-- app:horizonalProgressHeight="10dp"--> | |||||
<!-- app:textProgressSize="12sp"--> | |||||
<!-- app:colorProgress="#fd9112"--> | |||||
<!-- app:colorSecondProgress="#1592ff"--> | |||||
<!-- />--> | |||||
<com.litao.slider.NiftySlider | |||||
android:id="@+id/nifty_slider2" | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_marginRight="@dimen/dp_10" | |||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:maxHeight="30.0dip" | |||||
android:max="10" | |||||
android:minHeight="30.0dip" | |||||
android:thumbOffset="5.0dip" | |||||
android:layout_centerVertical="true" | android:layout_centerVertical="true" | ||||
style="@android:attr/progressBarStyleHorizontal" /> | |||||
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"/> | |||||
</RelativeLayout> | </RelativeLayout> | ||||
@@ -282,16 +293,29 @@ android:orientation="vertical"> | |||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
android:layout_weight="1" | android:layout_weight="1" | ||||
android:layout_height="match_parent"> | android:layout_height="match_parent"> | ||||
<SeekBar android:id="@+id/zd_dw" | |||||
<com.litao.slider.NiftySlider | |||||
android:id="@+id/nifty_slider3" | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_marginRight="@dimen/dp_10" | |||||
android:maxHeight="30.0dip" | |||||
android:max="60" | |||||
android:minHeight="30.0dip" | |||||
android:thumbOffset="5.0dip" | |||||
android:layout_centerVertical="true" | android:layout_centerVertical="true" | ||||
style="@android:attr/progressBarStyleHorizontal" /> | |||||
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"/> | |||||
</RelativeLayout> | </RelativeLayout> | ||||
@@ -123,4 +123,10 @@ | |||||
<color name="light_blue_900">#FF01579B</color> | <color name="light_blue_900">#FF01579B</color> | ||||
<color name="light_blue_A200">#FF40C4FF</color> | <color name="light_blue_A200">#FF40C4FF</color> | ||||
<color name="light_blue_A400">#FF00B0FF</color> | <color name="light_blue_A400">#FF00B0FF</color> | ||||
<color name="we_read_theme_color">#444138</color> | |||||
<color name="we_read_thumb_color">#fbf7eb</color> | |||||
<color name="pro1">#744CAF50</color> | |||||
<color name="pro2">#17000000</color> | |||||
</resources> | </resources> |
@@ -8,7 +8,7 @@ buildscript { | |||||
} | } | ||||
dependencies { | 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' | //classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1' | ||||
// NOTE: Do not place your application dependencies here; they belong | // NOTE: Do not place your application dependencies here; they belong | ||||
// in the individual module build.gradle files | // in the individual module build.gradle files | ||||
@@ -35,10 +35,10 @@ ext { // 统一版本入口 | |||||
versionName = "1.0.0" | versionName = "1.0.0" | ||||
// 支持Android版本 | // 支持Android版本 | ||||
buildToolsVersion = "28.0.3" | |||||
buildToolsVersion = "33.0.0" | |||||
minSdkVersion = 23 | minSdkVersion = 23 | ||||
targetSdkVersion = 28 | |||||
compileSdkVersion = 28 | |||||
targetSdkVersion = 33 | |||||
compileSdkVersion = 33 | |||||
// 支持包 | // 支持包 | ||||
supportVersion = "28.0.0" | supportVersion = "28.0.0" | ||||