完成 列表

master
wanghao 4 weeks ago
parent 67ac720833
commit 609b21dc52

@ -49,5 +49,6 @@ dependencies {
implementation 'com.google.code.gson:gson:2.13.1'
implementation 'com.google.zxing:core:3.5.3'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //
implementation 'io.github.scwang90:refresh-footer-classics:2.0.6' //
}

@ -0,0 +1,59 @@
package com.example.beijingnopowercon.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.example.beijingnopowercon.BR;
import com.example.beijingnopowercon.R;
import com.example.beijingnopowercon.data.DeviceInfo;
import com.example.beijingnopowercon.data.RecordUse;
import com.example.beijingnopowercon.databinding.ItemDeviceBinding;
import com.example.beijingnopowercon.databinding.ItemRecordBinding;
import java.util.List;
public class DeviceListAdapter extends RecyclerView.Adapter<DeviceListAdapter.MyViewHoder> {
private List<DeviceInfo> list;
private Context context;
private LayoutInflater inflater;
public DeviceListAdapter(Context context) {
this.context = context;
inflater = LayoutInflater.from(context);
}
public void setList(List<DeviceInfo> list) {
this.list = list;
}
@NonNull
@Override
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ItemDeviceBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_device, parent, false);
return new MyViewHoder(binding);
}
@Override
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
holder.binding.setVariable(BR.data, list.get(position));
}
@Override
public int getItemCount() {
return list == null ? 0 : list.size();
}
public class MyViewHoder extends RecyclerView.ViewHolder {
private ItemDeviceBinding binding;
public MyViewHoder(ItemDeviceBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
}
}

@ -0,0 +1,57 @@
package com.example.beijingnopowercon.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.example.beijingnopowercon.BR;
import com.example.beijingnopowercon.R;
import com.example.beijingnopowercon.data.RecordUse;
import com.example.beijingnopowercon.databinding.ItemRecordBinding;
import java.util.List;
public class RecordListAdapter extends RecyclerView.Adapter<RecordListAdapter.MyViewHoder> {
private List<RecordUse> list;
private Context context;
private LayoutInflater inflater;
public RecordListAdapter(Context context) {
this.context = context;
inflater = LayoutInflater.from(context);
}
public void setList(List<RecordUse> list) {
this.list = list;
}
@NonNull
@Override
public MyViewHoder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
ItemRecordBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_record, parent, false);
return new MyViewHoder(binding);
}
@Override
public void onBindViewHolder(@NonNull MyViewHoder holder, int position) {
holder.binding.setVariable(BR.data, list.get(position));
}
@Override
public int getItemCount() {
return list == null ? 0 : list.size();
}
public class MyViewHoder extends RecyclerView.ViewHolder {
private ItemRecordBinding binding;
public MyViewHoder(ItemRecordBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
}
}

