增加 出库

master
wangh 1 year ago
parent 3d6133e17b
commit 5a71af1ce6

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />

@ -45,4 +45,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
// https://mvnrepository.com/artifact/com.contrarywind/Android-PickerView
// implementation 'com.contrarywind:Android-PickerView:4.1.9'
// https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2
implementation 'com.alibaba.fastjson2:fastjson2:2.0.45'
}

@ -13,7 +13,10 @@
android:theme="@style/Theme.Jingyuanmes"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:name=".store.MaterialOutListActivity"
android:exported="false" />
<activity
android:name=".store.MaterialInActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -21,6 +24,17 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true">
<!-- <intent-filter> -->
<!-- <action android:name="android.intent.action.MAIN" /> -->
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<!-- </intent-filter> -->
</activity>
</application>
</manifest>

@ -1,15 +1,79 @@
package com.example.jingyuan_mes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
import com.alibaba.fastjson2.JSONObject;
import com.example.jingyuan_mes.base.BaseActivity;
import com.example.jingyuan_mes.base.MyRecultCall;
import com.example.jingyuan_mes.base.MyResult;
import com.example.jingyuan_mes.databinding.ActivityMainBinding;
import com.example.jingyuan_mes.uitls.SharedPreferencesUtils;
import com.example.jingyuan_mes.vm.LoginVm;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;
import okhttp3.RequestBody;
public class MainActivity extends BaseActivity {
private LoginVm loginVm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
loginVm = new LoginVm();
boolean isRemember = SharedPreferencesUtils.getboolean("isRemember", false);
if (isRemember) {
loginVm.setUsername(SharedPreferencesUtils.getstring("user", ""));
loginVm.setPassword(SharedPreferencesUtils.getstring("pass", ""));
loginVm.setRemember(isRemember);
}
binding.setUser(loginVm);
}
@Override
public void sanCodeCall(String code) {
}
public void login_click(View view) {
String pass = loginVm.getPassword();
String name = loginVm.getUsername();
if (pass == null || name == null || pass.isEmpty() || name.isEmpty()) return;
OkGo.<MyResult>post("http://175.27.215.92:7018/prod-api/auth/pdaLogin")
.upRequestBody(RequestBody.create(JSON, gson.toJson(loginVm)))
.execute(new MyRecultCall(dialog, this) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode() == 200) {
// gson.fromJson(body)
String accessToken = JSONObject.parseObject(body.getData().toString()).get("access_token").toString();
SharedPreferencesUtils.putstring("access_token",accessToken);
boolean remember = loginVm.isRemember();
if (remember) {
SharedPreferencesUtils.putboolean("isRemember", remember);
SharedPreferencesUtils.putstring("user", name);
SharedPreferencesUtils.putstring("pass", pass);
}
// Intent intent=new Intent(MainActivity.this, HomePageActivity.class);
// intent.putExtra("json",response.body());
// startActivity(intent);
// finish();
}
}
});
}
}

@ -0,0 +1,78 @@
package com.example.jingyuan_mes.base;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import androidx.appcompat.app.AppCompatActivity;
import com.google.gson.Gson;
import java.util.List;
import okhttp3.MediaType;
public abstract class BaseActivity extends AppCompatActivity {
public static String url = "http://175.27.215.92:7018/prod-api";
// public static String url = "http://172.20.10.2:90/api";
public ProgressDialog dialog;
public Gson gson;
public MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private MyReceiver myReceiver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gson = new Gson();
initDialog();
initSan();
}
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
}
}
private void initDialog() {
dialog = new ProgressDialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setCanceledOnTouchOutside(false);
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setMessage("请求网络中...");
}
private void initSan(){
myReceiver = new MyReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.rfid.FUN_KEY");
registerReceiver(myReceiver, intentFilter);
}
@Override
protected void onDestroy() {
super.onDestroy();
unregisterReceiver(myReceiver);
}
public void titleToolClick(View view){
finish();
}
public abstract void sanCodeCall(String code);
}

@ -0,0 +1,59 @@
package com.example.jingyuan_mes.base;
import android.app.Application;
import com.example.jingyuan_mes.uitls.SharedPreferencesUtils;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.cookie.CookieJarImpl;
import com.lzy.okgo.cookie.store.MemoryCookieStore;
import com.lzy.okgo.https.HttpsUtils;
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import okhttp3.OkHttpClient;
/**
* @author: wangh
* @description:
* @date: 2019/06/11-13:01
*/
public class MyApplication extends Application {
MyApplication application;
@Override
public void onCreate() {
super.onCreate();
application = this;
SharedPreferencesUtils.init(getApplicationContext(), "myapp");
okGoBase();
}
// OKGO 初始化
private void okGoBase() {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor("OkGo");
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY); // log打印级别决定了log显示的详细程度
loggingInterceptor.setColorLevel(Level.SEVERE); // log颜色级别决定了log在控制台显示的颜色
HttpsUtils.SSLParams sslParams1 = HttpsUtils.getSslSocketFactory(); // 方法一:信任所有证书,不安全有风险
builder.sslSocketFactory(sslParams1.sSLSocketFactory, sslParams1.trustManager);
builder.addInterceptor(loggingInterceptor);
builder.readTimeout(3000, TimeUnit.MILLISECONDS); // 全局的读取超时时间
builder.writeTimeout(3000, TimeUnit.MILLISECONDS); // 全局的写入超时时间
builder.connectTimeout(3000, TimeUnit.MILLISECONDS); // 全局的连接超时时间
builder.cookieJar(new CookieJarImpl(new MemoryCookieStore())); // 使用内存保持cookieapp退出后cookie消失
OkGo.getInstance().init(this).setOkHttpClient(builder.build()) // 建议设置OkHttpClient不设置将使用默认的
.setCacheMode(CacheMode.NO_CACHE) // 全局统一缓存模式,默认不使用缓存,可以不传
.setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE) // 全局统一缓存时间,默认永不过期,可以不传
.setRetryCount(3);
}
}

@ -0,0 +1,65 @@
package com.example.jingyuan_mes.base;
import android.app.ProgressDialog;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
import com.google.gson.Gson;
import com.lzy.okgo.callback.AbsCallback;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.base.Request;
import okhttp3.ResponseBody;
/**
* @author wanghao
* @date 2023/11/20 14:27
*/
public class MyRecultCall extends AbsCallback<MyResult> {
private ProgressDialog dialog;
private Context context;
public MyRecultCall(ProgressDialog dialog, Context context) {
this.dialog = dialog;
this.context = context;
}
@Override
public MyResult convertResponse(okhttp3.Response response) throws Throwable {
ResponseBody body = response.body();
if (body == null) return null;
Gson gson = new Gson();
MyResult resust = gson.fromJson(body.string(), MyResult.class);
resust.setData(gson.toJson(resust.getData()));
return resust;
}
@Override
public void onSuccess(Response<MyResult> response) {
dialog.dismiss();
// Log.e("网络请求情况", "onSuccess:");
}
@Override
public void onError(Response<MyResult> response) {
super.onError(response);
dialog.dismiss();
Log.e("网络请求情况", "onError:" );
Toast.makeText(context, "网络连接错误", Toast.LENGTH_SHORT).show();
}
@Override
public void onStart(Request<MyResult, ? extends Request> request) {
super.onStart(request);
dialog.show();
// Log.e("网络请求情况", "onStart:" );
}
@Override
public void onFinish() {
super.onFinish();
dialog.dismiss();
Log.e("网络请求情况", "onFinish:" );
}
}

@ -0,0 +1,35 @@
package com.example.jingyuan_mes.base;
/**
* @author wanghao
* @date 2023/12/21 15:31
*/
public class MyResult {
private int code;
private String msg;
private Object data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}

