diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml
new file mode 100644
index 00000000..02b915b8
--- /dev/null
+++ b/.idea/git_toolbox_prj.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 40a49cd5..9dccfee8 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,7 +1,13 @@
+import java.text.DateFormat
+import java.text.SimpleDateFormat
+
apply plugin: 'com.android.application'
//apply plugin: 'com.jakewharton.butterknife'
-
+def releaseTime() {
+ DateFormat df = new SimpleDateFormat("yyyyMMddHHmm")
+ return df.format(Calendar.getInstance(Locale.CHINA).getTime())
+}
android {
compileSdk rootProject.ext.compileSdkVersion
@@ -59,6 +65,11 @@ android {
buildFeatures {
viewBinding = true
}
+ applicationVariants.all { variant ->
+ variant.outputs.all {
+ outputFileName = "boluo-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk"
+ }
+ }
}
dependencies {
@@ -184,4 +195,7 @@ dependencies {
implementation "com.github.bumptech.glide:okhttp3-integration:4.16.0"
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
+
+ //leak 内存泄漏检测
+ debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-3'
}
diff --git a/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/BottomNavigationNewActivity.java b/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/BottomNavigationNewActivity.java
index 23858bbe..13ca1d32 100644
--- a/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/BottomNavigationNewActivity.java
+++ b/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/BottomNavigationNewActivity.java
@@ -315,7 +315,7 @@ public class BottomNavigationNewActivity extends BaseActivity {
*/
private void MakeThread() {
LogUtils.d("MakeThread()");
- ExecuteTheRecipe.context = this;
+// ExecuteTheRecipe.context = this;
mainTread = new Thread(new Runnable() {
@Override
public void run() {
diff --git a/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/ImageChooseActivity.java b/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/ImageChooseActivity.java
index 959d0098..cc62310e 100644
--- a/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/ImageChooseActivity.java
+++ b/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/ImageChooseActivity.java
@@ -1,22 +1,25 @@
package com.bonait.bnframework.ViewModel.ActivityViewModel;
-import androidx.recyclerview.widget.RecyclerView;
-
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
+import androidx.recyclerview.widget.RecyclerView;
+
import com.bonait.bnframework.R;
+import com.bonait.bnframework.ViewModel.Adapter.image_sp_adapter;
+import com.bonait.bnframework.ViewModel.CustomView.image_sp;
import com.bonait.bnframework.common.base.BaseActivity;
import com.bonait.bnframework.common.constant.MessageName;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.message.MessageManager;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.MyLayoutManager;
-import com.bonait.bnframework.ViewModel.Adapter.image_sp_adapter;
-import com.bonait.bnframework.ViewModel.CustomView.image_sp;
+import com.bonait.bnframework.event.ImageSelectEvent;
import com.qmuiteam.qmui.widget.QMUITopBarLayout;
+import org.greenrobot.eventbus.EventBus;
+
import java.io.File;
import java.util.ArrayList;
import java.util.List;
@@ -30,7 +33,7 @@ public class ImageChooseActivity extends BaseActivity {
QMUITopBarLayout mTopBar;//顶部标题
@BindView(R.id.recycler_view)
RecyclerView recyclerView;//image列表
- private static final String CACHE_PATH= Environment.getExternalStorageDirectory().getAbsolutePath()+"/hblxiaochaodb/WebImage";
+ public static final String CACHE_PATH= Environment.getExternalStorageDirectory().getAbsolutePath()+"/hblxiaochaodb/WebImage";
List data =new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -74,6 +77,12 @@ public class ImageChooseActivity extends BaseActivity {
image_sp sp=(image_sp)data;
MessageManager.getInstance().sendMessage(MessageName.ClickImage,sp.url);
finish();
+ recyclerView.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ EventBus.getDefault().post(new ImageSelectEvent(CACHE_PATH+"/"+sp.url));
+ }
+ },500);
}
@Override
public void clickListenerNew(View v, int k, Object data) {
diff --git a/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/LoginActivity.java b/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/LoginActivity.java
index cb57865c..c57360ca 100644
--- a/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/LoginActivity.java
+++ b/app/src/main/java/com/bonait/bnframework/ViewModel/ActivityViewModel/LoginActivity.java
@@ -4,7 +4,6 @@ import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
-import androidx.core.widget.NestedScrollView;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
@@ -22,9 +21,14 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
+import androidx.core.widget.NestedScrollView;
+import androidx.lifecycle.LifecycleObserver;
+
+import com.bonait.bnframework.Model.AppLoginPo;
import com.bonait.bnframework.R;
import com.bonait.bnframework.business.ConfigData;
import com.bonait.bnframework.common.base.BaseActivity;
+import com.bonait.bnframework.common.bg.SnowView;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.Constants;
import com.bonait.bnframework.common.constant.SPConstants;
@@ -38,7 +42,6 @@ import com.bonait.bnframework.common.utils.KeyboardToolUtils;
import com.bonait.bnframework.common.utils.PreferenceUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.manager.ActivityLifecycleManager;
-import com.bonait.bnframework.Model.AppLoginPo;
import com.bonait.bnframework.test.TestActivity;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.HttpParams;
@@ -92,6 +95,8 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL
ImageView imgPass;
@BindView(R.id.rl_title)
RelativeLayout rl_title;
+ @BindView(R.id.snowView)
+ SnowView snowView;
private long exitTime = 0;
private int screenHeight = 0;//屏幕高度
@@ -124,16 +129,9 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL
* 对布局进行缩放
*/
private void initView(){
- DisplayManager.scaleView(mEtAccount);
- DisplayManager.scaleView(mEtPassword);
- DisplayManager.scaleView(mCleanPassword);
- DisplayManager.scaleView(mIvCleanAccount);
- DisplayManager.scaleView(mIvShowPwd);
- DisplayManager.scaleView(cbCheckbox);
- DisplayManager.scaleView(mContent);
- DisplayManager.scaleView(imgAccount);
- DisplayManager.scaleView(imgPass);
- DisplayManager.scaleView(rl_title);
+ DisplayManager.scaleViewGroup(findViewById(R.id.root));
+
+ getLifecycle().addObserver((LifecycleObserver) snowView);
}
/**
@@ -544,4 +542,16 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL
}
return super.onKeyDown(keyCode, event);
}
+
+ @Override
+ public void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ getLifecycle().removeObserver((LifecycleObserver) snowView);
+
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ }
}
diff --git a/app/src/main/java/com/bonait/bnframework/ViewModel/FragmentViewModel/Home1Fragment.java b/app/src/main/java/com/bonait/bnframework/ViewModel/FragmentViewModel/Home1Fragment.java
index 012998ec..720abaf4 100644
--- a/app/src/main/java/com/bonait/bnframework/ViewModel/FragmentViewModel/Home1Fragment.java
+++ b/app/src/main/java/com/bonait/bnframework/ViewModel/FragmentViewModel/Home1Fragment.java
@@ -6,14 +6,6 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.fragment.app.Fragment;
-import androidx.core.content.ContextCompat;
-import androidx.recyclerview.widget.RecyclerView;
-
import android.os.CountDownTimer;
import android.util.Log;
import android.view.LayoutInflater;
@@ -23,23 +15,30 @@ import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.content.ContextCompat;
+import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.RecyclerView;
+
import com.bonait.bnframework.R;
+import com.bonait.bnframework.ViewModel.ActivityViewModel.CpxzActivity;
+import com.bonait.bnframework.ViewModel.Adapter.lc_adapter;
+import com.bonait.bnframework.ViewModel.CustomView.MyStatus;
+import com.bonait.bnframework.ViewModel.CustomView.huoli_control;
+import com.bonait.bnframework.ViewModel.CustomView.imagebutton_control;
import com.bonait.bnframework.business.ExecuteTheRecipe;
import com.bonait.bnframework.common.base.BaseFragment;
import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.constant.DataBus;
import com.bonait.bnframework.common.db.QueryDB;
-import com.bonait.bnframework.common.db.mode.BPA_GOODS_OLD;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
+import com.bonait.bnframework.common.db.mode.BPA_GOODS_OLD;
import com.bonait.bnframework.common.helper.I.MyClickListener;
import com.bonait.bnframework.common.utils.AlertDialogUtils;
import com.bonait.bnframework.common.utils.ToastUtils;
import com.bonait.bnframework.common.view.MyLayoutManager;
-import com.bonait.bnframework.ViewModel.Adapter.lc_adapter;
-import com.bonait.bnframework.ViewModel.ActivityViewModel.CpxzActivity;
-import com.bonait.bnframework.ViewModel.CustomView.MyStatus;
-import com.bonait.bnframework.ViewModel.CustomView.huoli_control;
-import com.bonait.bnframework.ViewModel.CustomView.imagebutton_control;
import com.capton.colorfulprogressbar.ColorfulProgressbar;
import com.litao.slider.NiftySlider;
import com.orhanobut.logger.Logger;
@@ -452,7 +451,7 @@ public class Home1Fragment extends BaseFragment {
* 商品制作线程
*/
public void MakeThread() {
- ExecuteTheRecipe.context = context;
+// ExecuteTheRecipe.context = context;
new Thread(new Runnable() {
@Override
diff --git a/app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java b/app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java
index efa5e108..b3b20a82 100644
--- a/app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java
+++ b/app/src/main/java/com/bonait/bnframework/common/base/BaseActivity.java
@@ -129,6 +129,7 @@ public class BaseActivity extends QMUIActivity implements EasyPermissions.Permis
@Override
protected void onDestroy() {
+ ActiveMax.destroy(this);
super.onDestroy();
LogUtils.d(getClassName()+"生命周期 onDestroy()");
}
diff --git a/app/src/main/java/com/bonait/bnframework/common/bg/SnowView.java b/app/src/main/java/com/bonait/bnframework/common/bg/SnowView.java
index 193b7787..cc93f95f 100644
--- a/app/src/main/java/com/bonait/bnframework/common/bg/SnowView.java
+++ b/app/src/main/java/com/bonait/bnframework/common/bg/SnowView.java
@@ -4,11 +4,14 @@ import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
-import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.widget.RelativeLayout;
+import androidx.annotation.NonNull;
+import androidx.lifecycle.Lifecycle;
+import androidx.lifecycle.LifecycleEventObserver;
+import androidx.lifecycle.LifecycleOwner;
import com.bonait.bnframework.common.bg.mode.SnowBean;
import com.bonait.bnframework.common.helper.Tools;
@@ -18,7 +21,7 @@ import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
-public class SnowView extends RelativeLayout {
+public class SnowView extends RelativeLayout implements LifecycleEventObserver {
// private final String SNOW = "❄";
// private final String SNOW = "☀❆★❉❈❀✿❃❁";
private final String SNOW = "❄";
@@ -173,6 +176,15 @@ public class SnowView extends RelativeLayout {
return detector.onTouchEvent(event);
}
+ @Override
+ public void onStateChanged(@NonNull LifecycleOwner source, @NonNull Lifecycle.Event event) {
+ switch (event) {
+ case ON_DESTROY:
+ destroy();
+ break;
+ }
+ }
+
private class MyGestureDetector implements GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener {
@Override
diff --git a/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS.java b/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS.java
index 2a00ae66..2b3a3d9c 100644
--- a/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS.java
+++ b/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS.java
@@ -32,11 +32,6 @@ public class BPA_GOODS extends ModeBase {
*/
public String classifyId;
- /**
- * 用来区分是否已下载,本地使用
- */
- public boolean isLocal;
-
@Override
public String toString() {
diff --git a/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS_PROCESS_DETAIL.java b/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS_PROCESS_DETAIL.java
index 5b7bd4fd..5eb3a30f 100644
--- a/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS_PROCESS_DETAIL.java
+++ b/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS_PROCESS_DETAIL.java
@@ -7,7 +7,7 @@ package com.bonait.bnframework.common.db.mode;
*/
public class BPA_GOODS_PROCESS_DETAIL extends ModeBase{
/**
- * 商品属性组合id
+ * 商品属性组合名称 a-b
*/
public String goodsSubAttributeGroupId;
/**
diff --git a/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS_SUBATTRIBUTE_GROUP.java b/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS_SUBATTRIBUTE_GROUP.java
index 6a55d179..2ea68d2b 100644
--- a/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS_SUBATTRIBUTE_GROUP.java
+++ b/app/src/main/java/com/bonait/bnframework/common/db/mode/BPA_GOODS_SUBATTRIBUTE_GROUP.java
@@ -11,7 +11,7 @@ public class BPA_GOODS_SUBATTRIBUTE_GROUP extends ModeBase{
*/
public String name;
/**
- * 子属性id组合 xxx,xxxx,xxx
+ * 子属性id组合 xxx,xxxx,xxx 暂时不用id匹配 用name匹配
*/
public String subAttributeIdList;
/**
diff --git a/app/src/main/java/com/bonait/bnframework/common/db/util/GoodsProcessDetailDBUtil.java b/app/src/main/java/com/bonait/bnframework/common/db/util/GoodsProcessDetailDBUtil.java
index dfd299db..74401103 100644
--- a/app/src/main/java/com/bonait/bnframework/common/db/util/GoodsProcessDetailDBUtil.java
+++ b/app/src/main/java/com/bonait/bnframework/common/db/util/GoodsProcessDetailDBUtil.java
@@ -80,15 +80,15 @@ public class GoodsProcessDetailDBUtil {
}
/**
- * 根据商品属性组合id查询旗下的工序列表
+ * 根据商品属性组合查询旗下的工序列表
*
- * @param goodsSubAttributeGroupId
+ * @param name
* @return
*/
- public static ArrayList getByGoodsSubAttributeGroupId(String goodsSubAttributeGroupId) {
+ public static ArrayList getByGoodsSubAttributeGroupName(String name) {
String orderby = QueryDB.Desc_Sort_Up + ',' + QueryDB.Desc_Time_Up;
String where = "isDelete=? and goodsSubAttributeGroupId=?";
- String[] args = new String[]{"0", goodsSubAttributeGroupId};
+ String[] args = new String[]{"0", name};
ArrayList data = new ArrayList<>();
ArrayList