@ -29,7 +29,8 @@ public class MyApplication extends Application {
public static MyApplication getApplication() {
return application;
}
public static String url="http://192.168.137.1:8091/api";
// public static String url="http://192.168.137.1:8091/api";
public static String url="http://119.45.202.115:8091/api";
@Override
public void onCreate() {
super.onCreate();

@ -164,8 +164,16 @@ public class DeviceInfo {
return deviceState;
}
private String useStateName;
private String deviceStateName;
public String getUseStateName() {
if (useState.equals("1")){
return "使用中";
}
return "空闲";
}
public String getDeviceStateName() {
if (useState.equals("1")){
return "使用中";

@ -0,0 +1,137 @@
package com.example.beijingnopowercon.data;
import java.util.Date;
/**
* 使 device_record_use
*
* @author ruoyi
* @date 2025-05-19
*/
public class RecordUse {
private String deviceId;
/**
*
*/
private String deviceCode;
/**
*
*/
private String deviceName;
/**
*
*/
private String deviceType;
/**
*
*/
private String openTime;
/**
*
*/
private String closeTime;
/**
* 使()
*/
private double useTime;
/**
* 使
*/
private String useState;
private String useStateName;
public String getUseStateName() {
if (useState.equals("1")){
return "使用中";
}
return "已完成";
}
/**
*
*/
private String useUser;
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getOpenTime() {
return openTime;
}
public void setOpenTime(String openTime) {
this.openTime = openTime;
}
public String getCloseTime() {
return closeTime;
}
public void setCloseTime(String closeTime) {
this.closeTime = closeTime;
}
public double getUseTime() {
return useTime;
}
public void setUseTime(double useTime) {
this.useTime = useTime;
}
public String getUseState() {
return useState;
}
public void setUseState(String useState) {
this.useState = useState;
}
public String getUseUser() {
return useUser;
}
public void setUseUser(String useUser) {
this.useUser = useUser;
}
}

@ -5,28 +5,61 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.ViewModelProvider;
import com.example.beijingnopowercon.adapter.RecordListAdapter;
import com.example.beijingnopowercon.base.BaseFragment;
import com.example.beijingnopowercon.data.RecordUse;
import com.example.beijingnopowercon.databinding.FragmentGalleryBinding;
import com.example.beijingnopowercon.okgo.MyRecultCall;
import com.example.beijingnopowercon.okgo.MyResult;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
public class GalleryFragment extends Fragment {
import java.util.List;
import okhttp3.MediaType;
import okhttp3.RequestBody;
public class GalleryFragment extends BaseFragment {
private FragmentGalleryBinding binding;
private RecordListAdapter adapter;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
GalleryViewModel galleryViewModel =
new ViewModelProvider(this).get(GalleryViewModel.class);
binding = FragmentGalleryBinding.inflate(inflater, container, false);
View root = binding.getRoot();
adapter=new RecordListAdapter(context);
binding.recordRecycler.setAdapter(adapter);
initRequest();
return binding.getRoot();
}
private void initRequest() {
OkGo.<MyResult>post(url + "/record/selectUseList")
.execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode()==0){
List<RecordUse> list=gson.fromJson(body.getDataJson(),new TypeToken<List<RecordUse>>(){}.getType());
adapter.setList(list);
adapter.notifyDataSetChanged();
return;
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_LONG).show();
}
});
final TextView textView = binding.textGallery;
galleryViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
return root;
}
@Override

@ -11,6 +11,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import com.example.beijingnopowercon.CustomScannerActivity;
import com.example.beijingnopowercon.adapter.DeviceListAdapter;
import com.example.beijingnopowercon.base.BaseFragment;
import com.example.beijingnopowercon.data.DeviceInfo;
import com.example.beijingnopowercon.databinding.FragmentHomeBinding;
@ -19,33 +20,67 @@ import com.example.beijingnopowercon.okgo.MyRecultCall;
import com.example.beijingnopowercon.okgo.MyResult;
import com.example.beijingnopowercon.uitls.SharedPreferencesUtils;
import com.google.android.material.snackbar.Snackbar;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import java.util.List;
import okhttp3.MediaType;
import okhttp3.RequestBody;
public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoDialogCall{
public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoDialogCall {
private View root;
private FragmentHomeBinding binding;
private SanInfoDialog infoDialog;
private DeviceListAdapter adapter;
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
binding = FragmentHomeBinding.inflate(inflater, container, false);
root = binding.getRoot();
binding.homeSan.setOnClickListener(v -> {
Intent intent = new Intent(getActivity(), CustomScannerActivity.class);
startActivityForResult(intent, IntentIntegrator.REQUEST_CODE);
startActivityForResult(intent, IntentIntegrator.REQUEST_CODE);
});
infoDialog=new SanInfoDialog(context);
infoDialog = new SanInfoDialog(context);
infoDialog.setCall(this);
adapter = new DeviceListAdapter(context);
binding.homeRcyler.setAdapter(adapter);
SmartRefreshLayout inventoryCreateRefresh = binding.inventoryCreateRefresh;
inventoryCreateRefresh.setEnableRefresh(true);
// 设置下拉刷新监听器
inventoryCreateRefresh.setOnRefreshListener(refreshLayout -> {
// 执行刷新操作,例如重新加载数据
initRequest();
// 刷新完成后调用此方法
refreshLayout.finishRefresh();
});
initRequest();
Log.e("TAG", "onCreateView:");
return root;
}
private void initRequest() {
OkGo.<MyResult>post(url + "/home/selectDeviceInfoList").execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
List<DeviceInfo> list = gson.fromJson(body.getDataJson(), new TypeToken<List<DeviceInfo>>() {
}.getType());
adapter.setList(list);
adapter.notifyDataSetChanged();
return;
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
@ -64,22 +99,21 @@ public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoD
// 查询设备
private void selectDeviceInfo(String code) {
OkGo.<MyResult>post(url + "/home/selectDeviceInfo").params("code", code)
.execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode()==0){
DeviceInfo deviceInfo= gson.fromJson(body.getDataJson(), DeviceInfo.class);
Log.e("TAG", "onSuccess:请求成功" );
infoDialog.setDeviceInfo(deviceInfo);
infoDialog.show();
return;
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
OkGo.<MyResult>post(url + "/home/selectDeviceInfo").params("code", code).execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
DeviceInfo deviceInfo = gson.fromJson(body.getDataJson(), DeviceInfo.class);
Log.e("TAG", "onSuccess:请求成功");
infoDialog.setDeviceInfo(deviceInfo);
infoDialog.show();
return;
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
}
});
}
@ -92,24 +126,22 @@ public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoD
@Override
public void openDeviceLockRequest(DeviceInfo deviceInfo) {
deviceInfo.setUserId(SharedPreferencesUtils.getLong("userId",0L));
deviceInfo.setDeptId(SharedPreferencesUtils.getLong("deptId",0L));
deviceInfo.setUseUser(SharedPreferencesUtils.getstring("user",null));
OkGo.<MyResult>post(url + "/home/openDeviceLock")
.upRequestBody(RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
gson.toJson(deviceInfo)))
.execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode()==0){
Toast.makeText(context, "开锁成功", Toast.LENGTH_SHORT).show();
infoDialog.dismiss();
return;
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_LONG).show();
}
});
deviceInfo.setUserId(SharedPreferencesUtils.getLong("userId", 0L));
deviceInfo.setDeptId(SharedPreferencesUtils.getLong("deptId", 0L));
deviceInfo.setUseUser(SharedPreferencesUtils.getstring("user", null));
OkGo.<MyResult>post(url + "/home/openDeviceLock").upRequestBody(RequestBody.create(MediaType.parse("application/json; charset=utf-8"), gson.toJson(deviceInfo))).execute(new MyRecultCall(dialog, context) {
@Override
public void onSuccess(Response<MyResult> response) {
super.onSuccess(response);
MyResult body = response.body();
if (body.getCode() == 0) {
Toast.makeText(context, "开锁成功", Toast.LENGTH_SHORT).show();
infoDialog.dismiss();
initRequest();
return;
}
Toast.makeText(context, body.getMsg(), Toast.LENGTH_LONG).show();
}
});
}
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp"/>
<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="#E3E3E3"/>
<corners android:radius="6dp"/>
</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="#D4E157"/>
<corners android:radius="6dp"/>
</shape>