@ -0,0 +1,62 @@
package com.example.jingyuan_mes.entity;
/**
* @author wanghao
* @date 2024/1/30 11:19
*/
public class MaterialIn {
private String materialBarcode;
private String locationCode;
private String instockAmount;
private String poNo;
private String batchCode;
private String materialId;
public String getMaterialBarcode() {
return materialBarcode;
}
public void setMaterialBarcode(String materialBarcode) {
this.materialBarcode = materialBarcode;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public String getInstockAmount() {
return instockAmount;
}
public void setInstockAmount(String instockAmount) {
this.instockAmount = instockAmount;
}
public String getPoNo() {
return poNo;
}
public void setPoNo(String poNo) {
this.poNo = poNo;
}
public String getBatchCode() {
return batchCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public String getMaterialId() {
return materialId;
}
public void setMaterialId(String materialId) {
this.materialId = materialId;
}
}

@ -0,0 +1,63 @@
package com.example.jingyuan_mes.store;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.Bindable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ObservableField;
import androidx.databinding.ObservableInt;
import androidx.databinding.ViewDataBinding;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.example.jingyuan_mes.R;
import com.example.jingyuan_mes.base.BaseActivity;
import com.example.jingyuan_mes.base.MyRecultCall;
import com.example.jingyuan_mes.base.MyResult;
import com.example.jingyuan_mes.databinding.ActivityMaterialInBinding;
import com.example.jingyuan_mes.entity.MaterialIn;
import com.example.jingyuan_mes.uitls.SharedPreferencesUtils;
import com.example.jingyuan_mes.vm.MaterialInVm;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import okhttp3.RequestBody;
public class MaterialInActivity extends BaseActivity {
private MaterialInVm vm;
private MaterialIn materialIn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityMaterialInBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_material_in);
binding.setTitle("原材料入库");
vm=new MaterialInVm();
binding.setVm(vm);
}
@Override
public void sanCodeCall(String code) {
}
public void material_in_submit(View view){
OkGo.<MyResult>post(url+"/wms/mobile/addRawInstock")
.headers("Authorization", SharedPreferencesUtils.getstring("access_token", ""))
.upRequestBody(RequestBody.create(JSON,gson.toJson(materialIn)))
.execute(new MyRecultCall(dialog,this){
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
var body = response.body();
if (body.getCode()==200){
finish();
}
Toast.makeText(MaterialInActivity.this, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
}

@ -0,0 +1,16 @@
package com.example.jingyuan_mes.store;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.jingyuan_mes.R;
public class MaterialOutListActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_material_out);
}
}

@ -0,0 +1,86 @@
package com.example.jingyuan_mes.uitls;
import android.content.Context;
import android.content.SharedPreferences;
/**
* Created by wang 18/7/5
*/
public class SharedPreferencesUtils {
private static SharedPreferences sharedPreferences;
private static SharedPreferences.Editor edit;
public static void init(Context context, String name) {
sharedPreferences = context.getSharedPreferences(name, context.MODE_PRIVATE);
edit = sharedPreferences.edit();
edit.commit();
}
public static void putstring(String key, String value) {
if (edit != null) {
edit.putString(key, value);
edit.commit();
}
}
public static void putInt(String key, int value) {
if (edit != null) {
edit.putInt(key, value);
edit.commit();
}
}
public static int getInt(String key, int value) {
if (sharedPreferences != null) {
return sharedPreferences.getInt(key,value);
}
return 0;
}
public static void putboolean(String key, boolean value) {
if (edit != null) {
edit.putBoolean(key, value);
edit.commit();
}
}
/**
*
*/
public static String getstring(String key, String deaflut) {
if (sharedPreferences != null) {
return sharedPreferences.getString(key, deaflut);
}
return "";
}
public static boolean getboolean(String key, boolean aaa) {
if (sharedPreferences != null) {
boolean aBoolean = sharedPreferences.getBoolean(key, aaa);
return aBoolean;
}
return aaa;
}
/**
* remo
*/
public static void removeKey(String key) {
if (edit != null) {
edit.remove(key);
edit.commit();
}
}
public static void Clean() {
//清空数据
try {
edit.clear();
edit.commit();
}catch (Exception e){
e.printStackTrace();
}
}
}

@ -0,0 +1,42 @@
package com.example.jingyuan_mes.vm;
import androidx.databinding.BaseObservable;
/**
* @author wanghao
* @date 2023/12/21 14:00
*/
public class LoginVm extends BaseObservable {
private String username;
private String password;
private boolean remember;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
notifyChange();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
notifyChange();
}
public boolean isRemember() {
return remember;
}
public void setRemember(boolean remember) {
this.remember = remember;
notifyChange();
}
}

