Browse Source

tomep

master
fyf 1 year ago
parent
commit
a601b79f1f
48 changed files with 799 additions and 50 deletions
  1. +2
    -0
      app/build.gradle
  2. +0
    -3
      app/src/main/AndroidManifest.xml
  3. +8
    -7
      app/src/main/java/com/example/bpa/MainActivity.java
  4. +2
    -0
      app/src/main/java/com/example/bpa/app/ICSApp.java
  5. +92
    -0
      app/src/main/java/com/example/bpa/helper/MyImageView.java
  6. +2
    -1
      app/src/main/java/com/example/bpa/helper/T.java
  7. +69
    -0
      app/src/main/java/com/example/bpa/helper/ToastUtil.java
  8. +73
    -1
      app/src/main/java/com/example/bpa/view/SystemCapabilitiesFragment.java
  9. +56
    -0
      app/src/main/java/com/example/bpa/view/control/ItemClickListener.java
  10. +57
    -0
      app/src/main/java/com/example/bpa/view/control/MainMeunAdapter.java
  11. +54
    -0
      app/src/main/java/com/example/bpa/view/control/MyLayoutManager.java
  12. +14
    -0
      app/src/main/java/com/example/bpa/view/mode/MenuMode.java
  13. +76
    -0
      app/src/main/res/drawable/frombg.xml
  14. +34
    -0
      app/src/main/res/drawable/frombj1.xml
  15. +11
    -0
      app/src/main/res/drawable/gongnengbj.xml
  16. +47
    -10
      app/src/main/res/layout/activity_main.xml
  17. +3
    -2
      app/src/main/res/layout/fragment_cloud.xml
  18. +86
    -9
      app/src/main/res/layout/fragment_hepler.xml
  19. +35
    -9
      app/src/main/res/layout/fragment_home.xml
  20. +11
    -7
      app/src/main/res/layout/fragment_system_capabilities.xml
  21. +1
    -0
      app/src/main/res/layout/fragment_system_set.xml
  22. +16
    -0
      app/src/main/res/layout/layout_toast.xml
  23. +34
    -0
      app/src/main/res/layout/meunbuttonitem.xml
  24. BIN
     
  25. BIN
     
  26. BIN
     
  27. BIN
     
  28. BIN
     
  29. BIN
     
  30. BIN
     
  31. BIN
     
  32. BIN
     
  33. BIN
     
  34. BIN
     
  35. BIN
     
  36. BIN
     
  37. BIN
     
  38. BIN
     
  39. BIN
     
  40. BIN
     
  41. BIN
     
  42. BIN
     
  43. BIN
     
  44. BIN
     
  45. BIN
     
  46. +9
    -0
      app/src/main/res/values/colors.xml
  47. +5
    -0
      app/src/main/res/values/dimens.xml
  48. +2
    -1
      build.gradle

+ 2
- 0
app/build.gradle View File

@@ -28,6 +28,7 @@ android {
buildFeatures {
viewBinding true
}

}

