parent
ef3f79aca4
commit
2b0849fac2
@ -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 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
@ -0,0 +1 @@
|
||||
code
|
||||
@ -0,0 +1,116 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
@ -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,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="app">
|
||||
<State />
|
||||
</entry>
|
||||
</value>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveExternalAnnotations" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,8 @@
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1 @@
|
||||
/build
|
||||
@ -0,0 +1,49 @@
|
||||
plugins {
|
||||
alias(libs.plugins.androidApplication)
|
||||
}
|
||||
android {
|
||||
namespace 'com.example.vote'
|
||||
compileSdk 30
|
||||
// buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.vote"
|
||||
minSdk 16
|
||||
targetSdk 30
|
||||
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_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.2.2'
|
||||
implementation 'androidx.navigation:navigation-ui:2.2.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation files('libs/gson-2.8.0.jar')
|
||||
implementation 'com.google.android.gms:play-services-plus:16.0.0'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
implementation 'commons-httpclient:commons-httpclient:3.1'
|
||||
implementation 'com.alibaba:fastjson:1.1.54.android'
|
||||
}
|
||||
Binary file not shown.
@ -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,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!-- To access Google+ APIs: -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:name="com.example.code.App"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Vote">
|
||||
<activity
|
||||
android:name="com.example.code.LoginActivity"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="com.example.code.MainActivity" />
|
||||
<activity android:name="com.example.code.RegisterActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -0,0 +1,35 @@
|
||||
package com.example.code;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import com.example.code.bien.User;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class App extends Application {
|
||||
|
||||
// public static String URL = "http://192.168.1.4:8026/"; //这个是要修改ip
|
||||
// public static String URL = "http://10.11.181.239:8026/"; //这个是要修改ip
|
||||
public static String URL = "http://10.8.39.108:8026/";
|
||||
public static String HOST = URL + "myproject/app";
|
||||
public static boolean isLogin = false;
|
||||
public static SharedPreferences sp;
|
||||
public static Gson gson;
|
||||
public static SharedPreferences.Editor sp_edit;
|
||||
public static List<User> userList;
|
||||
public static User user;
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
gson = new Gson();
|
||||
sp = getSharedPreferences("sd", MODE_PRIVATE);
|
||||
sp_edit = sp.edit();
|
||||
sp_edit.putInt("voitId", 0).commit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,148 @@
|
||||
package com.example.code;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.example.code.bien.User;
|
||||
import com.example.code.http.HttpUtlis;
|
||||
import com.example.code.http.OnResponseListner;
|
||||
import com.example.vote.R;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 登陆界面
|
||||
*/
|
||||
public class LoginActivity extends Activity implements View.OnClickListener {
|
||||
|
||||
private EditText username; //用户名输入框
|
||||
private EditText password; //密码输入框
|
||||
private Button login; //登陆按钮
|
||||
private Button register; //注册按钮
|
||||
|
||||
//页面创建
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
initView();
|
||||
|
||||
}
|
||||
|
||||
//页面内容初始化方法
|
||||
private void initView() {
|
||||
username = (EditText) findViewById(R.id.username);
|
||||
password = (EditText) findViewById(R.id.password);
|
||||
login = (Button) findViewById(R.id.login);
|
||||
register = (Button) findViewById(R.id.register);
|
||||
|
||||
login.setOnClickListener(this);
|
||||
register.setOnClickListener(this);
|
||||
}
|
||||
|
||||
//按钮点击事件绑定
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.login){
|
||||
submit();
|
||||
}
|
||||
if (v.getId() == R.id.register){
|
||||
startActivity(new Intent(getApplicationContext(), RegisterActivity.class));
|
||||
}
|
||||
// switch (v.getId()) {
|
||||
// case R.id.login:
|
||||
//
|
||||
// break;
|
||||
// case R.id.register:
|
||||
// //跳转注册页面
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
//登陆请求提交
|
||||
private void submit() {
|
||||
// validate
|
||||
String usernameString = username.getText().toString().trim();
|
||||
//判断用户名是否为空 为空则进行提示 并终止操作
|
||||
if (TextUtils.isEmpty(usernameString)) {
|
||||
Toast.makeText(this, "用户名错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
//判断密码是否为空
|
||||
String passwordString = password.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(passwordString)) {
|
||||
Toast.makeText(this, "密码错误", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
//使用多线程执行提交操作
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//在这填上您原来的代码即可
|
||||
loginSubmit();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
thread.start();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void loginSubmit() {
|
||||
//登陆请求地址
|
||||
String url = App.HOST + "/loginSubmit";
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("username", username.getText().toString());
|
||||
map.put("password", password.getText().toString());
|
||||
//执行http远程登陆请求
|
||||
HttpUtlis.postRequest(url, map, new OnResponseListner() {
|
||||
//http请求成功执行
|
||||
@Override
|
||||
public void onSucess(String response) {
|
||||
//执行登陆请求成功 解析返回json内容
|
||||
System.out.println("response = " + response);
|
||||
JSONObject object = JSON.parseObject(response);
|
||||
Integer status = object.getInteger("status");
|
||||
String msg = object.getString("msg");
|
||||
String data = object.getString("data");
|
||||
if (status == 200) {
|
||||
/*Looper.prepare();
|
||||
Toast.makeText(getApplicationContext(), "登录成功", Toast.LENGTH_SHORT).show();
|
||||
Looper.loop();*/
|
||||
System.out.println("登录成功");
|
||||
//更新界面
|
||||
User user = JSON.parseObject(data, User.class);
|
||||
App.user = user;
|
||||
startActivity(new Intent(getApplicationContext(), MainActivity.class));
|
||||
finish();
|
||||
} else {
|
||||
Looper.prepare();
|
||||
Toast.makeText(getApplicationContext(), "登录失败", Toast.LENGTH_SHORT).show();
|
||||
Looper.loop();
|
||||
System.out.println("登录失败");
|
||||
}
|
||||
}
|
||||
|
||||
//http请求出错执行方法
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
System.out.println("error = " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.example.code;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import com.example.vote.R;
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.navigation.NavController;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.navigation.ui.AppBarConfiguration;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
@SuppressLint("WrongConstant")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
BottomNavigationView navView = findViewById(R.id.nav_view);
|
||||
// Passing each menu ID as a set of Ids because each
|
||||
// menu should be considered as top level destinations.
|
||||
navView.setLabelVisibilityMode(BottomNavigationView.LAYOUT_MODE_OPTICAL_BOUNDS);
|
||||
AppBarConfiguration appBarConfiguration = new AppBarConfiguration.Builder(
|
||||
R.id.navigation_home, R.id.navigation_sc, R.id.navigation_wd)
|
||||
.build();
|
||||
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
||||
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
|
||||
NavigationUI.setupWithNavController(navView, navController);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,162 @@
|
||||
package com.example.code;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.example.code.http.HttpUtlis;
|
||||
import com.example.code.http.OnResponseListner;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.example.vote.R;
|
||||
/**
|
||||
* 注册界面
|
||||
*/
|
||||
public class RegisterActivity extends Activity implements View.OnClickListener {
|
||||
|
||||
private EditText username; //注册用户名框
|
||||
private EditText password;//注册密码框
|
||||
private EditText tlep; //注册电话框
|
||||
private EditText intro; //简介
|
||||
private EditText idcard; //身份证
|
||||
private Button login;//登陆按钮
|
||||
private Button register;//注册按钮
|
||||
|
||||
|
||||
//执行注册提交方法
|
||||
public void registerSubmit() {
|
||||
//注册请求地址
|
||||
String url = App.HOST + "/registerSubmit";
|
||||
//使用map集合传递参数
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("username", username.getText().toString());
|
||||
map.put("password", password.getText().toString());
|
||||
map.put("tlep", tlep.getText().toString());
|
||||
map.put("intro", intro.getText().toString());
|
||||
map.put("idcard", idcard.getText().toString());
|
||||
//执行http注册请求
|
||||
HttpUtlis.postRequest(url, map, new OnResponseListner() {
|
||||
//http请求成功
|
||||
@Override
|
||||
public void onSucess(String response) {
|
||||
System.out.println("response = " + response);
|
||||
//解析返回的json内容
|
||||
JSONObject object = JSON.parseObject(response);
|
||||
Integer status = object.getInteger("status");
|
||||
String msg = object.getString("msg");
|
||||
//状态为200代表注册成功
|
||||
if (status == 200) {
|
||||
Looper.prepare();
|
||||
Toast.makeText(getApplicationContext(), "注册成功", Toast.LENGTH_SHORT).show();
|
||||
Looper.loop();
|
||||
System.out.println("注册成功");
|
||||
//更新界面
|
||||
finish();
|
||||
|
||||
} else {
|
||||
Looper.prepare();
|
||||
Toast.makeText(getApplicationContext(), "注册失败", Toast.LENGTH_SHORT).show();
|
||||
Looper.loop();
|
||||
System.out.println("注册失败");
|
||||
}
|
||||
}
|
||||
|
||||
//http请求失败
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
System.out.println("error = " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//界面创建
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_register);
|
||||
initView();
|
||||
|
||||
|
||||
}
|
||||
|
||||
//界面初始化
|
||||
private void initView() {
|
||||
username = (EditText) findViewById(R.id.username);
|
||||
password = (EditText) findViewById(R.id.password);
|
||||
tlep = (EditText) findViewById(R.id.tlep);
|
||||
intro = (EditText) findViewById(R.id.intro);
|
||||
idcard = (EditText) findViewById(R.id.idcard);
|
||||
login = (Button) findViewById(R.id.login);
|
||||
register = (Button) findViewById(R.id.register);
|
||||
|
||||
login.setOnClickListener(this);
|
||||
register.setOnClickListener(this);
|
||||
}
|
||||
|
||||
//按钮点击事件绑定
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if (v.getId() == R.id.login){
|
||||
submit();
|
||||
}
|
||||
if (v.getId() == R.id.register){
|
||||
finish();
|
||||
}
|
||||
|
||||
// switch (v.getId()) {
|
||||
// case R.id.login:
|
||||
// submit();
|
||||
// break;
|
||||
// case R.id.register:
|
||||
// finish();
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
//点击注册按钮提交执行方法
|
||||
private void submit() {
|
||||
// validate
|
||||
String usernameString = username.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(usernameString)) {
|
||||
Toast.makeText(this, "用户名", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
String passwordString = password.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(passwordString)) {
|
||||
Toast.makeText(this, "密码", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
String tlepString = tlep.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(tlepString)) {
|
||||
Toast.makeText(this, "手机号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//使用多线程进行http请求 防止界面卡死
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//调用注册提交http请求
|
||||
registerSubmit();
|
||||
}
|
||||
});
|
||||
thread.start();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
package com.example.code.bien;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class User implements Serializable {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String picurl;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
private String role;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String intro;
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private Integer money;
|
||||
|
||||
public Integer getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setMoney(Integer money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getPicurl() {
|
||||
return picurl;
|
||||
}
|
||||
|
||||
public void setPicurl(String picurl) {
|
||||
this.picurl = picurl;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getIntro() {
|
||||
return intro;
|
||||
}
|
||||
|
||||
public void setIntro(String intro) {
|
||||
this.intro = intro;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package com.example.code.http;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Map;
|
||||
|
||||
public class HttpUtlis {
|
||||
/**
|
||||
*get请求封装
|
||||
*/
|
||||
public static void getRequest(String url, Map<String,String> params, OnResponseListner listner) {
|
||||
String encode = "utf-8";
|
||||
System.out.println( "请求地址 url = " + url);
|
||||
System.out.println(" 发送参数 params = " + params);
|
||||
StringBuffer sb = new StringBuffer(url);
|
||||
sb.append("?");
|
||||
if (params!=null && !params.isEmpty()){
|
||||
for (Map.Entry<String,String> entry:params.entrySet()) { //增强for遍历循环添加拼接请求内容
|
||||
sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
|
||||
}
|
||||
sb.deleteCharAt(sb.length()-1);
|
||||
if (listner!=null) {
|
||||
try {
|
||||
System.out.println(" 请求地址 = " + sb.toString());
|
||||
URL path = new URL(sb.toString());
|
||||
if (path!=null) {
|
||||
HttpURLConnection con = (HttpURLConnection) path.openConnection();
|
||||
con.setRequestMethod("GET"); //设置请求方式
|
||||
con.setConnectTimeout(3000); //链接超时3秒
|
||||
con.setDoOutput(true);
|
||||
con.setDoInput(true);
|
||||
OutputStream os = con.getOutputStream();
|
||||
os.write(sb.toString().getBytes(encode));
|
||||
os.close();
|
||||
if (con.getResponseCode() == 200) { //应答码200表示请求成功
|
||||
onSucessResopond(encode, listner, con);
|
||||
}
|
||||
}
|
||||
} catch (Exception error) {
|
||||
error.printStackTrace();
|
||||
onError(listner, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* POST请求
|
||||
*/
|
||||
public static void postRequest(String url,Map<String,String> params,OnResponseListner listner){
|
||||
System.out.println( "请求地址 url = " + url);
|
||||
System.out.println(" 发送参数 params = " + params);
|
||||
String encode = "utf-8";
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if (params!=null && !params.isEmpty()){
|
||||
for (Map.Entry<String,String> entry: params.entrySet()) {
|
||||
sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
|
||||
}
|
||||
sb.deleteCharAt(sb.length()-1);
|
||||
}
|
||||
if (listner!=null) {
|
||||
try {
|
||||
URL path = new URL(url);
|
||||
if (path!=null){
|
||||
HttpURLConnection con = (HttpURLConnection) path.openConnection();
|
||||
con.setRequestMethod("POST"); //设置请求方法POST
|
||||
con.setConnectTimeout(3000);
|
||||
con.setDoOutput(true);
|
||||
con.setDoInput(true);
|
||||
byte[] bytes = sb.toString().getBytes();
|
||||
OutputStream outputStream = con.getOutputStream();
|
||||
outputStream.write(bytes);
|
||||
outputStream.close();
|
||||
if (con.getResponseCode()==200){
|
||||
onSucessResopond(encode, listner, con);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
onError(listner, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void onError(OnResponseListner listner,Exception onError) {
|
||||
listner.onError(onError.toString());
|
||||
}
|
||||
|
||||
private static void onSucessResopond(String encode, OnResponseListner listner, HttpURLConnection con) throws IOException {
|
||||
InputStream inputStream = con.getInputStream();
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();//创建内存输出流
|
||||
int len = 0;
|
||||
byte[] bytes = new byte[1024];
|
||||
if (inputStream != null) {
|
||||
while ((len = inputStream.read(bytes)) != -1) {
|
||||
baos.write(bytes, 0, len);
|
||||
}
|
||||
String str = new String(baos.toByteArray(), encode);
|
||||
listner.onSucess(str);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.example.code.http;
|
||||
|
||||
public interface OnResponseListner {
|
||||
void onSucess(String response);
|
||||
void onError(String error);
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.example.code.ui.out;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.code.App;
|
||||
import com.example.code.LoginActivity;
|
||||
|
||||
import com.example.code.ui.wd.WdFragment;
|
||||
import com.example.vote.R;
|
||||
|
||||
|
||||
public class OutFragment extends Fragment {
|
||||
private View inflate;
|
||||
private ViewHolder viewHolder;
|
||||
|
||||
public static OutFragment newInstance() {
|
||||
return new OutFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
|
||||
inflate = inflater.inflate(R.layout.out_fragment, container, false);
|
||||
viewHolder = new ViewHolder(inflate);
|
||||
|
||||
//viewHolder.user.setText("用户名:");
|
||||
viewHolder.exit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
App.isLogin = false;
|
||||
App.user = null;
|
||||
startActivity(new Intent(getContext(), LoginActivity.class));
|
||||
getActivity().finish();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return inflate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
// TODO: Use the ViewModel
|
||||
}
|
||||
|
||||
class ViewHolder {
|
||||
public View rootView;
|
||||
public TextView user;
|
||||
public Button exit;
|
||||
|
||||
public ViewHolder(View rootView) {
|
||||
this.rootView = rootView;
|
||||
this.user = (TextView) rootView.findViewById(R.id.user);
|
||||
this.exit = (Button) rootView.findViewById(R.id.exit);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -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,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<stroke
|
||||
android:color="#ccc"
|
||||
android:width="1dp" />
|
||||
|
||||
<solid android:color="#fff" />
|
||||
<corners android:radius="15dp" />
|
||||
|
||||
</shape>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#2196F3"
|
||||
android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M15.41,16.59L10.83,12l4.58,-4.59L14,6l-6,6 6,6 1.41,-1.41z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM15.5,11c0.83,0 1.5,-0.67 1.5,-1.5S16.33,8 15.5,8 14,8.67 14,9.5s0.67,1.5 1.5,1.5zM8.5,11c0.83,0 1.5,-0.67 1.5,-1.5S9.33,8 8.5,8 7,8.67 7,9.5 7.67,11 8.5,11zM12,17.5c2.33,0 4.31,-1.46 5.11,-3.5L6.89,14c0.8,2.04 2.78,3.5 5.11,3.5z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM15.5,11c0.83,0 1.5,-0.67 1.5,-1.5S16.33,8 15.5,8 14,8.67 14,9.5s0.67,1.5 1.5,1.5zM8.5,11c0.83,0 1.5,-0.67 1.5,-1.5S9.33,8 8.5,8 7,8.67 7,9.5 7.67,11 8.5,11zM12,14c-2.33,0 -4.31,1.46 -5.11,3.5h10.22c-0.8,-2.04 -2.78,-3.5 -5.11,-3.5z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
|
||||
</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="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="#2196F3"
|
||||
android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
|
||||
</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="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
|
||||
</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,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="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
|
||||
</vector>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#EEEEEE" />
|
||||
<stroke android:width="3dp" android:color="#EEEEEE" />
|
||||
<corners android:radius="0dp" />
|
||||
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
|
||||
</shape>
|
||||
@ -0,0 +1,90 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/login"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:text="用户登录"
|
||||
android:textColor="#fff"
|
||||
android:gravity="center"
|
||||
android:textSize="18dp"
|
||||
android:background="#90673AB7"
|
||||
|
||||
android:layout_height="50dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingRight="30dp"
|
||||
tools:context=".act.LoginActivity"
|
||||
>
|
||||
<EditText
|
||||
android:text="test"
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:hint="用户名"
|
||||
android:gravity="center"
|
||||
android:maxLength="16"
|
||||
android:inputType="text"
|
||||
android:background="#77dddddd"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:text="123456"
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="20dp"
|
||||
android:hint="密码"
|
||||
android:background="#77dddddd"
|
||||
android:inputType="textPassword"
|
||||
android:maxLength="16"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="登录"
|
||||
android:textSize="16dp"
|
||||
android:id="@+id/login"
|
||||
android:textColor="#fff"
|
||||
android:background="#2196F3"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:textSize="16dp"
|
||||
android:textColor="#fff"
|
||||
android:id="@+id/register"
|
||||
android:text="注册"
|
||||
android:background="#2196F3"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,33 @@
|
||||
<?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"
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#fff">
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/nav_view"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="0dp"
|
||||
android:layout_marginEnd="0dp"
|
||||
android:background="?android:attr/windowBackground"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:menu="@menu/bottom_nav_menu" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_host_fragment"
|
||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/nav_view"
|
||||
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,201 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/login"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:text="用户注册"
|
||||
android:textColor="#fff"
|
||||
android:gravity="center"
|
||||
android:textSize="18dp"
|
||||
android:background="#673AB7"
|
||||
|
||||
android:layout_height="50dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="30dp"
|
||||
android:paddingRight="30dp"
|
||||
tools:context=".act.LoginActivity"
|
||||
>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="编 号:"
|
||||
android:textColor="#000"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:hint="编号"
|
||||
android:gravity="center"
|
||||
android:maxLength="16"
|
||||
android:inputType="text"
|
||||
android:background="#77dddddd"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<TextView
|
||||
android:text="密 码:"
|
||||
android:gravity="center"
|
||||
android:textColor="#000"
|
||||
android:textSize="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:hint="密码"
|
||||
android:gravity="center"
|
||||
android:maxLength="16"
|
||||
android:inputType="textPassword"
|
||||
android:background="#77dddddd"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<TextView
|
||||
android:text="手机号:"
|
||||
android:gravity="center"
|
||||
android:textColor="#000"
|
||||
android:textSize="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/tlep"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:hint="手机号"
|
||||
android:gravity="center"
|
||||
android:maxLength="11"
|
||||
android:inputType="number"
|
||||
android:background="#77dddddd"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<TextView
|
||||
android:text="姓 名:"
|
||||
android:gravity="center"
|
||||
android:textColor="#000"
|
||||
android:textSize="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/idcard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:hint="姓名"
|
||||
android:gravity="center"
|
||||
android:maxLength="18"
|
||||
android:inputType="text"
|
||||
android:background="#77dddddd"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<TextView
|
||||
android:text="邮 箱:"
|
||||
android:gravity="center"
|
||||
android:textColor="#000"
|
||||
android:textSize="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/intro"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:hint="邮箱"
|
||||
android:gravity="center"
|
||||
android:maxLength="100"
|
||||
android:inputType="text"
|
||||
android:background="#77dddddd"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="确定"
|
||||
android:textSize="16dp"
|
||||
android:id="@+id/login"
|
||||
android:textColor="#fff"
|
||||
android:background="#2196F3"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:textSize="16dp"
|
||||
android:textColor="#fff"
|
||||
android:id="@+id/register"
|
||||
android:text="取消"
|
||||
android:background="#2196F3"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressbar"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="3dip"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:visibility="gone"/>
|
||||
</FrameLayout>
|
||||
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<ImageView
|
||||
android:layout_width="70dp"
|
||||
android:id="@+id/ItemImage"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:padding="0dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/ItemImage"
|
||||
android:textSize="14dp"
|
||||
android:id="@+id/ItemText"
|
||||
android:layout_margin="0dp"
|
||||
android:padding="6dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
|
||||
/>
|
||||
</RelativeLayout>
|
||||
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/bg_20dp_r"
|
||||
android:layout_margin="10dp"
|
||||
android:padding="5dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:text="sdfasdfadadsfa"
|
||||
android:textColor="#000"
|
||||
android:textSize="20dp"
|
||||
android:id="@+id/tv1"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="middle"
|
||||
android:paddingLeft="10dp"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center|left"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:background="#ddd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
|
||||
|
||||
<RadioButton
|
||||
android:text="我是说对方"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/rb1"
|
||||
android:enabled="false"
|
||||
android:textSize="18dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:textColor="#111"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<RadioButton
|
||||
android:text="我是说对方"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="18dp"
|
||||
android:enabled="false"
|
||||
android:id="@+id/rb2"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:textColor="#111"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
<View
|
||||
android:background="#ddd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:text="已投票,查看结果"
|
||||
android:textColor="#00B0FF"
|
||||
android:textSize="16dp"
|
||||
android:id="@+id/tv3"
|
||||
android:layout_width="wrap_content"
|
||||
android:focusable="false"
|
||||
android:gravity="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_height="30dp" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:background="#fff"
|
||||
android:layout_height="50dp">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img"
|
||||
android:layout_width="30dp"
|
||||
android:background="@mipmap/aaa"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="30dp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et"
|
||||
android:layout_width="match_parent"
|
||||
android:paddingLeft="10dp"
|
||||
android:lines="1"
|
||||
android:singleLine="true"
|
||||
android:hint="选择2"
|
||||
android:textSize="18dp"
|
||||
android:layout_height="50dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/tvshow"
|
||||
android:layout_width="match_parent"
|
||||
android:text="当前播放节目"
|
||||
android:textColor="#fff"
|
||||
android:textSize="18dp"
|
||||
android:gravity="center"
|
||||
android:background="#673AB7"
|
||||
android:layout_height="30dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/prev"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="#2196F3"
|
||||
android:text="上一节目"
|
||||
android:textColor="#fff"
|
||||
android:padding="15dp"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/next"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#2196F3"
|
||||
android:text="下一节目"
|
||||
android:textColor="#fff"
|
||||
android:padding="15dp"
|
||||
android:textSize="20dp" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal">
|
||||
<Button
|
||||
android:id="@+id/add"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="#2196F3"
|
||||
android:text="音量+"
|
||||
android:textColor="#fff"
|
||||
android:padding="15dp"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/jian"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="40dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#2196F3"
|
||||
android:text="音量-"
|
||||
android:textColor="#fff"
|
||||
android:padding="15dp"
|
||||
android:textSize="20dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<GridView
|
||||
android:id="@+id/GridView"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_margin="0dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:numColumns="4"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:stretchMode="columnWidth"></GridView>
|
||||
|
||||
</LinearLayout>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue