完成开锁
@ -0,0 +1,15 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="LOCAL" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="$PROJECT_DIR$/../../../android gradle version/gradle-8.0.2" />
|
||||
<option name="gradleJvm" value="#JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="Deprecation" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
@ -0,0 +1,8 @@
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="liberica-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
/build
|
@ -0,0 +1,53 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.beijingnopowercon'
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.beijingnopowercon"
|
||||
minSdk 28
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
dataBinding true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.8.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.5.3'
|
||||
implementation 'androidx.navigation:navigation-ui:2.5.3'
|
||||
implementation 'androidx.annotation:annotation:1.6.0'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
implementation 'com.lzy.net:okgo:3.0.4'
|
||||
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'
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,26 @@
|
||||
package com.example.beijingnopowercon;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.beijingnopowercon", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="true" /> <!-- 可选:自动对焦支持 -->
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
|
||||
<application
|
||||
android:name=".base.MyApplication"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/logo"
|
||||
android:supportsRtl="true"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:theme="@style/Theme.BeijingNoPowerCon"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/loginTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".CustomScannerActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/Theme.BeijingNoPowerCon.NoActionBar">
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,73 @@
|
||||
package com.example.beijingnopowercon;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.journeyapps.barcodescanner.CaptureManager;
|
||||
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
||||
|
||||
public class CustomScannerActivity extends AppCompatActivity {
|
||||
private CaptureManager captureManager;
|
||||
private DecoratedBarcodeView barcodeScannerView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_custom_scanner);
|
||||
barcodeScannerView = findViewById(R.id.barcode_scanner);
|
||||
|
||||
captureManager = new CaptureManager(this, barcodeScannerView);
|
||||
captureManager.initializeFromIntent(getIntent(), savedInstanceState);
|
||||
captureManager.decode();
|
||||
// 初始化视图
|
||||
ImageView scanLine = findViewById(R.id.scan_line);
|
||||
|
||||
// 设置扫描线动画
|
||||
TranslateAnimation animation = new TranslateAnimation(
|
||||
TranslateAnimation.ABSOLUTE, 0f,
|
||||
TranslateAnimation.ABSOLUTE, 0f,
|
||||
TranslateAnimation.ABSOLUTE, 0f,
|
||||
TranslateAnimation.ABSOLUTE, 800f);
|
||||
animation.setDuration(2000);
|
||||
animation.setRepeatCount(Animation.INFINITE);
|
||||
animation.setRepeatMode(Animation.RESTART);
|
||||
scanLine.startAnimation(animation);
|
||||
findViewById(R.id.back_button).setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
captureManager.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
captureManager.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
captureManager.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
captureManager.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
captureManager.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.example.beijingnopowercon;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.example.beijingnopowercon.base.MyApplication;
|
||||
import com.example.beijingnopowercon.data.LoginUser;
|
||||
import com.example.beijingnopowercon.data.LoginVm;
|
||||
import com.example.beijingnopowercon.databinding.ActivityLoginBinding;
|
||||
import com.example.beijingnopowercon.dialog.LoadDialog;
|
||||
import com.example.beijingnopowercon.okgo.MyRecultCall;
|
||||
import com.example.beijingnopowercon.okgo.MyResult;
|
||||
import com.example.beijingnopowercon.uitls.SharedPreferencesUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
public class LoginActivity extends AppCompatActivity {
|
||||
private LoginVm loginVm;
|
||||
private Context context;
|
||||
private LoadDialog dialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ActivityLoginBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_login);
|
||||
boolean isRemember = SharedPreferencesUtils.getboolean("isRemember", false);
|
||||
loginVm = new LoginVm();
|
||||
if (isRemember) {
|
||||
loginVm.setName(SharedPreferencesUtils.getstring("user", ""));
|
||||
loginVm.setPass(SharedPreferencesUtils.getstring("pass", ""));
|
||||
loginVm.setRemember(isRemember);
|
||||
}
|
||||
binding.setUser(loginVm);
|
||||
// EasyUpdate.checkUpdate(this, url + "/getVersion");
|
||||
context = this;
|
||||
dialog = new LoadDialog(this);
|
||||
}
|
||||
|
||||
public void loginSubmit(View view) {
|
||||
String pass = loginVm.getPass();
|
||||
String name = loginVm.getName();
|
||||
if (pass == null || name == null || pass.isEmpty() || name.isEmpty()) return;
|
||||
|
||||
OkGo.<MyResult>get(MyApplication.url + "/login/finduser").tag(this).params("name", name).params("pass", pass).execute(new MyRecultCall(dialog, this) {
|
||||
@Override
|
||||
public void onSuccess(Response<MyResult> response) {
|
||||
super.onSuccess(response);
|
||||
MyResult body = response.body();
|
||||
if (body.getCode() == 0) {
|
||||
LoginUser user = new Gson().fromJson(body.getDataJson(), LoginUser.class);
|
||||
SharedPreferencesUtils.putLong("userId",user.getUserId());
|
||||
SharedPreferencesUtils.putLong("deptId",user.getDeptId());
|
||||
boolean remember = loginVm.isRemember();
|
||||
if (remember) {
|
||||
SharedPreferencesUtils.putboolean("isRemember", remember);
|
||||
SharedPreferencesUtils.putstring("user", name);
|
||||
SharedPreferencesUtils.putstring("pass", pass);
|
||||
Intent intent = new Intent(context, MainActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
finish();
|
||||
}
|
||||
Toast.makeText(context, body.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.example.beijingnopowercon;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Menu;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
|
||||
import androidx.navigation.NavController;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.navigation.ui.AppBarConfiguration;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.beijingnopowercon.databinding.ActivityMainBinding;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private AppBarConfiguration mAppBarConfiguration;
|
||||
private ActivityMainBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
setSupportActionBar(binding.appBarMain.toolbar);
|
||||
|
||||
DrawerLayout drawer = binding.drawerLayout;
|
||||
NavigationView navigationView = binding.navView;
|
||||
// Passing each menu ID as a set of Ids because each
|
||||
// menu should be considered as top level destinations.
|
||||
mAppBarConfiguration = new AppBarConfiguration.Builder(
|
||||
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
|
||||
.setOpenableLayout(drawer)
|
||||
.build();
|
||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
||||
NavigationUI.setupWithNavController(navigationView, navController);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// // Inflate the menu; this adds items to the action bar if it is present.
|
||||
// getMenuInflater().inflate(R.menu.main, menu);
|
||||
// return true;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
|
||||
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|
||||
|| super.onSupportNavigateUp();
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.example.beijingnopowercon.base;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.example.beijingnopowercon.dialog.LoadDialog;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
public class BaseFragment extends Fragment {
|
||||
|
||||
public Context context;
|
||||
public LoadDialog dialog;
|
||||
public String url;
|
||||
public Gson gson;
|
||||
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
this.context=context;
|
||||
dialog=new LoadDialog(context);
|
||||
url=MyApplication.url;
|
||||
gson=new Gson();
|
||||
}
|
||||
}
|
@ -0,0 +1,203 @@
|
||||
package com.example.beijingnopowercon.data;
|
||||
|
||||
/**
|
||||
* 设备基础信息对象 device_base_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-19
|
||||
*/
|
||||
public class DeviceInfo {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long objId;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private Long deviceType;
|
||||
|
||||
/**
|
||||
* 使用状态
|
||||
*/
|
||||
private String useState;
|
||||
|
||||
/**
|
||||
* 设备状态
|
||||
*/
|
||||
private String deviceState;
|
||||
|
||||
/**
|
||||
* 摆放桩位
|
||||
*/
|
||||
private String locationName;
|
||||
|
||||
/**
|
||||
* 开锁密码
|
||||
*/
|
||||
private String openPassword;
|
||||
private String typeName;
|
||||
private Double defaultPrice;
|
||||
|
||||
/**
|
||||
* 默认使用时间
|
||||
*/
|
||||
private Double defaultTime;
|
||||
private String remark;
|
||||
|
||||
/** 用户ID */
|
||||
private Long userId;
|
||||
|
||||
/** 部门ID */
|
||||
private Long deptId;
|
||||
private String useUser;
|
||||
|
||||
public String getUseUser() {
|
||||
return useUser;
|
||||
}
|
||||
|
||||
public void setUseUser(String useUser) {
|
||||
this.useUser = useUser;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Double getDefaultPrice() {
|
||||
return defaultPrice;
|
||||
}
|
||||
|
||||
public void setDefaultPrice(Double defaultPrice) {
|
||||
this.defaultPrice = defaultPrice;
|
||||
}
|
||||
|
||||
public Double getDefaultTime() {
|
||||
return defaultTime;
|
||||
}
|
||||
|
||||
public void setDefaultTime(Double defaultTime) {
|
||||
this.defaultTime = defaultTime;
|
||||
}
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
|
||||
public Long getObjId() {
|
||||
return objId;
|
||||
}
|
||||
|
||||
public void setObjId(Long objId) {
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
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 Long getDeviceType() {
|
||||
return deviceType;
|
||||
}
|
||||
|
||||
public void setDeviceType(Long deviceType) {
|
||||
this.deviceType = deviceType;
|
||||
}
|
||||
|
||||
public String getUseState() {
|
||||
return useState;
|
||||
}
|
||||
|
||||
public void setUseState(String useState) {
|
||||
this.useState = useState;
|
||||
}
|
||||
|
||||
public String getDeviceState() {
|
||||
return deviceState;
|
||||
}
|
||||
|
||||
private String deviceStateName;
|
||||
|
||||
public String getDeviceStateName() {
|
||||
if (useState.equals("1")){
|
||||
return "使用中";
|
||||
}else if (deviceState.equals("0")){
|
||||
return "停用";
|
||||
}else if (deviceState.equals("1")){
|
||||
return "正常";
|
||||
}else if (deviceState.equals("2")){
|
||||
return "维修";
|
||||
}
|
||||
|
||||
return deviceStateName;
|
||||
}
|
||||
|
||||
public void setDeviceState(String deviceState) {
|
||||
this.deviceState = deviceState;
|
||||
}
|
||||
|
||||
public String getLocationName() {
|
||||
return locationName;
|
||||
}
|
||||
|
||||
public void setLocationName(String locationName) {
|
||||
this.locationName = locationName;
|
||||
}
|
||||
|
||||
public String getOpenPassword() {
|
||||
return openPassword;
|
||||
}
|
||||
|
||||
public void setOpenPassword(String openPassword) {
|
||||
this.openPassword = openPassword;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.example.beijingnopowercon.data;
|
||||
|
||||
public class LoginUser {
|
||||
private Long userId;
|
||||
|
||||
|
||||
private Long deptId;
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.example.beijingnopowercon.data;
|
||||
|
||||
import androidx.databinding.BaseObservable;
|
||||
|
||||
/**
|
||||
* @author wanghao
|
||||
* @date 2023/12/21 14:00
|
||||
*/
|
||||
public class LoginVm extends BaseObservable {
|
||||
private String name;
|
||||
private String pass;
|
||||
private boolean remember;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public String getPass() {
|
||||
return pass;
|
||||
}
|
||||
|
||||
public void setPass(String pass) {
|
||||
this.pass = pass;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
public boolean isRemember() {
|
||||
return remember;
|
||||
}
|
||||
|
||||
public void setRemember(boolean remember) {
|
||||
this.remember = remember;
|
||||
notifyChange();
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.beijingnopowercon.dialog;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.view.Window;
|
||||
|
||||
public class LoadDialog extends ProgressDialog {
|
||||
|
||||
|
||||
public LoadDialog(Context context) {
|
||||
super(context);
|
||||
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
this.setCanceledOnTouchOutside(false);
|
||||
this.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
this.setMessage("请求网络...");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.example.beijingnopowercon.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Window;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
|
||||
import com.example.beijingnopowercon.R;
|
||||
import com.example.beijingnopowercon.data.DeviceInfo;
|
||||
import com.example.beijingnopowercon.databinding.DialogDeviceInfoBinding;
|
||||
|
||||
public class SanInfoDialog extends Dialog {
|
||||
|
||||
private DeviceInfo deviceInfo;
|
||||
private SanInfoDialogCall call;
|
||||
|
||||
public void setCall(SanInfoDialogCall call) {
|
||||
this.call = call;
|
||||
}
|
||||
|
||||
public void setDeviceInfo(DeviceInfo deviceInfo) {
|
||||
this.deviceInfo = deviceInfo;
|
||||
}
|
||||
private DialogDeviceInfoBinding binding;
|
||||
public SanInfoDialog(@NonNull Context context) {
|
||||
super(context,R.style.dialog);
|
||||
binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_device_info, null, false);
|
||||
setContentView(binding.getRoot());
|
||||
binding.dialogClose.setOnClickListener(v -> dismiss());
|
||||
binding.dialogButtonOpen.setOnClickListener(v -> call.openDeviceLockRequest(deviceInfo));
|
||||
// 获取 Window 对象并设置属性
|
||||
Window window = this.getWindow();
|
||||
window.setGravity(Gravity.BOTTOM); // 设置在底部
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public interface SanInfoDialogCall{
|
||||
void openDeviceLockRequest(DeviceInfo deviceInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
Log.e("TAG", "show:" +123);
|
||||
binding.setData(deviceInfo);
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.example.beijingnopowercon.okgo;
|
||||
|
||||
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 abstract 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 void onSuccess(Response<MyResult> response) {
|
||||
dialog.dismiss();
|
||||
// Log.e("网络请求情况", "onSuccess:");
|
||||
}
|
||||
@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.setDataJson(gson.toJson(resust.getData()));
|
||||
return resust;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onError(Response<MyResult> response) {
|
||||
super.onError(response);
|
||||
dialog.dismiss();
|
||||
Log.e("网络请求情况", "onError:" );
|
||||
Toast.makeText(context, "网络连接错误", Toast.LENGTH_LONG).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,44 @@
|
||||
package com.example.beijingnopowercon.okgo;
|
||||
|
||||
/**
|
||||
* @author wanghao
|
||||
* @date 2023/12/21 15:31
|
||||
*/
|
||||
public class MyResult {
|
||||
private int code;
|
||||
private String msg;
|
||||
private Object data;
|
||||
private String dataJson;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public String getDataJson() {
|
||||
return dataJson;
|
||||
}
|
||||
|
||||
public void setDataJson(String dataJson) {
|
||||
this.dataJson = dataJson;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.example.beijingnopowercon.ui.gallery;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.example.beijingnopowercon.databinding.FragmentGalleryBinding;
|
||||
|
||||
public class GalleryFragment extends Fragment {
|
||||
|
||||
private FragmentGalleryBinding binding;
|
||||
|
||||
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();
|
||||
|
||||
final TextView textView = binding.textGallery;
|
||||
galleryViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.beijingnopowercon.ui.gallery;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class GalleryViewModel extends ViewModel {
|
||||
|
||||
private final MutableLiveData<String> mText;
|
||||
|
||||
public GalleryViewModel() {
|
||||
mText = new MutableLiveData<>();
|
||||
mText.setValue("This is gallery fragment");
|
||||
}
|
||||
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
}
|
@ -0,0 +1,115 @@
|
||||
package com.example.beijingnopowercon.ui.home;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.example.beijingnopowercon.CustomScannerActivity;
|
||||
import com.example.beijingnopowercon.base.BaseFragment;
|
||||
import com.example.beijingnopowercon.data.DeviceInfo;
|
||||
import com.example.beijingnopowercon.databinding.FragmentHomeBinding;
|
||||
import com.example.beijingnopowercon.dialog.SanInfoDialog;
|
||||
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.zxing.integration.android.IntentIntegrator;
|
||||
import com.google.zxing.integration.android.IntentResult;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
public class HomeFragment extends BaseFragment implements SanInfoDialog.SanInfoDialogCall{
|
||||
private View root;
|
||||
private FragmentHomeBinding binding;
|
||||
private SanInfoDialog infoDialog;
|
||||
|
||||
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);
|
||||
});
|
||||
infoDialog=new SanInfoDialog(context);
|
||||
infoDialog.setCall(this);
|
||||
Log.e("TAG", "onCreateView:");
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == IntentIntegrator.REQUEST_CODE) {
|
||||
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
|
||||
if (result != null) {
|
||||
if (result.getContents() == null) {
|
||||
Snackbar.make(root, "扫描取消", Snackbar.LENGTH_LONG).show();
|
||||
} else {
|
||||
// Toast.makeText(context, "扫描成功", Toast.LENGTH_SHORT).show();
|
||||
selectDeviceInfo(result.getContents());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 查询设备
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
|
||||
|
||||
@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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.beijingnopowercon.ui.home;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class HomeViewModel extends ViewModel {
|
||||
|
||||
private final MutableLiveData<String> mText;
|
||||
|
||||
public HomeViewModel() {
|
||||
mText = new MutableLiveData<>();
|
||||
mText.setValue("This is home fragment");
|
||||
}
|
||||
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.example.beijingnopowercon.ui.slideshow;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.example.beijingnopowercon.databinding.FragmentSlideshowBinding;
|
||||
|
||||
public class SlideshowFragment extends Fragment {
|
||||
|
||||
private FragmentSlideshowBinding binding;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
SlideshowViewModel slideshowViewModel =
|
||||
new ViewModelProvider(this).get(SlideshowViewModel.class);
|
||||
|
||||
binding = FragmentSlideshowBinding.inflate(inflater, container, false);
|
||||
View root = binding.getRoot();
|
||||
|
||||
final TextView textView = binding.textSlideshow;
|
||||
slideshowViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
binding = null;
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.example.beijingnopowercon.ui.slideshow;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
public class SlideshowViewModel extends ViewModel {
|
||||
|
||||
private final MutableLiveData<String> mText;
|
||||
|
||||
public SlideshowViewModel() {
|
||||
mText = new MutableLiveData<>();
|
||||
mText.setValue("This is slideshow fragment");
|
||||
}
|
||||
|
||||
public LiveData<String> getText() {
|
||||
return mText;
|
||||
}
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.example.beijingnopowercon.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 putLong(String key, Long value) {
|
||||
if (edit != null) {
|
||||
edit.putLong(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 long getLong(String key, long value) {
|
||||
if (sharedPreferences != null) {
|
||||
return sharedPreferences.getLong(key, value);
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
|
||||
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,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:fromYDelta="100%p"
|
||||
android:toYDelta="0" />
|
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:fromYDelta="0"
|
||||
android:toYDelta="100%p" />
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:topLeftRadius="18dp"
|
||||
android:topRightRadius="18dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M7,24h10v-2H7v2zM12,1L8,9h8L12,1zM13,13v8h-2v-8h2z" />
|
||||
</vector>
|
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
@ -0,0 +1,54 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:width="1024dp"
|
||||
android:height="1024dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024"
|
||||
tools:ignore="VectorRaster">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M864.128,565.187 C773.929,482.35,684.088,399.022,594.13,315.868
|
||||
C566.866,290.657,539.556,265.492,512.128,240.184
|
||||
C507.628,244.239,503.972,247.424,500.403,250.7
|
||||
C454.431,293.16,408.494,335.672,362.521,378.178
|
||||
C293.457,442.035,224.276,505.84,155.453,570.055
|
||||
C151.193,574.064,146.969,581.57,146.969,587.443
|
||||
C146.488,698.762,146.324,810.173,146.851,921.492
|
||||
C146.969,950.804,164.541,968.504,190.673,968.504
|
||||
C266.72,968.545,342.798,968.504,418.841,968.504
|
||||
C422.855,968.504,426.874,968.094,431.907,967.823 L431.907,696.535
|
||||
L592.957,696.535 L592.957,967.101
|
||||
C595.143,967.777,596.367,968.371,597.545,968.366
|
||||
C678.205,968.412,758.912,968.648,839.619,968.192
|
||||
C845.911,968.146,852.849,964.818,858.322,960.957
|
||||
C873.457,950.348,877.722,933.647,877.686,914.442
|
||||
C877.476,808.811,877.317,703.094,877.886,597.412
|
||||
C877.963,583.071,873.831,574.06,864.129,565.187 Z"
|
||||
tools:ignore="VectorPath" />
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M1008.38,493.23 C969.098,456.504,930.028,419.553,890.179,383.596
|
||||
C880.651,374.948,877.241,366.214,877.318,352.605
|
||||
C877.845,264.454,877.651,176.247,877.564,88.096
|
||||
C877.523,65.8394,871.031,58.4205,852.287,58.3744
|
||||
C815.93,58.2874,779.573,58.3283,743.221,58.3283
|
||||
C719.807,58.3744,714.206,64.6566,714.165,90.9581
|
||||
C714.124,132.148,714.165,173.385,714.165,218.031
|
||||
C709.624,214.068,707.35,212.204,705.195,210.197
|
||||
C659.796,167.691,614.346,125.225,569.023,82.581
|
||||
C530.679,46.4901,493.426,46.4901,455.164,82.3148
|
||||
C370.838,161.322,286.399,240.098,202.036,318.971
|
||||
C138.737,378.127,75.3971,437.207,12.2163,496.512
|
||||
C-2.5958,510.479,-3.0822,521.18,9.17504,537.743
|
||||
A4377.8048,4377.8048,0,0,0,40.9907,580.152
|
||||
C53.8931,597.089,63.4265,597.949,78.7661,583.567
|
||||
C191.969,477.624,305.183,371.63,418.386,265.676
|
||||
C449.429,236.594,480.553,207.605,511.918,178.293
|
||||
C517.56,183.48,522.511,187.898,527.339,192.404
|
||||
C666.844,322.974,806.307,453.591,945.771,584.115
|
||||
C960.337,597.77,970.398,596.767,982.568,580.705
|
||||
C992.475,567.736,1002.09,554.491,1011.9,541.476
|
||||
C1028.14,520.033,1027.64,511.258,1008.38,493.23 Z"
|
||||
tools:ignore="VectorPath" />
|
||||
|
||||
</vector>
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="1024dp"
|
||||
android:height="1024dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
|
||||
<path
|
||||
android:fillColor="#231815"
|
||||
android:pathData="M512,0 A512,512,0,1,0,1024,512 A511.721133,511.721133,0,0,0,512,0 Z
|
||||
M760.192,585.621 L499.73,585.621 A47.965142,47.965142,0,0,1,451.765,537.935
|
||||
L451.765,205.525 A47.965142,47.965142,0,1,1,547.416,205.525 L547.416,490.527
|
||||
L760.192,490.527 A47.965142,47.965142,0,0,1,760.192,586.178 Z" />
|
||||
</vector>
|
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
|
||||
</vector>
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="250dp"
|
||||
android:height="250dp"
|
||||
android:viewportWidth="250"
|
||||
android:viewportHeight="250">
|
||||
|
||||
<!-- 四个角落的线条 -->
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#00CC00"
|
||||
android:strokeWidth="4"
|
||||
android:pathData="M0,2 L25,2 M2,25 L2,2" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#00CC00"
|
||||
android:strokeWidth="4"
|
||||
|
||||
android:pathData="M250,2 L225,2 M248,2 L248,25" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#00CC00"
|
||||
android:strokeWidth="4"
|
||||
android:pathData="M0,248 L28,248 M2,248 L2,225" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#00CC00"
|
||||
android:strokeWidth="4"
|
||||
android:pathData="M250,248 L225,248 M248,248 L248,225" />
|
||||
</vector>
|
@ -0,0 +1,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#0000CC00"
|
||||
android:centerColor="#3C00CC00"
|
||||
android:startColor="#00CC00"
|
||||
android:type="linear" />
|
||||
</shape>
|
@ -0,0 +1,10 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
|
||||
|
||||
android:endColor="#42A5F5"
|
||||
android:startColor="@color/blue"
|
||||
|
||||
android:type="linear" />
|
||||
</shape>
|
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#000000">
|
||||
|
||||
|
||||
<!-- 扫描视图 -->
|
||||
<com.journeyapps.barcodescanner.DecoratedBarcodeView
|
||||
android:id="@+id/barcode_scanner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:zxing_framing_rect_height="250dp"
|
||||
app:zxing_framing_rect_width="250dp"
|
||||
app:zxing_scanner_layout="@layout/zxing_barcode_scanner"
|
||||
app:zxing_use_texture_view="false" />
|
||||
<!-- 顶部导航栏 -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/top_navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:background="#000000">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:src="@mipmap/ic_back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="扫码"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="250dp"
|
||||
android:layout_gravity="center">
|
||||
<!-- 扫描线动画 -->
|
||||
<ImageView
|
||||
android:id="@+id/scan_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:src="@drawable/scan_line" />
|
||||
|
||||
|
||||
<!-- 扫描框 -->
|
||||
<ImageView
|
||||
android:id="@+id/scan_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/scan_frame" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
@ -0,0 +1,107 @@
|
||||
<?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">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="user"
|
||||
type="com.example.beijingnopowercon.data.LoginVm" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".LoginActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="88dp"
|
||||
android:src="@mipmap/logo"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center"
|
||||
android:letterSpacing="0.2"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView2"
|
||||
tools:layout_editor_absoluteX="0dp" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInputLayout"
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:hint="用户名"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView2">
|
||||
|
||||
<EditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@={user.name}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInputLayout2"
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="密码"
|
||||
android:layout_marginTop="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInputLayout"
|
||||
app:passwordToggleEnabled="true">
|
||||
|
||||
<EditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="textPassword"
|
||||
android:text="@={user.pass}" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkBox"
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:checked="@={user.remember}"
|
||||
android:text="记住我"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInputLayout2" />
|
||||
|
||||
<Button
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="52dp"
|
||||
android:letterSpacing="1"
|
||||
android:onClick="loginSubmit"
|
||||
android:text="登录"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/checkBox" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:openDrawer="start">
|
||||
|
||||
<include
|
||||
android:id="@+id/app_bar_main"
|
||||
layout="@layout/app_bar_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.google.android.material.navigation.NavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/nav_header_main"
|
||||
app:menu="@menu/activity_main_drawer" />
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout 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">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/Theme.BeijingNoPowerCon.AppBarOverlay">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/Theme.BeijingNoPowerCon.PopupOverlay" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_main" />
|
||||
|
||||
<!-- <com.google.android.material.floatingactionbutton.FloatingActionButton-->
|
||||
<!-- android:id="@+id/fab"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="bottom|end"-->
|
||||
<!-- android:layout_marginEnd="@dimen/fab_margin"-->
|
||||
<!-- android:layout_marginBottom="16dp"-->
|
||||
<!-- app:srcCompat="@android:drawable/ic_dialog_email" />-->
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/app_bar_main">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_host_fragment_content_main"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navGraph="@navigation/mobile_navigation" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,131 @@
|
||||
<?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="match_parent"
|
||||
android:background="@drawable/bg_top_radius"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dialog_close"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:padding="12dp"
|
||||
android:src="@mipmap/ic_zhedie" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/text_blue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:text="设备编码:" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_black_14"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{data.deviceCode}" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:gravity="center|left"
|
||||
android:text="设备状态:"
|
||||
android:textColor="@color/blue" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_black_14"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{data.deviceStateName}"
|
||||
android:textColor='@{data.deviceStateName.equals("正常")?@color/green : @color/yelow}'/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/text_blue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:text="设备名称:" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_black_14"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="123" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/text_blue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="计费标准" />
|
||||
|
||||
<TextView
|
||||
style="@style/text_black_14_2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:text='@{ "每小时费用 "+data.defaultPrice+" 元,默认使用时间为" +data.defaultTime+" 小时。"}'/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
style="@style/text_blue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="注意事项" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/text_black_14"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{data.remark}" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="20dp"
|
||||
|
||||
android:src="@mipmap/ic_jinggao" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialog_button_open"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:letterSpacing="0.3"
|
||||
android:text="确认开锁"
|
||||
android:textSize="20dp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_gallery"
|
||||
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>
|
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
tools:context=".ui.home.HomeFragment">
|
||||
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:background="@drawable/bg_top_radius"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/home_san"
|
||||
style="@style/button_20"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_gravity="center"
|
||||
android:text="扫码开锁" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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.slideshow.SlideshowFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_slideshow"
|
||||
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>
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/nav_header_height"
|
||||
android:background="@drawable/side_nav_bar"
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/nav_header_desc"
|
||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||
app:srcCompat="@mipmap/logo" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||
android:text="@string/app_name"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="测试版本" />
|
||||
</LinearLayout>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:showIn="navigation_view">
|
||||
|
||||
<group android:checkableBehavior="single">
|
||||
<item
|
||||
android:id="@+id/nav_home"
|
||||
android:icon="@drawable/ic_menu_home"
|
||||
android:title="@string/menu_home" />
|
||||
<item
|
||||
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="" />
|
||||
</group>
|
||||
</menu>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/action_settings"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 779 B |
After Width: | Height: | Size: 120 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 982 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 7.6 KiB |
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<navigation 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:id="@+id/mobile_navigation"
|
||||
app:startDestination="@+id/nav_home">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_home"
|
||||
android:name="com.example.beijingnopowercon.ui.home.HomeFragment"
|
||||
android:label="@string/menu_home"
|
||||
tools:layout="@layout/fragment_home" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_gallery"
|
||||
android:name="com.example.beijingnopowercon.ui.gallery.GalleryFragment"
|
||||
android:label="@string/menu_gallery"
|
||||
tools:layout="@layout/fragment_gallery" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_slideshow"
|
||||
android:name="com.example.beijingnopowercon.ui.slideshow.SlideshowFragment"
|
||||
android:label="@string/menu_slideshow"
|
||||
tools:layout="@layout/fragment_slideshow" />
|
||||
</navigation>
|
@ -0,0 +1,4 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">48dp</dimen>
|
||||
<dimen name="activity_horizontal_margin">48dp</dimen>
|
||||
</resources>
|
@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.BeijingNoPowerCon" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
@ -0,0 +1,4 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">200dp</dimen>
|
||||
<dimen name="activity_horizontal_margin">200dp</dimen>
|
||||
</resources>
|
@ -0,0 +1,4 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">48dp</dimen>
|
||||
<dimen name="activity_horizontal_margin">48dp</dimen>
|
||||
</resources>
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="green">#26A69A</color>
|
||||
<color name="yelow">#FFA726</color>
|
||||
<color name="blue">#387BE7</color>
|
||||
<color name="blue_700">#1976D2</color>
|
||||
</resources>
|
@ -0,0 +1,8 @@
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="nav_header_vertical_spacing">8dp</dimen>
|
||||
<dimen name="nav_header_height">176dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
</resources>
|
@ -0,0 +1,22 @@
|
||||
<resources>
|
||||
<string name="app_name">无动力设备管理</string>
|
||||
<string name="navigation_drawer_open">Open navigation drawer</string>
|
||||
<string name="navigation_drawer_close">Close navigation drawer</string>
|
||||
<string name="nav_header_title">Android Studio</string>
|
||||
|
||||
<string name="nav_header_desc">Navigation header</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
|
||||
<string name="menu_home">Home</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>
|
||||
<string name="prompt_password">Password</string>
|
||||
<string name="action_sign_in">Sign in or register</string>
|
||||
<string name="action_sign_in_short">Sign in</string>
|
||||
<string name="welcome">"Welcome !"</string>
|
||||
<string name="invalid_username">Not a valid username</string>
|
||||
<string name="invalid_password">Password must be >5 characters</string>
|
||||
<string name="login_failed">"Login failed"</string>
|
||||
</resources>
|
@ -0,0 +1,84 @@
|
||||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.BeijingNoPowerCon" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<!-- <item name="colorPrimary">@color/purple_500</item>-->
|
||||
<!-- <item name="colorPrimaryVariant">@color/purple_700</item>-->
|
||||
<item name="colorPrimary">@color/blue</item>
|
||||
<item name="colorPrimaryVariant">@color/blue_700</item>
|
||||
|
||||
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.BeijingNoPowerCon.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.BeijingNoPowerCon.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<style name="Theme.BeijingNoPowerCon.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
|
||||
<style name="button_20">
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:layout_marginStart">20dp</item>
|
||||
<item name="android:layout_marginEnd">20dp</item>
|
||||
</style>
|
||||
|
||||
<style name="loginTheme" parent="Theme.Material3.Light.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<item name="colorPrimary">@color/blue</item>
|
||||
<item name="colorPrimaryVariant">@color/white</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="text_blue">
|
||||
<item name="android:textColor">@color/blue</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
</style>
|
||||
|
||||
<style name="text_black_14">
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textSize">14sp</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="dialog">
|
||||
<!--背景颜色及和透明程度-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<!--是否去除标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!--是否去除边框-->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
|
||||
<!--是否浮现在activity之上-->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!--是否模糊-->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowMinWidthMinor">100%</item><!--宽度铺满全屏-->
|
||||
|
||||
<item name="android:windowAnimationStyle"> @style/dialogAnimation</item>
|
||||
</style>
|
||||
|
||||
<style name="dialogAnimation">
|
||||
<item name="android:windowEnterAnimation">@anim/dialog_in</item>
|
||||
<item name="android:windowExitAnimation">@anim/dialog_out</item>
|
||||
</style>
|
||||
</resources>
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older that API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
@ -0,0 +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);
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.1.2' apply false
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# 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
|
@ -0,0 +1,6 @@
|
||||
#Fri May 09 16:07:40 CST 2025
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
@ -0,0 +1,89 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
@ -0,0 +1,37 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
|
||||
|
||||
|
||||
maven{url"https://jitpack.io"}
|
||||
maven{url'https://maven.aliyun.com/repository/releases'}
|
||||
maven{url'https://maven.aliyun.com/repository/jcenter'}
|
||||
maven{url'https://maven.aliyun.com/repository/google'}
|
||||
maven{url'https://maven.aliyun.com/repository/central'}
|
||||
maven{url'https://maven.aliyun.com/repository/gradle-plugin'}
|
||||
maven{url'https://maven.aliyun.com/repository/public'}
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
|
||||
|
||||
|
||||
maven{url"https://jitpack.io"}
|
||||
maven{url'https://maven.aliyun.com/repository/releases'}
|
||||
maven{url'https://maven.aliyun.com/repository/jcenter'}
|
||||
maven{url'https://maven.aliyun.com/repository/google'}
|
||||
maven{url'https://maven.aliyun.com/repository/central'}
|
||||
maven{url'https://maven.aliyun.com/repository/gradle-plugin'}
|
||||
maven{url'https://maven.aliyun.com/repository/public'}
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "BeijingNoPowerCon"
|
||||
include ':app'
|