dependencies {
@@ -35,6 +36,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'


+ 0
- 3
app/src/main/AndroidManifest.xml View File

@@ -30,9 +30,6 @@
<activity
android:name=".view.CloudFragment"
android:exported="false" />
<activity
android:name=".HomeActivity"
android:exported="false" />
<activity
android:name=".LoginActivity"
android:exported="true">


+ 8
- 7
app/src/main/java/com/example/bpa/MainActivity.java View File

@@ -76,7 +76,7 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
ColseMain= findViewById(R.id.ColseMain);
fragment_container= findViewById(R.id.fragment_container);
clist_title.setText(ConfigName.getInstance().Shop_Name);
ShowFragment(homeFragment);
ShowFragment(homeFragment,"系统主页");
}
/**
* 初始化按钮事件
@@ -102,19 +102,19 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
public void onClick(View v) {
switch (v.getId()) {
case R.id.CloudUpdates://系统更新按钮
ShowFragment(cloudFragment);
ShowFragment(cloudFragment,"云端更新");
break;
case R.id.SystemCapabilities://系统功能按钮
ShowFragment(systemCapabilitiesFragment);
ShowFragment(systemCapabilitiesFragment,"功能菜单");
break;
case R.id.SystemSettings://系统设置按钮
ShowFragment(systemSetFragment);
ShowFragment(systemSetFragment,"系统设置");
break;
case R.id.SystemHelp://系统帮助按钮
ShowFragment(heplerFragment);
ShowFragment(heplerFragment,"系统帮助");
break;
case R.id.HomeMain://主页
ShowFragment(homeFragment);
ShowFragment(homeFragment,"系统主页");
break;
case R.id.ColseMain://关闭主窗体
ColseActive();
@@ -129,8 +129,9 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
/**
* 打开窗体
*/
public void ShowFragment(Fragment fragment)
public void ShowFragment(Fragment fragment,String Text)
{
clist_title.setText(Text);
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
if(SelectFragment!=null)


+ 2
- 0
app/src/main/java/com/example/bpa/app/ICSApp.java View File

@@ -9,6 +9,7 @@ import com.example.bpa.db.QueryDB;
import com.example.bpa.db.mode.BPA_MATERIAL;
import com.example.bpa.helper.Json;
import com.example.bpa.helper.SdCart;
import com.example.bpa.helper.ToastUtil;

import java.util.ArrayList;

@@ -23,6 +24,7 @@ public class ICSApp extends Application {
super.onCreate();
//1.设置程序active,初始化Main函数进程
ConfigName.getInstance().dishesCon = this;
ToastUtil.init(this);
Main.getInstance();
//2.初始化SD卡,数据库DB
SdCart.getInstance().initSD();


+ 92
- 0
app/src/main/java/com/example/bpa/helper/MyImageView.java View File

@@ -0,0 +1,92 @@
package com.example.bpa.helper;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.Toast;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class MyImageView extends ImageView {
public static final int GET_DATA_SUCCESS = 1;
public static final int NETWORK_ERROR = 2;
public static final int SERVER_ERROR = 3;
//子线程不能操作UI,通过Handler设置图片
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what){
case GET_DATA_SUCCESS:
Bitmap bitmap = (Bitmap) msg.obj;
setImageBitmap(bitmap);
break;
case NETWORK_ERROR:
Toast.makeText(getContext(),"网络连接失败",Toast.LENGTH_SHORT).show();
break;
case SERVER_ERROR:
Toast.makeText(getContext(),"服务器发生错误",Toast.LENGTH_SHORT).show();
break;
}
}
};

public MyImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

public MyImageView(Context context) {
super(context);
}

public MyImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}

//设置网络图片
public void setImageURL(final String path) {
//开启一个线程用于联网
new Thread() {
@Override
public void run() {
try {
//把传过来的路径转成URL
URL url = new URL(path);
//获取连接
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
//使用GET方法访问网络
connection.setRequestMethod("GET");
//超时时间为10秒
connection.setConnectTimeout(10000);
//获取返回码
int code = connection.getResponseCode();
if (code == 200) {
InputStream inputStream = connection.getInputStream();
//使用工厂把网络的输入流生产Bitmap
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
//利用Message把图片发给Handler
Message msg = Message.obtain();
msg.obj = bitmap;
msg.what = GET_DATA_SUCCESS;
handler.sendMessage(msg);
inputStream.close();
}else {
//服务启发生错误
handler.sendEmptyMessage(SERVER_ERROR);
}
} catch (IOException e) {
e.printStackTrace();
//网络连接错误
handler.sendEmptyMessage(NETWORK_ERROR);
}
}
}.start();
}

}

+ 2
- 1
app/src/main/java/com/example/bpa/helper/T.java View File

@@ -8,7 +8,8 @@ import android.widget.Toast;
*/
public class T {
public static void show(Context context, String str){
Toast.makeText(context, str, (int)0).show();
//Toast.makeText(context, str, (int)0).show();
ToastUtil.showToast(str);
Log.i(context.getPackageName(),str);
}
}


+ 69
- 0
app/src/main/java/com/example/bpa/helper/ToastUtil.java View File

@@ -0,0 +1,69 @@
package com.example.bpa.helper;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.example.bpa.R;