@ -1,22 +1,21 @@
<?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=".ui.gallery.GalleryFragment">
xmlns:tools="http://schemas.android.com/tools">
<TextView
android:id="@+id/text_gallery"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_height="match_parent"
tools:context=".ui.gallery.GalleryFragment"
android:background="#F1F1F1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/record_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</LinearLayout>
</layout>

@ -1,16 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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:background="#e1e1e1"
android:orientation="vertical"
tools:context=".ui.home.HomeFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@color/blue">
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
style="@style/text_black_16_center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="设备编码"
android:textColor="@color/white" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
style="@style/text_black_16_center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="设备名称"
android:textColor="@color/white" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
style="@style/text_black_16_center"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="摆放桩位"
android:textColor="@color/white" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/white" />
<TextView
style="@style/text_black_16_center"
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="使用状态"
android:textColor="@color/white" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/white" />
</LinearLayout>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/inventory_create_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
app:srlEnableRefresh="false"
>
<com.scwang.smart.refresh.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/home_rcyler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="8dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@drawable/bg_top_radius"
@ -29,4 +113,4 @@
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="data"
type="com.example.beijingnopowercon.data.DeviceInfo" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="55dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{data.deviceCode}"
style="@style/text_black_16_center" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{data.deviceName}"
style="@style/text_black_16_center" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{data.locationName}"
style="@style/text_black_16_center" />
<TextView
android:layout_width="70dp"
android:layout_height="match_parent"
android:text="@{data.deviceStateName}"
style="@style/text_black_16_center" />
</LinearLayout>
</layout>

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="data"
type="com.example.beijingnopowercon.data.RecordUse" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:background="@drawable/bg_item"
android:orientation="vertical"
android:padding="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp">
<View
android:layout_width="4dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:background="@color/blue" />
<TextView
style="@style/text_black_16"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingStart="5dp"
android:text="@{data.deviceName}" />
<TextView
style="@style/text_black_16_center"
android:layout_width="100dp"
android:layout_height="match_parent"
android:background='@{data.useState.equals("0")?@drawable/item_state_0:@drawable/item_state_1}'
android:text="@{data.useStateName}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginTop="2dp">
<TextView
style="@style/text_black_16_center"
android:layout_width="120dp"
android:layout_height="match_parent"
android:text="开锁时间:" />
<TextView
style="@style/text_black_16"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="@{data.openTime}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginTop="2dp">
<TextView
style="@style/text_black_16_center"
android:layout_width="120dp"
android:layout_height="match_parent"
android:text="关锁时间:" />
<TextView
style="@style/text_black_16"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="@{data.closeTime}" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginTop="2dp">
<TextView
style="@style/text_black_16_center"
android:layout_width="120dp"
android:layout_height="match_parent"
android:text="使用时长:" />
<TextView
style="@style/text_black_16"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text='@{String.valueOf(data.useTime)+" 小时"}' />
</LinearLayout>
</LinearLayout>
</layout>

