diff --git a/app/build.gradle b/app/build.gradle index 940adac2..4983f510 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,6 +11,7 @@ android { versionCode rootProject.ext.versionCode versionName rootProject.ext.versionName testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' + multiDexEnabled true } buildTypes { release { @@ -71,8 +72,11 @@ dependencies { // QMUI框架 link: http://qmuiteam.com/android // 本App 搭建的基础框架,基本使用控件功能请看官网的功能列表 - implementation 'com.qmuiteam:qmui:1.2.0' - implementation 'com.qmuiteam:arch:0.3.1' +// implementation 'com.qmuiteam:qmui:1.2.0' +// implementation 'com.qmuiteam:arch:0.3.1' +// implementation 'com.qmuiteam:qmui:1.2.0' + implementation 'com.qmuiteam:arch:2.0.0-alpha10' + implementation 'com.qmuiteam:qmui:2.0.0-alpha10' // RecyclerAdapter框架 implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46' diff --git a/app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java b/app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java index 899028f5..81c66a72 100644 --- a/app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java +++ b/app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java @@ -73,10 +73,23 @@ public class UpdateAppUtils { */ private static void doPost(final Context context) { VersionMode mode=new VersionMode(); - mode.productCode="1668085292913659904"; - mode.moduleCode="naichaji"; - mode.serverCode="1668175205545807872"; - mode.branchCode="1668801915890962433"; + //大炒 + mode.productCode="1679306986915368960"; + mode.moduleCode="dcdjbbd"; + mode.serverCode="1680766359592243200"; + mode.branchCode="1679308856555737089"; + + //小炒网络v版本 +// mode.productCode="1679306986915368960"; +// mode.moduleCode="xcapp"; +// mode.serverCode="1680766359592243200"; +// mode.branchCode="1679307408505835521"; + + //小炒单击 +// mode.productCode="1679306986915368960"; +// mode.moduleCode="xcdjbbd"; +// mode.serverCode="1680766359592243200"; +// mode.branchCode="1679308917918404609"; String msg= new Json().objectToJson(VersionMode.class, mode); String getNewVersionUrl =ConfigName.getInstance().UpdateVersion; MediaType JSON = MediaType.parse("application/json; charset=utf-8"); @@ -90,7 +103,7 @@ public class UpdateAppUtils { ResVersion version= response.body(); if (version != null && version.data!=null) { serviceVersionCode = version.data.versionNo; - description = version.data.description; + description = version.data.description==null?"暂无描述":version.data.description; //获取apk下载地址 downloadUrl = version.data.downloadLink; // 判断Apk是否是最新版本 @@ -101,6 +114,9 @@ public class UpdateAppUtils { ToastUtils.info("当前版本已是最新版本"); } + }else + { + ToastUtils.info("服务器没有版本"); } } }); diff --git a/app/src/main/java/com/bonait/bnframework/common/view/QMAutoDialogBuilderView.java b/app/src/main/java/com/bonait/bnframework/common/view/QMAutoDialogBuilderView.java index 50ca1123..ddc4c9b5 100644 --- a/app/src/main/java/com/bonait/bnframework/common/view/QMAutoDialogBuilderView.java +++ b/app/src/main/java/com/bonait/bnframework/common/view/QMAutoDialogBuilderView.java @@ -1,6 +1,8 @@ package com.bonait.bnframework.common.view; import android.content.Context; + +import androidx.annotation.NonNull; import androidx.core.content.ContextCompat; import android.view.View; import android.view.ViewGroup; @@ -28,19 +30,15 @@ public class QMAutoDialogBuilderView extends QMUIDialog.AutoResizeDialogBuilder mContext = context; } - public EditText getEditText() { - return mEditText; - } - @Override - public View onBuildContent(QMUIDialog dialog, ScrollView parent) { + public View onBuildContent(@NonNull QMUIDialog dialog, @NonNull Context context) { LinearLayout layout = new LinearLayout(mContext); layout.setOrientation(LinearLayout.VERTICAL); layout.setLayoutParams(new ScrollView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); int padding = QMUIDisplayHelper.dp2px(mContext, 20); layout.setPadding(padding, padding, padding, padding); mEditText = new EditText(mContext); - QMUIViewHelper.setBackgroundKeepingPadding(mEditText, QMUIResHelper.getAttrDrawable(mContext, R.attr.qmui_list_item_bg_with_border_bottom)); + QMUIViewHelper.setBackgroundKeepingPadding(mEditText, QMUIResHelper.getAttrDrawable(mContext, R.attr.qmui_border_color)); mEditText.setHint("输入框"); LinearLayout.LayoutParams editTextLP = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, QMUIDisplayHelper.dpToPx(50)); editTextLP.bottomMargin = QMUIDisplayHelper.dp2px(mContext, 15); @@ -57,4 +55,9 @@ public class QMAutoDialogBuilderView extends QMUIDialog.AutoResizeDialogBuilder layout.addView(textView); return layout; } + + public EditText getEditText() { + return mEditText; + } + } diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationActivity.java index 237ef4a8..97c231af 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/activity/BottomNavigationActivity.java @@ -7,6 +7,8 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; import androidx.core.content.ContextCompat; import androidx.viewpager.widget.ViewPager; + +import android.view.Gravity; import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup; @@ -21,8 +23,10 @@ import com.bonait.bnframework.modules.mine.fragment.MyFragment; import com.lzy.okgo.OkGo; import com.qmuiteam.qmui.util.QMUIResHelper; import com.qmuiteam.qmui.widget.QMUIPagerAdapter; -import com.qmuiteam.qmui.widget.QMUITabSegment; import com.qmuiteam.qmui.widget.QMUIViewPager; +import com.qmuiteam.qmui.widget.tab.QMUITab; +import com.qmuiteam.qmui.widget.tab.QMUITabBuilder; +import com.qmuiteam.qmui.widget.tab.QMUITabSegment; import butterknife.BindView; import butterknife.ButterKnife; @@ -55,27 +59,26 @@ public class BottomNavigationActivity extends BaseActivity { * 初始化tab * */ private void initTabs() { - int normalColor = QMUIResHelper.getAttrColor(context, R.attr.qmui_config_color_gray_6); - int selectColor = QMUIResHelper.getAttrColor(context, R.attr.qmui_config_color_blue); - mTabSegment.setDefaultNormalColor(normalColor); - mTabSegment.setDefaultSelectedColor(selectColor); - - QMUITabSegment.Tab home = new QMUITabSegment.Tab( - ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_component), - ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_component_selected), - "主页", false - ); - - QMUITabSegment.Tab Lab = new QMUITabSegment.Tab( - ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_util), - ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_util_selected), - "烹饪", false - ); - QMUITabSegment.Tab My = new QMUITabSegment.Tab( - ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_lab), - ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_lab_selected), - "我的", false - ); +// int normalColor = QMUIResHelper.getAttrColor(context, R.attr.qmui_config_color_gray_6); +// int selectColor = QMUIResHelper.getAttrColor(context, R.attr.qmui_config_color_blue); +// mTabSegment.setDefaultNormalColor(normalColor); +// mTabSegment.setDefaultSelectedColor(selectColor); + QMUITabBuilder tabBuilder =mTabSegment.tabBuilder().setGravity(Gravity.CENTER); + QMUITab home = tabBuilder + .setNormalDrawable(ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_component)) + .setSelectedDrawable(ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_component_selected)) + .setText("主页") + .build(context); + QMUITab Lab = tabBuilder + .setNormalDrawable(ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_component)) + .setSelectedDrawable(ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_component_selected)) + .setText("烹饪") + .build(context); + QMUITab My = tabBuilder + .setNormalDrawable(ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_component)) + .setSelectedDrawable(ContextCompat.getDrawable(context, R.mipmap.icon_tabbar_component_selected)) + .setText("我的") + .build(context); mTabSegment.addTab(home) .addTab(Lab) .addTab(My); diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDSectionHeaderView.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDSectionHeaderView.java index 0c4fc3b0..cc0310c0 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDSectionHeaderView.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/QDSectionHeaderView.java @@ -29,12 +29,12 @@ public class QDSectionHeaderView extends LinearLayout { super(context, attrs); setOrientation(LinearLayout.HORIZONTAL); setGravity(Gravity.CENTER_VERTICAL); - setBackgroundColor(Color.WHITE); + setBackgroundColor(Color.parseColor("#DEE0E2")); // android:background="@drawable/qmui_list_item_bg_with_border_bottom" int paddingHor = QMUIDisplayHelper.dp2px(context, 24); mTitleTv = new TextView(getContext()); mTitleTv.setTextSize(16); mTitleTv.setTextColor(Color.BLACK); - mTitleTv.setPadding(paddingHor, 0, paddingHor, 0); + mTitleTv.setPadding(paddingHor, 10, paddingHor, 0); addView(mTitleTv, new LinearLayout.LayoutParams( 0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f)); mArrowView = new AppCompatImageView(context); diff --git a/app/src/main/res/drawable/qmui_list_item_bg_with_border_bottom.xml b/app/src/main/res/drawable/qmui_list_item_bg_with_border_bottom.xml new file mode 100644 index 00000000..9600157f --- /dev/null +++ b/app/src/main/res/drawable/qmui_list_item_bg_with_border_bottom.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/qmui_list_item_bg_with_border_top.xml b/app/src/main/res/drawable/qmui_list_item_bg_with_border_top.xml new file mode 100644 index 00000000..ad9d24ad --- /dev/null +++ b/app/src/main/res/drawable/qmui_list_item_bg_with_border_top.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_bottom_navigation.xml b/app/src/main/res/layout/activity_bottom_navigation.xml index 3068c8d2..dba945ef 100644 --- a/app/src/main/res/layout/activity_bottom_navigation.xml +++ b/app/src/main/res/layout/activity_bottom_navigation.xml @@ -14,10 +14,12 @@ android:layout_marginBottom="@dimen/home_tab_height" android:fitsSystemWindows="true"/> - diff --git a/app/src/main/res/layout/activity_cp.xml b/app/src/main/res/layout/activity_cp.xml index 50492502..34b239df 100644 --- a/app/src/main/res/layout/activity_cp.xml +++ b/app/src/main/res/layout/activity_cp.xml @@ -11,7 +11,11 @@ + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> + android:fitsSystemWindows="true" + app:qmui_skin_background="?attr/app_skin_common_background"> + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> diff --git a/app/src/main/res/layout/activity_wh.xml b/app/src/main/res/layout/activity_wh.xml index a91cafc3..4f1a09fc 100644 --- a/app/src/main/res/layout/activity_wh.xml +++ b/app/src/main/res/layout/activity_wh.xml @@ -10,7 +10,11 @@ + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> diff --git a/app/src/main/res/layout/fragment_home1.xml b/app/src/main/res/layout/fragment_home1.xml index ff889d6f..42f69c2c 100644 --- a/app/src/main/res/layout/fragment_home1.xml +++ b/app/src/main/res/layout/fragment_home1.xml @@ -12,7 +12,11 @@ android:orientation="vertical"> + android:layout_height="?attr/qmui_topbar_height" + android:fitsSystemWindows="true" + app:qmui_layout_collapseMode="pin" + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> + android:background="@color/qmui_config_color_white" + app:qmui_skin_background="?attr/app_skin_common_background"> + android:background="@color/qmui_config_color_transparent" + app:qmui_bottomDividerHeight="0px"/> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 847920b0..78c0cbf1 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,7 +1,7 @@ - 49dp + 56dp @dimen/qmui_content_spacing_horizontal diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 9a817b44..922b0cf8 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -21,9 +21,9 @@ @color/app_color_blue - @color/s_btn_blue_bg - @color/s_btn_blue_border - @color/s_btn_blue_text + + + 20dp @dimen/qmui_content_spacing_horizontal @@ -45,15 +45,13 @@ - + + + + + + + + + + @@ -177,7 +173,7 @@ left - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 3a291441..5cd40bd4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,4 +14,3 @@ org.gradle.jvmargs=-Xmx1536m android.useAndroidX=true android.enableJetifier=true -