/**
* Toast统一管理类
*/
public class ToastUtil {

private static Context context;
private static View view;
private static Toast toast;
public static Handler mHandler = new Handler(Looper.getMainLooper());

public static void init(Context c) {
context = c;
}

private static void show(Context context, String text) {
if (toast != null) {
toast.cancel();
}
toast = new Toast(context);
//设置Toast要显示的位置,水平居中并在底部,X轴偏移0个单位,Y轴偏移70个单位,
toast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 0, dip2px(context, 80));
//设置显示时间
toast.setDuration(Toast.LENGTH_SHORT);
if (view == null) {
view = LayoutInflater.from(context).inflate(R.layout.layout_toast, null);
}
TextView textView = view.findViewById(R.id.tv_toast_text);
textView.setText(text);
toast.setView(view);
toast.show();
}

/**
* Toast工具类
* @param content
*/
public static void showToast(String content) {
if (Looper.myLooper() == Looper.getMainLooper()) {
show(context, content);
} else {
mHandler.post(new Runnable() {
@Override
public void run() {
show(context, content);
}
});
}
}

/**
* dp转px
*/
static int dip2px(Context context, float f) {
return (int) ((f * context.getResources().getDisplayMetrics().density) + 0.5f);
}
}

+ 73
- 1
app/src/main/java/com/example/bpa/view/SystemCapabilitiesFragment.java View File

@@ -4,23 +4,95 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.bpa.R;
import com.example.bpa.config.ConfigName;
import com.example.bpa.helper.T;
import com.example.bpa.view.control.ItemClickListener;
import com.example.bpa.view.control.MainMeunAdapter;
import com.example.bpa.view.control.MyLayoutManager;
import com.example.bpa.view.mode.MenuMode;

import java.util.ArrayList;
import java.util.List;

/**
* 系统功能界面
*/
public class SystemCapabilitiesFragment extends Fragment {

//region 变量
RecyclerView recyclerView;
RelativeLayout recycler_view_container;
View view;
MainMeunAdapter adapter;
List<MenuMode> menuModes = new ArrayList<>();
//endregion

//region 私有函数
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_system_capabilities, container,false);
view = inflater.inflate(R.layout.fragment_system_capabilities, container,false);
Init();
initEvents();
return view;
}
//endregion
//region 公有函数
/**
* 初始化
*/
private void Init() {
recyclerView = view.findViewById(R.id.recycler_view);
recycler_view_container=(RelativeLayout) view.findViewById(R.id.recycler_view_container);

menuModes.clear();
menuModes.add(new MenuMode("料仓设置",R.mipmap.lcsz));
menuModes.add(new MenuMode("电子秤校验",R.mipmap.dzcjy));
menuModes.add(new MenuMode("流速校验",R.mipmap.lsjy));
menuModes.add(new MenuMode("自动清洗",R.mipmap.zdqx));
menuModes.add(new MenuMode("研发出料",R.mipmap.yfcl));
menuModes.add(new MenuMode("订单预警日志",R.mipmap.gjrz));
menuModes.add(new MenuMode("员工操作日志",R.mipmap.czrz));
menuModes.add(new MenuMode("配方研发",R.mipmap.yfpf));

MyLayoutManager layout = new MyLayoutManager();
//必须,防止recyclerview高度为wrap时测量item高度0
layout.setAutoMeasureEnabled(true);
recyclerView.setLayoutManager(layout);
adapter = new MainMeunAdapter(view.getContext(), menuModes);
recyclerView.setAdapter(adapter);
recyclerView.addOnItemTouchListener(new ItemClickListener(recyclerView, new ItemClickListener.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
// list.remove(position);
// adapter.notifyItemRemoved(position);
TextView textView = (TextView) view.findViewById(R.id.meun_textview);
T.show(view.getContext(),textView.getText().toString());
}

@Override
public void onItemLongClick(View view, int position) {

}
}));
}
/**
* 初始化按钮事件
*/
private void initEvents() {
//设置四个Tab的点击事件

}
//endregion
}

+ 56
- 0
app/src/main/java/com/example/bpa/view/control/ItemClickListener.java View File

@@ -0,0 +1,56 @@
package com.example.bpa.view.control;

import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;

import androidx.core.view.GestureDetectorCompat;
import androidx.recyclerview.widget.RecyclerView;