@ -0,0 +1,35 @@
package com.example.jingyuan_mes.vm;
/**
* @author wanghao
* @date 2024/1/30 13:49
*/
public class MaterialInVm {
private String goodsCode;
private String locationCode;
private int number;
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp"/>
<stroke android:color="@color/black" android:width="1dp"/>
<solid android:color="@color/white"/>
</shape>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<corners android:radius="6dp"/>
</shape>

@ -1,18 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<layout 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=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="user"
type="com.example.jingyuan_mes.vm.LoginVm" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@color/white"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:gravity="left|center"
android:text="登录MES"
android:textColor="@color/black"
android:textSize="22sp" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:hint="用户名">
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@={user.username}" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout2"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:hint="密码"
app:passwordToggleEnabled="true">
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="textPassword"
android:layout_gravity="center"
android:imeOptions="actionDone"
android:text="@={user.password}" />
</com.google.android.material.textfield.TextInputLayout>
<CheckBox
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:checked="@={user.remember}"
android:text="记住我" />
<Button
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:letterSpacing="1"
android:text="登录"
android:textSize="20sp"
android:textStyle="bold"
android:onClick="login_click" />
</LinearLayout>
</layout>

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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"
xmlns:bind="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="title"
type="String" />
<variable
name="vm"
type="com.example.jingyuan_mes.vm.MaterialInVm" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".store.MaterialInActivity"
android:orientation="vertical">
<include layout="@layout/toolbar"
bind:title="@{title}"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="扫描物料:" />
<EditText
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@={vm.goodsCode}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="扫描库位:" />
<!-- -->
<EditText
style="@style/text_san"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp"
android:text="@={vm.locationCode}"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="4dp">
<TextView
style="@style/text_title"
android:layout_width="90dp"
android:layout_height="match_parent"
android:text="输入数量:" />
<EditText
style="@style/text_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="numberDecimal"
android:text='@={vm.number + "" }' />
</LinearLayout>
<Button
style="@style/button_style"
android:layout_width="match_parent"
android:layout_height="55dp"
android:layout_margin="20dp"
android:onClick="material_in_submit"
android:text="提交" />
</LinearLayout>
</layout>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<layout 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"
xmlns:bind="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="title"
type="String" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".store.MaterialOutListActivity">
<include
bind:title="@{title}"
layout="@layout/toolbar" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"/>
</LinearLayout>
</layout>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/text_bg">
</androidx.constraintlayout.widget.ConstraintLayout>

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="title"
type="String" />
</data>
<FrameLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary">
<ImageView
android:layout_width="66dp"
android:layout_height="match_parent"
android:src="@mipmap/ic_back"
android:padding="16dp"
android:onClick="titleToolClick" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="22sp"
android:gravity="center"
android:textColor="@color/white"
android:letterSpacing="0.2"
android:textStyle="bold"
android:text="@{title}" />
</FrameLayout>
</layout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -2,4 +2,11 @@
<resources>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="blue">#3073ff</color>
<color name="red">#F44336</color>
<color name="activity_bg">#F2F3F5</color>
<color name="yellow">#FFC107</color>
<color name="green">#ADDCA7</color>
<color name="item_bg">#DEE3E6</color>
</resources>

@ -3,7 +3,37 @@
<style name="Base.Theme.Jingyuanmes" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
<item name="colorPrimary">@color/blue</item>
<item name="android:windowBackground">@color/activity_bg</item>
</style>
<style name="Theme.Jingyuanmes" parent="Base.Theme.Jingyuanmes" />
<style name="text_title">
<item name="android:textSize">18sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
</style>
<style name="text_info">
<item name="android:textSize">18sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
<item name="android:background">@drawable/text_bg</item>
</style>
<style name="text_san">
<item name="android:textSize">18sp</item>
<item name="android:gravity">center</item>
<item name="android:textColor">@color/black</item>
<item name="android:background">@drawable/san_text_bg</item>
</style>
<style name="button_style">
<item name="android:textStyle">bold</item>
<item name="android:textSize">20sp</item>
<item name="android:elevation">2dp</item>
<item name="android:textColor">@color/white</item>
<item name="android:letterSpacing">0.5</item>
</style>
</resources>
Loading…
Cancel
Save