@ -12,9 +12,9 @@
android:id="@+id/nav_gallery"
android:icon="@drawable/ic_menu_record"
android:title="@string/menu_gallery" />
<item
android:id="@+id/nav_slideshow"
android:icon="@drawable/ic_menu_slideshow"
android:title="" />
<!-- <item-->
<!-- android:id="@+id/nav_slideshow"-->
<!-- android:icon="@drawable/ic_menu_slideshow"-->
<!-- android:title="" />-->
</group>
</menu>

@ -8,7 +8,7 @@
<string name="action_settings">Settings</string>
<string name="menu_home">Home</string>
<string name="menu_gallery">借用历史</string>
<string name="menu_gallery">借用记录</string>
<string name="menu_slideshow">Slideshow</string>
<string name="title_activity_login">LoginActivity</string>
<string name="prompt_email">Email</string>

@ -54,12 +54,25 @@
<item name="android:paddingStart">2dp</item>
<item name="android:layout_weight">1</item>
</style>
<style name="text_black_16">
<item name="android:textColor">@color/black</item>
<item name="android:textSize">16sp</item>
<item name="android:gravity">center|left</item>
<item name="android:paddingStart">2dp</item>
<item name="android:layout_weight">1</item>
</style>
<style name="text_black_14_2">
<item name="android:textColor">@color/black</item>
<item name="android:textSize">14sp</item>
<item name="android:gravity">center|left</item>
</style>
<style name="text_black_16_center">
<item name="android:textColor">@color/black</item>
<item name="android:textSize">16sp</item>
<item name="android:gravity">center</item>
</style>
<style name="dialog">
<!--背景颜色及和透明程度-->
<item name="android:windowBackground">@android:color/transparent</item>

@ -1,17 +1,17 @@
package com.example.beijingnopowercon;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
// package com.example.beijingnopowercon;
//
// import org.junit.Test;
//
// import static org.junit.Assert.*;
//
// /**
// * Example local unit test, which will execute on the development machine (host).
// *
// * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
// */
// public class ExampleUnitTest {
// @Test
// public void addition_isCorrect() {
// assertEquals(4, 2 + 2);
// }
// }

@ -19,3 +19,6 @@ android.useAndroidX=true
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.enableJetifier=true
Loading…
Cancel
Save