/**
* recyclerview item 监听器
* Created by chengxiakuan on 2016/9/24.
*/
public class ItemClickListener extends RecyclerView.SimpleOnItemTouchListener {

private OnItemClickListener clickListener;
private GestureDetectorCompat gestureDetector;

public interface OnItemClickListener {

void onItemClick(View view, int position);

void onItemLongClick(View view, int position);
}

public ItemClickListener(final RecyclerView recyclerView,
OnItemClickListener listener) {
this.clickListener = listener;
gestureDetector = new GestureDetectorCompat(recyclerView.getContext(),
new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapUp(MotionEvent e) {
View childView = recyclerView.findChildViewUnder(e.getX(), e.getY());
if (childView != null && clickListener != null) {
clickListener.onItemClick(childView, recyclerView.getChildAdapterPosition(childView));
}
return true;
}
@Override
public void onLongPress(MotionEvent e) {
View childView = recyclerView.findChildViewUnder(e.getX(), e.getY());
if (childView != null && clickListener != null) {
clickListener.onItemLongClick(childView,
recyclerView.getChildAdapterPosition(childView));
}
}
});
}

@Override
public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
gestureDetector.onTouchEvent(e);
return false;
}

}

+ 57
- 0
app/src/main/java/com/example/bpa/view/control/MainMeunAdapter.java View File

@@ -0,0 +1,57 @@
package com.example.bpa.view.control;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.example.bpa.R;
import com.example.bpa.view.mode.MenuMode;
import java.util.List;

public class MainMeunAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

private final LayoutInflater mLayoutInflater;
private Context context;
private List<MenuMode> list;

public MainMeunAdapter(Context context, List<MenuMode> list) {
this.context = context;
this.list = list;
mLayoutInflater = LayoutInflater.from(context);
}


@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View inflate = mLayoutInflater.inflate(R.layout.meunbuttonitem, parent, false);
return new MyViewHolder(inflate);

}

@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (holder instanceof MyViewHolder) {
MyViewHolder myViewHolder = (MyViewHolder) holder;
myViewHolder.textView.setText(list.get(position).Name);
myViewHolder.imageView.setImageResource(list.get(position).Url);
}
}

@Override
public int getItemCount() {
return list.size();
}

static class MyViewHolder extends RecyclerView.ViewHolder {
TextView textView;
ImageView imageView;
public MyViewHolder(View view) {
super(view);
textView = (TextView) view.findViewById(R.id.meun_textview);
imageView = (ImageView) view.findViewById(R.id.meun_imageview);
}
}

}

+ 54
- 0
app/src/main/java/com/example/bpa/view/control/MyLayoutManager.java View File

@@ -0,0 +1,54 @@
package com.example.bpa.view.control;
import android.view.View;
import androidx.recyclerview.widget.RecyclerView;

/**
* 自动换行布局管理
* Created by fengyoufu.
*/
public class MyLayoutManager extends RecyclerView.LayoutManager {

@Override
public RecyclerView.LayoutParams generateDefaultLayoutParams() {
return new RecyclerView.LayoutParams(
RecyclerView.LayoutParams.WRAP_CONTENT,
RecyclerView.LayoutParams.WRAP_CONTENT);
}

@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
detachAndScrapAttachedViews(recycler);

int sumWidth = getWidth();

int curLineWidth = 0, curLineTop = 0;
int lastLineMaxHeight = 0;
for (int i = 0; i < getItemCount(); i++) {
View view = recycler.getViewForPosition(i);

addView(view);
measureChildWithMargins(view, 0, 0);
int width = getDecoratedMeasuredWidth(view);
int height = getDecoratedMeasuredHeight(view);

curLineWidth += width;
if (curLineWidth <= sumWidth) {//不需要换行
layoutDecorated(view, curLineWidth - width, curLineTop, curLineWidth, curLineTop + height);
//比较当前行多有item的最大高度
lastLineMaxHeight = Math.max(lastLineMaxHeight, height);
} else {//换行
curLineWidth = width;
if (lastLineMaxHeight == 0) {
lastLineMaxHeight = height;
}
//记录当前行top
curLineTop += lastLineMaxHeight;

layoutDecorated(view, 0, curLineTop, width, curLineTop + height);
lastLineMaxHeight = height;
}
}

}

}

+ 14
- 0
app/src/main/java/com/example/bpa/view/mode/MenuMode.java View File

@@ -0,0 +1,14 @@
package com.example.bpa.view.mode;

