@ -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="11" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,20 @@
|
|||||||
|
<?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="DEFAULT_WRAPPED" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DesignSurface">
|
||||||
|
<option name="filePathToZoomLevelMap">
|
||||||
|
<map>
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/drawable/ic_baseline_add_circle_outline_24.xml" value="0.1205" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/drawable/ic_launcher_background.xml" value="0.1205" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_course.xml" value="0.136" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_course_create.xml" value="0.176" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_login.xml" value="0.264" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_main.xml" value="0.22327898550724637" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_modifyactivity.xml" value="0.264" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_participate_in.xml" value="0.176" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_quit_course.xml" value="0.22327898550724637" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_register.xml" value="0.22327898550724637" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_sign_create.xml" value="0.176" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/activity_sign_in.xml" value="0.109375" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/course_info.xml" value="0.22327898550724637" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/course_item.xml" value="0.22327898550724637" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/dialog.xml" value="0.109375" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/fragment_personal_infomation.xml" value="0.22327898550724637" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/layout/sign_item.xml" value="0.22327898550724637" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/menu/pop_menus_action.xml" value="0.24947916666666667" />
|
||||||
|
<entry key="..\:/COURCE/app/src/main/res/xml/network_security_config.xml" value="0.22327898550724637" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" 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,41 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.android.application'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdk 32
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "com.example.cource"
|
||||||
|
minSdk 27
|
||||||
|
targetSdk 32
|
||||||
|
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.3.0'
|
||||||
|
implementation 'com.google.android.material:material:1.4.0'
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
implementation 'com.google.code.gson:gson:2.9.0'
|
||||||
|
implementation 'com.growingio.android:okhttp3:3.3.6'
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.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.cource;
|
||||||
|
|
||||||
|
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.cource", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.example.cource">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
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.AppCompat.Light.NoActionBar">
|
||||||
|
<activity
|
||||||
|
android:name=".QuitCourse_Activity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".Sign_inActivity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".Modifyactivity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".Participate_in_Activity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".Course_create_Activity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".Sign_CreateActivity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".CourseActivity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".RegisterActivity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name=".LoginActivity"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:exported="false" />
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,37 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class BaseRespone <T>{
|
||||||
|
private int code;
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
|
||||||
|
public final static int RESPONE_SUCCESS = 0;
|
||||||
|
private T data;
|
||||||
|
public BaseRespone() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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 T getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(T data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public final class Constans {
|
||||||
|
private Constans(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String Accept="application/json, text/plain, */*";
|
||||||
|
public static String Content_Type="application/json";
|
||||||
|
public static String ReqUrl ="http://47.107.52.7:88/member/sign/";
|
||||||
|
public static String appId = "7a313d4c78764cb89dde6c031efdc480";
|
||||||
|
public static String appSecret="32939480977be35ff4daf88e1b8c209ce0c12";
|
||||||
|
public static String all_course = "course/all";
|
||||||
|
public static String detail = "course/detail";
|
||||||
|
public static String student= "course/student";
|
||||||
|
public static String imagePath = "https://guet-lab.oss-cn-guangzhou.aliyuncs.com/api/2022/06/14/Screenshot_2021-10-16_21_47_43.png";
|
||||||
|
public static String studentdrop= "course/student/drop";
|
||||||
|
|
||||||
|
public static String studentselect= "course/student/select";
|
||||||
|
|
||||||
|
public static String studentsign = "course/student/sign";
|
||||||
|
|
||||||
|
|
||||||
|
public static String studentsignList = "course/student/signList";
|
||||||
|
public static String teacher = "course/teacher";
|
||||||
|
public static String teacherfinished = "course/teacher/finished";
|
||||||
|
public static String teacherinitiate = "course/teacher/initiate";
|
||||||
|
public static String teacherpage = "course/teacher/page";
|
||||||
|
public static String teacherunfinish = "course/teacher/finished";
|
||||||
|
public static String imageload= "image/load";
|
||||||
|
public static String userlogin= "user/login";
|
||||||
|
public static String userrigister= "user/register";
|
||||||
|
public static String userupdate= "user/update";
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,284 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class CourseActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private List<signInfo> signRecords;
|
||||||
|
private List<SignInfo_student> signRecords1;
|
||||||
|
private TextView sign,action,head;
|
||||||
|
private ImageView signment;
|
||||||
|
private SwipeRefreshLayout swipe_course;
|
||||||
|
|
||||||
|
private int status=0;
|
||||||
|
private String signId="0";
|
||||||
|
private SignAdapterStudent adapter1;
|
||||||
|
private SignAdapter adapter;
|
||||||
|
private ListView lv_sign;
|
||||||
|
private String courseName;
|
||||||
|
private int courseId,roleId;
|
||||||
|
private long userId;
|
||||||
|
private final Callback callback=new okhttp3.Callback(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if(response.isSuccessful()){
|
||||||
|
final String body1 = response.body().string();
|
||||||
|
Log.println(Log.INFO,"OK",body1);
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<ResponseData<List<SignInfo_student>>>>(){}.getType();
|
||||||
|
BaseRespone<ResponseData<List<SignInfo_student>>> newUserResponse = gson.fromJson(body1,jsonType);
|
||||||
|
Log.println(Log.INFO,"records","what3?");
|
||||||
|
if (newUserResponse.getData()!=null)
|
||||||
|
{
|
||||||
|
if (!adapter1.isEmpty()) {
|
||||||
|
adapter1.clear();
|
||||||
|
}Log.println(Log.INFO,"records","what2?");
|
||||||
|
ResponseData<List<SignInfo_student>> u = newUserResponse.getData();
|
||||||
|
if (!u.getRecords().isEmpty()) {
|
||||||
|
List<SignInfo_student> s = u.getRecords();
|
||||||
|
for (SignInfo_student s1:s){
|
||||||
|
adapter1.add(s1);
|
||||||
|
}
|
||||||
|
adapter1.notifyDataSetChanged();
|
||||||
|
Log.println(Log.INFO,"records","what1?");
|
||||||
|
}
|
||||||
|
}Log.println(Log.INFO,"records","what?");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
String msg = response.message();
|
||||||
|
int code = response.code();
|
||||||
|
Log.println(Log.ERROR,"error",String.valueOf(code)+" "+msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
private final Callback callback1 = new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if(response.isSuccessful()){
|
||||||
|
String body2 = response.body().string();
|
||||||
|
Log.println(Log.INFO,"OK",body2);
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<signInfo>>(){}.getType();
|
||||||
|
BaseRespone<signInfo> newUserResponse = gson.fromJson(body2,jsonType);
|
||||||
|
signInfo u= newUserResponse.getData();
|
||||||
|
//Log.println(Log.INFO,"OK",Long.toString(u.getCourseId()));
|
||||||
|
if (!adapter.isEmpty())
|
||||||
|
{
|
||||||
|
adapter.clear();
|
||||||
|
|
||||||
|
}else {
|
||||||
|
adapter.add(u);
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
Log.println(Log.INFO,"test","nosign");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_course);
|
||||||
|
Intent intent = getIntent();
|
||||||
|
|
||||||
|
lv_sign =findViewById(R.id.sign_lv);
|
||||||
|
signment =findViewById(R.id.introduction);
|
||||||
|
|
||||||
|
swipe_course = findViewById(R.id.swipe_course);
|
||||||
|
courseId = intent.getIntExtra("courseId",0);
|
||||||
|
userId = intent.getLongExtra("UserId",0);
|
||||||
|
|
||||||
|
roleId = intent.getIntExtra("roleId",0);
|
||||||
|
courseName=intent.getStringExtra("courseName");
|
||||||
|
|
||||||
|
head =findViewById(R.id.TvCalendar);
|
||||||
|
head.setText(courseName);
|
||||||
|
sign = findViewById(R.id.sign);
|
||||||
|
action = findViewById(R.id.action);
|
||||||
|
sign.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
action.setTextColor(0xFFE0DBDB);
|
||||||
|
sign.setTextColor(0xFF000000);
|
||||||
|
|
||||||
|
status=0;
|
||||||
|
if (roleId==1){
|
||||||
|
getSign();
|
||||||
|
}else {
|
||||||
|
getSignStudent(status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
action.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
status=1;
|
||||||
|
sign.setTextColor(0xFFE0DBDB);
|
||||||
|
action.setTextColor(0xFF000000);
|
||||||
|
if (roleId==0){
|
||||||
|
getSignStudent(status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
signment.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
if (roleId==1){
|
||||||
|
Intent intent1 = new Intent(CourseActivity.this, Sign_CreateActivity.class);
|
||||||
|
intent1.putExtra("courseName", courseName);
|
||||||
|
intent1.putExtra("courseId", courseId);
|
||||||
|
intent1.putExtra("userId", userId);
|
||||||
|
startActivity(intent1);
|
||||||
|
}else if (roleId ==0){
|
||||||
|
Intent intent1 = new Intent(CourseActivity.this, Sign_inActivity.class);
|
||||||
|
intent1.putExtra("userId", userId);
|
||||||
|
intent1.putExtra("userSignId", signId);
|
||||||
|
startActivity(intent1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Log.println(Log.INFO," Course id:",Integer.toString(courseId));
|
||||||
|
Log.println(Log.INFO,"user id:",Long.toString(userId));
|
||||||
|
|
||||||
|
if (roleId==0){
|
||||||
|
initData();
|
||||||
|
}else {
|
||||||
|
initSign();
|
||||||
|
}
|
||||||
|
|
||||||
|
swipe_course.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
if (roleId==0){
|
||||||
|
getSignStudent(status);
|
||||||
|
}else {
|
||||||
|
getSign();
|
||||||
|
}
|
||||||
|
swipe_course.setRefreshing(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void getSignStudent(int i){
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
String urlparam;
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
if (i==0){
|
||||||
|
urlparam = "?courseId="+courseId+"&status=0"+"&userId="+userId;
|
||||||
|
}else {
|
||||||
|
urlparam = "?courseId=" + courseId + "&status=1" + "&userId=" + userId;
|
||||||
|
}
|
||||||
|
Request request1 = new Request.Builder().url(Constans.ReqUrl+Constans.studentsignList+urlparam)
|
||||||
|
.headers(Headers.of(map1))
|
||||||
|
.get()
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request1).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.println(Log.ERROR,"error","error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
void initData(){
|
||||||
|
signRecords1 = new ArrayList<>();
|
||||||
|
adapter1 = new SignAdapterStudent(CourseActivity.this,R.layout.course_item,signRecords1);
|
||||||
|
lv_sign.setAdapter(adapter1);
|
||||||
|
getSignStudent(0);
|
||||||
|
}
|
||||||
|
void initSign(){
|
||||||
|
signRecords = new ArrayList<>();
|
||||||
|
adapter = new SignAdapter(CourseActivity.this,R.layout.course_item,signRecords);
|
||||||
|
lv_sign.setAdapter(adapter);
|
||||||
|
getSign();
|
||||||
|
}
|
||||||
|
void getSign(){
|
||||||
|
//获取签到列表
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
String urlparam = "?courseId="+courseId+"&userId="+userId;
|
||||||
|
|
||||||
|
Request request1 = new Request.Builder().url(Constans.ReqUrl+Constans.teacherpage+urlparam)
|
||||||
|
.headers(Headers.of(map1))
|
||||||
|
.get()
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request1).enqueue(callback1);
|
||||||
|
}catch (NetworkOnMainThreadException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.println(Log.ERROR,"error","error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,94 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class CourseInfo {
|
||||||
|
private int courseId;
|
||||||
|
private String coursePhoto;
|
||||||
|
private String collegeName;
|
||||||
|
private String courseName;
|
||||||
|
private long endTime;
|
||||||
|
private String introduce;
|
||||||
|
private String realName;
|
||||||
|
private long startTime;
|
||||||
|
private long userID;
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
public String getCollegeName() {
|
||||||
|
return collegeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollegeName(String collegeName) {
|
||||||
|
this.collegeName = collegeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCoursePhoto() {
|
||||||
|
return coursePhoto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoursePhoto(String coursePhoto) {
|
||||||
|
this.coursePhoto = coursePhoto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getEndTime() {
|
||||||
|
return endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndTime(long endTime) {
|
||||||
|
this.endTime = endTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIntroduce() {
|
||||||
|
return introduce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntroduce(String intrudoce) {
|
||||||
|
this.introduce = intrudoce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRealName() {
|
||||||
|
return realName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRealName(String realName) {
|
||||||
|
this.realName = realName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(long startTime) {
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getUserID() {
|
||||||
|
return userID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserID(long userID) {
|
||||||
|
this.userID = userID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCourseId() {
|
||||||
|
return courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseId(int courseId) {
|
||||||
|
this.courseId = courseId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class CourseResponse<T> {
|
||||||
|
private int code;
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
|
||||||
|
private final static int RESPONE_SUCCESS = 0;
|
||||||
|
private T data;
|
||||||
|
private int total;
|
||||||
|
private int current;
|
||||||
|
private int size;
|
||||||
|
|
||||||
|
public CourseResponse() {
|
||||||
|
|
||||||
|
}
|
||||||
|
public static int getResponeSuccess() {
|
||||||
|
return RESPONE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 T getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(T data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(int total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCurrent() {
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrent(int current) {
|
||||||
|
this.current = current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(int size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class Course_create_Activity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private Long userid;
|
||||||
|
private String userName,realName,collegeName;
|
||||||
|
private EditText StartTime,EndTime,CourseName,Introduction;
|
||||||
|
private Button create_course;
|
||||||
|
private Callback callback = new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if (response.isSuccessful()){
|
||||||
|
final String body = response.body().string();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<String>>(){}.getType();
|
||||||
|
BaseRespone<String> stringBaseRespone =gson.fromJson(body,jsonType);
|
||||||
|
int code = stringBaseRespone.getCode();
|
||||||
|
String msg = stringBaseRespone.getMsg();
|
||||||
|
Log.println(Log.INFO,"code",Integer.toString(code)+msg);
|
||||||
|
if (code ==200){
|
||||||
|
Toast.makeText(getApplicationContext(),"添加成功",Toast.LENGTH_SHORT).show();
|
||||||
|
}else Toast.makeText(getApplicationContext(),stringBaseRespone.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_course_create);
|
||||||
|
Intent intent = getIntent();
|
||||||
|
userid=intent.getLongExtra("userId",0);
|
||||||
|
collegeName = intent.getStringExtra("collegeName");
|
||||||
|
userName = intent.getStringExtra("userName");
|
||||||
|
realName = intent.getStringExtra("realName");
|
||||||
|
Log.println(Log.INFO,"id_course_create_activity",Long.toString(userid));
|
||||||
|
|
||||||
|
StartTime = findViewById(R.id.courseStartTime_create);
|
||||||
|
EndTime = findViewById(R.id.courseEnd_create);
|
||||||
|
CourseName = findViewById(R.id.courseName_create);
|
||||||
|
Introduction = findViewById(R.id.courseIntroduction_create);
|
||||||
|
create_course = findViewById(R.id.Bt_course_create);
|
||||||
|
|
||||||
|
create_course.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if(realName ==null||collegeName==null){
|
||||||
|
Toast.makeText(getApplicationContext(),"请完善个人信息",Toast.LENGTH_SHORT).show();
|
||||||
|
}else {
|
||||||
|
courseCreate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
void courseCreate(){
|
||||||
|
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
Log.println(Log.ERROR,"jsontest","this is");
|
||||||
|
try {
|
||||||
|
jsonObject.put("collegeName",collegeName);
|
||||||
|
jsonObject.put("courseName",CourseName.getText().toString());
|
||||||
|
jsonObject.put("coursePhoto",Constans.imagePath);
|
||||||
|
jsonObject.put("realName",realName);
|
||||||
|
jsonObject.put("endTime",EndTime.getText().toString());
|
||||||
|
jsonObject.put("introduce",Introduction.getText().toString());
|
||||||
|
jsonObject.put("startTime",StartTime.getText().toString());
|
||||||
|
jsonObject.put("userId",userid);
|
||||||
|
jsonObject.put("userName",userName);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"),String.valueOf(jsonObject));
|
||||||
|
Request request = new Request.Builder().url(Constans.ReqUrl+Constans.teacher)
|
||||||
|
.headers(Headers.of(map1))
|
||||||
|
.post(requestBody)
|
||||||
|
.build();
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class ErrorInfo {
|
||||||
|
private String timestamp;
|
||||||
|
private String error;
|
||||||
|
private String message;
|
||||||
|
private String path;
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
public String getTimestamp() {
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimestamp(String timestamp) {
|
||||||
|
this.timestamp = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getError() {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setError(String error) {
|
||||||
|
this.error = error;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class ErrorRespone<T> {
|
||||||
|
private T data;
|
||||||
|
public ErrorRespone() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,197 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class LoginActivity extends AppCompatActivity{
|
||||||
|
|
||||||
|
private Button login;
|
||||||
|
private EditText user,passwd;
|
||||||
|
private String username,password;
|
||||||
|
private TextView register;
|
||||||
|
private CheckBox PwdRem;
|
||||||
|
|
||||||
|
private okhttp3.Callback callback =new okhttp3.Callback(){
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if(response.isSuccessful()){
|
||||||
|
final String body = response.body().string();
|
||||||
|
int code = response.code();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<Userinfo>>(){}.getType();
|
||||||
|
BaseRespone<Userinfo> newUserResponse = gson.fromJson(body,jsonType);
|
||||||
|
Userinfo u =(Userinfo) newUserResponse.getData();
|
||||||
|
long code1 = u.getId();
|
||||||
|
String userName = u.getUserName();
|
||||||
|
String realName = u.getRealName();
|
||||||
|
String collegeName = u.getCollegeName();
|
||||||
|
String roleId = u.getRoleId();
|
||||||
|
Log.println(Log.INFO,"OK",body);
|
||||||
|
Log.println(Log.INFO,"cide",Long.toString(code1));
|
||||||
|
switch (code){
|
||||||
|
case 500:
|
||||||
|
Toast.makeText(getApplicationContext(),"未找到该用户",Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case 200:Intent intent =new Intent(LoginActivity.this,MainActivity.class);
|
||||||
|
intent.putExtra("id",code1);
|
||||||
|
intent.putExtra("role",Integer.valueOf(roleId));
|
||||||
|
intent.putExtra("collegeName",collegeName);
|
||||||
|
intent.putExtra("userName",userName);
|
||||||
|
intent.putExtra("realName",realName);
|
||||||
|
intent.putExtra("email",u.getEmail());
|
||||||
|
intent.putExtra("idNumber",u.getIdNumber());
|
||||||
|
intent.putExtra("inTime",u.getInSchoolTime());
|
||||||
|
intent.putExtra("phone",u.getPhone());
|
||||||
|
intent.putExtra("gender",u.isGender());
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
default: Toast.makeText(getApplicationContext(),newUserResponse.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
int code = response.code();
|
||||||
|
Log.println(Log.ERROR,"error",String.valueOf(code));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_login);
|
||||||
|
login = findViewById(R.id.login_button);
|
||||||
|
user = findViewById(R.id.username);
|
||||||
|
passwd = findViewById(R.id.passwd);
|
||||||
|
register = findViewById(R.id.register);
|
||||||
|
PwdRem = findViewById(R.id.RememberPwd);
|
||||||
|
login.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Rember();
|
||||||
|
Login();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
register.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
register();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
String spFileName = getResources().getString(R.string.shared_preferences_file_name);
|
||||||
|
String accountKey = getResources().getString(R.string.login_account_name);
|
||||||
|
String passwordKey = getResources().getString(R.string.login_password);
|
||||||
|
String rememberPasswordKey = getResources().getString(R.string.login_remember_password);
|
||||||
|
|
||||||
|
SharedPreferences spFile = getSharedPreferences(spFileName, Context.MODE_PRIVATE);
|
||||||
|
String password = spFile.getString(passwordKey,null);
|
||||||
|
String account = spFile.getString(accountKey,null);
|
||||||
|
Boolean rememberPassword = spFile.getBoolean(rememberPasswordKey,false);
|
||||||
|
|
||||||
|
if (account!=null&&!TextUtils.isEmpty(account)){
|
||||||
|
user.setText(account);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (password!=null&&!TextUtils.isEmpty(password)){
|
||||||
|
passwd.setText(password);
|
||||||
|
}
|
||||||
|
PwdRem.setChecked(rememberPassword);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Rember(){
|
||||||
|
String spFileName = getResources().getString(R.string.shared_preferences_file_name);
|
||||||
|
String accountKey = getResources().getString(R.string.login_account_name);
|
||||||
|
String passwordKey = getResources().getString(R.string.login_password);
|
||||||
|
String rememberPasswordKey = getResources().getString(R.string.login_remember_password);
|
||||||
|
|
||||||
|
SharedPreferences spFile = getSharedPreferences(spFileName, Context.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = spFile.edit();
|
||||||
|
|
||||||
|
if (PwdRem.isChecked()){
|
||||||
|
String password = passwd.getText().toString();
|
||||||
|
String account = user.getText().toString();
|
||||||
|
editor.putString(accountKey,account);
|
||||||
|
editor.putString(passwordKey,password);
|
||||||
|
editor.putBoolean(rememberPasswordKey,true);
|
||||||
|
editor.apply();
|
||||||
|
}else{
|
||||||
|
editor.remove(accountKey);
|
||||||
|
editor.remove(passwordKey);
|
||||||
|
editor.remove(rememberPasswordKey);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
void Login(){
|
||||||
|
username = user.getText().toString();
|
||||||
|
password = passwd.getText().toString();
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
UserRequest requestobj = new UserRequest();
|
||||||
|
requestobj.setPassword(password);
|
||||||
|
requestobj.setUsername(username);
|
||||||
|
String urlParam = requestobj.toString();
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
Log.println(Log.INFO,"param",urlParam);
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), urlParam);
|
||||||
|
Request request = new Request.Builder().url(Constans.ReqUrl+Constans.userlogin+urlParam)
|
||||||
|
.addHeader("appId",Constans.appId)
|
||||||
|
.addHeader("appSecret",Constans.appSecret).post(requestBody).build();
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request).enqueue(callback);
|
||||||
|
|
||||||
|
}catch (NetworkOnMainThreadException ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
void register(){
|
||||||
|
Intent intent = new Intent(LoginActivity.this,RegisterActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,367 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.annotation.ColorInt;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.PopupMenu;
|
||||||
|
import android.widget.Switch;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private String urlParam,collegeName,userName,realName,phone,email,inTime;
|
||||||
|
private boolean gender;
|
||||||
|
private long code,idNumber;
|
||||||
|
private int roleId;
|
||||||
|
private ListView recordList;
|
||||||
|
private List<record> records;
|
||||||
|
private RecordAdapter adapter;
|
||||||
|
private TextView all,teaching,studying;
|
||||||
|
private SwipeRefreshLayout swipe;
|
||||||
|
|
||||||
|
private int mode=0;
|
||||||
|
private ImageView head_image;
|
||||||
|
private Toolbar mytoolbar;
|
||||||
|
private Callback callback=new okhttp3.Callback(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if(response.isSuccessful()){
|
||||||
|
final String body = response.body().string();
|
||||||
|
Log.println(Log.INFO,"OK",body);
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<ResponseData<List<record>>>>(){}.getType();
|
||||||
|
BaseRespone<ResponseData<List<record>>> newUserResponse = gson.fromJson(body,jsonType);
|
||||||
|
ResponseData<List<record>> u= newUserResponse.getData();
|
||||||
|
if (!u.getRecords().isEmpty()) {
|
||||||
|
adapter.clear();
|
||||||
|
for (record r : u.getRecords()) {
|
||||||
|
adapter.add(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
adapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Toast.makeText(getApplicationContext(),"您还没用创建课程",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
int c = newUserResponse.getCode();
|
||||||
|
if (u!=null){
|
||||||
|
Log.println(Log.INFO,"code",Integer.toString(c));
|
||||||
|
int id = u.getCurrent();
|
||||||
|
Log.println(Log.INFO,"current",Integer.toString(id));
|
||||||
|
Log.println(Log.INFO,"records",records.get(0).getCoursePhoto());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
/*final String errorbody = response.body().string();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<ErrorInfo>(){}.getType();
|
||||||
|
ErrorInfo newUserResponse = gson.fromJson(errorbody,jsonType);
|
||||||
|
String message =newUserResponse.getMessage();
|
||||||
|
Log.println(Log.ERROR,"error",message);
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
String msg = response.message();
|
||||||
|
int code = response.code();
|
||||||
|
Log.println(Log.ERROR,"error",String.valueOf(code)+" "+msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
|
Intent intent = getIntent();
|
||||||
|
collegeName = intent.getStringExtra("collegeName");
|
||||||
|
realName = intent.getStringExtra("realName");
|
||||||
|
userName = intent.getStringExtra("userName");
|
||||||
|
roleId = intent.getIntExtra("role",2);
|
||||||
|
code = intent.getLongExtra("id",0);
|
||||||
|
phone = intent.getStringExtra("phone");
|
||||||
|
email = intent.getStringExtra("email");
|
||||||
|
inTime = intent.getStringExtra("inTime");
|
||||||
|
gender = intent.getBooleanExtra("gender",true);
|
||||||
|
idNumber = intent.getLongExtra("idNumber",0);
|
||||||
|
Log.println(Log.INFO,"intent",Long.toString(code)+" "+Integer.toString(roleId));
|
||||||
|
|
||||||
|
all = findViewById(R.id.all);
|
||||||
|
teaching = findViewById(R.id.teaching);
|
||||||
|
studying = findViewById(R.id.study);
|
||||||
|
|
||||||
|
head_image = findViewById(R.id.head_image);
|
||||||
|
mytoolbar = findViewById(R.id.myToolbar);
|
||||||
|
setSupportActionBar(mytoolbar);
|
||||||
|
|
||||||
|
swipe = findViewById(R.id.swipe);
|
||||||
|
|
||||||
|
initView();
|
||||||
|
initCourse();
|
||||||
|
|
||||||
|
all.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
mode=0;
|
||||||
|
all.setTextColor(0xFF000000);
|
||||||
|
teaching.setTextColor(0xFFBBBCBF);
|
||||||
|
studying.setTextColor(0xFFBBBCBF);
|
||||||
|
search(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
teaching.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
if (roleId==1){
|
||||||
|
mode=1;
|
||||||
|
teaching.setTextColor(0xFF000000);
|
||||||
|
all.setTextColor(0xFFBBBCBF);
|
||||||
|
studying.setTextColor(0xFFBBBCBF);
|
||||||
|
search(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
studying.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if(roleId==0) {
|
||||||
|
mode=2;
|
||||||
|
all.setTextColor(0xFFBBBCBF);
|
||||||
|
teaching.setTextColor(0xFFBBBCBF);
|
||||||
|
studying.setTextColor(0xFF000000);
|
||||||
|
search(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
head_image.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
achieve(3);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
swipe.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
|
||||||
|
switch (mode){
|
||||||
|
case 1:search(1);
|
||||||
|
break;
|
||||||
|
case 2:search(2);
|
||||||
|
break;
|
||||||
|
default:search(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
swipe.setRefreshing(false);
|
||||||
|
Toast.makeText(getApplicationContext(),"刷新完成",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
|
||||||
|
MenuInflater inflater = getMenuInflater();
|
||||||
|
inflater.inflate(R.menu.pop_menus_action,menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
switch (item.getItemId()){
|
||||||
|
case R.id.participate:
|
||||||
|
if (roleId==0){
|
||||||
|
achieve(1);
|
||||||
|
}else Toast.makeText(MainActivity.this,"您不是学生",Toast.LENGTH_SHORT).show();
|
||||||
|
return true;
|
||||||
|
case R.id.create:
|
||||||
|
if (roleId==1) {
|
||||||
|
achieve(2);
|
||||||
|
}else Toast.makeText(MainActivity.this,"您不是教师",Toast.LENGTH_SHORT).show();
|
||||||
|
return true;
|
||||||
|
case R.id.drop:
|
||||||
|
if (roleId==0){
|
||||||
|
achieve(0);
|
||||||
|
}else Toast.makeText(MainActivity.this,"您不是学生",Toast.LENGTH_SHORT).show();
|
||||||
|
default:
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void achieve(int id){
|
||||||
|
Intent intent;
|
||||||
|
switch (id){
|
||||||
|
case 0:intent = new Intent(MainActivity.this,QuitCourse_Activity.class);
|
||||||
|
intent.putExtra("userId",code);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
intent = new Intent(MainActivity.this,Participate_in_Activity.class);
|
||||||
|
intent.putExtra("userId",code);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
intent = new Intent(MainActivity.this,Course_create_Activity.class);
|
||||||
|
intent.putExtra("userId",code);
|
||||||
|
intent.putExtra("realName",realName);
|
||||||
|
intent.putExtra("collegeName",collegeName);
|
||||||
|
intent.putExtra("userName",userName);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
intent = new Intent(MainActivity.this,Modifyactivity.class);
|
||||||
|
intent.putExtra("userId",code);
|
||||||
|
intent.putExtra("realName",realName);
|
||||||
|
intent.putExtra("collegeName",collegeName);
|
||||||
|
intent.putExtra("userName",userName);
|
||||||
|
intent.putExtra("phone",phone);
|
||||||
|
intent.putExtra("email",email);
|
||||||
|
intent.putExtra("inTime",inTime);
|
||||||
|
intent.putExtra("idNumber",idNumber);
|
||||||
|
intent.putExtra("gender",gender);
|
||||||
|
startActivity(intent);
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void initView(){
|
||||||
|
recordList = findViewById(R.id.lv_course);
|
||||||
|
|
||||||
|
recordList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
Intent intent = new Intent(MainActivity.this,CourseActivity.class);
|
||||||
|
record r = adapter.getItem(position);
|
||||||
|
intent.putExtra("courseName",r.getCourseName());
|
||||||
|
intent.putExtra("courseId",r.getCourseId());
|
||||||
|
intent.putExtra("UserId",code);
|
||||||
|
intent.putExtra("roleId",roleId);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
void initCourse(){
|
||||||
|
records = new ArrayList<>();
|
||||||
|
adapter = new RecordAdapter(MainActivity.this,R.layout.course_item,records);
|
||||||
|
recordList.setAdapter(adapter);
|
||||||
|
|
||||||
|
refresh();
|
||||||
|
//Log.println(Log.INFO,"records",records.get(0).toString());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
void refresh(){
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
|
||||||
|
|
||||||
|
Request request1 = new Request.Builder().url(Constans.ReqUrl+Constans.all_course).headers(Headers.of(map1))
|
||||||
|
.get()
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request1).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.println(Log.ERROR,"error","error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
void search(int c){
|
||||||
|
switch (c){
|
||||||
|
case 1:urlParam = Constans.teacherunfinish+"?userId="+Long.toString(code);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:urlParam = Constans.student+"?userId="+Long.toString(code);
|
||||||
|
break;
|
||||||
|
default:urlParam=Constans.all_course; break;
|
||||||
|
}
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
|
||||||
|
Request request1 = new Request.Builder().url(Constans.ReqUrl+urlParam).headers(Headers.of(map1))
|
||||||
|
.get()
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request1).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.println(Log.ERROR,"error","error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,164 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class Modifyactivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private TextView collegeName,email,gender,idNumber,inTime,phone,realName,userName;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
private Button modify_button;
|
||||||
|
private Callback callback = new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if (response.isSuccessful()){
|
||||||
|
final String body = response.body().string();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<String>>(){}.getType();
|
||||||
|
BaseRespone<String> stringBaseRespone =gson.fromJson(body,jsonType);
|
||||||
|
int code = stringBaseRespone.getCode();
|
||||||
|
String msg = stringBaseRespone.getMsg();
|
||||||
|
Log.println(Log.INFO,"code",Integer.toString(code)+msg);
|
||||||
|
if (code ==200){
|
||||||
|
Toast.makeText(getApplicationContext(),"修改成功",Toast.LENGTH_SHORT).show();
|
||||||
|
}else Toast.makeText(getApplicationContext(),stringBaseRespone.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_modifyactivity);
|
||||||
|
Intent intent = getIntent();
|
||||||
|
userId=intent.getLongExtra("userId",0);
|
||||||
|
collegeName = findViewById(R.id.ed_college_Name_modify);
|
||||||
|
email = findViewById(R.id.ed_email_modify);
|
||||||
|
gender = findViewById(R.id.ed_gender_modify);
|
||||||
|
idNumber = findViewById(R.id.ed_idNumber_modify);
|
||||||
|
inTime = findViewById(R.id.ed_inSchoolTime_modify);
|
||||||
|
phone = findViewById(R.id.ed_phone_modify);
|
||||||
|
realName = findViewById(R.id.ed_realName_modify);
|
||||||
|
userName = findViewById(R.id.ed_userName_modify);
|
||||||
|
|
||||||
|
collegeName.setText(intent.getStringExtra("collegeName"));
|
||||||
|
realName.setText(intent.getStringExtra("realName"));
|
||||||
|
userName.setText(intent.getStringExtra("userName"));
|
||||||
|
if (intent.getLongExtra("idNumber",0)!=0){
|
||||||
|
String s = Long.toString(intent.getLongExtra("idNumber",0));
|
||||||
|
idNumber.setText(s);
|
||||||
|
}
|
||||||
|
inTime.setText(intent.getStringExtra("inTime"));
|
||||||
|
phone.setText(intent.getStringExtra("phone"));
|
||||||
|
email.setText(intent.getStringExtra("email"));
|
||||||
|
if (intent.getBooleanExtra("gender",true)){
|
||||||
|
gender.setText("男");
|
||||||
|
}else gender.setText("女");
|
||||||
|
modify_button =findViewById(R.id.button_modify);
|
||||||
|
modify_button.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
modify();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void modify(){
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
Log.println(Log.ERROR,"jsontest","this is");
|
||||||
|
try {
|
||||||
|
if (collegeName.getText()!=null) {
|
||||||
|
jsonObject.put("collegeName", collegeName.getText().toString());
|
||||||
|
}
|
||||||
|
if (email.getText()!=null) {
|
||||||
|
jsonObject.put("email", email.getText().toString());
|
||||||
|
}
|
||||||
|
if (gender.getText().toString().equals("男")){
|
||||||
|
jsonObject.put("gender","true");
|
||||||
|
}else {
|
||||||
|
jsonObject.put("gender","false");
|
||||||
|
}
|
||||||
|
if (realName.getText().toString()!=null) {
|
||||||
|
jsonObject.put("realName", realName.getText().toString());
|
||||||
|
}
|
||||||
|
if (inTime.getText().toString()!=null) {
|
||||||
|
jsonObject.put("inSchoolTime", inTime.getText().toString());
|
||||||
|
}
|
||||||
|
if (phone.getText().toString()!=null){
|
||||||
|
jsonObject.put("phone", phone.getText().toString());
|
||||||
|
}
|
||||||
|
if (userName.getText().toString()!=null){
|
||||||
|
jsonObject.put("userName", userName.getText().toString());
|
||||||
|
}
|
||||||
|
jsonObject.put("id",userId);
|
||||||
|
if (idNumber.getText().toString()!=null) {
|
||||||
|
jsonObject.put("idNumber", idNumber.getText().toString());
|
||||||
|
}
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"),String.valueOf(jsonObject));
|
||||||
|
Request request = new Request.Builder().url(Constans.ReqUrl+Constans.userupdate)
|
||||||
|
.headers(Headers.of(map1))
|
||||||
|
.post(requestBody)
|
||||||
|
.build();
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class Participate_in_Activity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
private EditText Edit;
|
||||||
|
private Button Bt_participate;
|
||||||
|
private Callback callback = new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if (response.isSuccessful()){
|
||||||
|
final String body = response.body().string();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<String>>(){}.getType();
|
||||||
|
BaseRespone<String> newUserResponse = gson.fromJson(body,jsonType);
|
||||||
|
int code = newUserResponse.getCode();
|
||||||
|
Log.println(Log.INFO,"cide",Integer.toString(code));
|
||||||
|
if (code ==200){
|
||||||
|
|
||||||
|
Toast.makeText(getApplicationContext(),"加入成功",Toast.LENGTH_SHORT).show();
|
||||||
|
}else Toast.makeText(getApplicationContext(),newUserResponse.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}else Log.println(Log.INFO,"cide",Integer.toString(response.code())+response.message());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_participate_in);
|
||||||
|
Intent intent =getIntent();
|
||||||
|
userId = intent.getLongExtra("userId",0);
|
||||||
|
|
||||||
|
Edit =findViewById(R.id.Edit_courseid);
|
||||||
|
Bt_participate = findViewById(R.id.Bt_participate_in);
|
||||||
|
Bt_participate.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
participate_in();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
void participate_in(){
|
||||||
|
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
String urlParam ="?"+"courseId="+Edit.getText().toString()+"&userId="+userId;
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), urlParam);
|
||||||
|
Request request = new Request.Builder().url(Constans.ReqUrl+Constans.studentselect+urlParam)
|
||||||
|
.headers(Headers.of(map1))
|
||||||
|
.post(requestBody).build();
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient() ;
|
||||||
|
client.newCall(request).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple {@link Fragment} subclass.
|
||||||
|
* Use the {@link PersonalInfomation#newInstance} factory method to
|
||||||
|
* create an instance of this fragment.
|
||||||
|
*/
|
||||||
|
public class PersonalInfomation extends Fragment {
|
||||||
|
|
||||||
|
// TODO: Rename parameter arguments, choose names that match
|
||||||
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||||
|
private static final String ARG_PARAM1 = "param1";
|
||||||
|
private static final String ARG_PARAM2 = "param2";
|
||||||
|
|
||||||
|
// TODO: Rename and change types of parameters
|
||||||
|
private String mParam1;
|
||||||
|
private String mParam2;
|
||||||
|
|
||||||
|
public PersonalInfomation() {
|
||||||
|
// Required empty public constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use this factory method to create a new instance of
|
||||||
|
* this fragment using the provided parameters.
|
||||||
|
*
|
||||||
|
* @param param1 Parameter 1.
|
||||||
|
* @param param2 Parameter 2.
|
||||||
|
* @return A new instance of fragment PersonalInfomation.
|
||||||
|
*/
|
||||||
|
// TODO: Rename and change types and number of parameters
|
||||||
|
public static PersonalInfomation newInstance(String param1, String param2) {
|
||||||
|
PersonalInfomation fragment = new PersonalInfomation();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putString(ARG_PARAM1, param1);
|
||||||
|
args.putString(ARG_PARAM2, param2);
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments() != null) {
|
||||||
|
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||||
|
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
// Inflate the layout for this fragment
|
||||||
|
return inflater.inflate(R.layout.fragment_personal_infomation, container, false);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class QuitCourse_Activity extends AppCompatActivity {
|
||||||
|
private Long userId;
|
||||||
|
private EditText Edit;
|
||||||
|
private Button Bt_quit;
|
||||||
|
private Callback callback = new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if (response.isSuccessful()){
|
||||||
|
final String body = response.body().string();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<String>>(){}.getType();
|
||||||
|
BaseRespone<String> newUserResponse = gson.fromJson(body,jsonType);
|
||||||
|
int code = newUserResponse.getCode();
|
||||||
|
Log.println(Log.INFO,"cide",Integer.toString(code)+newUserResponse.getMsg());
|
||||||
|
if (code ==200){
|
||||||
|
|
||||||
|
Toast.makeText(getApplicationContext(),"退课成功",Toast.LENGTH_SHORT).show();
|
||||||
|
}else Toast.makeText(getApplicationContext(),newUserResponse.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}else Log.println(Log.INFO,"cide",Integer.toString(response.code())+response.message());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_quit_course);
|
||||||
|
Intent intent =getIntent();
|
||||||
|
userId = intent.getLongExtra("userId",0);
|
||||||
|
|
||||||
|
Edit =findViewById(R.id.Edit_courseid_quit);
|
||||||
|
Bt_quit = findViewById(R.id.Bt_quit_out);
|
||||||
|
Bt_quit.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
quit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
void quit(){
|
||||||
|
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
String urlParam ="?"+"courseId="+Edit.getText().toString()+"&userId="+userId;
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), urlParam);
|
||||||
|
Request request = new Request.Builder().url(Constans.ReqUrl+Constans.studentdrop+urlParam)
|
||||||
|
.headers(Headers.of(map1))
|
||||||
|
.delete(requestBody).build();
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient() ;
|
||||||
|
client.newCall(request).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class RecordAdapter extends ArrayAdapter<record> {
|
||||||
|
private List<record> records;
|
||||||
|
private Context mContext;
|
||||||
|
private int resourseId;
|
||||||
|
|
||||||
|
public RecordAdapter(Context context,int resourseId,List<record> recordList){
|
||||||
|
|
||||||
|
super(context,resourseId,recordList);
|
||||||
|
this.mContext = context;
|
||||||
|
this.records=recordList;
|
||||||
|
this.resourseId = resourseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||||
|
record r = getItem(position);
|
||||||
|
View view;
|
||||||
|
|
||||||
|
final ViewHolder vh;
|
||||||
|
if(convertView==null){
|
||||||
|
view = LayoutInflater.from(getContext()).inflate(resourseId,parent,false);
|
||||||
|
vh= new ViewHolder();
|
||||||
|
vh.college = view.findViewById(R.id.college);
|
||||||
|
vh.name = view.findViewById(R.id.name_course);
|
||||||
|
vh.course_id = view.findViewById(R.id.id_course);
|
||||||
|
view.setTag(vh);
|
||||||
|
}else{
|
||||||
|
view = convertView;
|
||||||
|
vh = (ViewHolder) view.getTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
vh.course_id.setText(Integer.toString(r.getCourseId()));
|
||||||
|
vh.college.setText(r.getCollegeName());
|
||||||
|
vh.name.setText(r.getCourseName());
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
class ViewHolder{
|
||||||
|
TextView name;
|
||||||
|
TextView course_id;
|
||||||
|
TextView college;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
import org.json.JSONStringer;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.FormBody;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import okhttp3.internal.http2.Header;
|
||||||
|
import okio.BufferedSink;
|
||||||
|
|
||||||
|
public class RegisterActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private EditText user,passwd,role;
|
||||||
|
private Button register;
|
||||||
|
private okhttp3.Callback callback =new okhttp3.Callback(){
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if(response.isSuccessful()){
|
||||||
|
final String body = response.body().string();
|
||||||
|
Log.println(Log.INFO,"OK",body);
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<Userinfo>>(){}.getType();
|
||||||
|
BaseRespone<Userinfo> newUserResponse = gson.fromJson(body,jsonType);
|
||||||
|
Userinfo u =newUserResponse.getData();
|
||||||
|
int c = newUserResponse.getCode();
|
||||||
|
if (u==null){
|
||||||
|
Log.println(Log.INFO,"code",Integer.toString(c));
|
||||||
|
if (c==200){
|
||||||
|
Toast.makeText(getApplicationContext(),"注册成功",Toast.LENGTH_SHORT).show();
|
||||||
|
}else Toast.makeText(getApplicationContext(),newUserResponse.getMsg(),Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
String msg = response.message();
|
||||||
|
int code = response.code();
|
||||||
|
Log.println(Log.ERROR,"error",String.valueOf(code)+" "+msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_register);
|
||||||
|
user = findViewById(R.id.user_register);
|
||||||
|
passwd = findViewById(R.id.Pwd_register);
|
||||||
|
role = findViewById(R.id.Role_register);
|
||||||
|
register = findViewById(R.id.button_register);
|
||||||
|
|
||||||
|
register.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
RegisterIn();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
void RegisterIn(){
|
||||||
|
String username = String.valueOf(user.getText());
|
||||||
|
String password = String.valueOf(passwd.getText());
|
||||||
|
String rol = String.valueOf(role.getText());
|
||||||
|
Log.println(Log.INFO,"username",String.valueOf(username));
|
||||||
|
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
Log.println(Log.ERROR,"jsontest","this is");
|
||||||
|
try {
|
||||||
|
jsonObject.put("password",password);
|
||||||
|
jsonObject.put("roleId",Integer.valueOf(rol));
|
||||||
|
jsonObject.put("userName",username);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
String json = "password"+password+","+"roleId"+rol+","+"userName"+username;
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), String.valueOf(jsonObject));
|
||||||
|
Request request1 = new Request.Builder().url(Constans.ReqUrl+Constans.userrigister).headers(Headers.of(map1))
|
||||||
|
.post(requestBody)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request1).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.println(Log.ERROR,"error","error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class ResponseData <T>{
|
||||||
|
private T records;
|
||||||
|
private int total;
|
||||||
|
private int size;
|
||||||
|
private int current;
|
||||||
|
|
||||||
|
public T getRecords() {
|
||||||
|
return records;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecords(T records) {
|
||||||
|
this.records = records;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(int total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(int size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCurrent() {
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrent(int current) {
|
||||||
|
this.current = current;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SignAdapter extends ArrayAdapter<signInfo> {
|
||||||
|
private List<signInfo> records;
|
||||||
|
private Context mContext;
|
||||||
|
private int resourseId;
|
||||||
|
public SignAdapter(Context context,int resourseId,List<signInfo> recordList){
|
||||||
|
|
||||||
|
super(context,resourseId,recordList);
|
||||||
|
this.mContext = context;
|
||||||
|
this.records=recordList;
|
||||||
|
this.resourseId = resourseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||||
|
signInfo r = getItem(position);
|
||||||
|
View view;
|
||||||
|
|
||||||
|
final ViewHolder vh;
|
||||||
|
if(convertView==null){
|
||||||
|
view = LayoutInflater.from(getContext()).inflate(resourseId,parent,false);
|
||||||
|
vh= new ViewHolder();
|
||||||
|
vh.name = view.findViewById(R.id.college);
|
||||||
|
vh.course_id = view.findViewById(R.id.name_course);
|
||||||
|
vh.courseNum = view.findViewById(R.id.id_course);
|
||||||
|
view.setTag(vh);
|
||||||
|
}else{
|
||||||
|
view = convertView;
|
||||||
|
vh = (ViewHolder) view.getTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
vh.course_id.setText("课程ID:"+Long.toString(r.getCourseId()));
|
||||||
|
vh.courseNum.setText(Integer.toString(r.getCourseNum()));
|
||||||
|
vh.name.setText(r.getCourseName());
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
class ViewHolder{
|
||||||
|
TextView name;
|
||||||
|
TextView course_id;
|
||||||
|
TextView courseNum;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SignAdapterStudent extends ArrayAdapter<SignInfo_student> {
|
||||||
|
private List<SignInfo_student> records;
|
||||||
|
private Context mContext;
|
||||||
|
private int resourseId;
|
||||||
|
public SignAdapterStudent(Context context,int resourseId,List<SignInfo_student> recordList){
|
||||||
|
|
||||||
|
super(context,resourseId,recordList);
|
||||||
|
this.mContext = context;
|
||||||
|
this.records=recordList;
|
||||||
|
this.resourseId = resourseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||||
|
SignInfo_student r = getItem(position);
|
||||||
|
View view;
|
||||||
|
|
||||||
|
final ViewHolder vh;
|
||||||
|
if(convertView==null){
|
||||||
|
view = LayoutInflater.from(getContext()).inflate(resourseId,parent,false);
|
||||||
|
vh= new ViewHolder();
|
||||||
|
vh.name = view.findViewById(R.id.name_course);
|
||||||
|
vh.college = view.findViewById(R.id.college);
|
||||||
|
vh.course_id = view.findViewById(R.id.id_course);
|
||||||
|
view.setTag(vh);
|
||||||
|
}else{
|
||||||
|
view = convertView;
|
||||||
|
vh = (ViewHolder) view.getTag();
|
||||||
|
}
|
||||||
|
|
||||||
|
vh.course_id.setText(r.getCourseAddr());
|
||||||
|
vh.college.setText("用户签到id:"+r.getUserSignId());
|
||||||
|
vh.name.setText(r.getCourseName());
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
class ViewHolder{
|
||||||
|
TextView name;
|
||||||
|
TextView course_id;
|
||||||
|
TextView college;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class SignInfo_student {
|
||||||
|
|
||||||
|
private String courseName;
|
||||||
|
private String courseAddr;
|
||||||
|
private String createTime;
|
||||||
|
private String userSignId;
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseAddr() {
|
||||||
|
return courseAddr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseAddr(String courseAddr) {
|
||||||
|
this.courseAddr = courseAddr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserSignId() {
|
||||||
|
return userSignId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserSignId(String userSignId) {
|
||||||
|
this.userSignId = userSignId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,137 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class Sign_CreateActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private Long startTime,terminalTime;
|
||||||
|
private Button add_button;
|
||||||
|
private EditText beginT,endT,Addr,sign;
|
||||||
|
private String courseAddr,courseName;
|
||||||
|
private int signCode,courseId,total;
|
||||||
|
private Long beginTime,endTime,userId;
|
||||||
|
private Callback callback = new Callback() {
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG","Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if(response.isSuccessful()){
|
||||||
|
final String body = response.body().string();
|
||||||
|
Log.println(Log.INFO,"OK",body);
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<String>>(){}.getType();
|
||||||
|
BaseRespone<String> newUserResponse = gson.fromJson(body,jsonType);
|
||||||
|
String u= newUserResponse.getData();
|
||||||
|
int c = newUserResponse.getCode();
|
||||||
|
if (c==200){
|
||||||
|
Log.println(Log.INFO,"code",Integer.toString(c));
|
||||||
|
Toast.makeText(getApplicationContext(),"发起成功",Toast.LENGTH_SHORT).show();
|
||||||
|
}else Toast.makeText(getApplicationContext(),"发起签到失败",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_sign_create);
|
||||||
|
Intent intent = getIntent();
|
||||||
|
courseName = intent.getStringExtra("courseName");
|
||||||
|
courseId=intent.getIntExtra("courseId",0);
|
||||||
|
userId=intent.getLongExtra("userId",0);
|
||||||
|
beginT=findViewById(R.id.beginTime);
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒", Locale.getDefault());
|
||||||
|
startTime = System.currentTimeMillis();
|
||||||
|
terminalTime = startTime+300000;
|
||||||
|
beginT.setText(simpleDateFormat.format(startTime));
|
||||||
|
endT=findViewById(R.id.ed_endtime);
|
||||||
|
endT.setText(simpleDateFormat.format(terminalTime));
|
||||||
|
Addr = findViewById(R.id.courseAddr);
|
||||||
|
sign = findViewById(R.id.signcode);
|
||||||
|
add_button = findViewById(R.id.add_button);
|
||||||
|
Log.println(Log.INFO,"userId",Long.toString(userId));
|
||||||
|
Log.println(Log.INFO,"courseId",Long.toString(courseId));
|
||||||
|
|
||||||
|
add_button.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
add_sign();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
void add_sign(){
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
Log.println(Log.ERROR,"jsontest","this is");
|
||||||
|
try {
|
||||||
|
jsonObject.put("courseName",courseName);
|
||||||
|
jsonObject.put("userId",userId);
|
||||||
|
jsonObject.put("courseId",courseId);
|
||||||
|
jsonObject.put("courseAddr",Addr.getText().toString());
|
||||||
|
jsonObject.put("beginTime",startTime);
|
||||||
|
jsonObject.put("endTime",terminalTime);
|
||||||
|
jsonObject.put("signCode",sign.getText().toString());
|
||||||
|
jsonObject.put("total",99);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"),String.valueOf(jsonObject));
|
||||||
|
Request request = new Request.Builder().url(Constans.ReqUrl+Constans.teacherinitiate)
|
||||||
|
.headers(Headers.of(map1))
|
||||||
|
.post(requestBody)
|
||||||
|
.build();
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,126 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.NetworkOnMainThreadException;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Headers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
public class Sign_inActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
private String signCode;
|
||||||
|
private EditText ed_sign,userSignId;
|
||||||
|
private Button bt_sign;
|
||||||
|
private final Callback callback=new okhttp3.Callback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call call, IOException e) {
|
||||||
|
Log.e("TAG", "Failed to connect server!");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call call, Response response) throws IOException {
|
||||||
|
if (response.isSuccessful()) {
|
||||||
|
final String body = response.body().string();
|
||||||
|
Log.println(Log.INFO, "OK", body);
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type jsonType = new TypeToken<BaseRespone<String>>() {}.getType();
|
||||||
|
BaseRespone<String> newUserResponse = gson.fromJson(body, jsonType);
|
||||||
|
int code = newUserResponse.getCode();
|
||||||
|
if (code==200){
|
||||||
|
Toast.makeText(getApplicationContext(),"签到成功",Toast.LENGTH_SHORT).show();
|
||||||
|
}else {
|
||||||
|
Toast.makeText(getApplicationContext(),"签到失败",Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
String msg = response.message();
|
||||||
|
int code = response.code();
|
||||||
|
Log.println(Log.ERROR, "error", String.valueOf(code) + " " + msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_sign_in);
|
||||||
|
Intent intent = getIntent();
|
||||||
|
userId = intent.getLongExtra("userId",0);
|
||||||
|
userSignId = findViewById(R.id.userSignId);
|
||||||
|
ed_sign = findViewById(R.id.Edit_Signcode);
|
||||||
|
bt_sign =findViewById(R.id.Bt_sign_in);
|
||||||
|
bt_sign.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
sign_in();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
void sign_in(){
|
||||||
|
new Thread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
HashMap<String,String> map1 = new HashMap<String,String>();
|
||||||
|
map1.put("Accept",Constans.Accept);
|
||||||
|
map1.put("Content-Type",Constans.Content_Type);
|
||||||
|
map1.put("appId",Constans.appId);
|
||||||
|
map1.put("appSecret",Constans.appSecret);
|
||||||
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
try {
|
||||||
|
jsonObject.put("signCode",ed_sign.getText().toString());
|
||||||
|
jsonObject.put("userId",userId);
|
||||||
|
jsonObject.put("userSignId",userSignId.getText().toString());
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"),String.valueOf(jsonObject));
|
||||||
|
Request request1 = new Request.Builder().url(Constans.ReqUrl+Constans.studentsign)
|
||||||
|
.headers(Headers.of(map1))
|
||||||
|
.post(requestBody)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
client.newCall(request1).enqueue(callback);
|
||||||
|
}catch (NetworkOnMainThreadException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.println(Log.ERROR,"error","error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class UserRequest {
|
||||||
|
private String username;
|
||||||
|
private String password;
|
||||||
|
private int roleId;
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String retvalue;
|
||||||
|
retvalue = "?"+"password="+password+"&username="+username;
|
||||||
|
return retvalue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toRegisterString(){
|
||||||
|
String retvalue;
|
||||||
|
retvalue = "?"+"password="+password+"&username="+username+"&roleId="+roleId;
|
||||||
|
return retvalue;
|
||||||
|
}
|
||||||
|
public int getRoleId() {
|
||||||
|
return roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleId(int roleId) {
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,133 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class Userinfo {
|
||||||
|
private long id;
|
||||||
|
private String appKey;
|
||||||
|
private String userName;
|
||||||
|
private String roleId;
|
||||||
|
private String realName;
|
||||||
|
private long idNumber;
|
||||||
|
private String collegeName;
|
||||||
|
private boolean gender=true;
|
||||||
|
private String phone;
|
||||||
|
private String email;
|
||||||
|
private String avatar;
|
||||||
|
private String inSchoolTime;
|
||||||
|
private String createTime;
|
||||||
|
private String lastUpdateTime;
|
||||||
|
|
||||||
|
public String getCollegeName() {
|
||||||
|
return collegeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollegeName(String collegeName) {
|
||||||
|
this.collegeName = collegeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isGender() {
|
||||||
|
return gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGender(boolean gender) {
|
||||||
|
this.gender = gender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getIdNumber() {
|
||||||
|
return idNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdNumber(long idNumber) {
|
||||||
|
this.idNumber = idNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRealName() {
|
||||||
|
return realName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRealName(String realName) {
|
||||||
|
this.realName = realName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoleId() {
|
||||||
|
return roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleId(String roleId) {
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAppKey() {
|
||||||
|
return appKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAppKey(String appKey) {
|
||||||
|
this.appKey = appKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(String avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInSchoolTime(String inSchoolTime) {
|
||||||
|
this.inSchoolTime = inSchoolTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastUpdateTime() {
|
||||||
|
return lastUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastUpdateTime(String lastUpdateTime) {
|
||||||
|
this.lastUpdateTime = lastUpdateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInSchoolTime() {
|
||||||
|
return inSchoolTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class record {
|
||||||
|
private int courseId;
|
||||||
|
private String courseName;
|
||||||
|
private String coursePhoto;
|
||||||
|
private String collegeName;
|
||||||
|
|
||||||
|
public int getCourseId() {
|
||||||
|
return courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseId(int courseId) {
|
||||||
|
this.courseId = courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCoursePhoto() {
|
||||||
|
return coursePhoto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoursePhoto(String coursePhoto) {
|
||||||
|
this.coursePhoto = coursePhoto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCollegeName() {
|
||||||
|
return collegeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollegeName(String collegeName) {
|
||||||
|
this.collegeName = collegeName;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
public class signInfo {
|
||||||
|
private String courseName;
|
||||||
|
private Long courseId;
|
||||||
|
private int courseNum;
|
||||||
|
|
||||||
|
public String getCourseName() {
|
||||||
|
return courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseName(String courseName) {
|
||||||
|
this.courseName = courseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCourseId() {
|
||||||
|
return courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseId(Long courseId) {
|
||||||
|
this.courseId = courseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCourseNum() {
|
||||||
|
return courseNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCourseNum(int courseNum) {
|
||||||
|
this.courseNum = courseNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -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>
|
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="12dp" android:tint="#A8A4B4"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="12dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||||
|
</vector>
|
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#636060"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
|
||||||
|
</vector>
|
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#CBD0D4"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z"/>
|
||||||
|
</vector>
|
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#6BB0E3"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" 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,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>
|
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,189 @@
|
|||||||
|
<?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:orientation="vertical"
|
||||||
|
tools:context=".CourseActivity">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:id="@+id/TvCalendar"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:textAlignment="gravity"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/divider1"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/TvCalendar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="@color/gray"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/diver2"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/divider1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/professor"
|
||||||
|
android:src="@drawable/teacher"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:src="@drawable/introduction"
|
||||||
|
android:id="@+id/introduction"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/member"
|
||||||
|
android:src="@drawable/member2"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"/>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/group"
|
||||||
|
android:src="@drawable/group1"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="48dp"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/diver2"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/pro_label"
|
||||||
|
android:text="教师"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/intro_label"
|
||||||
|
android:text="签到"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/mem_label"
|
||||||
|
android:text="成员"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/group_label"
|
||||||
|
android:text="分组"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dp"
|
||||||
|
android:background="@color/gray_light"
|
||||||
|
/>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="6"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/routine"
|
||||||
|
android:text="学习日志"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="30dp"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:id="@+id/LineLayout"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/routine"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="30dp">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sign"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:text="未签到"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/action"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/gray"
|
||||||
|
android:text="已签到"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<View
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/LineLayout"
|
||||||
|
android:id="@+id/div"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginHorizontal="16dp"
|
||||||
|
android:background="@color/gray"
|
||||||
|
/>
|
||||||
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
|
android:id="@+id/swipe_course"
|
||||||
|
android:layout_marginHorizontal="14dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/div"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp">
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/sign_lv"
|
||||||
|
android:layout_margin="14dp"
|
||||||
|
android:divider="@android:color/transparent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
/>
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,97 @@
|
|||||||
|
<?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=".Course_create_Activity">
|
||||||
|
<View
|
||||||
|
android:background="@color/gray_light"
|
||||||
|
android:id="@+id/head_course_create"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_weight="1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="80dp"/>
|
||||||
|
<TextView
|
||||||
|
android:text="课程名称"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:id="@+id/courseName_create_tv"
|
||||||
|
android:layout_marginVertical="24dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/head_course_create"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/courseName_create"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/courseName_create"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseName_create_tv"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="开课时间"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:id="@+id/courseStartTime_create_tv"
|
||||||
|
android:layout_marginVertical="24dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseName_create"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/courseStartTime_create"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseStartTime_create_tv"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="课程介绍"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:id="@+id/courseIntroduction_create_tv"
|
||||||
|
android:layout_marginVertical="24dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseStartTime_create"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/courseIntroduction_create"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseIntroduction_create_tv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="结课时间"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:id="@+id/courseEnd_create_tv"
|
||||||
|
android:layout_marginVertical="24dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseIntroduction_create"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/courseEnd_create"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseEnd_create_tv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<Button
|
||||||
|
android:id="@+id/Bt_course_create"
|
||||||
|
android:text="添加"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:layout_margin="48dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseEnd_create"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,116 @@
|
|||||||
|
<?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"
|
||||||
|
tools:context=".LoginActivity"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="108dp"
|
||||||
|
android:layout_height="108dp"
|
||||||
|
android:layout_centerInParent="true" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_marginVertical="6dp"
|
||||||
|
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
>
|
||||||
|
<ImageView
|
||||||
|
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/username"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginEnd="48dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:gravity="start"
|
||||||
|
android:hint="Email/Account"
|
||||||
|
android:inputType="text"
|
||||||
|
android:maxLines="1" />
|
||||||
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
|
||||||
|
android:layout_marginVertical="6dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp">
|
||||||
|
<ImageView
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/passwd"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginEnd="48dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:autofillHints="password"
|
||||||
|
android:hint="Password"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textAlignment="textStart" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/pwd_switch"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginBottom="6dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
|
||||||
|
android:layout_weight="3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/RememberPwd"
|
||||||
|
android:text="记住密码"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<Button
|
||||||
|
android:id="@+id/login_button"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginEnd="32dp"
|
||||||
|
android:text="登录" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/register"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:text="注册用户"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,113 @@
|
|||||||
|
<?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=".MainActivity">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/header_title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
>
|
||||||
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
android:id="@+id/myToolbar"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<ImageView
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:src="@drawable/personal"
|
||||||
|
android:id="@+id/head_image"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_width="44dp"
|
||||||
|
android:layout_height="44dp"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/body"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/header_title"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/nevigation_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:text="所有课程"
|
||||||
|
android:editable="true"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:id="@+id/all"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
|
||||||
|
android:text="我教的课"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:id="@+id/teaching"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/all"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/study"
|
||||||
|
android:text="我听的课"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:layout_width="100dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/teaching"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
|
android:id="@+id/swipe"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/study"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp">
|
||||||
|
<ListView
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:id="@+id/lv_course"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:layout_margin="14dp"
|
||||||
|
android:divider="@android:color/transparent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp">
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/nevigation_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,189 @@
|
|||||||
|
<?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=".Modifyactivity">
|
||||||
|
<View
|
||||||
|
android:background="@color/gray_light"
|
||||||
|
android:id="@+id/header_modify"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_weight="1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="80dp"/>
|
||||||
|
<TextView
|
||||||
|
android:text="真实姓名"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/tv_realName_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/header_modify"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/ed_realName_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_userName_modify"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="用户名"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:id="@+id/tv_userName_modify"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/tv_realName_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/header_modify"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginEnd="72dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:id="@+id/ed_userName_modify"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/ed_realName_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_userName_modify"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="性别"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginStart="72dp"
|
||||||
|
android:id="@+id/tv_gender_modify"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ed_userName_modify"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:text="男"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginStart="72dp"
|
||||||
|
android:id="@+id/ed_gender_modify"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_gender_modify"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="学/工号"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:id="@+id/tv_idNumber_modify"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/tv_gender_modify"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/tv_gender_modify"
|
||||||
|
app:layout_constraintBaseline_toBaselineOf="@+id/tv_gender_modify"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:id="@+id/ed_idNumber_modify"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/ed_gender_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_idNumber_modify"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="入学时间"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/tv_inSchoolTime_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ed_idNumber_modify"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/ed_inSchoolTime_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_inSchoolTime_modify"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="手机号码"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/tv_phone_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ed_inSchoolTime_modify"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/ed_phone_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_phone_modify"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="院校名称"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/college_Name"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ed_phone_modify"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/ed_college_Name_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/college_Name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="邮箱"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/email_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ed_college_Name_modify"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/ed_email_modify"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/email_modify"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_modify"
|
||||||
|
android:text="修改"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ed_email_modify"
|
||||||
|
android:layout_marginHorizontal="108dp"
|
||||||
|
android:layout_marginVertical="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,37 @@
|
|||||||
|
<?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=".Participate_in_Activity">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/Text_courseId"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:text="请输入课程ID"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/Edit_courseid"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:id="@+id/Edit_courseid"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<Button
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/Edit_courseid"
|
||||||
|
android:layout_marginTop="48dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:text="加入课程"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:id="@+id/Bt_participate_in"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,36 @@
|
|||||||
|
<?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=".QuitCourse_Activity">
|
||||||
|
<TextView
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/Text_courseId_quit"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:text="请输入课程ID"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/Edit_courseid_quit"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:id="@+id/Edit_courseid_quit"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<Button
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/Edit_courseid_quit"
|
||||||
|
android:layout_marginTop="48dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:text="退出课程"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:id="@+id/Bt_quit_out"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,108 @@
|
|||||||
|
<?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:orientation="vertical"
|
||||||
|
tools:context=".RegisterActivity">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/userTv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginTop="40dp"
|
||||||
|
android:text="Username"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/user_register"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"></TextView>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/user_register"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:layout_marginEnd="48dp"
|
||||||
|
android:inputType="text"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/userTv"></EditText>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/PwsTv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="Password"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/user_register" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/Pwd_register"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:layout_marginEnd="48dp"
|
||||||
|
android:inputType="text"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/PwsTv" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/roleTv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="Role(Student/Teacher)"
|
||||||
|
android:textSize="18sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/Pwd_register" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/Role_register"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_marginStart="48dp"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:layout_marginEnd="48dp"
|
||||||
|
android:inputType="text"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/roleTv" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_register"
|
||||||
|
android:layout_marginStart="60dp"
|
||||||
|
android:layout_marginEnd="60dp"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:text="注册"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,97 @@
|
|||||||
|
<?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=".Sign_CreateActivity">
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:background="@color/gray_light"
|
||||||
|
android:id="@+id/head"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/tv_beginTime"
|
||||||
|
app:layout_constraintVertical_weight="1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="80dp"/>
|
||||||
|
<TextView
|
||||||
|
android:text="签到开始时间"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:labelFor="@+id/beginTime"
|
||||||
|
android:id="@+id/tv_beginTime"
|
||||||
|
android:layout_marginVertical="24dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/head"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/beginTime"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_beginTime"
|
||||||
|
android:layout_marginVertical="8dp"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="上课地点"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:id="@+id/tv_courseAddr"
|
||||||
|
android:layout_marginVertical="4dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/beginTime"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_courseAddr"
|
||||||
|
android:id="@+id/courseAddr"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="签到结束时间"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/courseAddr"
|
||||||
|
android:id="@+id/tv_endtime"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_endtime"
|
||||||
|
android:id="@+id/ed_endtime"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:text="签到码"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/ed_endtime"
|
||||||
|
android:id="@+id/tv_sign"
|
||||||
|
android:layout_marginVertical="4dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_sign"
|
||||||
|
android:id="@+id/signcode"
|
||||||
|
android:layout_marginVertical="8dp"
|
||||||
|
android:layout_marginHorizontal="48dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/add_button"
|
||||||
|
android:text="添加"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="20sp"
|
||||||
|
android:layout_margin="48dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/signcode"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,52 @@
|
|||||||
|
<?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=".Sign_inActivity">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_userSignId"
|
||||||
|
android:text="请输入签到ID"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:layout_margin="12dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/userSignId"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/userSignId"
|
||||||
|
android:textAlignment="center"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/Text_courseId"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:id="@+id/Text_courseId"
|
||||||
|
android:layout_marginVertical="12dp"
|
||||||
|
android:text="请输入签到码"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/Edit_Signcode"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<EditText
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:id="@+id/Edit_Signcode"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<Button
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/Edit_Signcode"
|
||||||
|
android:layout_marginTop="48dp"
|
||||||
|
android:layout_marginHorizontal="72dp"
|
||||||
|
android:text="签到"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:id="@+id/Bt_sign_in"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"></androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
app:layout_constraintCircleRadius="12dp"
|
||||||
|
android:layout_marginHorizontal="12dp"
|
||||||
|
android:layout_marginVertical="8dp"
|
||||||
|
android:background="@color/cardview_shadow_start_color"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:id="@+id/name_course"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginVertical="16dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:id="@+id/college"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="24dp"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_marginHorizontal="12dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/id_course"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/id_course"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<TextView
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:id="@+id/id_course"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:layout_width="108dp"
|
||||||
|
android:layout_height="24dp"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".PersonalInfomation">
|
||||||
|
|
||||||
|
<!-- TODO: Update blank fragment layout -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:text="@string/hello_blank_fragment" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
app:layout_constraintCircleRadius="12dp"
|
||||||
|
android:layout_marginHorizontal="12dp"
|
||||||
|
android:layout_marginVertical="8dp"
|
||||||
|
android:background="@color/cardview_shadow_start_color"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="96dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:id="@+id/name_course"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_marginHorizontal="24dp"
|
||||||
|
android:layout_marginVertical="16dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:id="@+id/college"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:layout_width="108dp"
|
||||||
|
android:layout_height="24dp"/>
|
||||||
|
<TextView
|
||||||
|
app:layout_constraintStart_toEndOf="@id/college"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:id="@+id/id_course"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:layout_width="108dp"
|
||||||
|
android:layout_height="24dp"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
|
||||||
|
<item android:title="加入课程"
|
||||||
|
android:id="@+id/participate"
|
||||||
|
/>
|
||||||
|
<item android:id="@+id/create"
|
||||||
|
android:title="创建课程"/>
|
||||||
|
<item android:id="@+id/drop"
|
||||||
|
android:title="退出课程"/>
|
||||||
|
</menu>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?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" />
|
||||||
|
</adaptive-icon>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?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" />
|
||||||
|
</adaptive-icon>
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.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,16 @@
|
|||||||
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="Theme.COURCE" 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" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
</style>
|
||||||
|
</resources>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?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="gray">#FFBBBCBF</color>
|
||||||
|
<color name="gray_light">#FFE0DBDB</color>
|
||||||
|
</resources>
|
@ -0,0 +1,9 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">COURCE</string>
|
||||||
|
<!-- TODO: Remove or change this placeholder text -->
|
||||||
|
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||||
|
<string name="shared_preferences_file_name">sp_login</string>
|
||||||
|
<string name="login_account_name">login_account_name</string>
|
||||||
|
<string name="login_password">login_password</string>
|
||||||
|
<string name="login_remember_password">login_remember_password</string>
|
||||||
|
</resources>
|
@ -0,0 +1,16 @@
|
|||||||
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="Theme.COURCE" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||||
|
<!-- Primary brand color. -->
|
||||||
|
<item name="colorPrimary">@color/purple_500</item>
|
||||||
|
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||||
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
|
<!-- Secondary brand color. -->
|
||||||
|
<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" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
</style>
|
||||||
|
</resources>
|
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config>
|
||||||
|
<base-config cleartextTrafficPermitted="true"/>
|
||||||
|
</network-security-config>
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.example.cource;
|
||||||
|
|
||||||
|
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,9 @@
|
|||||||
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
plugins {
|
||||||
|
id 'com.android.application' version '7.1.3' apply false
|
||||||
|
id 'com.android.library' version '7.1.3' apply false
|
||||||
|
}
|
||||||
|
|
||||||
|
task clean(type: Delete) {
|
||||||
|
delete rootProject.buildDir
|
||||||
|
}
|
@ -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 @@
|
|||||||
|
#Sat Jun 11 18:04:47 CST 2022
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
@ -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,16 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rootProject.name = "COURCE"
|
||||||
|
include ':app'
|