Browse Source

4343

tags/old_version_1
fyf 1 year ago
parent
commit
42eaaf9a65
8 changed files with 126 additions and 64 deletions
  1. +5
    -0
      .idea/jarRepositories.xml
  2. +16
    -14
      app/build.gradle
  3. +14
    -10
      app/src/main/AndroidManifest.xml
  4. +4
    -5
      app/src/main/java/com/bonait/bnframework/MainApplication.java
  5. +29
    -7
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/Home1Fragment.java
  6. +48
    -24
      app/src/main/res/layout/fragment_home1.xml
  7. +6
    -0
      app/src/main/res/values/colors.xml
  8. +4
    -4
      build.gradle

+ 5
- 0
.idea/jarRepositories.xml View File

@@ -26,5 +26,10 @@
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</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>
</project>

+ 16
- 14
app/build.gradle View File

@@ -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'
}

+ 14
- 10
app/src/main/AndroidManifest.xml View File

@@ -30,7 +30,7 @@
tools:node="merge">
<activity
android:name=".modules.home.fragment.from.fragment.SystemCsPLCFragment"
android:exported="false" />
android:exported="false" tools:ignore="Instantiatable"/>
<activity
android:name=".modules.home.fragment.from.FileActivity"
android:exported="false" />
@@ -42,28 +42,31 @@
android:exported="false" />
<activity
android:name=".modules.home.fragment.mode.fragment_gx"
android:exported="false" />
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.SystemCsFltlFragment"
android:exported="false" />
android:exported="false"
tools:ignore="Instantiatable"/>
<activity
android:name=".modules.home.fragment.from.fragment.SystemCsMonitorFragment"
android:exported="false" />
android:exported="false" tools:ignore="Instantiatable"/>
<activity
android:name=".modules.home.fragment.from.fragment.SystemCsControlFragment"
android:exported="false" />
android:exported="false" tools:ignore="Instantiatable"/>
<activity
android:name=".modules.home.fragment.from.fragment.SystemSeasoningsetFragment"
android:exported="false" />
android:exported="false" tools:ignore="Instantiatable"/>
<activity
android:name=".modules.home.fragment.from.fragment.SystemSystemsetFragment"
android:exported="false" />
android:exported="false"
tools:ignore="Instantiatable" />
<activity
android:name=".modules.home.fragment.from.fragment.SystemDeviceinFragment"
android:exported="false" />
android:exported="false" tools:ignore="Instantiatable"/>
<activity
android:name=".modules.home.fragment.from.fragment.systeminternetfragment"
android:exported="false" />
android:exported="false" tools:ignore="Instantiatable"/>
<activity
android:name=".modules.home.fragment.from.CpxzActivity"
android:exported="false" />
@@ -95,7 +98,8 @@

<activity
android:name=".modules.welcome.activity.WelcomeActivity"
android:theme="@style/AppTheme.Launcher">
android:theme="@style/AppTheme.Launcher"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />



+ 4
- 5
app/src/main/java/com/bonait/bnframework/MainApplication.java View File

@@ -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);
}
}



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

@@ -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


+ 48
- 24
app/src/main/res/layout/fragment_home1.xml View File

@@ -207,28 +207,39 @@ android:orientation="vertical">
android:layout_width="0dp"
android:layout_weight="1"
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_marginRight="@dimen/dp_10"
android:layout_height="wrap_content"
android:maxHeight="30.0dip"
android:max="10"
android:minHeight="30.0dip"
android:thumbOffset="5.0dip"
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>

@@ -282,16 +293,29 @@ android:orientation="vertical">
android:layout_width="wrap_content"
android:layout_weight="1"
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_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"
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>



+ 6
- 0
app/src/main/res/values/colors.xml View File

@@ -123,4 +123,10 @@
<color name="light_blue_900">#FF01579B</color>
<color name="light_blue_A200">#FF40C4FF</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>

+ 4
- 4
build.gradle View File

@@ -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"


Loading…
Cancel
Save