/**
* 菜单Model
*/
public class MenuMode {
public String Name;
public int Url;
public MenuMode(String name,int url)
{
this.Name=name;
this.Url=url;
}
}

+ 76
- 0
app/src/main/res/drawable/frombg.xml View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="500dp"
android:height="500dp"
android:viewportWidth="500"
android:viewportHeight="500">
<path
android:fillColor="#10ABF3"
android:pathData="M 85.00,25.14
C 85.00,25.14 117.00,25.14 117.00,25.14
117.00,25.14 175.00,25.14 175.00,25.14
178.84,25.01 182.53,24.78 185.92,27.01
192.40,31.31 192.44,40.92 185.92,45.26
182.95,47.27 179.44,46.99 176.00,47.00
176.00,47.00 96.00,47.00 96.00,47.00
66.91,47.05 47.05,66.92 47.00,96.00
47.00,96.00 47.00,176.00 47.00,176.00
46.99,179.44 47.27,182.95 45.26,185.92
40.92,192.44 31.31,192.40 27.01,185.92
24.78,182.53 25.01,178.84 25.00,175.00
25.00,175.00 25.00,118.00 25.00,118.00
25.00,88.69 22.72,63.95 47.00,42.17
52.31,37.41 56.70,34.86 63.00,31.76
71.93,27.36 75.44,26.87 85.00,25.14 Z
M 317.00,25.65
C 317.00,25.65 364.00,25.00 364.00,25.00
364.00,25.00 394.00,25.00 394.00,25.00
394.00,25.00 407.00,25.00 407.00,25.00
427.96,25.03 448.30,34.10 461.10,51.00
464.82,55.91 468.75,63.23 470.94,69.00
473.77,76.48 474.99,85.03 475.00,93.00
475.00,93.00 475.00,175.00 475.00,175.00
474.99,178.84 475.22,182.53 472.99,185.92
468.69,192.40 459.08,192.44 454.74,185.92
452.73,182.95 453.01,179.44 453.00,176.00
453.00,176.00 453.00,110.00 453.00,110.00
453.00,90.59 454.43,75.12 438.91,60.17
423.77,45.59 409.14,47.00 390.00,47.00
390.00,47.00 324.00,47.00 324.00,47.00
320.01,46.99 316.42,47.32 313.13,44.57
305.97,38.58 308.89,29.14 317.00,25.65 Z
M 33.00,309.65
C 50.89,306.35 47.00,328.04 47.00,339.00
47.00,339.00 47.00,390.00 47.00,390.00
47.00,408.60 45.54,422.95 59.30,437.91
74.51,454.44 90.71,453.00 111.00,453.00
111.00,453.00 176.00,453.00 176.00,453.00
179.44,453.01 182.95,452.73 185.92,454.74
192.44,459.08 192.40,468.69 185.92,472.99
182.53,475.22 178.84,474.99 175.00,475.00
175.00,475.00 114.00,475.00 114.00,475.00
87.74,475.00 66.91,476.52 46.00,456.91
40.23,451.50 36.32,446.02 32.76,439.00
23.50,420.75 25.00,409.56 25.00,390.00
25.00,390.00 25.00,349.00 25.00,349.00
25.00,349.00 25.00,325.00 25.00,325.00
25.01,321.61 24.81,318.13 26.45,315.04
28.14,311.86 29.88,310.99 33.00,309.65 Z
M 461.00,309.57
C 470.80,308.04 474.88,313.91 475.00,323.00
475.00,323.00 475.00,366.00 475.00,366.00
475.00,366.00 475.00,394.00 475.00,394.00
475.00,394.00 475.00,407.00 475.00,407.00
474.97,427.96 465.90,448.30 449.00,461.10
444.11,464.80 436.75,468.76 431.00,470.94
423.82,473.65 414.66,474.99 407.00,475.00
407.00,475.00 367.00,475.00 367.00,475.00
367.00,475.00 324.00,475.00 324.00,475.00
320.03,474.98 316.49,475.02 313.21,472.35
307.53,467.73 307.96,458.81 314.05,454.74
317.05,452.73 320.56,453.01 324.00,453.00
324.00,453.00 404.00,453.00 404.00,453.00
432.20,452.96 452.96,433.54 453.00,405.00
453.00,405.00 453.00,334.00 453.00,334.00
453.00,324.54 450.28,313.79 461.00,309.57 Z" />
</vector>

+ 34
- 0
app/src/main/res/drawable/frombj1.xml View File

@@ -0,0 +1,34 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<corners android:radius="15dp" />
<solid android:color="@color/light_blue" />
</shape>
</item>

<item
android:bottom="6dp"
android:left="6dp"
android:right="6dp"
android:top="6dp">
<shape>
<corners android:radius="12dp" />
<solid android:color="@color/white" />
</shape>
</item>
<item
android:left="30dp"
android:right="30dp">
<shape>
<solid android:color="@color/white" />
</shape>
</item>
<item
android:bottom="30dp"
android:top="30dp">
<shape>
<solid android:color="@color/white" />
</shape>
</item>

</layer-list>

+ 11
- 0
app/src/main/res/drawable/gongnengbj.xml View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android"

android:shape="rectangle">
<solid android:color="#101622" />
<corners android:radius="10dp" />
<stroke
android:width="1dp"
android:color="#101622" />
</shape>

+ 47
- 10
app/src/main/res/layout/activity_main.xml View File

@@ -12,15 +12,15 @@
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="@color/test">
<ImageView
android:id="@+id/mainreturn"
android:layout_width="20dp"
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:src="@mipmap/zj"
android:visibility="invisible"
android:textSize="@dimen/TitleSize"
android:textColor="@color/titleforeground"
android:text="四川黑菠萝科技@奶茶机1.0"
/>
<RelativeLayout
android:layout_centerInParent="true"
@@ -32,8 +32,8 @@
android:layout_height="wrap_content"
android:text="茶百道奶茶机"
android:layout_centerInParent="true"
android:textColor="@android:color/white"
android:textSize="16dp"
android:textColor="@color/white"
android:textSize="@dimen/textTitleSize"
android:textStyle="bold" />
<ImageView
android:layout_width="400dp"
@@ -104,8 +104,45 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#FF03668F" />
<FrameLayout
android:id="@+id/fragment_container"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent"
android:layout_margin="5dp">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@mipmap/zs"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:src="@mipmap/zx"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@mipmap/ys"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:src="@mipmap/yx"/>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp">
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
</RelativeLayout>

</LinearLayout>

+ 3
- 2
app/src/main/res/layout/fragment_cloud.xml View File

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:tag="云端更新"
tools:context=".view.CloudFragment">
<TextView
android:layout_width="wrap_content"
@@ -12,4 +13,4 @@
android:textSize="50dp"
android:textColor="@color/color_purl">
</TextView>
</LinearLayout>
</RelativeLayout>

+ 86
- 9
app/src/main/res/layout/fragment_hepler.xml View File

@@ -1,15 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".view.HeplerFragment">
<TextView
android:layout_width="wrap_content"
android:tag="系统帮助"
tools:context=".view.HeplerFragment"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="系统帮助"
android:textSize="50dp"
android:textColor="@color/color_purl">
</TextView>
</LinearLayout>
android:layout_centerInParent="true" >
<RelativeLayout
android:layout_width="600dp"
android:layout_height="400dp"
android:layout_margin="20dip"
android:layout_centerHorizontal="true"
android:background="@mipmap/bk3"
android:orientation="vertical"
android:padding="40dip" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_marginTop="0dp"
android:layout_marginLeft="100dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="100dp">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="1.填入可滑动内容....\n
3.填入可滑动内容....\n
4.填入可滑动内容....\n
5.填入可滑动内容....\n
6.填入可滑动内容....\n
7.填入可滑动内容....\n
8.填入可滑动内容....\n
9.填入可滑动内容....\n
10.填入可滑动内容....\n
11.填入可滑动内容....\n
12.填入可滑动内容....\n
13.填入可滑动内容....\n
14.填入可滑动内容....\n
15.填入可滑动内容....\n
16.填入可滑动内容....\n
17.填入可滑动内容....\n
12.填入可滑动内容....\n
13.填入可滑动内容....\n
14.填入可滑动内容....\n
15.填入可滑动内容....\n
16.填入可滑动内容....\n
17.填入可滑动内容....\n
"
android:textColor="@color/foreground"
android:textSize="@dimen/textSize" />
</ScrollView>

</LinearLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0px"
android:layout_marginRight="20dp"
android:layout_marginLeft="100dp"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/textSize"
android:textColor="@color/lable_color"
android:text="四川黑菠萝科技有限公司 ● 成都">
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="0dp"
android:textSize="@dimen/textSize"
android:textColor="@color/lable_color"
android:text="©HBL 2021-2022">
</TextView>
</RelativeLayout>
</RelativeLayout>

</RelativeLayout>
</RelativeLayout>

+ 35
- 9
app/src/main/res/layout/fragment_home.xml View File

@@ -1,15 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:tag="系统主页"
tools:context=".view.HomeFragment">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="系统主页"
android:textSize="50dp"
android:textColor="@color/color_purl">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="20dp">
<RelativeLayout
android:layout_width="260dp"
android:layout_height="400dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="@mipmap/rqbk">
</ImageView>
</RelativeLayout>

<RelativeLayout
android:layout_width="260dp"
android:layout_marginLeft="20dp"
android:layout_height="400dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="@mipmap/rqbk">
</ImageView>
</RelativeLayout>

</LinearLayout>
</RelativeLayout>

+ 11
- 7
app/src/main/res/layout/fragment_system_capabilities.xml View File

@@ -4,12 +4,16 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:tag="系统功能"
tools:context=".view.SystemCapabilitiesFragment">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="系统功能"
android:textSize="50dp"
android:textColor="@color/color_purl">
</TextView>
<RelativeLayout
android:id="@+id/recycler_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>
</LinearLayout>

+ 1
- 0
app/src/main/res/layout/fragment_system_set.xml View File

@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:tag="系统设置"
tools:context=".view.SystemSetFragment">
<TextView
android:layout_width="wrap_content"


+ 16
- 0
app/src/main/res/layout/layout_toast.xml View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tv_toast_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/bg_black65_30"
android:gravity="center"
android:lineSpacingExtra="3dp"
android:maxWidth="667dp"
android:paddingLeft="47dp"
android:paddingTop="15dp"
android:paddingRight="47dp"
android:paddingBottom="15dp"
android:textColor="#ffffff"
android:textSize="21sp"/>

+ 34
- 0
app/src/main/res/layout/meunbuttonitem.xml View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="5dp">
<RelativeLayout
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:background="@mipmap/nbbj1">
<ImageView
android:id="@+id/meun_imageview"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerInParent="true"
android:layout_alignParentTop="true"
android:layout_marginTop="15dp"
android:scaleType="fitXY"
android:src="@mipmap/lcsz"/>
<TextView
android:id="@+id/meun_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="15dp"
android:textColor="@color/white"
android:textSize="@dimen/TitleSize"
android:text="料仓设置">
</TextView>
</RelativeLayout>
</LinearLayout>

BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


BIN
View File


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

@@ -29,6 +29,15 @@
<color name="warm_red">#E5514E</color>
<color name="warm_blue">#42A5F5</color>
<color name="light_blue">#EC6BBAFA</color>
<color name="lable_color">#FF00EEF3</color>
<color name="foreground">#a2c2e8</color>
<color name="borderBrush">#FF074B92</color>
<color name="titleforeground">#FF07D7FF</color>
<color name="dataGridColumnHeaderColor">#00c2f4</color>
<color name="buttonSelectForeground">#4fade8</color>
<color name="buttonUnSelectForeground">#3afdff</color>
<color name="meunSelectForeground">#8f723c</color>
<color name="meunUnSelectForeground">#E6E6E6</color>
<!-- common -->

<color name="app_color_blue">#00A8E1</color>


+ 5
- 0
app/src/main/res/values/dimens.xml View File

@@ -41,4 +41,9 @@
<!-- Span Utils 各种 Span 工具 -->
<dimen name="spanUtils_column_marginBottom">35dp</dimen>
<dimen name="spanUtils_common_textSize">16sp</dimen>

<!-- text -->
<dimen name="textSize">14dp</dimen>
<dimen name="textTitleSize">16sp</dimen>
<dimen name="TitleSize">18sp</dimen>
</resources>

+ 2
- 1
build.gradle View File

@@ -1,5 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
id 'com.android.application' version '7.4.1' apply false
id 'com.android.library' version '7.4.1' apply false
}
}

Loading…
Cancel
Save