Commit 9d5f373a0a66e038a8e242174e862d3df5b52016
1 parent
b9c422a7c5
Exists in
master
家长端APP功能完成
Showing
67 changed files
with
3586 additions
and
1447 deletions
Show diff stats
app/build.gradle
| ... | ... | @@ -8,6 +8,17 @@ def url = rootProject.ext.url |
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | android { |
| 11 | + signingConfigs { | |
| 12 | + | |
| 13 | + config { | |
| 14 | + keyAlias 'alias' | |
| 15 | + keyPassword '123456' | |
| 16 | + storeFile file('key.jks') | |
| 17 | + storePassword '123456' | |
| 18 | + } | |
| 19 | + debug { | |
| 20 | + } | |
| 21 | + } | |
| 11 | 22 | compileSdk 32 |
| 12 | 23 | |
| 13 | 24 | defaultConfig { |
| ... | ... | @@ -20,12 +31,28 @@ android { |
| 20 | 31 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
| 21 | 32 | } |
| 22 | 33 | |
| 34 | + android.applicationVariants.all { | |
| 35 | + variant -> | |
| 36 | + variant.outputs.all { | |
| 37 | + //在这里修改apk文件名 | |
| 38 | + outputFileName = "parent-${variant.name}-v${variant.versionName}.apk" | |
| 39 | + } | |
| 40 | + } | |
| 23 | 41 | buildTypes { |
| 42 | + debug { | |
| 43 | + minifyEnabled false | |
| 44 | + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | |
| 45 | + } | |
| 24 | 46 | release { |
| 25 | 47 | minifyEnabled false |
| 26 | 48 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| 49 | + signingConfig signingConfigs.config | |
| 27 | 50 | } |
| 28 | 51 | } |
| 52 | + lintOptions { | |
| 53 | + checkReleaseBuilds false | |
| 54 | + abortOnError false | |
| 55 | + } | |
| 29 | 56 | compileOptions { |
| 30 | 57 | sourceCompatibility JavaVersion.VERSION_1_8 |
| 31 | 58 | targetCompatibility JavaVersion.VERSION_1_8 |
| ... | ... | @@ -38,5 +65,5 @@ dependencies { |
| 38 | 65 | implementation 'androidx.appcompat:appcompat:1.5.1' |
| 39 | 66 | implementation 'com.google.android.material:material:1.6.1' |
| 40 | 67 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' |
| 41 | - | |
| 68 | + implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50' | |
| 42 | 69 | } |
| 43 | 70 | \ No newline at end of file | ... | ... |
app/key.jks
No preview for this file type
app/src/main/AndroidManifest.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:tools="http://schemas.android.com/tools" | |
| 3 | 4 | package="com.hjx.parent"> |
| 4 | 5 | |
| 5 | 6 | |
| ... | ... | @@ -22,50 +23,76 @@ |
| 22 | 23 | <uses-permission android:name="android.permission.VIBRATE" /> |
| 23 | 24 | |
| 24 | 25 | <application |
| 26 | + android:name=".MyApplication" | |
| 25 | 27 | android:allowBackup="true" |
| 26 | 28 | android:icon="@mipmap/icon" |
| 27 | 29 | android:label="@string/app_name" |
| 28 | 30 | android:supportsRtl="true" |
| 29 | - android:theme="@style/Theme.Parent" | |
| 30 | - android:name=".MyApplication" | |
| 31 | - > | |
| 31 | + android:theme="@style/Theme.Parent"> | |
| 32 | 32 | <activity |
| 33 | 33 | android:name=".LoginActivity" |
| 34 | - android:theme="@style/ThemeSplash" | |
| 35 | - android:exported="true"> | |
| 34 | + android:exported="true" | |
| 35 | + android:theme="@style/ThemeSplash"> | |
| 36 | 36 | <intent-filter> |
| 37 | 37 | <action android:name="android.intent.action.MAIN" /> |
| 38 | 38 | <category android:name="android.intent.category.LAUNCHER" /> |
| 39 | 39 | </intent-filter> |
| 40 | 40 | </activity> |
| 41 | - <activity android:name=".MainActivity" | |
| 42 | - android:theme="@style/Theme.AppCompat.NoActionBar" | |
| 43 | - /> | |
| 44 | - <activity android:name=".RegisterActivity" | |
| 45 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 46 | - <activity android:name=".UserActivity" | |
| 47 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 48 | - <activity android:name=".YinsiActivity" | |
| 49 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 50 | - <activity android:name=".QRActivity" | |
| 51 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 52 | - <activity android:name=".AddStudentActivity" | |
| 53 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 54 | - <activity android:name=".NickActivity" | |
| 55 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 56 | - <activity android:name=".SexActivity" | |
| 57 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 58 | - <activity android:name=".NianActivity" | |
| 59 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 60 | - <activity android:name=".ShenActivity" | |
| 61 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 62 | - <activity android:name=".AccountActivity" | |
| 63 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 64 | - | |
| 65 | - <activity android:name=".ChangePwdActivity" | |
| 66 | - android:theme="@style/Theme.AppCompat.NoActionBar"/> | |
| 41 | + <activity | |
| 42 | + android:name=".MainActivity" | |
| 43 | + android:launchMode="singleTask" | |
| 44 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 45 | + <activity | |
| 46 | + android:name=".RegisterActivity" | |
| 47 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 48 | + <activity | |
| 49 | + android:name=".UserActivity" | |
| 50 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 51 | + <activity | |
| 52 | + android:name=".YinsiActivity" | |
| 53 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 54 | + <activity | |
| 55 | + android:name=".QRActivity" | |
| 56 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 57 | + <activity | |
| 58 | + android:name=".AddStudentActivity" | |
| 59 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 60 | + <activity | |
| 61 | + android:name=".NickActivity" | |
| 62 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 63 | + <activity | |
| 64 | + android:name=".SexActivity" | |
| 65 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 66 | + <activity | |
| 67 | + android:name=".NianActivity" | |
| 68 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 69 | + <activity | |
| 70 | + android:name=".ShenActivity" | |
| 71 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 72 | + <activity | |
| 73 | + android:name=".AccountActivity" | |
| 74 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 67 | 75 | |
| 76 | + <activity | |
| 77 | + android:name=".ChangePwdActivity" | |
| 78 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 79 | + <activity | |
| 80 | + android:name=".EditStudentActivity" | |
| 81 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 82 | + <activity | |
| 83 | + android:name=".ChooseActivity" | |
| 84 | + android:theme="@style/Theme.AppCompat.NoActionBar" /> | |
| 68 | 85 | |
| 86 | + <provider | |
| 87 | + android:name="androidx.core.content.FileProvider" | |
| 88 | + android:authorities="com.hjx.parent.fileprovider" | |
| 89 | + android:exported="false" | |
| 90 | + android:grantUriPermissions="true"> | |
| 91 | + <meta-data | |
| 92 | + android:name="android.support.FILE_PROVIDER_PATHS" | |
| 93 | + android:resource="@xml/file_provider_paths" | |
| 94 | + tools:replace="android:resource" /> | |
| 95 | + </provider> | |
| 69 | 96 | </application> |
| 70 | 97 | |
| 71 | 98 | </manifest> |
| 72 | 99 | \ No newline at end of file | ... | ... |
app/src/main/java/com/hjx/parent/AccountActivity.java
| 1 | 1 | package com.hjx.parent; |
| 2 | 2 | |
| 3 | +import android.app.AlertDialog; | |
| 4 | +import android.content.DialogInterface; | |
| 5 | +import android.content.Intent; | |
| 6 | +import android.graphics.Bitmap; | |
| 7 | +import android.net.NetworkRequest; | |
| 8 | +import android.net.Uri; | |
| 9 | +import android.os.Build; | |
| 10 | +import android.os.Bundle; | |
| 11 | +import android.os.Environment; | |
| 12 | +import android.provider.MediaStore; | |
| 13 | +import android.text.TextUtils; | |
| 14 | +import android.util.Log; | |
| 15 | +import android.view.LayoutInflater; | |
| 16 | +import android.view.View; | |
| 17 | +import android.widget.ImageView; | |
| 3 | 18 | import android.widget.TextView; |
| 19 | +import android.widget.Toast; | |
| 4 | 20 | |
| 21 | +import androidx.core.content.FileProvider; | |
| 22 | + | |
| 23 | +import com.bumptech.glide.Glide; | |
| 24 | +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | |
| 25 | +import com.bumptech.glide.request.RequestOptions; | |
| 26 | +import com.google.android.material.bottomsheet.BottomSheetDialog; | |
| 5 | 27 | import com.prws.common.base.BaseActivity; |
| 6 | 28 | import com.prws.common.base.BasePresenter; |
| 29 | +import com.prws.common.bean.ResponseResult; | |
| 30 | +import com.prws.common.net.NetWorks; | |
| 31 | +import com.prws.common.utils.LogUtil; | |
| 32 | +import com.prws.common.utils.ScreenUtils; | |
| 7 | 33 | import com.prws.common.utils.SharedPreferencesUtil; |
| 8 | 34 | |
| 35 | +import org.json.JSONObject; | |
| 36 | + | |
| 37 | +import java.io.File; | |
| 38 | +import java.io.FileOutputStream; | |
| 39 | +import java.io.IOException; | |
| 40 | +import java.util.HashMap; | |
| 41 | +import java.util.Map; | |
| 42 | + | |
| 43 | +import butterknife.BindView; | |
| 44 | +import butterknife.OnClick; | |
| 45 | +import io.reactivex.Observer; | |
| 46 | +import io.reactivex.disposables.Disposable; | |
| 47 | +import okhttp3.ResponseBody; | |
| 48 | + | |
| 9 | 49 | public class AccountActivity extends BaseActivity { |
| 10 | 50 | |
| 51 | + | |
| 11 | 52 | @Override |
| 12 | 53 | protected int layoutResId() { |
| 13 | 54 | return R.layout.activity_setac; |
| ... | ... | @@ -23,12 +64,25 @@ public class AccountActivity extends BaseActivity { |
| 23 | 64 | return null; |
| 24 | 65 | } |
| 25 | 66 | |
| 26 | - | |
| 67 | + private static int CAMERA_REQUEST_CODE = 343; | |
| 68 | + private static int ALBUM_REQUEST_CODE = 456; | |
| 69 | + private static int CROP_REQUEST_CODE = 234; | |
| 70 | + private File tempFile; | |
| 71 | + private String path; | |
| 27 | 72 | TextView tv_6; |
| 73 | + @BindView(R.id.iv_3) | |
| 74 | + ImageView iv_3; | |
| 75 | + | |
| 28 | 76 | @Override |
| 29 | 77 | protected void initView() { |
| 30 | 78 | tv_6 = findViewById(R.id.tv_6); |
| 31 | 79 | String phone = (String) SharedPreferencesUtil.getData("phone", ""); |
| 80 | + String photo = (String) SharedPreferencesUtil.getData("photo", ""); | |
| 81 | + if(!TextUtils.isEmpty(photo)){ | |
| 82 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AccountActivity.this, 45)); | |
| 83 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 84 | + Glide.with(AccountActivity.this).load(photo).apply(options).into(iv_3); | |
| 85 | + } | |
| 32 | 86 | if (phone != null && phone.length() > 0) |
| 33 | 87 | tv_6.setText(phone); |
| 34 | 88 | } |
| ... | ... | @@ -36,7 +90,6 @@ public class AccountActivity extends BaseActivity { |
| 36 | 90 | @Override |
| 37 | 91 | protected void initListener() { |
| 38 | 92 | findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); |
| 39 | - | |
| 40 | 93 | findViewById(R.id.tv_7).setOnClickListener(view -> startActivity(ChangePwdActivity.class)); |
| 41 | 94 | } |
| 42 | 95 | |
| ... | ... | @@ -49,4 +102,235 @@ public class AccountActivity extends BaseActivity { |
| 49 | 102 | public void onNetChanged(int netWorkState) { |
| 50 | 103 | |
| 51 | 104 | } |
| 105 | + | |
| 106 | + private void uploadAvatar(File file) { | |
| 107 | + | |
| 108 | + NetWorks.uploadAvatar(file, new Observer<ResponseResult<Map<String, String>>>() { | |
| 109 | + @Override | |
| 110 | + public void onSubscribe(Disposable d) { | |
| 111 | + | |
| 112 | + } | |
| 113 | + | |
| 114 | + @Override | |
| 115 | + public void onNext(ResponseResult<Map<String, String>> responseBody) { | |
| 116 | + if (responseBody.getData() != null && responseBody.getCode() == 200) { | |
| 117 | + path = responseBody.getData().get("imageUrl"); | |
| 118 | + editUser(path); | |
| 119 | + } | |
| 120 | + } | |
| 121 | + | |
| 122 | + @Override | |
| 123 | + public void onError(Throwable e) { | |
| 124 | + e.toString(); | |
| 125 | + } | |
| 126 | + | |
| 127 | + @Override | |
| 128 | + public void onComplete() { | |
| 129 | + | |
| 130 | + } | |
| 131 | + }); | |
| 132 | + } | |
| 133 | + | |
| 134 | + public void editUser(String path) { | |
| 135 | + Map map = new HashMap(); | |
| 136 | + map.put("userId", SharedPreferencesUtil.getData("userId", "")); | |
| 137 | + map.put("photo", path); | |
| 138 | + | |
| 139 | + NetWorks.editUser(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { | |
| 140 | + @Override | |
| 141 | + public void onSubscribe(Disposable d) { | |
| 142 | + | |
| 143 | + } | |
| 144 | + | |
| 145 | + @Override | |
| 146 | + public void onNext(ResponseBody responseBody) { | |
| 147 | + try { | |
| 148 | + String str = responseBody.string().toString(); | |
| 149 | + LogUtil.e(TAG, "----" + str); | |
| 150 | + JSONObject jo = new JSONObject(str); | |
| 151 | + boolean isSucceed = jo.getBoolean("success"); | |
| 152 | + if (isSucceed) { | |
| 153 | + SharedPreferencesUtil.putData("photo", path); | |
| 154 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(AccountActivity.this, 45)); | |
| 155 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 156 | + Glide.with(AccountActivity.this).load(path).apply(options).into(iv_3); | |
| 157 | + Toast.makeText(AccountActivity.this, "修改成功", Toast.LENGTH_SHORT).show(); | |
| 158 | + } else { | |
| 159 | + Toast.makeText(AccountActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); | |
| 160 | + } | |
| 161 | + } catch (Exception e) { | |
| 162 | + e.printStackTrace(); | |
| 163 | + Toast.makeText(AccountActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); | |
| 164 | + } | |
| 165 | + } | |
| 166 | + | |
| 167 | + @Override | |
| 168 | + public void onError(Throwable e) { | |
| 169 | + | |
| 170 | + } | |
| 171 | + | |
| 172 | + @Override | |
| 173 | + public void onComplete() { | |
| 174 | + | |
| 175 | + } | |
| 176 | + }); | |
| 177 | + } | |
| 178 | + | |
| 179 | + public File saveImage(String name, Bitmap bmp) { | |
| 180 | + File appDir = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES).getPath()); | |
| 181 | + if (!appDir.exists()) { | |
| 182 | + appDir.mkdir(); | |
| 183 | + } | |
| 184 | + String fileName = name + ".jpg"; | |
| 185 | + File file = new File(appDir, fileName); | |
| 186 | + try { | |
| 187 | + FileOutputStream fos = new FileOutputStream(file); | |
| 188 | + bmp.compress(Bitmap.CompressFormat.PNG, 100, fos); | |
| 189 | + fos.flush(); | |
| 190 | + fos.close(); | |
| 191 | + return file; | |
| 192 | + } catch (IOException e) { | |
| 193 | + Log.d("dsadsadsa", e.getLocalizedMessage()); | |
| 194 | + e.printStackTrace(); | |
| 195 | + } | |
| 196 | + return null; | |
| 197 | + } | |
| 198 | + | |
| 199 | + @Override | |
| 200 | + protected void onActivityResult(int requestCode, int resultCode, Intent intent) { | |
| 201 | + super.onActivityResult(requestCode, resultCode, intent); | |
| 202 | + if (requestCode == CAMERA_REQUEST_CODE) { | |
| 203 | + if (resultCode == RESULT_OK) { | |
| 204 | + //用相机返回的照片去调用剪裁也需要对Uri进行处理 | |
| 205 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
| 206 | + Uri contentUri = FileProvider.getUriForFile(this, | |
| 207 | + this.getPackageName() + ".fileprovider", tempFile); | |
| 208 | + cropPhoto(contentUri); | |
| 209 | + } else { | |
| 210 | + cropPhoto(Uri.fromFile(tempFile)); | |
| 211 | + } | |
| 212 | + } | |
| 213 | + } else if (requestCode == ALBUM_REQUEST_CODE) { | |
| 214 | + if (resultCode == RESULT_OK) { | |
| 215 | + Uri uri = intent.getData(); | |
| 216 | + cropPhoto(uri); | |
| 217 | + } | |
| 218 | + } else if (requestCode == CROP_REQUEST_CODE) { | |
| 219 | + if (intent == null) { | |
| 220 | + return; | |
| 221 | + } | |
| 222 | + Bundle bundle = intent.getExtras(); | |
| 223 | + if (bundle != null) { | |
| 224 | + //在这里获得了剪裁后的Bitmap对象,可以用于上传 | |
| 225 | + Bitmap image = bundle.getParcelable("data"); | |
| 226 | + //设置到ImageView上 | |
| 227 | + //也可以进行一些保存、压缩等操作后上传 | |
| 228 | + File file = saveImage("head_output", image); | |
| 229 | + uploadAvatar(file); | |
| 230 | + // Log.d("dsadsadsa",path); | |
| 231 | + } | |
| 232 | + } | |
| 233 | + } | |
| 234 | + | |
| 235 | + private void getPicFromCamera() { | |
| 236 | + //用于保存调用相机拍照后所生成的文件 | |
| 237 | + tempFile = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg"); | |
| 238 | + //跳转到调用系统相机 | |
| 239 | + Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
| 240 | + //判断版本 | |
| 241 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //如果在Android7.0以上,使用FileProvider获取Uri | |
| 242 | + intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); | |
| 243 | + Uri contentUri = FileProvider.getUriForFile(this, | |
| 244 | + this.getPackageName() + ".fileprovider", tempFile); | |
| 245 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri); | |
| 246 | + } else { //否则使用Uri.fromFile(file)方法获取Uri | |
| 247 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile)); | |
| 248 | + } | |
| 249 | + startActivityForResult(intent, CAMERA_REQUEST_CODE); | |
| 250 | + } | |
| 251 | + | |
| 252 | + private void cropPhoto(Uri uri) { | |
| 253 | + Uri contentUri = Uri.fromFile(new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg")); | |
| 254 | + Intent intent = new Intent("com.android.camera.action.CROP"); | |
| 255 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
| 256 | + //Android 7.0需要临时添加读取Url的权限, 添加此属性是为了解决:调用裁剪框时候提示:图片无法加载或者加载图片失败或者无法加载此图片 | |
| 257 | + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | |
| 258 | + } | |
| 259 | + intent.setDataAndType(uri, "image/*"); | |
| 260 | + intent.putExtra("crop", "true");//发送裁剪信号,去掉也能进行裁剪 | |
| 261 | + intent.putExtra("scale", true);// 设置缩放 | |
| 262 | + intent.putExtra("scaleUpIfNeeded", true);// 去黑边 | |
| 263 | + intent.putExtra("aspectX", 1); | |
| 264 | + intent.putExtra("aspectY", 1); | |
| 265 | + //上述两个属性控制裁剪框的缩放比例。 | |
| 266 | + //当用户用手拉伸裁剪框时候,裁剪框会按照上述比例缩放。 | |
| 267 | + intent.putExtra("outputX", 300);//属性控制裁剪完毕,保存的图片的大小格式。 | |
| 268 | + intent.putExtra("outputY", 300);//你按照1:1的比例来裁剪的,如果最后成像是800*400,那么按照2:1的样式保存, | |
| 269 | + intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());//输出裁剪文件的格式 | |
| 270 | + intent.putExtra("return-data", true);//是否返回裁剪后图片的Bitmap | |
| 271 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri);//设置输出路径 | |
| 272 | + startActivityForResult(intent, CROP_REQUEST_CODE); | |
| 273 | + } | |
| 274 | + | |
| 275 | + /** | |
| 276 | + * 从相册获取图片 | |
| 277 | + */ | |
| 278 | + private void getPicFromAlbm() { | |
| 279 | + Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); | |
| 280 | + photoPickerIntent.setType("image/*"); | |
| 281 | + startActivityForResult(photoPickerIntent, ALBUM_REQUEST_CODE); | |
| 282 | + } | |
| 283 | + | |
| 284 | + @OnClick(R.id.iv_3) | |
| 285 | + public void showButtonDialog(View view) { | |
| 286 | + BottomSheetDialog dialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | |
| 287 | + View bottomView = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_layout, null); | |
| 288 | + dialog.setContentView(bottomView); | |
| 289 | + bottomView.findViewById(R.id.take_photo).setOnClickListener(new View.OnClickListener() { | |
| 290 | + @Override | |
| 291 | + public void onClick(View view) { | |
| 292 | + dialog.dismiss(); | |
| 293 | + getPicFromCamera(); | |
| 294 | + } | |
| 295 | + }); | |
| 296 | + bottomView.findViewById(R.id.choose_photo).setOnClickListener(new View.OnClickListener() { | |
| 297 | + @Override | |
| 298 | + public void onClick(View view) { | |
| 299 | + dialog.dismiss(); | |
| 300 | + getPicFromAlbm(); | |
| 301 | + } | |
| 302 | + }); | |
| 303 | + bottomView.findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() { | |
| 304 | + @Override | |
| 305 | + public void onClick(View view) { | |
| 306 | + dialog.dismiss(); | |
| 307 | + } | |
| 308 | + }); | |
| 309 | + dialog.show(); | |
| 310 | + } | |
| 311 | + | |
| 312 | + @OnClick(R.id.logout) | |
| 313 | + public void logout(View view) { | |
| 314 | + AlertDialog.Builder builder = new AlertDialog.Builder(this, android.R.style.Theme_DeviceDefault_Light_Dialog_Alert); | |
| 315 | + builder.setTitle("温馨提示"); | |
| 316 | + builder.setMessage("是否退出登录?"); | |
| 317 | + builder.setCancelable(false); | |
| 318 | + builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { | |
| 319 | + @Override | |
| 320 | + public void onClick(DialogInterface dialogInterface, int i) { | |
| 321 | + dialogInterface.dismiss(); | |
| 322 | + } | |
| 323 | + }); | |
| 324 | + builder.setPositiveButton("确认", new DialogInterface.OnClickListener() { | |
| 325 | + @Override | |
| 326 | + public void onClick(DialogInterface dialogInterface, int i) { | |
| 327 | + SharedPreferencesUtil.clear(AccountActivity.this); | |
| 328 | + dialogInterface.dismiss(); | |
| 329 | + setResult(1001); | |
| 330 | + finish(); | |
| 331 | + } | |
| 332 | + }); | |
| 333 | + builder.show(); | |
| 334 | + } | |
| 335 | + | |
| 52 | 336 | } |
| 53 | 337 | \ No newline at end of file | ... | ... |
app/src/main/java/com/hjx/parent/AddStudentActivity.java
| 1 | 1 | package com.hjx.parent; |
| 2 | 2 | |
| 3 | +import android.content.Intent; | |
| 4 | +import android.graphics.Bitmap; | |
| 3 | 5 | import android.graphics.Color; |
| 6 | +import android.net.Uri; | |
| 7 | +import android.os.Build; | |
| 8 | +import android.os.Bundle; | |
| 9 | +import android.os.Environment; | |
| 10 | +import android.provider.MediaStore; | |
| 11 | +import android.util.Log; | |
| 12 | +import android.view.LayoutInflater; | |
| 4 | 13 | import android.view.View; |
| 5 | 14 | import android.widget.Button; |
| 15 | +import android.widget.ImageView; | |
| 6 | 16 | import android.widget.TextView; |
| 7 | 17 | import android.widget.Toast; |
| 8 | 18 | |
| 19 | +import androidx.core.content.FileProvider; | |
| 20 | + | |
| 21 | +import com.bumptech.glide.Glide; | |
| 22 | +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | |
| 23 | +import com.bumptech.glide.request.RequestOptions; | |
| 24 | +import com.google.android.material.bottomsheet.BottomSheetDialog; | |
| 9 | 25 | import com.prws.common.base.BaseActivity; |
| 10 | 26 | import com.prws.common.base.BasePresenter; |
| 27 | +import com.prws.common.bean.ResponseResult; | |
| 11 | 28 | import com.prws.common.net.NetWorks; |
| 12 | 29 | import com.prws.common.utils.LogUtil; |
| 30 | +import com.prws.common.utils.ScreenUtils; | |
| 13 | 31 | import com.prws.common.utils.SharedPreferencesUtil; |
| 14 | 32 | |
| 15 | 33 | import org.json.JSONObject; |
| 16 | 34 | |
| 35 | +import java.io.File; | |
| 36 | +import java.io.FileOutputStream; | |
| 37 | +import java.io.IOException; | |
| 17 | 38 | import java.util.HashMap; |
| 18 | 39 | import java.util.Map; |
| 19 | 40 | |
| 41 | +import butterknife.BindView; | |
| 42 | +import butterknife.OnClick; | |
| 20 | 43 | import io.reactivex.Observer; |
| 21 | 44 | import io.reactivex.disposables.Disposable; |
| 22 | 45 | import okhttp3.ResponseBody; |
| ... | ... | @@ -43,6 +66,8 @@ public class AddStudentActivity extends BaseActivity { |
| 43 | 66 | View view_5; |
| 44 | 67 | Button btn_next; |
| 45 | 68 | TextView tv_name, tv_sex, tv_nian, tv_shen; |
| 69 | + @BindView(R.id.iv_avatar) | |
| 70 | + ImageView iv_avatar; | |
| 46 | 71 | |
| 47 | 72 | @Override |
| 48 | 73 | protected void initView() { |
| ... | ... | @@ -54,8 +79,6 @@ public class AddStudentActivity extends BaseActivity { |
| 54 | 79 | tv_sex = findViewById(R.id.tv_sex); |
| 55 | 80 | tv_nian = findViewById(R.id.tv_nian); |
| 56 | 81 | tv_shen = findViewById(R.id.tv_shen); |
| 57 | - | |
| 58 | - | |
| 59 | 82 | btn_next = findViewById(R.id.btn_next); |
| 60 | 83 | } |
| 61 | 84 | |
| ... | ... | @@ -63,13 +86,18 @@ public class AddStudentActivity extends BaseActivity { |
| 63 | 86 | boolean isSex = false; |
| 64 | 87 | boolean isNian = false; |
| 65 | 88 | boolean isShen = false; |
| 89 | + private static int CAMERA_REQUEST_CODE = 343; | |
| 90 | + private static int ALBUM_REQUEST_CODE = 456; | |
| 91 | + private static int CROP_REQUEST_CODE = 234; | |
| 92 | + private File tempFile; | |
| 93 | + private String path; | |
| 66 | 94 | |
| 67 | 95 | @Override |
| 68 | 96 | protected void onStart() { |
| 69 | 97 | super.onStart(); |
| 70 | 98 | String name = (String) SharedPreferencesUtil.getData("setName", ""); |
| 71 | 99 | String sex = (String) SharedPreferencesUtil.getData("setSex", ""); |
| 72 | - String nian = (String) SharedPreferencesUtil.getData("setNian", ""); | |
| 100 | + String nian = (String) SharedPreferencesUtil.getData("setNian", "") + SharedPreferencesUtil.getData("setXueq", ""); | |
| 73 | 101 | String shen = (String) SharedPreferencesUtil.getData("setShen", ""); |
| 74 | 102 | |
| 75 | 103 | if (name != null && name.length() > 0) { |
| ... | ... | @@ -128,8 +156,10 @@ public class AddStudentActivity extends BaseActivity { |
| 128 | 156 | SharedPreferencesUtil.putData("setNian", ""); |
| 129 | 157 | SharedPreferencesUtil.putData("setShen", ""); |
| 130 | 158 | SharedPreferencesUtil.putData("setXueq", ""); |
| 131 | - | |
| 159 | + SharedPreferencesUtil.putData("grade", 0); | |
| 132 | 160 | } |
| 161 | + | |
| 162 | + | |
| 133 | 163 | public void addStudent() { |
| 134 | 164 | String name = (String) SharedPreferencesUtil.getData("setName", ""); |
| 135 | 165 | String sex = (String) SharedPreferencesUtil.getData("setSex", ""); |
| ... | ... | @@ -140,11 +170,13 @@ public class AddStudentActivity extends BaseActivity { |
| 140 | 170 | |
| 141 | 171 | Map map = new HashMap(); |
| 142 | 172 | map.put("nickName", name); |
| 143 | - map.put("gender", "1"); | |
| 144 | - map.put("gradeId", 1); | |
| 173 | + map.put("gender", "男".equals(sex) ? 0 : 1); | |
| 174 | + map.put("gradeId", SharedPreferencesUtil.getData("grade", 1)); | |
| 145 | 175 | map.put("parentIdentity", shen); |
| 146 | 176 | map.put("term", xueq); |
| 147 | - | |
| 177 | + if (path != null) { | |
| 178 | + map.put("photo", path); | |
| 179 | + } | |
| 148 | 180 | |
| 149 | 181 | NetWorks.registerStudent(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { |
| 150 | 182 | @Override |
| ... | ... | @@ -194,4 +226,167 @@ public class AddStudentActivity extends BaseActivity { |
| 194 | 226 | public void onNetChanged(int netWorkState) { |
| 195 | 227 | |
| 196 | 228 | } |
| 229 | + | |
| 230 | + @OnClick(R.id.iv_avatar) | |
| 231 | + public void showButtonDialog(View view) { | |
| 232 | + BottomSheetDialog dialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | |
| 233 | + View bottomView = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_layout, null); | |
| 234 | + dialog.setContentView(bottomView); | |
| 235 | + bottomView.findViewById(R.id.take_photo).setOnClickListener(new View.OnClickListener() { | |
| 236 | + @Override | |
| 237 | + public void onClick(View view) { | |
| 238 | + dialog.dismiss(); | |
| 239 | + getPicFromCamera(); | |
| 240 | + } | |
| 241 | + }); | |
| 242 | + bottomView.findViewById(R.id.choose_photo).setOnClickListener(new View.OnClickListener() { | |
| 243 | + @Override | |
| 244 | + public void onClick(View view) { | |
| 245 | + dialog.dismiss(); | |
| 246 | + getPicFromAlbm(); | |
| 247 | + } | |
| 248 | + }); | |
| 249 | + bottomView.findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() { | |
| 250 | + @Override | |
| 251 | + public void onClick(View view) { | |
| 252 | + dialog.dismiss(); | |
| 253 | + } | |
| 254 | + }); | |
| 255 | + dialog.show(); | |
| 256 | + } | |
| 257 | + | |
| 258 | + private void cropPhoto(Uri uri) { | |
| 259 | + Uri contentUri = Uri.fromFile(new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg")); | |
| 260 | + Intent intent = new Intent("com.android.camera.action.CROP"); | |
| 261 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
| 262 | + //Android 7.0需要临时添加读取Url的权限, 添加此属性是为了解决:调用裁剪框时候提示:图片无法加载或者加载图片失败或者无法加载此图片 | |
| 263 | + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | |
| 264 | + } | |
| 265 | + intent.setDataAndType(uri, "image/*"); | |
| 266 | + intent.putExtra("crop", "true");//发送裁剪信号,去掉也能进行裁剪 | |
| 267 | + intent.putExtra("scale", true);// 设置缩放 | |
| 268 | + intent.putExtra("scaleUpIfNeeded", true);// 去黑边 | |
| 269 | + intent.putExtra("aspectX", 1); | |
| 270 | + intent.putExtra("aspectY", 1); | |
| 271 | + //上述两个属性控制裁剪框的缩放比例。 | |
| 272 | + //当用户用手拉伸裁剪框时候,裁剪框会按照上述比例缩放。 | |
| 273 | + intent.putExtra("outputX", 300);//属性控制裁剪完毕,保存的图片的大小格式。 | |
| 274 | + intent.putExtra("outputY", 300);//你按照1:1的比例来裁剪的,如果最后成像是800*400,那么按照2:1的样式保存, | |
| 275 | + intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());//输出裁剪文件的格式 | |
| 276 | + intent.putExtra("return-data", true);//是否返回裁剪后图片的Bitmap | |
| 277 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri);//设置输出路径 | |
| 278 | + startActivityForResult(intent, CROP_REQUEST_CODE); | |
| 279 | + } | |
| 280 | + | |
| 281 | + @Override | |
| 282 | + protected void onActivityResult(int requestCode, int resultCode, Intent intent) { | |
| 283 | + super.onActivityResult(requestCode, resultCode, intent); | |
| 284 | + if (requestCode == CAMERA_REQUEST_CODE) { | |
| 285 | + if (resultCode == RESULT_OK) { | |
| 286 | + //用相机返回的照片去调用剪裁也需要对Uri进行处理 | |
| 287 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
| 288 | + Uri contentUri = FileProvider.getUriForFile(AddStudentActivity.this, | |
| 289 | + this.getPackageName() + ".fileprovider", tempFile); | |
| 290 | + cropPhoto(contentUri); | |
| 291 | + } else { | |
| 292 | + cropPhoto(Uri.fromFile(tempFile)); | |
| 293 | + } | |
| 294 | + } | |
| 295 | + } else if (requestCode == ALBUM_REQUEST_CODE) { | |
| 296 | + if (resultCode == RESULT_OK) { | |
| 297 | + Uri uri = intent.getData(); | |
| 298 | + cropPhoto(uri); | |
| 299 | + } | |
| 300 | + } else if (requestCode == CROP_REQUEST_CODE) { | |
| 301 | + if (intent == null) { | |
| 302 | + return; | |
| 303 | + } | |
| 304 | + Bundle bundle = intent.getExtras(); | |
| 305 | + if (bundle != null) { | |
| 306 | + //在这里获得了剪裁后的Bitmap对象,可以用于上传 | |
| 307 | + Bitmap image = bundle.getParcelable("data"); | |
| 308 | + //设置到ImageView上 | |
| 309 | + //也可以进行一些保存、压缩等操作后上传 | |
| 310 | + File file = saveImage("head_output", image); | |
| 311 | + uploadAvatar(file); | |
| 312 | + // Log.d("dsadsadsa",path); | |
| 313 | + } | |
| 314 | + } | |
| 315 | + } | |
| 316 | + | |
| 317 | + private void uploadAvatar(File file) { | |
| 318 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 45)); | |
| 319 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 320 | + Glide.with(this).load(file).apply(options).into(iv_avatar); | |
| 321 | + NetWorks.uploadAvatar(file, new Observer<ResponseResult<Map<String, String>>>() { | |
| 322 | + @Override | |
| 323 | + public void onSubscribe(Disposable d) { | |
| 324 | + | |
| 325 | + } | |
| 326 | + | |
| 327 | + @Override | |
| 328 | + public void onNext(ResponseResult<Map<String, String>> responseBody) { | |
| 329 | + if (responseBody.getData() != null && responseBody.getCode() == 200) { | |
| 330 | + path = responseBody.getData().get("imageUrl"); | |
| 331 | + } | |
| 332 | + } | |
| 333 | + | |
| 334 | + @Override | |
| 335 | + public void onError(Throwable e) { | |
| 336 | + e.toString(); | |
| 337 | + } | |
| 338 | + | |
| 339 | + @Override | |
| 340 | + public void onComplete() { | |
| 341 | + | |
| 342 | + } | |
| 343 | + }); | |
| 344 | + } | |
| 345 | + | |
| 346 | + public File saveImage(String name, Bitmap bmp) { | |
| 347 | + File appDir = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES).getPath()); | |
| 348 | + if (!appDir.exists()) { | |
| 349 | + appDir.mkdir(); | |
| 350 | + } | |
| 351 | + String fileName = name + ".jpg"; | |
| 352 | + File file = new File(appDir, fileName); | |
| 353 | + try { | |
| 354 | + FileOutputStream fos = new FileOutputStream(file); | |
| 355 | + bmp.compress(Bitmap.CompressFormat.PNG, 100, fos); | |
| 356 | + fos.flush(); | |
| 357 | + fos.close(); | |
| 358 | + return file; | |
| 359 | + } catch (IOException e) { | |
| 360 | + Log.d("dsadsadsa", e.getLocalizedMessage()); | |
| 361 | + e.printStackTrace(); | |
| 362 | + } | |
| 363 | + return null; | |
| 364 | + } | |
| 365 | + | |
| 366 | + private void getPicFromCamera() { | |
| 367 | + //用于保存调用相机拍照后所生成的文件 | |
| 368 | + tempFile = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg"); | |
| 369 | + //跳转到调用系统相机 | |
| 370 | + Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
| 371 | + //判断版本 | |
| 372 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //如果在Android7.0以上,使用FileProvider获取Uri | |
| 373 | + intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); | |
| 374 | + Uri contentUri = FileProvider.getUriForFile(AddStudentActivity.this, | |
| 375 | + this.getPackageName() + ".fileprovider", tempFile); | |
| 376 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri); | |
| 377 | + } else { //否则使用Uri.fromFile(file)方法获取Uri | |
| 378 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile)); | |
| 379 | + } | |
| 380 | + startActivityForResult(intent, CAMERA_REQUEST_CODE); | |
| 381 | + } | |
| 382 | + | |
| 383 | + /** | |
| 384 | + * 从相册获取图片 | |
| 385 | + */ | |
| 386 | + private void getPicFromAlbm() { | |
| 387 | + Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); | |
| 388 | + photoPickerIntent.setType("image/*"); | |
| 389 | + startActivityForResult(photoPickerIntent, ALBUM_REQUEST_CODE); | |
| 390 | + } | |
| 391 | + | |
| 197 | 392 | } | ... | ... |
app/src/main/java/com/hjx/parent/ChangePwdActivity.java
| ... | ... | @@ -15,11 +15,16 @@ import org.json.JSONObject; |
| 15 | 15 | import java.util.HashMap; |
| 16 | 16 | import java.util.Map; |
| 17 | 17 | |
| 18 | +import butterknife.BindView; | |
| 18 | 19 | import io.reactivex.Observer; |
| 19 | 20 | import io.reactivex.disposables.Disposable; |
| 20 | 21 | import okhttp3.ResponseBody; |
| 21 | 22 | |
| 22 | 23 | public class ChangePwdActivity extends BaseActivity { |
| 24 | + @BindView(R.id.et_old_password) | |
| 25 | + EditText et_old_password; | |
| 26 | + @BindView(R.id.et_pwd_2) | |
| 27 | + EditText et_pwd_2; | |
| 23 | 28 | |
| 24 | 29 | @Override |
| 25 | 30 | protected int layoutResId() { |
| ... | ... | @@ -37,39 +42,40 @@ public class ChangePwdActivity extends BaseActivity { |
| 37 | 42 | } |
| 38 | 43 | |
| 39 | 44 | |
| 40 | - | |
| 41 | 45 | EditText et_pwd; |
| 46 | + | |
| 42 | 47 | @Override |
| 43 | 48 | protected void initView() { |
| 44 | - | |
| 45 | - | |
| 46 | 49 | et_pwd = findViewById(R.id.et_pwd); |
| 47 | 50 | } |
| 48 | 51 | |
| 49 | 52 | @Override |
| 50 | 53 | protected void initListener() { |
| 51 | 54 | findViewById(R.id.iv_back).setOnClickListener(view -> onBackPressed()); |
| 52 | - | |
| 53 | 55 | findViewById(R.id.btn_next).setOnClickListener(view -> { |
| 54 | 56 | String pwd = et_pwd.getText().toString().trim(); |
| 55 | - if (pwd == null || pwd.length() == 0){ | |
| 56 | - Toast.makeText(this,"密码不能为空",Toast.LENGTH_SHORT).show(); | |
| 57 | + if (pwd == null || pwd.length() == 0) { | |
| 58 | + Toast.makeText(this, "密码不能为空", Toast.LENGTH_SHORT).show(); | |
| 59 | + return; | |
| 60 | + } | |
| 61 | + if (pwd.length() < 6 || pwd.length() > 16) { | |
| 62 | + Toast.makeText(this, "密码必须为6-16位,数字或字母", Toast.LENGTH_SHORT).show(); | |
| 63 | + return; | |
| 64 | + } | |
| 65 | + if (!pwd.equals(et_pwd_2.getText().toString())) { | |
| 66 | + Toast.makeText(this, "两次密码输入不一致", Toast.LENGTH_SHORT).show(); | |
| 57 | 67 | return; |
| 58 | 68 | } |
| 59 | - | |
| 60 | 69 | changePwd(pwd); |
| 61 | - | |
| 62 | 70 | }); |
| 63 | - | |
| 64 | 71 | } |
| 65 | 72 | |
| 66 | - public void changePwd(String pwd){ | |
| 73 | + public void changePwd(String pwd) { | |
| 67 | 74 | String userId = (String) SharedPreferencesUtil.getData("userId", ""); |
| 68 | 75 | Map map = new HashMap(); |
| 69 | - map.put("userId",userId); | |
| 70 | - map.put("password",pwd); | |
| 71 | - | |
| 72 | - | |
| 76 | + map.put("userId", userId); | |
| 77 | + map.put("password", pwd); | |
| 78 | + map.put("oldPassword", et_old_password.getText().toString()); | |
| 73 | 79 | NetWorks.changePassword(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { |
| 74 | 80 | @Override |
| 75 | 81 | public void onSubscribe(Disposable d) { |
| ... | ... | @@ -83,19 +89,19 @@ public class ChangePwdActivity extends BaseActivity { |
| 83 | 89 | String str = responseBody.string().toString(); |
| 84 | 90 | |
| 85 | 91 | |
| 86 | - LogUtil.e(TAG,"----"+str); | |
| 92 | + LogUtil.e(TAG, "----" + str); | |
| 87 | 93 | JSONObject jo = new JSONObject(str); |
| 88 | - boolean isSucceed = jo.getBoolean("success"); | |
| 89 | - if (isSucceed){ | |
| 94 | + boolean isSucceed = jo.getBoolean("success"); | |
| 95 | + if (isSucceed) { | |
| 90 | 96 | Toast.makeText(ChangePwdActivity.this, "修改成功", Toast.LENGTH_SHORT).show(); |
| 91 | 97 | finish(); |
| 92 | 98 | |
| 93 | - }else { | |
| 99 | + } else { | |
| 94 | 100 | Toast.makeText(ChangePwdActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); |
| 95 | 101 | } |
| 96 | - }catch (Exception e){ | |
| 102 | + } catch (Exception e) { | |
| 97 | 103 | e.printStackTrace(); |
| 98 | - Toast.makeText(ChangePwdActivity.this,"服务繁忙,请重试",Toast.LENGTH_SHORT).show(); | |
| 104 | + Toast.makeText(ChangePwdActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); | |
| 99 | 105 | } |
| 100 | 106 | |
| 101 | 107 | } | ... | ... |
app/src/main/java/com/hjx/parent/ChooseActivity.java
| ... | ... | @@ -0,0 +1,200 @@ |
| 1 | +package com.hjx.parent; | |
| 2 | + | |
| 3 | +import android.content.Intent; | |
| 4 | +import android.text.TextUtils; | |
| 5 | +import android.view.View; | |
| 6 | +import android.widget.ImageView; | |
| 7 | + | |
| 8 | +import androidx.annotation.NonNull; | |
| 9 | +import androidx.recyclerview.widget.LinearLayoutManager; | |
| 10 | +import androidx.recyclerview.widget.RecyclerView; | |
| 11 | + | |
| 12 | +import com.bumptech.glide.Glide; | |
| 13 | +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | |
| 14 | +import com.bumptech.glide.request.RequestOptions; | |
| 15 | +import com.chad.library.adapter.base.BaseQuickAdapter; | |
| 16 | +import com.chad.library.adapter.base.BaseViewHolder; | |
| 17 | +import com.google.gson.Gson; | |
| 18 | +import com.hjx.parent.bean.StudentBean; | |
| 19 | +import com.prws.common.base.BaseActivity; | |
| 20 | +import com.prws.common.base.BasePresenter; | |
| 21 | +import com.prws.common.net.NetWorks; | |
| 22 | +import com.prws.common.utils.LogUtil; | |
| 23 | +import com.prws.common.utils.ScreenUtils; | |
| 24 | +import com.prws.common.utils.SharedPreferencesUtil; | |
| 25 | + | |
| 26 | +import org.json.JSONArray; | |
| 27 | +import org.json.JSONObject; | |
| 28 | + | |
| 29 | +import java.util.ArrayList; | |
| 30 | + | |
| 31 | +import butterknife.BindView; | |
| 32 | +import butterknife.OnClick; | |
| 33 | +import io.reactivex.Observer; | |
| 34 | +import io.reactivex.disposables.Disposable; | |
| 35 | +import okhttp3.ResponseBody; | |
| 36 | + | |
| 37 | +public class ChooseActivity extends BaseActivity { | |
| 38 | + @BindView(R.id.recycle) | |
| 39 | + RecyclerView recycle; | |
| 40 | + private int select = 0; | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + protected int layoutResId() { | |
| 44 | + return R.layout.choose_activity; | |
| 45 | + } | |
| 46 | + | |
| 47 | + @Override | |
| 48 | + public Object getContract() { | |
| 49 | + return null; | |
| 50 | + } | |
| 51 | + | |
| 52 | + @Override | |
| 53 | + public BasePresenter getPresenter() { | |
| 54 | + return null; | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Override | |
| 58 | + protected void initView() { | |
| 59 | + | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + protected void initListener() { | |
| 64 | + | |
| 65 | + } | |
| 66 | + | |
| 67 | + @Override | |
| 68 | + protected void initData() { | |
| 69 | + | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Override | |
| 73 | + public void onNetChanged(int netWorkState) { | |
| 74 | + | |
| 75 | + } | |
| 76 | + | |
| 77 | + @Override | |
| 78 | + protected void onResume() { | |
| 79 | + super.onResume(); | |
| 80 | + loadChildList(); | |
| 81 | + } | |
| 82 | + | |
| 83 | + ArrayList<StudentBean> alist = new ArrayList<>(); | |
| 84 | + | |
| 85 | + public void loadChildList() { | |
| 86 | + NetWorks.listChildren(new Observer<ResponseBody>() { | |
| 87 | + @Override | |
| 88 | + public void onSubscribe(Disposable d) { | |
| 89 | + | |
| 90 | + } | |
| 91 | + | |
| 92 | + @Override | |
| 93 | + public void onNext(ResponseBody responseBody) { | |
| 94 | + try { | |
| 95 | + | |
| 96 | + String str = responseBody.string().toString(); | |
| 97 | + | |
| 98 | + | |
| 99 | + LogUtil.e("TAG", "----" + str); | |
| 100 | + JSONObject jo = new JSONObject(str); | |
| 101 | + boolean isSucceed = jo.getBoolean("success"); | |
| 102 | + if (isSucceed) { | |
| 103 | + JSONArray jarr = jo.getJSONArray("data"); | |
| 104 | + alist.clear(); | |
| 105 | + for (int i = 0; i < jarr.length(); i++) { | |
| 106 | + JSONObject jo2 = jarr.getJSONObject(i); | |
| 107 | + Gson gson = new Gson(); | |
| 108 | + StudentBean sb = gson.fromJson(jo2.toString(), StudentBean.class); | |
| 109 | + alist.add(sb); | |
| 110 | + } | |
| 111 | + if (alist.size() > 0) { | |
| 112 | + loadList(); | |
| 113 | + } | |
| 114 | + | |
| 115 | + } else { | |
| 116 | + | |
| 117 | + } | |
| 118 | + } catch (Exception e) { | |
| 119 | + e.printStackTrace(); | |
| 120 | + } | |
| 121 | + } | |
| 122 | + | |
| 123 | + @Override | |
| 124 | + public void onError(Throwable e) { | |
| 125 | + | |
| 126 | + } | |
| 127 | + | |
| 128 | + @Override | |
| 129 | + public void onComplete() { | |
| 130 | + | |
| 131 | + } | |
| 132 | + }); | |
| 133 | + } | |
| 134 | + | |
| 135 | + public void loadList() { | |
| 136 | + StudentBean sb = new StudentBean(); | |
| 137 | + sb.setNickName("添加学生"); | |
| 138 | + alist.add(sb); | |
| 139 | + String student = (String) SharedPreferencesUtil.getData("student", ""); | |
| 140 | + try { | |
| 141 | + StudentBean studentBean = new Gson().fromJson(student, StudentBean.class); | |
| 142 | + for (int i = 0; i < alist.size(); i++) { | |
| 143 | + if (studentBean.getStuId().equals(alist.get(i).getStuId())) { | |
| 144 | + select = i; | |
| 145 | + break; | |
| 146 | + } | |
| 147 | + } | |
| 148 | + } catch (Exception e) { | |
| 149 | + | |
| 150 | + } | |
| 151 | + BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_child_choose, alist) { | |
| 152 | + @Override | |
| 153 | + protected void convert(@NonNull BaseViewHolder item, Object o) { | |
| 154 | + StudentBean studentBean = alist.get(item.getAdapterPosition()); | |
| 155 | + item.setText(R.id.tv_name, studentBean.getNickName()); | |
| 156 | + if (TextUtils.isEmpty(studentBean.getStuId())) { | |
| 157 | + item.setVisible(R.id.rl_add, true); | |
| 158 | + item.getConvertView().setOnClickListener(new View.OnClickListener() { | |
| 159 | + @Override | |
| 160 | + public void onClick(View view) { | |
| 161 | + startActivity(new Intent(ChooseActivity.this, AddStudentActivity.class)); | |
| 162 | + } | |
| 163 | + }); | |
| 164 | + } else { | |
| 165 | + item.setBackgroundRes(R.id.rl_child, select == item.getAdapterPosition() ? R.drawable.bg_solid_white_10_or : R.drawable.bg_solid_white_10); | |
| 166 | + item.setImageResource(R.id.iv_select, select == item.getAdapterPosition() ? R.mipmap.gx : R.mipmap.wsyq); | |
| 167 | + item.setVisible(R.id.rl_add, false); | |
| 168 | + if (TextUtils.isEmpty(studentBean.getPhoto())) { | |
| 169 | + item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
| 170 | + } else { | |
| 171 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(ChooseActivity.this, 45)); | |
| 172 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 173 | + Glide.with(ChooseActivity.this).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); | |
| 174 | + } | |
| 175 | + item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); | |
| 176 | + item.getConvertView().setOnClickListener(new View.OnClickListener() { | |
| 177 | + @Override | |
| 178 | + public void onClick(View view) { | |
| 179 | + select = item.getAdapterPosition(); | |
| 180 | + notifyDataSetChanged(); | |
| 181 | + } | |
| 182 | + }); | |
| 183 | + } | |
| 184 | + } | |
| 185 | + }; | |
| 186 | + recycle.setLayoutManager(new LinearLayoutManager(ChooseActivity.this, LinearLayoutManager.VERTICAL, false)); | |
| 187 | + recycle.setAdapter(adapter); | |
| 188 | + } | |
| 189 | + | |
| 190 | + @OnClick(R.id.tv_confirm) | |
| 191 | + public void confirm(View view) { | |
| 192 | + if (alist.size() > 0 && alist.size() - 1 >= select && alist.get(select) != null) { | |
| 193 | + StudentBean studentBean = alist.get(select); | |
| 194 | + Intent intent = new Intent(ChooseActivity.this, MainActivity.class); | |
| 195 | + SharedPreferencesUtil.putData("student", new Gson().toJson(studentBean)); | |
| 196 | + startActivity(intent); | |
| 197 | + finish(); | |
| 198 | + } | |
| 199 | + } | |
| 200 | +} | ... | ... |
app/src/main/java/com/hjx/parent/EditStudentActivity.java
| ... | ... | @@ -0,0 +1,384 @@ |
| 1 | +package com.hjx.parent; | |
| 2 | + | |
| 3 | +import android.content.Intent; | |
| 4 | +import android.graphics.Bitmap; | |
| 5 | +import android.graphics.Color; | |
| 6 | +import android.net.Uri; | |
| 7 | +import android.os.Build; | |
| 8 | +import android.os.Bundle; | |
| 9 | +import android.os.Environment; | |
| 10 | +import android.provider.MediaStore; | |
| 11 | +import android.text.TextUtils; | |
| 12 | +import android.util.Log; | |
| 13 | +import android.view.LayoutInflater; | |
| 14 | +import android.view.View; | |
| 15 | +import android.widget.Button; | |
| 16 | +import android.widget.ImageView; | |
| 17 | +import android.widget.TextView; | |
| 18 | +import android.widget.Toast; | |
| 19 | + | |
| 20 | +import androidx.core.content.FileProvider; | |
| 21 | + | |
| 22 | +import com.bumptech.glide.Glide; | |
| 23 | +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | |
| 24 | +import com.bumptech.glide.request.RequestOptions; | |
| 25 | +import com.google.android.material.bottomsheet.BottomSheetDialog; | |
| 26 | +import com.google.gson.Gson; | |
| 27 | +import com.hjx.parent.bean.StudentBean; | |
| 28 | +import com.prws.common.base.BaseActivity; | |
| 29 | +import com.prws.common.base.BasePresenter; | |
| 30 | +import com.prws.common.bean.ResponseResult; | |
| 31 | +import com.prws.common.net.NetWorks; | |
| 32 | +import com.prws.common.utils.LogUtil; | |
| 33 | +import com.prws.common.utils.ScreenUtils; | |
| 34 | +import com.prws.common.utils.SharedPreferencesUtil; | |
| 35 | + | |
| 36 | +import org.json.JSONObject; | |
| 37 | + | |
| 38 | +import java.io.File; | |
| 39 | +import java.io.FileOutputStream; | |
| 40 | +import java.io.IOException; | |
| 41 | +import java.util.HashMap; | |
| 42 | +import java.util.Map; | |
| 43 | + | |
| 44 | +import butterknife.BindView; | |
| 45 | +import butterknife.OnClick; | |
| 46 | +import io.reactivex.Observer; | |
| 47 | +import io.reactivex.disposables.Disposable; | |
| 48 | + | |
| 49 | +public class EditStudentActivity extends BaseActivity { | |
| 50 | + View view_2; | |
| 51 | + View view_3; | |
| 52 | + View view_4; | |
| 53 | + View view_5; | |
| 54 | + Button btn_next; | |
| 55 | + TextView tv_name, tv_sex, tv_nian, tv_shen; | |
| 56 | + @BindView(R.id.iv_avatar) | |
| 57 | + ImageView iv_avatar; | |
| 58 | + @BindView(R.id.tv_teacher) | |
| 59 | + TextView tv_teacher; | |
| 60 | + @BindView(R.id.iv_teacher) | |
| 61 | + ImageView iv_teacher; | |
| 62 | + private static int CAMERA_REQUEST_CODE = 343; | |
| 63 | + private static int ALBUM_REQUEST_CODE = 456; | |
| 64 | + private static int CROP_REQUEST_CODE = 234; | |
| 65 | + private File tempFile; | |
| 66 | + private String path; | |
| 67 | + StudentBean studentBean; | |
| 68 | + | |
| 69 | + @Override | |
| 70 | + protected int layoutResId() { | |
| 71 | + return R.layout.activity_edit_stu; | |
| 72 | + } | |
| 73 | + | |
| 74 | + @Override | |
| 75 | + public Object getContract() { | |
| 76 | + return null; | |
| 77 | + } | |
| 78 | + | |
| 79 | + @Override | |
| 80 | + public BasePresenter getPresenter() { | |
| 81 | + return null; | |
| 82 | + } | |
| 83 | + | |
| 84 | + @Override | |
| 85 | + protected void initView() { | |
| 86 | + view_2 = findViewById(R.id.view_2); | |
| 87 | + view_3 = findViewById(R.id.view_3); | |
| 88 | + view_4 = findViewById(R.id.view_4); | |
| 89 | + view_5 = findViewById(R.id.view_5); | |
| 90 | + tv_name = findViewById(R.id.tv_name); | |
| 91 | + tv_sex = findViewById(R.id.tv_sex); | |
| 92 | + tv_nian = findViewById(R.id.tv_nian); | |
| 93 | + tv_shen = findViewById(R.id.tv_shen); | |
| 94 | + btn_next = findViewById(R.id.btn_next); | |
| 95 | + } | |
| 96 | + | |
| 97 | + @Override | |
| 98 | + protected void onStart() { | |
| 99 | + super.onStart(); | |
| 100 | + String name = (String) SharedPreferencesUtil.getData("setName", ""); | |
| 101 | + String sex = (String) SharedPreferencesUtil.getData("setSex", ""); | |
| 102 | + String nian = (String) SharedPreferencesUtil.getData("setNian", ""); | |
| 103 | + String shen = (String) SharedPreferencesUtil.getData("setShen", ""); | |
| 104 | + String xueq = (String) SharedPreferencesUtil.getData("setXueq", ""); | |
| 105 | + btn_next.setTextColor(Color.WHITE); | |
| 106 | + btn_next.setBackground(getResources().getDrawable(R.drawable.bg_solid_btn)); | |
| 107 | + studentBean = new Gson().fromJson(getIntent().getStringExtra("student"), StudentBean.class); | |
| 108 | + if (name != null && name.length() > 0) { | |
| 109 | + studentBean.setNickName(name); | |
| 110 | + } | |
| 111 | + if (sex != null && sex.length() > 0) { | |
| 112 | + studentBean.setGender("男".equals(sex) ? 0 : 1); | |
| 113 | + } | |
| 114 | + if (nian != null && nian.length() > 0) { | |
| 115 | + studentBean.setGrade(nian); | |
| 116 | + studentBean.setGradeId((Integer) SharedPreferencesUtil.getData("grade", 1)); | |
| 117 | + } | |
| 118 | + if (xueq != null && xueq.length() > 0) { | |
| 119 | + studentBean.setTerm(xueq); | |
| 120 | + } | |
| 121 | + if (shen != null && shen.length() > 0) { | |
| 122 | + studentBean.setParentIdentity(shen); | |
| 123 | + } | |
| 124 | + tv_name.setText(studentBean.getNickName()); | |
| 125 | + tv_nian.setText(studentBean.getGrade() + studentBean.getTerm()); | |
| 126 | + tv_sex.setText(studentBean.getGender() == 0 ? "男" : "女"); | |
| 127 | + tv_shen.setText(studentBean.getParentIdentity()); | |
| 128 | + if (!TextUtils.isEmpty(studentBean.getPhoto())) { | |
| 129 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 45)); | |
| 130 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 131 | + Glide.with(this).load(studentBean.getPhoto()).apply(options).into(iv_avatar); | |
| 132 | + } else { | |
| 133 | + iv_avatar.setImageResource(studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
| 134 | + } | |
| 135 | + if (!"虚拟".equals(studentBean.getTeacherIdentity())) { | |
| 136 | + tv_teacher.setText(studentBean.getTeacherName()); | |
| 137 | + if (!TextUtils.isEmpty(studentBean.getTeacherAvatar())) { | |
| 138 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(this, 25)); | |
| 139 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 140 | + Glide.with(this).load(studentBean.getTeacherAvatar()).apply(options).into(iv_teacher); | |
| 141 | + } else { | |
| 142 | + iv_teacher.setImageResource(studentBean.getSex() == 0 ? R.mipmap.ic_teacher_male : R.mipmap.ic_teacher_female); | |
| 143 | + } | |
| 144 | + } else { | |
| 145 | + iv_teacher.setVisibility(View.GONE); | |
| 146 | + } | |
| 147 | + | |
| 148 | + } | |
| 149 | + | |
| 150 | + @Override | |
| 151 | + protected void initListener() { | |
| 152 | + view_2.setOnClickListener(view -> startActivity(NickActivity.class)); | |
| 153 | + view_3.setOnClickListener(view -> startActivity(SexActivity.class)); | |
| 154 | + view_4.setOnClickListener(view -> startActivity(NianActivity.class)); | |
| 155 | + view_5.setOnClickListener(view -> startActivity(ShenActivity.class)); | |
| 156 | + findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); | |
| 157 | + btn_next.setOnClickListener(view -> { | |
| 158 | + editStudent(); | |
| 159 | + }); | |
| 160 | + } | |
| 161 | + | |
| 162 | + public void editStudent() { | |
| 163 | + Map map = new HashMap(); | |
| 164 | + map.put("nickName", studentBean.getNickName()); | |
| 165 | + map.put("gender", studentBean.getGender()); | |
| 166 | + map.put("gradeId", studentBean.getGradeId()); | |
| 167 | + map.put("parentIdentity", studentBean.getParentIdentity()); | |
| 168 | + map.put("term", studentBean.getTerm()); | |
| 169 | + map.put("stuId", studentBean.getStuId()); | |
| 170 | + NetWorks.editStudent(NetWorks.getMapRequestBody(map), new Observer<ResponseResult>() { | |
| 171 | + @Override | |
| 172 | + public void onSubscribe(Disposable d) { | |
| 173 | + | |
| 174 | + } | |
| 175 | + | |
| 176 | + @Override | |
| 177 | + public void onNext(ResponseResult responseResult) { | |
| 178 | + try { | |
| 179 | + boolean isSucceed = responseResult.getSuccess(); | |
| 180 | + if (isSucceed) { | |
| 181 | + finish(); | |
| 182 | + } else { | |
| 183 | + Toast.makeText(EditStudentActivity.this, responseResult.getMsg(), Toast.LENGTH_SHORT).show(); | |
| 184 | + } | |
| 185 | + } catch (Exception e) { | |
| 186 | + | |
| 187 | + } | |
| 188 | + } | |
| 189 | + | |
| 190 | + @Override | |
| 191 | + public void onError(Throwable e) { | |
| 192 | + | |
| 193 | + } | |
| 194 | + | |
| 195 | + @Override | |
| 196 | + public void onComplete() { | |
| 197 | + | |
| 198 | + } | |
| 199 | + }); | |
| 200 | + } | |
| 201 | + | |
| 202 | + @Override | |
| 203 | + protected void initData() { | |
| 204 | + | |
| 205 | + } | |
| 206 | + | |
| 207 | + @Override | |
| 208 | + public void onNetChanged(int netWorkState) { | |
| 209 | + | |
| 210 | + } | |
| 211 | + | |
| 212 | + private void cropPhoto(Uri uri) { | |
| 213 | + Uri contentUri = Uri.fromFile(new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg")); | |
| 214 | + Intent intent = new Intent("com.android.camera.action.CROP"); | |
| 215 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
| 216 | + //Android 7.0需要临时添加读取Url的权限, 添加此属性是为了解决:调用裁剪框时候提示:图片无法加载或者加载图片失败或者无法加载此图片 | |
| 217 | + intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); | |
| 218 | + } | |
| 219 | + intent.setDataAndType(uri, "image/*"); | |
| 220 | + intent.putExtra("crop", "true");//发送裁剪信号,去掉也能进行裁剪 | |
| 221 | + intent.putExtra("scale", true);// 设置缩放 | |
| 222 | + intent.putExtra("scaleUpIfNeeded", true);// 去黑边 | |
| 223 | + intent.putExtra("aspectX", 1); | |
| 224 | + intent.putExtra("aspectY", 1); | |
| 225 | + //上述两个属性控制裁剪框的缩放比例。 | |
| 226 | + //当用户用手拉伸裁剪框时候,裁剪框会按照上述比例缩放。 | |
| 227 | + intent.putExtra("outputX", 300);//属性控制裁剪完毕,保存的图片的大小格式。 | |
| 228 | + intent.putExtra("outputY", 300);//你按照1:1的比例来裁剪的,如果最后成像是800*400,那么按照2:1的样式保存, | |
| 229 | + intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());//输出裁剪文件的格式 | |
| 230 | + intent.putExtra("return-data", true);//是否返回裁剪后图片的Bitmap | |
| 231 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri);//设置输出路径 | |
| 232 | + startActivityForResult(intent, CROP_REQUEST_CODE); | |
| 233 | + } | |
| 234 | + | |
| 235 | + @Override | |
| 236 | + protected void onActivityResult(int requestCode, int resultCode, Intent intent) { | |
| 237 | + super.onActivityResult(requestCode, resultCode, intent); | |
| 238 | + if (requestCode == CAMERA_REQUEST_CODE) { | |
| 239 | + if (resultCode == RESULT_OK) { | |
| 240 | + //用相机返回的照片去调用剪裁也需要对Uri进行处理 | |
| 241 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | |
| 242 | + Uri contentUri = FileProvider.getUriForFile(this, | |
| 243 | + this.getPackageName() + ".fileprovider", tempFile); | |
| 244 | + cropPhoto(contentUri); | |
| 245 | + } else { | |
| 246 | + cropPhoto(Uri.fromFile(tempFile)); | |
| 247 | + } | |
| 248 | + } | |
| 249 | + } else if (requestCode == ALBUM_REQUEST_CODE) { | |
| 250 | + if (resultCode == RESULT_OK) { | |
| 251 | + Uri uri = intent.getData(); | |
| 252 | + cropPhoto(uri); | |
| 253 | + } | |
| 254 | + } else if (requestCode == CROP_REQUEST_CODE) { | |
| 255 | + if (intent == null) { | |
| 256 | + return; | |
| 257 | + } | |
| 258 | + Bundle bundle = intent.getExtras(); | |
| 259 | + if (bundle != null) { | |
| 260 | + //在这里获得了剪裁后的Bitmap对象,可以用于上传 | |
| 261 | + Bitmap image = bundle.getParcelable("data"); | |
| 262 | + //设置到ImageView上 | |
| 263 | + //也可以进行一些保存、压缩等操作后上传 | |
| 264 | + File file = saveImage("head_output", image); | |
| 265 | + uploadAvatar(file); | |
| 266 | + // Log.d("dsadsadsa",path); | |
| 267 | + } | |
| 268 | + } | |
| 269 | + } | |
| 270 | + | |
| 271 | + private void uploadAvatar(File file) { | |
| 272 | + NetWorks.uploadStudentAvatar(file, studentBean.getStuId(), new Observer<ResponseResult<Map<String, String>>>() { | |
| 273 | + @Override | |
| 274 | + public void onSubscribe(Disposable d) { | |
| 275 | + | |
| 276 | + } | |
| 277 | + | |
| 278 | + @Override | |
| 279 | + public void onNext(ResponseResult<Map<String, String>> responseBody) { | |
| 280 | + if (responseBody.getData() != null && responseBody.getCode() == 200) { | |
| 281 | + String filePath = responseBody.getData().get("imageUrl"); | |
| 282 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(EditStudentActivity.this, 45)); | |
| 283 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 284 | + Glide.with(EditStudentActivity.this).load(filePath).apply(options).into(iv_avatar); | |
| 285 | + } | |
| 286 | + } | |
| 287 | + | |
| 288 | + @Override | |
| 289 | + public void onError(Throwable e) { | |
| 290 | + e.toString(); | |
| 291 | + } | |
| 292 | + | |
| 293 | + @Override | |
| 294 | + public void onComplete() { | |
| 295 | + | |
| 296 | + } | |
| 297 | + }); | |
| 298 | + } | |
| 299 | + | |
| 300 | + public File saveImage(String name, Bitmap bmp) { | |
| 301 | + File appDir = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES).getPath()); | |
| 302 | + if (!appDir.exists()) { | |
| 303 | + appDir.mkdir(); | |
| 304 | + } | |
| 305 | + String fileName = name + ".jpg"; | |
| 306 | + File file = new File(appDir, fileName); | |
| 307 | + try { | |
| 308 | + FileOutputStream fos = new FileOutputStream(file); | |
| 309 | + bmp.compress(Bitmap.CompressFormat.PNG, 100, fos); | |
| 310 | + fos.flush(); | |
| 311 | + fos.close(); | |
| 312 | + return file; | |
| 313 | + } catch (IOException e) { | |
| 314 | + Log.d("dsadsadsa", e.getLocalizedMessage()); | |
| 315 | + e.printStackTrace(); | |
| 316 | + } | |
| 317 | + return null; | |
| 318 | + } | |
| 319 | + | |
| 320 | + private void getPicFromCamera() { | |
| 321 | + //用于保存调用相机拍照后所生成的文件 | |
| 322 | + tempFile = new File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg"); | |
| 323 | + //跳转到调用系统相机 | |
| 324 | + Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
| 325 | + //判断版本 | |
| 326 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { //如果在Android7.0以上,使用FileProvider获取Uri | |
| 327 | + intent.setFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); | |
| 328 | + Uri contentUri = FileProvider.getUriForFile(this, | |
| 329 | + this.getPackageName() + ".fileprovider", tempFile); | |
| 330 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, contentUri); | |
| 331 | + } else { //否则使用Uri.fromFile(file)方法获取Uri | |
| 332 | + intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile)); | |
| 333 | + } | |
| 334 | + startActivityForResult(intent, CAMERA_REQUEST_CODE); | |
| 335 | + } | |
| 336 | + | |
| 337 | + /** | |
| 338 | + * 从相册获取图片 | |
| 339 | + */ | |
| 340 | + private void getPicFromAlbm() { | |
| 341 | + Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); | |
| 342 | + photoPickerIntent.setType("image/*"); | |
| 343 | + startActivityForResult(photoPickerIntent, ALBUM_REQUEST_CODE); | |
| 344 | + } | |
| 345 | + | |
| 346 | + @Override | |
| 347 | + protected void onDestroy() { | |
| 348 | + super.onDestroy(); | |
| 349 | + SharedPreferencesUtil.putData("setName", ""); | |
| 350 | + SharedPreferencesUtil.putData("setSex", ""); | |
| 351 | + SharedPreferencesUtil.putData("setNian", ""); | |
| 352 | + SharedPreferencesUtil.putData("setShen", ""); | |
| 353 | + SharedPreferencesUtil.putData("setXueq", ""); | |
| 354 | + SharedPreferencesUtil.putData("grade", 0); | |
| 355 | + } | |
| 356 | + | |
| 357 | + @OnClick(R.id.iv_avatar) | |
| 358 | + public void showButtonDialog(View view) { | |
| 359 | + BottomSheetDialog dialog = new BottomSheetDialog(this, R.style.BottomSheetDialog); | |
| 360 | + View bottomView = LayoutInflater.from(this).inflate(R.layout.bottom_sheet_layout, null); | |
| 361 | + dialog.setContentView(bottomView); | |
| 362 | + bottomView.findViewById(R.id.take_photo).setOnClickListener(new View.OnClickListener() { | |
| 363 | + @Override | |
| 364 | + public void onClick(View view) { | |
| 365 | + dialog.dismiss(); | |
| 366 | + getPicFromCamera(); | |
| 367 | + } | |
| 368 | + }); | |
| 369 | + bottomView.findViewById(R.id.choose_photo).setOnClickListener(new View.OnClickListener() { | |
| 370 | + @Override | |
| 371 | + public void onClick(View view) { | |
| 372 | + dialog.dismiss(); | |
| 373 | + getPicFromAlbm(); | |
| 374 | + } | |
| 375 | + }); | |
| 376 | + bottomView.findViewById(R.id.cancel).setOnClickListener(new View.OnClickListener() { | |
| 377 | + @Override | |
| 378 | + public void onClick(View view) { | |
| 379 | + dialog.dismiss(); | |
| 380 | + } | |
| 381 | + }); | |
| 382 | + dialog.show(); | |
| 383 | + } | |
| 384 | +} | ... | ... |
app/src/main/java/com/hjx/parent/LoginActivity.java
| 1 | 1 | package com.hjx.parent; |
| 2 | 2 | |
| 3 | +import android.content.Intent; | |
| 3 | 4 | import android.os.Bundle; |
| 4 | 5 | import android.telephony.PhoneNumberUtils; |
| 5 | 6 | import android.text.InputType; |
| 7 | +import android.text.TextUtils; | |
| 6 | 8 | import android.widget.Button; |
| 7 | 9 | import android.widget.CheckBox; |
| 8 | 10 | import android.widget.EditText; |
| ... | ... | @@ -45,7 +47,6 @@ public class LoginActivity extends BaseActivity { |
| 45 | 47 | TextView tv_ys; |
| 46 | 48 | |
| 47 | 49 | |
| 48 | - | |
| 49 | 50 | @Override |
| 50 | 51 | protected int layoutResId() { |
| 51 | 52 | return R.layout.activity_login; |
| ... | ... | @@ -75,20 +76,19 @@ public class LoginActivity extends BaseActivity { |
| 75 | 76 | tv_ys = findViewById(R.id.tv_6); |
| 76 | 77 | |
| 77 | 78 | |
| 78 | - String role = (String) SharedPreferencesUtil.getData("role",""); | |
| 79 | + String student = (String) SharedPreferencesUtil.getData("student", ""); | |
| 79 | 80 | |
| 80 | - if (role != null && role.length()> 0){ | |
| 81 | - LogUtil.e(TAG,"role 不是空----"); | |
| 82 | - startActivity(MainActivity.class); | |
| 81 | + if (!TextUtils.isEmpty(student)) { | |
| 82 | + LogUtil.e(TAG, "role 不是空----"); | |
| 83 | + Intent intent = new Intent(this, MainActivity.class); | |
| 84 | + startActivity(intent); | |
| 83 | 85 | finish(); |
| 84 | 86 | return; |
| 85 | - }else { | |
| 86 | - LogUtil.e(TAG,"role 是空----"); | |
| 87 | + } else { | |
| 88 | + LogUtil.e(TAG, "role 是空----"); | |
| 87 | 89 | } |
| 88 | 90 | |
| 89 | 91 | |
| 90 | - | |
| 91 | - | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | @Override |
| ... | ... | @@ -97,16 +97,13 @@ public class LoginActivity extends BaseActivity { |
| 97 | 97 | et_phone.setText(""); |
| 98 | 98 | }); |
| 99 | 99 | iv_show.setOnClickListener(view -> { |
| 100 | - | |
| 101 | - if (iv_show.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())){ | |
| 100 | + if (iv_show.getBackground().getConstantState().equals(getDrawable(R.mipmap.xs).getConstantState())) { | |
| 102 | 101 | iv_show.setBackgroundResource(R.mipmap.yc); |
| 103 | 102 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); |
| 104 | - }else { | |
| 103 | + } else { | |
| 105 | 104 | iv_show.setBackgroundResource(R.mipmap.xs); |
| 106 | 105 | et_pwd.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); |
| 107 | 106 | } |
| 108 | - | |
| 109 | - | |
| 110 | 107 | }); |
| 111 | 108 | |
| 112 | 109 | |
| ... | ... | @@ -114,22 +111,22 @@ public class LoginActivity extends BaseActivity { |
| 114 | 111 | |
| 115 | 112 | String phone = et_phone.getText().toString().trim(); |
| 116 | 113 | String pwd = et_pwd.getText().toString().trim(); |
| 117 | - if (phone.isEmpty() || pwd.isEmpty() || phone.length() == 0 || pwd.length() == 0){ | |
| 118 | - Toast.makeText(this,"手机号以及密码不能为空",Toast.LENGTH_SHORT).show(); | |
| 114 | + if (phone.isEmpty() || pwd.isEmpty() || phone.length() == 0 || pwd.length() == 0) { | |
| 115 | + Toast.makeText(this, "手机号以及密码不能为空", Toast.LENGTH_SHORT).show(); | |
| 119 | 116 | return; |
| 120 | 117 | } |
| 121 | 118 | |
| 122 | - if (!PhoneNumberUtils.isGlobalPhoneNumber(et_phone.getText().toString())){ | |
| 123 | - Toast.makeText(this,"请输入正确的手机号码",Toast.LENGTH_SHORT).show(); | |
| 119 | + if (!PhoneNumberUtils.isGlobalPhoneNumber(et_phone.getText().toString())) { | |
| 120 | + Toast.makeText(this, "请输入正确的手机号码", Toast.LENGTH_SHORT).show(); | |
| 124 | 121 | return; |
| 125 | 122 | } |
| 126 | 123 | |
| 127 | - if (!cb_1.isChecked()){ | |
| 128 | - Toast.makeText(this,"请勾选协议",Toast.LENGTH_SHORT).show(); | |
| 124 | + if (!cb_1.isChecked()) { | |
| 125 | + Toast.makeText(this, "请勾选协议", Toast.LENGTH_SHORT).show(); | |
| 129 | 126 | return; |
| 130 | 127 | } |
| 131 | 128 | |
| 132 | - login(phone,pwd); | |
| 129 | + login(phone, pwd); | |
| 133 | 130 | |
| 134 | 131 | }); |
| 135 | 132 | |
| ... | ... | @@ -146,11 +143,11 @@ public class LoginActivity extends BaseActivity { |
| 146 | 143 | }); |
| 147 | 144 | } |
| 148 | 145 | |
| 149 | - public void login(final String phone ,String pwd){ | |
| 146 | + public void login(final String phone, String pwd) { | |
| 150 | 147 | |
| 151 | 148 | Map map = new HashMap(); |
| 152 | - map.put("username",phone); | |
| 153 | - map.put("password",pwd); | |
| 149 | + map.put("username", phone); | |
| 150 | + map.put("password", pwd); | |
| 154 | 151 | |
| 155 | 152 | |
| 156 | 153 | NetWorks.login(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { |
| ... | ... | @@ -162,30 +159,27 @@ public class LoginActivity extends BaseActivity { |
| 162 | 159 | @Override |
| 163 | 160 | public void onNext(ResponseBody responseBody) { |
| 164 | 161 | try { |
| 165 | - | |
| 166 | 162 | String str = responseBody.string().toString(); |
| 167 | - | |
| 168 | - | |
| 169 | - LogUtil.e(TAG,"----"+str); | |
| 163 | + LogUtil.e(TAG, "----" + str); | |
| 170 | 164 | JSONObject jo = new JSONObject(str); |
| 171 | - boolean isSucceed = jo.getBoolean("success"); | |
| 172 | - if (isSucceed){ | |
| 173 | - JSONObject jo2 = jo.getJSONObject("data"); | |
| 174 | - SharedPreferencesUtil.putData("phone",phone); | |
| 175 | - SharedPreferencesUtil.putData("role",jo2.getString("role")); | |
| 176 | - SharedPreferencesUtil.putData("userId",jo2.getString("userId")); | |
| 177 | - SharedPreferencesUtil.putData("token",jo2.getString("token")); | |
| 178 | - | |
| 179 | - startActivity(MainActivity.class); | |
| 180 | - | |
| 181 | - }else { | |
| 182 | - Toast.makeText(LoginActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); | |
| 183 | - } | |
| 184 | - }catch (Exception e){ | |
| 165 | + boolean isSucceed = jo.getBoolean("success"); | |
| 166 | + if (isSucceed) { | |
| 167 | + JSONObject jo2 = jo.getJSONObject("data"); | |
| 168 | + SharedPreferencesUtil.putData("phone", phone); | |
| 169 | + SharedPreferencesUtil.putData("role", jo2.getString("role")); | |
| 170 | + SharedPreferencesUtil.putData("userId", jo2.getString("userId")); | |
| 171 | + SharedPreferencesUtil.putData("token", jo2.getString("token")); | |
| 172 | + JSONObject user = new JSONObject(jo2.getString("user")); | |
| 173 | + SharedPreferencesUtil.putData("photo", user.getString("photo")); | |
| 174 | + startActivity(ChooseActivity.class); | |
| 175 | + finish(); | |
| 176 | + } else { | |
| 177 | + Toast.makeText(LoginActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); | |
| 178 | + } | |
| 179 | + } catch (Exception e) { | |
| 185 | 180 | e.printStackTrace(); |
| 186 | - Toast.makeText(LoginActivity.this,"服务繁忙,请重试",Toast.LENGTH_SHORT).show(); | |
| 181 | + Toast.makeText(LoginActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); | |
| 187 | 182 | } |
| 188 | - | |
| 189 | 183 | } |
| 190 | 184 | |
| 191 | 185 | @Override | ... | ... |
app/src/main/java/com/hjx/parent/MainActivity.java
| ... | ... | @@ -31,72 +31,55 @@ public class MainActivity extends BaseActivity { |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | - | |
| 35 | - | |
| 36 | 34 | HomeFragment homeFragment; |
| 37 | 35 | MeFragment meFragment; |
| 38 | 36 | ConstraintLayout cl_home; |
| 39 | 37 | ConstraintLayout cl_me; |
| 40 | - ImageView iv_3,iv_4; | |
| 41 | - TextView tv_1,tv_4; | |
| 38 | + ImageView iv_3, iv_4; | |
| 39 | + TextView tv_1, tv_4; | |
| 42 | 40 | |
| 43 | 41 | @Override |
| 44 | 42 | protected void initView() { |
| 45 | - showFragment(getHomeFragment(),R.id.rl_content); | |
| 43 | + showFragment(getHomeFragment(), R.id.rl_content); | |
| 46 | 44 | cl_home = findViewById(R.id.cl_home); |
| 47 | 45 | cl_me = findViewById(R.id.cl_me); |
| 48 | 46 | iv_3 = findViewById(R.id.iv_3); |
| 49 | 47 | iv_4 = findViewById(R.id.iv_4); |
| 50 | 48 | tv_1 = findViewById(R.id.tv_1); |
| 51 | 49 | tv_4 = findViewById(R.id.tv_4); |
| 52 | - | |
| 53 | - | |
| 54 | 50 | iv_3.setBackgroundResource(R.mipmap.hoss); |
| 55 | 51 | tv_1.setTextColor(Color.parseColor("#FE5E09")); |
| 56 | - | |
| 57 | - | |
| 58 | - | |
| 59 | 52 | } |
| 60 | 53 | |
| 61 | - public HomeFragment getHomeFragment(){ | |
| 54 | + public HomeFragment getHomeFragment() { | |
| 62 | 55 | if (homeFragment == null) |
| 63 | 56 | homeFragment = new HomeFragment(); |
| 64 | 57 | return homeFragment; |
| 65 | 58 | } |
| 66 | 59 | |
| 67 | - public MeFragment getMeFragment(){ | |
| 60 | + public MeFragment getMeFragment() { | |
| 68 | 61 | if (meFragment == null) |
| 69 | 62 | meFragment = new MeFragment(); |
| 70 | 63 | return meFragment; |
| 71 | 64 | } |
| 72 | 65 | |
| 73 | 66 | |
| 74 | - | |
| 75 | 67 | @Override |
| 76 | 68 | protected void initListener() { |
| 77 | 69 | cl_home.setOnClickListener(view -> { |
| 78 | - showFragment(getHomeFragment(),R.id.rl_content); | |
| 70 | + showFragment(getHomeFragment(), R.id.rl_content); | |
| 79 | 71 | iv_3.setBackgroundResource(R.mipmap.hoss); |
| 80 | 72 | tv_1.setTextColor(Color.parseColor("#FE5E09")); |
| 81 | - | |
| 82 | - | |
| 83 | 73 | iv_4.setBackgroundResource(R.mipmap.wmus); |
| 84 | 74 | tv_4.setTextColor(Color.parseColor("#333333")); |
| 85 | - | |
| 86 | - | |
| 87 | 75 | }); |
| 88 | 76 | |
| 89 | 77 | cl_me.setOnClickListener(view -> { |
| 90 | - showFragment(getMeFragment(),R.id.rl_content); | |
| 91 | - | |
| 78 | + showFragment(getMeFragment(), R.id.rl_content); | |
| 92 | 79 | iv_3.setBackgroundResource(R.mipmap.hous); |
| 93 | 80 | tv_1.setTextColor(Color.parseColor("#333333")); |
| 94 | - | |
| 95 | - | |
| 96 | 81 | iv_4.setBackgroundResource(R.mipmap.wmss); |
| 97 | 82 | tv_4.setTextColor(Color.parseColor("#FE5E09")); |
| 98 | - | |
| 99 | - | |
| 100 | 83 | }); |
| 101 | 84 | } |
| 102 | 85 | ... | ... |
app/src/main/java/com/hjx/parent/NianActivity.java
| 1 | 1 | package com.hjx.parent; |
| 2 | 2 | |
| 3 | +import android.app.AlertDialog; | |
| 4 | +import android.content.DialogInterface; | |
| 5 | +import android.view.View; | |
| 3 | 6 | import android.widget.TextView; |
| 7 | +import android.widget.Toast; | |
| 4 | 8 | |
| 9 | +import com.google.gson.Gson; | |
| 10 | +import com.prws.common.bean.GradeAndSubject; | |
| 5 | 11 | import com.prws.common.base.BaseActivity; |
| 6 | 12 | import com.prws.common.base.BasePresenter; |
| 13 | +import com.prws.common.bean.ResponseResult; | |
| 14 | +import com.prws.common.net.NetWorks; | |
| 7 | 15 | import com.prws.common.utils.SharedPreferencesUtil; |
| 8 | 16 | |
| 17 | +import java.io.IOException; | |
| 18 | +import java.util.ArrayList; | |
| 19 | +import java.util.List; | |
| 20 | + | |
| 21 | +import butterknife.BindView; | |
| 22 | +import butterknife.OnClick; | |
| 23 | +import io.reactivex.Observer; | |
| 24 | +import io.reactivex.disposables.Disposable; | |
| 25 | +import okhttp3.ResponseBody; | |
| 26 | + | |
| 9 | 27 | public class NianActivity extends BaseActivity { |
| 10 | 28 | @Override |
| 11 | 29 | protected int layoutResId() { |
| ... | ... | @@ -22,21 +40,81 @@ public class NianActivity extends BaseActivity { |
| 22 | 40 | return null; |
| 23 | 41 | } |
| 24 | 42 | |
| 43 | + @BindView(R.id.tv_nian) | |
| 25 | 44 | TextView tv_nian; |
| 45 | + @BindView(R.id.tv_xq) | |
| 26 | 46 | TextView tv_xq; |
| 47 | + private int gradeId; | |
| 27 | 48 | |
| 28 | 49 | @Override |
| 29 | 50 | protected void initView() { |
| 30 | - tv_nian = findViewById(R.id.tv_nian); | |
| 31 | - tv_xq = findViewById(R.id.tv_xq); | |
| 32 | 51 | findViewById(R.id.tv_cancel).setOnClickListener(view -> onBackPressed()); |
| 33 | 52 | findViewById(R.id.tv_ok).setOnClickListener(view -> { |
| 34 | 53 | SharedPreferencesUtil.putData("setNian", tv_nian.getText()); |
| 35 | 54 | SharedPreferencesUtil.putData("setXueq", tv_xq.getText()); |
| 55 | + SharedPreferencesUtil.putData("grade", gradeId); | |
| 36 | 56 | finish(); |
| 37 | 57 | }); |
| 58 | + } | |
| 59 | + | |
| 60 | + @OnClick(R.id.view_3) | |
| 61 | + public void changeTerm(View view) { | |
| 62 | + String[] strings = {"上学期", "下学期"}; | |
| 63 | + AlertDialog.Builder builder = new AlertDialog.Builder(NianActivity.this, android.R.style.Theme_DeviceDefault_Light_Dialog_Alert); | |
| 64 | + builder.setTitle("请选择学期"); | |
| 65 | + builder.setSingleChoiceItems(strings, 0, new DialogInterface.OnClickListener() { | |
| 66 | + @Override | |
| 67 | + public void onClick(DialogInterface dialogInterface, int i) { | |
| 68 | + tv_xq.setText(strings[i]); | |
| 69 | + dialogInterface.dismiss(); | |
| 70 | + } | |
| 71 | + }); | |
| 72 | + builder.setCancelable(false); | |
| 73 | + builder.show(); | |
| 74 | + } | |
| 38 | 75 | |
| 76 | + @OnClick(R.id.view_2) | |
| 77 | + public void getGradeAndSubject(View view) { | |
| 78 | + NetWorks.listGradeAndSubject(new Observer<ResponseResult<List<GradeAndSubject>>>() { | |
| 79 | + @Override | |
| 80 | + public void onSubscribe(Disposable d) { | |
| 39 | 81 | |
| 82 | + } | |
| 83 | + | |
| 84 | + @Override | |
| 85 | + public void onNext(ResponseResult<List<GradeAndSubject>> listResponseResult) { | |
| 86 | + if (listResponseResult != null && listResponseResult.getCode() == 200) { | |
| 87 | + List<GradeAndSubject> list = listResponseResult.getData(); | |
| 88 | + List<String> stringList = new ArrayList<>(); | |
| 89 | + for (GradeAndSubject gradeAndSubject : list) { | |
| 90 | + stringList.add(gradeAndSubject.getGrade().getGrade()); | |
| 91 | + } | |
| 92 | + String[] strings = stringList.toArray(new String[stringList.size()]); | |
| 93 | + AlertDialog.Builder builder = new AlertDialog.Builder(NianActivity.this, android.R.style.Theme_DeviceDefault_Light_Dialog_Alert); | |
| 94 | + builder.setTitle("请选择年级"); | |
| 95 | + builder.setSingleChoiceItems(strings, 0, new DialogInterface.OnClickListener() { | |
| 96 | + @Override | |
| 97 | + public void onClick(DialogInterface dialogInterface, int i) { | |
| 98 | + tv_nian.setText(list.get(i).getGrade().getGrade()); | |
| 99 | + gradeId = list.get(i).getGrade().getId(); | |
| 100 | + dialogInterface.dismiss(); | |
| 101 | + } | |
| 102 | + }); | |
| 103 | + builder.setCancelable(false); | |
| 104 | + builder.show(); | |
| 105 | + } | |
| 106 | + } | |
| 107 | + | |
| 108 | + @Override | |
| 109 | + public void onError(Throwable e) { | |
| 110 | + e.toString(); | |
| 111 | + } | |
| 112 | + | |
| 113 | + @Override | |
| 114 | + public void onComplete() { | |
| 115 | + | |
| 116 | + } | |
| 117 | + }); | |
| 40 | 118 | } |
| 41 | 119 | |
| 42 | 120 | @Override | ... | ... |
app/src/main/java/com/hjx/parent/QRActivity.java
| ... | ... | @@ -47,7 +47,7 @@ public class QRActivity extends BaseActivity { |
| 47 | 47 | captureFragment.setAnalyzeCallback(new CodeUtils.AnalyzeCallback() { |
| 48 | 48 | @Override |
| 49 | 49 | public void onAnalyzeSuccess(Bitmap mBitmap, String result) { |
| 50 | - LogUtil.e(TAG,"result----:"+result); | |
| 50 | + LogUtil.e(TAG, "result----:" + result); | |
| 51 | 51 | |
| 52 | 52 | loginAnd(result); |
| 53 | 53 | |
| ... | ... | @@ -65,7 +65,7 @@ public class QRActivity extends BaseActivity { |
| 65 | 65 | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public void loginAnd(String str){ | |
| 68 | + public void loginAnd(String str) { | |
| 69 | 69 | NetWorks.scanAndLogin(str, new Observer<ResponseBody>() { |
| 70 | 70 | @Override |
| 71 | 71 | public void onSubscribe(Disposable d) { |
| ... | ... | @@ -77,25 +77,20 @@ public class QRActivity extends BaseActivity { |
| 77 | 77 | try { |
| 78 | 78 | |
| 79 | 79 | String str = responseBody.string().toString(); |
| 80 | - LogUtil.e(TAG,"----"+str); | |
| 80 | + LogUtil.e(TAG, "----" + str); | |
| 81 | 81 | JSONObject jo = new JSONObject(str); |
| 82 | - boolean isSucceed = jo.getBoolean("success"); | |
| 83 | - if (isSucceed){ | |
| 82 | + boolean isSucceed = jo.getBoolean("success"); | |
| 83 | + if (isSucceed) { | |
| 84 | 84 | startActivity(MainActivity.class); |
| 85 | 85 | finish(); |
| 86 | - }else { | |
| 86 | + } else { | |
| 87 | 87 | Toast.makeText(QRActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); |
| 88 | 88 | } |
| 89 | - }catch (Exception e){ | |
| 89 | + } catch (Exception e) { | |
| 90 | 90 | e.printStackTrace(); |
| 91 | - Toast.makeText(QRActivity.this,"服务繁忙,请重试",Toast.LENGTH_SHORT).show(); | |
| 91 | + Toast.makeText(QRActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); | |
| 92 | 92 | startActivity(MainActivity.class); |
| 93 | 93 | } |
| 94 | - | |
| 95 | - | |
| 96 | - | |
| 97 | - | |
| 98 | - | |
| 99 | 94 | } |
| 100 | 95 | |
| 101 | 96 | @Override | ... | ... |
app/src/main/java/com/hjx/parent/RegisterActivity.java
| ... | ... | @@ -28,6 +28,8 @@ import com.prws.common.utils.SharedPreferencesUtil; |
| 28 | 28 | import com.uuzuche.lib_zxing.activity.CaptureActivity; |
| 29 | 29 | import com.uuzuche.lib_zxing.activity.CodeUtils; |
| 30 | 30 | |
| 31 | +import org.json.JSONObject; | |
| 32 | + | |
| 31 | 33 | import java.io.IOException; |
| 32 | 34 | import java.util.HashMap; |
| 33 | 35 | import java.util.List; |
| ... | ... | @@ -192,12 +194,10 @@ public class RegisterActivity extends BaseActivity { |
| 192 | 194 | } |
| 193 | 195 | |
| 194 | 196 | if (registerBean.getData().getUserName() != null && registerBean.getData().getUserName().length() > 0) { |
| 195 | - SharedPreferencesUtil.putData("phone",phone); | |
| 196 | - SharedPreferencesUtil.putData("role",registerBean.getData().getUserName()); | |
| 197 | - SharedPreferencesUtil.putData("userId",registerBean.getData().getUserName()); | |
| 198 | - | |
| 199 | - //进入扫码界面 | |
| 200 | - goQRView(); | |
| 197 | + SharedPreferencesUtil.putData("phone", phone); | |
| 198 | + SharedPreferencesUtil.putData("role", registerBean.getData().getUserName()); | |
| 199 | + SharedPreferencesUtil.putData("userId", registerBean.getData().getUserName()); | |
| 200 | + login(phone, pwd); | |
| 201 | 201 | |
| 202 | 202 | } |
| 203 | 203 | |
| ... | ... | @@ -216,6 +216,53 @@ public class RegisterActivity extends BaseActivity { |
| 216 | 216 | }); |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | + public void login(final String phone, String pwd) { | |
| 220 | + Map map = new HashMap(); | |
| 221 | + map.put("username", phone); | |
| 222 | + map.put("password", pwd); | |
| 223 | + | |
| 224 | + NetWorks.login(NetWorks.getMapRequestBody(map), new Observer<ResponseBody>() { | |
| 225 | + @Override | |
| 226 | + public void onSubscribe(Disposable d) { | |
| 227 | + | |
| 228 | + } | |
| 229 | + | |
| 230 | + @Override | |
| 231 | + public void onNext(ResponseBody responseBody) { | |
| 232 | + try { | |
| 233 | + String str = responseBody.string().toString(); | |
| 234 | + LogUtil.e(TAG, "----" + str); | |
| 235 | + JSONObject jo = new JSONObject(str); | |
| 236 | + boolean isSucceed = jo.getBoolean("success"); | |
| 237 | + if (isSucceed) { | |
| 238 | + JSONObject jo2 = jo.getJSONObject("data"); | |
| 239 | + SharedPreferencesUtil.putData("phone", phone); | |
| 240 | + SharedPreferencesUtil.putData("role", jo2.getString("role")); | |
| 241 | + SharedPreferencesUtil.putData("userId", jo2.getString("userId")); | |
| 242 | + SharedPreferencesUtil.putData("token", jo2.getString("token")); | |
| 243 | + startActivity(ChooseActivity.class); | |
| 244 | + } else { | |
| 245 | + Toast.makeText(RegisterActivity.this, jo.getString("msg"), Toast.LENGTH_SHORT).show(); | |
| 246 | + } | |
| 247 | + } catch (Exception e) { | |
| 248 | + e.printStackTrace(); | |
| 249 | + Toast.makeText(RegisterActivity.this, "服务繁忙,请重试", Toast.LENGTH_SHORT).show(); | |
| 250 | + } | |
| 251 | + | |
| 252 | + } | |
| 253 | + | |
| 254 | + @Override | |
| 255 | + public void onError(Throwable e) { | |
| 256 | + | |
| 257 | + } | |
| 258 | + | |
| 259 | + @Override | |
| 260 | + public void onComplete() { | |
| 261 | + | |
| 262 | + } | |
| 263 | + }); | |
| 264 | + } | |
| 265 | + | |
| 219 | 266 | public void goQRView() { |
| 220 | 267 | |
| 221 | 268 | if (!XXPermissions.isGranted(this, Permission.CAMERA)) { |
| ... | ... | @@ -256,7 +303,6 @@ public class RegisterActivity extends BaseActivity { |
| 256 | 303 | } |
| 257 | 304 | |
| 258 | 305 | |
| 259 | - | |
| 260 | 306 | @Override |
| 261 | 307 | protected void initData() { |
| 262 | 308 | ... | ... |
app/src/main/java/com/hjx/parent/bean/StudentBean.java
| ... | ... | @@ -18,6 +18,11 @@ public class StudentBean { |
| 18 | 18 | String parentIdentity; |
| 19 | 19 | String teacherName; |
| 20 | 20 | int teacherId; |
| 21 | + String teacherAvatar; | |
| 22 | + String grade; | |
| 23 | + String teacherIdentity; | |
| 24 | + int sex; | |
| 25 | + | |
| 21 | 26 | |
| 22 | 27 | @Override |
| 23 | 28 | public String toString() { |
| ... | ... | @@ -38,9 +43,45 @@ public class StudentBean { |
| 38 | 43 | ", parentIdentity='" + parentIdentity + '\'' + |
| 39 | 44 | ", teacherName='" + teacherName + '\'' + |
| 40 | 45 | ", teacherId=" + teacherId + |
| 46 | + ", teacherAvatar=" + teacherAvatar + | |
| 47 | + ", grade=" + grade + | |
| 48 | + ", teacherIdentity=" + teacherIdentity + | |
| 49 | + ", sex=" + sex + | |
| 41 | 50 | '}'; |
| 42 | 51 | } |
| 43 | 52 | |
| 53 | + public void setSex(int sex) { | |
| 54 | + this.sex = sex; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public int getSex() { | |
| 58 | + return sex; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setTeacherIdentity(String teacherIdentity) { | |
| 62 | + this.teacherIdentity = teacherIdentity; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public String getTeacherIdentity() { | |
| 66 | + return teacherIdentity; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void setTeacherAvatar(String teacherAvatar) { | |
| 70 | + this.teacherAvatar = teacherAvatar; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void setGrade(String grade) { | |
| 74 | + this.grade = grade; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public String getTeacherAvatar() { | |
| 78 | + return teacherAvatar; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public String getGrade() { | |
| 82 | + return grade; | |
| 83 | + } | |
| 84 | + | |
| 44 | 85 | public String getStuId() { |
| 45 | 86 | return stuId; |
| 46 | 87 | } | ... | ... |
app/src/main/java/com/hjx/parent/fragment/HomeFragment.java
| ... | ... | @@ -2,23 +2,51 @@ package com.hjx.parent.fragment; |
| 2 | 2 | |
| 3 | 3 | import android.content.Intent; |
| 4 | 4 | import android.os.Bundle; |
| 5 | +import android.text.TextUtils; | |
| 6 | +import android.view.LayoutInflater; | |
| 7 | +import android.view.View; | |
| 5 | 8 | import android.widget.ImageView; |
| 9 | +import android.widget.LinearLayout; | |
| 6 | 10 | import android.widget.TextView; |
| 7 | 11 | import android.widget.Toast; |
| 8 | 12 | |
| 13 | +import androidx.annotation.NonNull; | |
| 9 | 14 | import androidx.annotation.Nullable; |
| 10 | - | |
| 15 | +import androidx.recyclerview.widget.LinearLayoutManager; | |
| 16 | +import androidx.recyclerview.widget.RecyclerView; | |
| 17 | + | |
| 18 | +import com.bumptech.glide.Glide; | |
| 19 | +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | |
| 20 | +import com.bumptech.glide.request.RequestOptions; | |
| 21 | +import com.chad.library.adapter.base.BaseQuickAdapter; | |
| 22 | +import com.chad.library.adapter.base.BaseViewHolder; | |
| 23 | +import com.google.gson.Gson; | |
| 11 | 24 | import com.hjq.permissions.OnPermissionCallback; |
| 12 | 25 | import com.hjq.permissions.Permission; |
| 13 | 26 | import com.hjq.permissions.XXPermissions; |
| 27 | +import com.hjx.parent.ChooseActivity; | |
| 28 | +import com.hjx.parent.QRActivity; | |
| 14 | 29 | import com.hjx.parent.R; |
| 30 | +import com.hjx.parent.bean.StudentBean; | |
| 15 | 31 | import com.prws.common.base.BaseFragment; |
| 32 | +import com.prws.common.bean.ResponseResult; | |
| 33 | +import com.prws.common.bean.ScheduleBean; | |
| 34 | +import com.prws.common.bean.Video; | |
| 35 | +import com.prws.common.net.NetWorks; | |
| 36 | +import com.prws.common.utils.ScreenUtils; | |
| 16 | 37 | import com.prws.common.utils.SharedPreferencesUtil; |
| 17 | 38 | import com.uuzuche.lib_zxing.activity.CaptureActivity; |
| 18 | 39 | import com.uuzuche.lib_zxing.activity.CodeUtils; |
| 19 | 40 | |
| 41 | +import java.text.SimpleDateFormat; | |
| 42 | +import java.util.ArrayList; | |
| 20 | 43 | import java.util.List; |
| 21 | 44 | |
| 45 | +import butterknife.BindView; | |
| 46 | +import butterknife.OnClick; | |
| 47 | +import io.reactivex.Observer; | |
| 48 | +import io.reactivex.disposables.Disposable; | |
| 49 | + | |
| 22 | 50 | public class HomeFragment extends BaseFragment { |
| 23 | 51 | @Override |
| 24 | 52 | protected int getLayoutRes() { |
| ... | ... | @@ -27,27 +55,36 @@ public class HomeFragment extends BaseFragment { |
| 27 | 55 | |
| 28 | 56 | ImageView iv_sapmiao; |
| 29 | 57 | TextView tv_name; |
| 58 | + StudentBean studentBean; | |
| 59 | + ImageView iv_2; | |
| 60 | + @BindView(R.id.recycle) | |
| 61 | + RecyclerView recyclerView; | |
| 62 | + @BindView(R.id.tv_empty) | |
| 63 | + TextView tv_empty; | |
| 64 | + @BindView(R.id.iv_empty) | |
| 65 | + ImageView iv_empty; | |
| 66 | + | |
| 30 | 67 | @Override |
| 31 | 68 | protected void initDatas() { |
| 32 | 69 | super.initDatas(); |
| 70 | + iv_2 = mRootView.findViewById(R.id.iv_2); | |
| 33 | 71 | iv_sapmiao = mRootView.findViewById(R.id.iv_sapmiao); |
| 34 | 72 | tv_name = mRootView.findViewById(R.id.tv_name); |
| 35 | 73 | iv_sapmiao.setOnClickListener(view -> { |
| 36 | - | |
| 37 | - if (!XXPermissions.isGranted(getActivity(), Permission.CAMERA)){ | |
| 74 | + if (!XXPermissions.isGranted(getActivity(), Permission.CAMERA)) { | |
| 38 | 75 | XXPermissions.with(getActivity()) |
| 39 | 76 | // 申请多个权限 |
| 40 | 77 | .permission(Permission.CAMERA) |
| 41 | 78 | .request(new OnPermissionCallback() { |
| 42 | 79 | @Override |
| 43 | 80 | public void onGranted(List<String> permissions, boolean all) { |
| 44 | - if (all){ | |
| 81 | + if (all) { | |
| 45 | 82 | //开启扫码界面 |
| 46 | 83 | startQRView(); |
| 47 | 84 | |
| 48 | 85 | |
| 49 | - }else { | |
| 50 | - Toast.makeText(getActivity(),"需要相机权限",Toast.LENGTH_SHORT).show(); | |
| 86 | + } else { | |
| 87 | + Toast.makeText(getActivity(), "需要相机权限", Toast.LENGTH_SHORT).show(); | |
| 51 | 88 | } |
| 52 | 89 | } |
| 53 | 90 | |
| ... | ... | @@ -56,38 +93,68 @@ public class HomeFragment extends BaseFragment { |
| 56 | 93 | XXPermissions.startPermissionActivity(getActivity(), permissions); |
| 57 | 94 | } |
| 58 | 95 | }); |
| 96 | + } else { | |
| 97 | + startQRView(); | |
| 98 | + } | |
| 59 | 99 | |
| 100 | + }); | |
| 101 | + } | |
| 60 | 102 | |
| 61 | 103 | |
| 62 | - | |
| 63 | - }else { | |
| 64 | - startQRView(); | |
| 104 | + @Override | |
| 105 | + public void onResume() { | |
| 106 | + super.onResume(); | |
| 107 | + String student = (String) SharedPreferencesUtil.getData("student", ""); | |
| 108 | + try { | |
| 109 | + studentBean = new Gson().fromJson(student, StudentBean.class); | |
| 110 | + tv_name.setText(studentBean.getNickName()); | |
| 111 | + if (TextUtils.isEmpty(studentBean.getPhoto())) { | |
| 112 | + iv_2.setImageResource(studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
| 113 | + } else { | |
| 114 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 20)); | |
| 115 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 116 | + Glide.with(getActivity()).load(studentBean.getPhoto()).apply(options).into(iv_2); | |
| 65 | 117 | } |
| 118 | + getWeekPlan(studentBean.getStuId()); | |
| 119 | + } catch (Exception e) { | |
| 66 | 120 | |
| 121 | + } | |
| 122 | + } | |
| 67 | 123 | |
| 68 | - }); | |
| 124 | + public void getWeekPlan(String id) { | |
| 125 | + NetWorks.getWeekPlan(id, new Observer<ResponseResult<ScheduleBean>>() { | |
| 126 | + @Override | |
| 127 | + public void onSubscribe(Disposable d) { | |
| 69 | 128 | |
| 70 | - String role = (String) SharedPreferencesUtil.getData("role",""); | |
| 71 | - String userId = (String) SharedPreferencesUtil.getData("userId",""); | |
| 72 | - String token = (String) SharedPreferencesUtil.getData("token",""); | |
| 73 | - String phone = (String) SharedPreferencesUtil.getData("phone",""); | |
| 74 | - if (role != null && role.length() > 0) | |
| 75 | - tv_name.setText(role); | |
| 129 | + } | |
| 76 | 130 | |
| 77 | - } | |
| 131 | + @Override | |
| 132 | + public void onNext(ResponseResult<ScheduleBean> result) { | |
| 133 | + if (result != null && result.getCode() == 200) { | |
| 134 | + showWeekPlan(result.getData().getList()); | |
| 135 | + } | |
| 136 | + } | |
| 78 | 137 | |
| 79 | - public void startQRView(){ | |
| 138 | + @Override | |
| 139 | + public void onError(Throwable e) { | |
| 80 | 140 | |
| 141 | + } | |
| 81 | 142 | |
| 82 | - startActivityForResult(new Intent(getActivity(), CaptureActivity.class),101); | |
| 143 | + @Override | |
| 144 | + public void onComplete() { | |
| 83 | 145 | |
| 146 | + } | |
| 147 | + }); | |
| 148 | + } | |
| 84 | 149 | |
| 150 | + public void startQRView() { | |
| 151 | + startActivityForResult(new Intent(getActivity(), QRActivity.class), 101); | |
| 85 | 152 | } |
| 86 | 153 | |
| 87 | 154 | @Override |
| 88 | 155 | public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { |
| 89 | 156 | super.onActivityResult(requestCode, resultCode, data); |
| 90 | - if (requestCode == 101){ | |
| 157 | + if (requestCode == 101) { | |
| 91 | 158 | if (null != data) { |
| 92 | 159 | Bundle bundle = data.getExtras(); |
| 93 | 160 | if (bundle == null) { |
| ... | ... | @@ -101,7 +168,72 @@ public class HomeFragment extends BaseFragment { |
| 101 | 168 | } |
| 102 | 169 | } |
| 103 | 170 | } |
| 171 | + } | |
| 172 | + | |
| 173 | + @OnClick({R.id.iv_2, R.id.tv_name}) | |
| 174 | + public void choose(View view) { | |
| 175 | + Intent intent = new Intent(getActivity(), ChooseActivity.class); | |
| 176 | + startActivity(intent); | |
| 177 | + } | |
| 178 | + | |
| 179 | + @OnClick(R.id.iv_1) | |
| 180 | + public void exit(View view) { | |
| 181 | + getActivity().finish(); | |
| 182 | + } | |
| 183 | + | |
| 184 | + private void showWeekPlan(List<Video> list) { | |
| 185 | + iv_empty.setVisibility(list.size() > 0 ? View.GONE : View.VISIBLE); | |
| 186 | + tv_empty.setVisibility(list.size() > 0 ? View.GONE : View.VISIBLE); | |
| 187 | + List<Schedule> schedules = new ArrayList<>(); | |
| 188 | + for (int i = 0; i < list.size(); i++) { | |
| 189 | + String date = new SimpleDateFormat("yyyy.MM.dd").format(list.get(i).getStudyTime()); | |
| 190 | + if (schedules.size() > 0 && schedules.get(schedules.size() - 1).getDate().equals(date)) { | |
| 191 | + schedules.get(schedules.size() - 1).getStrings().add(list.get(i).getSectionChildName()); | |
| 192 | + } else { | |
| 193 | + List<String> stringList = new ArrayList<>(); | |
| 194 | + Schedule schedule = new Schedule(); | |
| 195 | + schedule.setDate(date); | |
| 196 | + stringList.add(list.get(i).getSectionChildName()); | |
| 197 | + schedule.setStrings(stringList); | |
| 198 | + schedules.add(schedule); | |
| 199 | + } | |
| 200 | + } | |
| 201 | + BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_schedule, schedules) { | |
| 202 | + @Override | |
| 203 | + protected void convert(@NonNull BaseViewHolder item, Object o) { | |
| 204 | + Schedule schedule = schedules.get(item.getAdapterPosition()); | |
| 205 | + item.setText(R.id.tv_date, schedule.getDate()); | |
| 206 | + LinearLayout layout = item.getView(R.id.ll_schedule); | |
| 207 | + for (int i = 0; i < schedule.getStrings().size(); i++) { | |
| 208 | + View view = LayoutInflater.from(getContext()).inflate(R.layout.item_video, null); | |
| 209 | + TextView textView = view.findViewById(R.id.tv_name); | |
| 210 | + textView.setText(schedule.getStrings().get(i)); | |
| 211 | + layout.addView(view); | |
| 212 | + } | |
| 213 | + } | |
| 214 | + }; | |
| 215 | + recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false)); | |
| 216 | + recyclerView.setAdapter(adapter); | |
| 217 | + } | |
| 218 | + | |
| 219 | + class Schedule { | |
| 220 | + String date; | |
| 221 | + List<String> strings; | |
| 222 | + | |
| 223 | + public void setDate(String date) { | |
| 224 | + this.date = date; | |
| 225 | + } | |
| 104 | 226 | |
| 227 | + public void setStrings(List<String> strings) { | |
| 228 | + this.strings = strings; | |
| 229 | + } | |
| 105 | 230 | |
| 231 | + public String getDate() { | |
| 232 | + return date; | |
| 233 | + } | |
| 234 | + | |
| 235 | + public List<String> getStrings() { | |
| 236 | + return strings; | |
| 237 | + } | |
| 106 | 238 | } |
| 107 | 239 | } | ... | ... |
app/src/main/java/com/hjx/parent/fragment/MeFragment.java
| 1 | 1 | package com.hjx.parent.fragment; |
| 2 | 2 | |
| 3 | +import android.app.AlertDialog; | |
| 4 | +import android.content.DialogInterface; | |
| 3 | 5 | import android.content.Intent; |
| 6 | +import android.text.TextUtils; | |
| 4 | 7 | import android.view.View; |
| 5 | 8 | import android.widget.ImageView; |
| 6 | 9 | import android.widget.TextView; |
| 7 | 10 | import android.widget.Toast; |
| 8 | 11 | |
| 12 | +import androidx.annotation.NonNull; | |
| 13 | +import androidx.annotation.Nullable; | |
| 9 | 14 | import androidx.constraintlayout.widget.Group; |
| 15 | +import androidx.recyclerview.widget.LinearLayoutManager; | |
| 16 | +import androidx.recyclerview.widget.RecyclerView; | |
| 10 | 17 | |
| 11 | 18 | import com.bumptech.glide.Glide; |
| 19 | +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; | |
| 20 | +import com.bumptech.glide.request.RequestOptions; | |
| 21 | +import com.chad.library.adapter.base.BaseQuickAdapter; | |
| 22 | +import com.chad.library.adapter.base.BaseViewHolder; | |
| 12 | 23 | import com.developer.wang.utils.PermissionUtils; |
| 13 | 24 | import com.google.gson.Gson; |
| 14 | 25 | import com.google.gson.JsonArray; |
| ... | ... | @@ -17,6 +28,7 @@ import com.hjq.permissions.Permission; |
| 17 | 28 | import com.hjq.permissions.XXPermissions; |
| 18 | 29 | import com.hjx.parent.AccountActivity; |
| 19 | 30 | import com.hjx.parent.AddStudentActivity; |
| 31 | +import com.hjx.parent.EditStudentActivity; | |
| 20 | 32 | import com.hjx.parent.LoginActivity; |
| 21 | 33 | import com.hjx.parent.MainActivity; |
| 22 | 34 | import com.hjx.parent.QRActivity; |
| ... | ... | @@ -27,6 +39,7 @@ import com.hjx.parent.bean.StudentBean; |
| 27 | 39 | import com.prws.common.base.BaseFragment; |
| 28 | 40 | import com.prws.common.net.NetWorks; |
| 29 | 41 | import com.prws.common.utils.LogUtil; |
| 42 | +import com.prws.common.utils.ScreenUtils; | |
| 30 | 43 | import com.prws.common.utils.SharedPreferencesUtil; |
| 31 | 44 | |
| 32 | 45 | import org.json.JSONArray; |
| ... | ... | @@ -37,6 +50,8 @@ import java.util.HashMap; |
| 37 | 50 | import java.util.List; |
| 38 | 51 | import java.util.Map; |
| 39 | 52 | |
| 53 | +import butterknife.BindView; | |
| 54 | +import butterknife.OnClick; | |
| 40 | 55 | import io.reactivex.Observer; |
| 41 | 56 | import io.reactivex.disposables.Disposable; |
| 42 | 57 | import okhttp3.ResponseBody; |
| ... | ... | @@ -47,109 +62,45 @@ public class MeFragment extends BaseFragment { |
| 47 | 62 | return R.layout.fragment_me; |
| 48 | 63 | } |
| 49 | 64 | |
| 50 | - ImageView iv_bann; | |
| 51 | 65 | Group group_1; |
| 52 | 66 | TextView tv_name; |
| 53 | 67 | TextView tv_phone; |
| 54 | - ImageView iv_21, iv_22, iv_23; | |
| 55 | - TextView tv_21, tv_22, tv_23; | |
| 56 | - | |
| 68 | + ImageView iv_toux; | |
| 69 | + RecyclerView recycle; | |
| 57 | 70 | |
| 58 | 71 | @Override |
| 59 | 72 | protected void initDatas() { |
| 60 | 73 | super.initDatas(); |
| 61 | - | |
| 62 | - | |
| 63 | - iv_bann = mRootView.findViewById(R.id.iv_bann); | |
| 74 | + recycle = mRootView.findViewById(R.id.recycle); | |
| 64 | 75 | group_1 = mRootView.findViewById(R.id.group_1); |
| 65 | - | |
| 66 | 76 | String role = (String) SharedPreferencesUtil.getData("role", ""); |
| 67 | 77 | String userId = (String) SharedPreferencesUtil.getData("userId", ""); |
| 68 | 78 | String token = (String) SharedPreferencesUtil.getData("token", ""); |
| 69 | 79 | String phone = (String) SharedPreferencesUtil.getData("phone", ""); |
| 70 | - if (role == null || role.length() == 0) { | |
| 71 | - iv_bann.setVisibility(View.VISIBLE); | |
| 72 | - group_1.setVisibility(View.GONE); | |
| 73 | - | |
| 74 | - iv_bann.setOnClickListener(view -> { | |
| 75 | - | |
| 76 | - if (!XXPermissions.isGranted(getActivity(), Permission.CAMERA)) { | |
| 77 | - XXPermissions.with(getActivity()) | |
| 78 | - // 申请多个权限 | |
| 79 | - .permission(Permission.CAMERA) | |
| 80 | - .request(new OnPermissionCallback() { | |
| 81 | - @Override | |
| 82 | - public void onGranted(List<String> permissions, boolean all) { | |
| 83 | - if (all) { | |
| 84 | - //开启扫码界面 | |
| 85 | - startActivity(new Intent(getActivity(), QRActivity.class)); | |
| 86 | - getActivity().finish(); | |
| 87 | - } else { | |
| 88 | - Toast.makeText(getActivity(), "需要相机权限", Toast.LENGTH_SHORT).show(); | |
| 89 | - } | |
| 90 | - } | |
| 91 | - | |
| 92 | - @Override | |
| 93 | - public void onDenied(List<String> permissions, boolean never) { | |
| 94 | - XXPermissions.startPermissionActivity(getActivity(), permissions); | |
| 95 | - } | |
| 96 | - }); | |
| 97 | - | |
| 98 | - | |
| 99 | - } | |
| 100 | - | |
| 101 | - | |
| 102 | - }); | |
| 103 | - return; | |
| 104 | - } else { | |
| 105 | - iv_bann.setVisibility(View.GONE); | |
| 106 | - group_1.setVisibility(View.VISIBLE); | |
| 107 | - } | |
| 80 | + group_1.setVisibility(View.VISIBLE); | |
| 81 | + iv_toux = mRootView.findViewById(R.id.iv_toux); | |
| 108 | 82 | tv_name = mRootView.findViewById(R.id.tv_name); |
| 109 | 83 | tv_phone = mRootView.findViewById(R.id.tv_phone); |
| 110 | - iv_21 = mRootView.findViewById(R.id.iv_21); | |
| 111 | - iv_22 = mRootView.findViewById(R.id.iv_22); | |
| 112 | - iv_23 = mRootView.findViewById(R.id.iv_23); | |
| 113 | - tv_21 = mRootView.findViewById(R.id.tv_21); | |
| 114 | - tv_22 = mRootView.findViewById(R.id.tv_22); | |
| 115 | - tv_23 = mRootView.findViewById(R.id.tv_23); | |
| 116 | - | |
| 117 | - tv_phone.setText(phone); | |
| 118 | - tv_name.setText(role); | |
| 119 | - | |
| 120 | - iv_21.setOnClickListener(view -> { | |
| 121 | - if (iv_21.getBackground().getConstantState().equals(getActivity().getDrawable(R.mipmap.tjxss).getConstantState())) { | |
| 122 | - startActivity(new Intent(getActivity(), AddStudentActivity.class)); | |
| 123 | - } | |
| 124 | - | |
| 125 | - }); | |
| 126 | - | |
| 127 | - iv_22.setOnClickListener(view -> { | |
| 128 | - if (iv_22.getBackground().getConstantState().equals(getActivity().getDrawable(R.mipmap.tjxss).getConstantState())) { | |
| 129 | - startActivity(new Intent(getActivity(), AddStudentActivity.class)); | |
| 130 | - | |
| 131 | - } | |
| 132 | - }); | |
| 133 | - iv_23.setOnClickListener(view -> { | |
| 134 | - if (iv_23.getBackground().getConstantState().equals(getActivity().getDrawable(R.mipmap.tjxss).getConstantState())) { | |
| 135 | - startActivity(new Intent(getActivity(), AddStudentActivity.class)); | |
| 136 | - } | |
| 137 | - }); | |
| 138 | - | |
| 139 | - | |
| 84 | + tv_phone.setVisibility(View.GONE); | |
| 85 | +// tv_phone.setText(phone); | |
| 86 | + tv_name.setText(phone); | |
| 140 | 87 | } |
| 141 | 88 | |
| 142 | 89 | @Override |
| 143 | 90 | public void onResume() { |
| 144 | 91 | super.onResume(); |
| 92 | + String photo = (String) SharedPreferencesUtil.getData("photo", ""); | |
| 93 | + if (!TextUtils.isEmpty(photo)) { | |
| 94 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); | |
| 95 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 96 | + Glide.with(getContext()).load(photo).apply(options).into(iv_toux); | |
| 97 | + } | |
| 145 | 98 | loadChildList(); |
| 146 | 99 | } |
| 147 | 100 | |
| 148 | 101 | ArrayList<StudentBean> alist = new ArrayList<>(); |
| 149 | 102 | |
| 150 | 103 | public void loadChildList() { |
| 151 | - | |
| 152 | - | |
| 153 | 104 | NetWorks.listChildren(new Observer<ResponseBody>() { |
| 154 | 105 | @Override |
| 155 | 106 | public void onSubscribe(Disposable d) { |
| ... | ... | @@ -171,85 +122,20 @@ public class MeFragment extends BaseFragment { |
| 171 | 122 | alist.clear(); |
| 172 | 123 | for (int i = 0; i < jarr.length(); i++) { |
| 173 | 124 | JSONObject jo2 = jarr.getJSONObject(i); |
| 174 | - StudentBean sb = new StudentBean(); | |
| 175 | - try { | |
| 176 | - sb.setStuId(jo2.getString("stuId")); | |
| 177 | - } catch (Exception e) { | |
| 178 | - } | |
| 179 | - try { | |
| 180 | - sb.setStuName(jo2.getString("stuName")); | |
| 181 | - } catch (Exception e) { | |
| 182 | - } | |
| 183 | - try { | |
| 184 | - sb.setGender(jo2.getInt("gender")); | |
| 185 | - } catch (Exception e) { | |
| 186 | - } | |
| 187 | - try { | |
| 188 | - sb.setTerm(jo2.getString("term")); | |
| 189 | - } catch (Exception e) { | |
| 190 | - } | |
| 191 | - try { | |
| 192 | - sb.setAccount(jo2.getString("account")); | |
| 193 | - } catch (Exception e) { | |
| 194 | - } | |
| 195 | - try { | |
| 196 | - sb.setNickName(jo2.getString("nickName")); | |
| 197 | - } catch (Exception e) { | |
| 198 | - } | |
| 199 | - try { | |
| 200 | - sb.setAddress(jo2.getString("address")); | |
| 201 | - } catch (Exception e) { | |
| 202 | - } | |
| 203 | - try { | |
| 204 | - sb.setPhone(jo2.getString("phone")); | |
| 205 | - } catch (Exception e) { | |
| 206 | - } | |
| 207 | - try { | |
| 208 | - sb.setPhoto(jo2.getString("photo")); | |
| 209 | - } catch (Exception e) { | |
| 210 | - } | |
| 211 | - try { | |
| 212 | - sb.setFromType(jo2.getInt("fromType")); | |
| 213 | - } catch (Exception e) { | |
| 214 | - } | |
| 215 | - try { | |
| 216 | - sb.setGradeId(jo2.getInt("gradeId")); | |
| 217 | - } catch (Exception e) { | |
| 218 | - } | |
| 219 | - try { | |
| 220 | - sb.setTeacherId(jo2.getInt("teacherId")); | |
| 221 | - } catch (Exception e) { | |
| 222 | - } | |
| 223 | - try { | |
| 224 | - sb.setOriSchool(jo2.getString("oriSchool")); | |
| 225 | - } catch (Exception e) { | |
| 226 | - } | |
| 227 | - try { | |
| 228 | - sb.setParentPhone(jo2.getString("parentPhone")); | |
| 229 | - } catch (Exception e) { | |
| 230 | - } | |
| 231 | - try { | |
| 232 | - sb.setParentIdentity(jo2.getString("parentIdentity")); | |
| 233 | - } catch (Exception e) { | |
| 234 | - } | |
| 235 | - try { | |
| 236 | - sb.setTeacherName(jo2.getString("teacherName")); | |
| 237 | - } catch (Exception e) { | |
| 238 | - } | |
| 125 | + Gson gson = new Gson(); | |
| 126 | + StudentBean sb = gson.fromJson(jo2.toString(), StudentBean.class); | |
| 239 | 127 | alist.add(sb); |
| 240 | 128 | } |
| 241 | - | |
| 242 | - if (alist.size() > 0) | |
| 129 | + if (alist.size() > 0) { | |
| 243 | 130 | loadList(); |
| 131 | + } | |
| 244 | 132 | |
| 245 | 133 | } else { |
| 246 | 134 | |
| 247 | 135 | } |
| 248 | 136 | } catch (Exception e) { |
| 249 | 137 | e.printStackTrace(); |
| 250 | - | |
| 251 | 138 | } |
| 252 | - | |
| 253 | 139 | } |
| 254 | 140 | |
| 255 | 141 | @Override |
| ... | ... | @@ -262,45 +148,57 @@ public class MeFragment extends BaseFragment { |
| 262 | 148 | |
| 263 | 149 | } |
| 264 | 150 | }); |
| 265 | - | |
| 266 | - | |
| 267 | 151 | mRootView.findViewById(R.id.view_4).setOnClickListener(view -> startActivity(new Intent(getActivity(), YinsiActivity.class))); |
| 268 | 152 | mRootView.findViewById(R.id.view_5).setOnClickListener(view -> startActivity(new Intent(getActivity(), UserActivity.class))); |
| 269 | - mRootView.findViewById(R.id.view_3).setOnClickListener(view -> startActivity(new Intent(getActivity(), AccountActivity.class))); | |
| 153 | + mRootView.findViewById(R.id.view_3).setOnClickListener(view -> startActivityForResult(new Intent(getActivity(), AccountActivity.class), 1003)); | |
| 154 | + } | |
| 270 | 155 | |
| 156 | + @Override | |
| 157 | + public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { | |
| 158 | + super.onActivityResult(requestCode, resultCode, data); | |
| 159 | + Intent intent = new Intent(getActivity(), LoginActivity.class); | |
| 160 | + startActivity(intent); | |
| 161 | + getActivity().finish(); | |
| 271 | 162 | } |
| 272 | 163 | |
| 273 | 164 | public void loadList() { |
| 274 | - iv_21.setBackgroundResource(R.mipmap.tjxss); | |
| 275 | - tv_21.setText("添加学生"); | |
| 276 | - | |
| 277 | - | |
| 278 | - iv_22.setBackgroundResource(R.mipmap.tjxss); | |
| 279 | - tv_22.setText("添加学生"); | |
| 280 | - | |
| 281 | - iv_23.setBackgroundResource(R.mipmap.tjxss); | |
| 282 | - tv_23.setText("添加学生"); | |
| 283 | - | |
| 284 | - if (alist.size() >= 1) { | |
| 285 | -// if (alist.get(0).getPhoto() != null && alist.get(0).getPhoto().length() > 0) | |
| 286 | -// Glide.with(getActivity()).load(alist.get(0).getPhoto()).into(iv_21); | |
| 287 | -// else | |
| 288 | - iv_21.setBackgroundResource(R.mipmap.txz); | |
| 289 | - tv_21.setText(alist.get(0).getStuName()); | |
| 290 | - } | |
| 291 | - if (alist.size() >= 2) { | |
| 292 | -// if (alist.get(1).getPhoto() != null && alist.get(1).getPhoto().length() > 0) | |
| 293 | -// Glide.with(getActivity()).load(alist.get(1).getPhoto()).into(iv_22); | |
| 294 | -// else | |
| 295 | - iv_22.setBackgroundResource(R.mipmap.txz); | |
| 296 | - tv_22.setText(alist.get(1).getStuName()); | |
| 297 | - } | |
| 298 | - if (alist.size() >= 3) { | |
| 299 | -// if (alist.get(2).getPhoto() != null && alist.get(2).getPhoto().length() > 0) | |
| 300 | -// Glide.with(getActivity()).load(alist.get(2).getPhoto()).into(iv_23); | |
| 301 | -// else | |
| 302 | - iv_23.setBackgroundResource(R.mipmap.txz); | |
| 303 | - tv_23.setText(alist.get(2).getStuName()); | |
| 304 | - } | |
| 165 | + StudentBean sb = new StudentBean(); | |
| 166 | + sb.setNickName("添加学生"); | |
| 167 | + alist.add(0, sb); | |
| 168 | + BaseQuickAdapter adapter = new BaseQuickAdapter(R.layout.item_child, alist) { | |
| 169 | + @Override | |
| 170 | + protected void convert(@NonNull BaseViewHolder item, Object o) { | |
| 171 | + StudentBean studentBean = alist.get(item.getAdapterPosition()); | |
| 172 | + item.setText(R.id.tv_name, studentBean.getNickName()); | |
| 173 | + if (TextUtils.isEmpty(studentBean.getStuId())) { | |
| 174 | + item.setImageResource(R.id.iv_avatar, R.mipmap.tjxss); | |
| 175 | + item.setVisible(R.id.iv_vip, false); | |
| 176 | + item.getConvertView().setOnClickListener(new View.OnClickListener() { | |
| 177 | + @Override | |
| 178 | + public void onClick(View view) { | |
| 179 | + startActivity(new Intent(getActivity(), AddStudentActivity.class)); | |
| 180 | + } | |
| 181 | + }); | |
| 182 | + } else { | |
| 183 | + if (TextUtils.isEmpty(studentBean.getPhoto())) { | |
| 184 | + item.setImageResource(R.id.iv_avatar, studentBean.getGender() == 0 ? R.mipmap.ic_avatar_male : R.mipmap.ic_avatar_female); | |
| 185 | + } else { | |
| 186 | + RoundedCorners roundedCorners = new RoundedCorners(ScreenUtils.dpToPx(getContext(), 45)); | |
| 187 | + RequestOptions options = RequestOptions.bitmapTransform(roundedCorners); | |
| 188 | + Glide.with(getActivity()).load(studentBean.getPhoto()).apply(options).into((ImageView) item.getView(R.id.iv_avatar)); | |
| 189 | + } | |
| 190 | + item.setVisible(R.id.iv_vip, !"虚拟".equals(studentBean.getTeacherIdentity())); | |
| 191 | + item.getConvertView().setOnClickListener(new View.OnClickListener() { | |
| 192 | + @Override | |
| 193 | + public void onClick(View view) { | |
| 194 | + startActivity(new Intent(getActivity(), EditStudentActivity.class).putExtra("student", new Gson().toJson(studentBean))); | |
| 195 | + } | |
| 196 | + }); | |
| 197 | + } | |
| 198 | + } | |
| 199 | + }; | |
| 200 | + recycle.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); | |
| 201 | + recycle.setAdapter(adapter); | |
| 305 | 202 | } |
| 203 | + | |
| 306 | 204 | } | ... | ... |
app/src/main/res/drawable/bg_item_video_10.xml
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | + android:shape="rectangle"> | |
| 4 | + | |
| 5 | + <solid android:color="#FFF9F6" /> | |
| 6 | + | |
| 7 | + <corners | |
| 8 | + android:radius="10dp" | |
| 9 | + /> | |
| 10 | + | |
| 11 | +</shape> | |
| 0 | 12 | \ No newline at end of file | ... | ... |
app/src/main/res/drawable/bg_solid_btn_grad.xml
app/src/main/res/drawable/bg_solid_white_10_or.xml
| ... | ... | @@ -2,14 +2,11 @@ |
| 2 | 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | 3 | android:shape="rectangle"> |
| 4 | 4 | |
| 5 | - <solid android:color="#FFFFFF" | |
| 6 | - /> | |
| 7 | - <stroke android:width="2dp" | |
| 8 | - android:color="#FE5E09" | |
| 9 | - /> | |
| 5 | + <solid android:color="#FFFFFF" /> | |
| 6 | + <stroke | |
| 7 | + android:width="1dp" | |
| 8 | + android:color="#FE5E09" /> | |
| 10 | 9 | |
| 11 | - <corners | |
| 12 | - android:radius="10dp" | |
| 13 | - /> | |
| 10 | + <corners android:radius="10dp" /> | |
| 14 | 11 | |
| 15 | 12 | </shape> |
| 16 | 13 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_add_stu.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 6 | + android:background="#F4F6F8"> | |
| 8 | 7 | |
| 9 | 8 | <View |
| 10 | 9 | android:id="@+id/view_1" |
| 11 | 10 | android:layout_width="match_parent" |
| 12 | 11 | android:layout_height="44dp" |
| 13 | - app:layout_constraintTop_toTopOf="parent" | |
| 14 | 12 | android:background="@android:color/white" |
| 15 | - /> | |
| 13 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 14 | + | |
| 16 | 15 | <TextView |
| 17 | 16 | android:layout_width="wrap_content" |
| 18 | 17 | android:layout_height="wrap_content" |
| 19 | 18 | android:text="添加学生" |
| 20 | 19 | android:textColor="#333333" |
| 21 | 20 | android:textSize="18dp" |
| 21 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 22 | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 23 | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 24 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 25 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 26 | - /> | |
| 24 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 25 | + | |
| 27 | 26 | <TextView |
| 28 | 27 | android:id="@+id/tv_cancel" |
| 29 | 28 | android:layout_width="wrap_content" |
| 30 | 29 | android:layout_height="wrap_content" |
| 30 | + android:layout_marginLeft="15dp" | |
| 31 | 31 | android:text="取消" |
| 32 | 32 | android:textColor="#666666" |
| 33 | 33 | android:textSize="16dp" |
| 34 | - app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 35 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 36 | 34 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 37 | - android:layout_marginLeft="15dp" | |
| 38 | - /> | |
| 39 | - <ImageView | |
| 35 | + app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 36 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 37 | + | |
| 38 | + <RelativeLayout | |
| 39 | + android:id="@+id/rl_avatar" | |
| 40 | 40 | android:layout_width="75dp" |
| 41 | 41 | android:layout_height="75dp" |
| 42 | - android:background="@mipmap/txz" | |
| 42 | + android:layout_marginTop="32dp" | |
| 43 | 43 | app:layout_constraintLeft_toLeftOf="parent" |
| 44 | 44 | app:layout_constraintRight_toRightOf="parent" |
| 45 | - app:layout_constraintTop_toBottomOf="@id/view_1" | |
| 46 | - android:layout_marginTop="32dp" | |
| 47 | - /> | |
| 45 | + app:layout_constraintTop_toBottomOf="@id/view_1"> | |
| 46 | + | |
| 47 | + <ImageView | |
| 48 | + android:id="@+id/iv_avatar" | |
| 49 | + android:layout_width="match_parent" | |
| 50 | + android:layout_height="match_parent" | |
| 51 | + android:background="@mipmap/txz" /> | |
| 52 | + | |
| 53 | + <ImageView | |
| 54 | + android:layout_width="20dp" | |
| 55 | + android:layout_height="20dp" | |
| 56 | + android:layout_alignParentRight="true" | |
| 57 | + android:layout_alignParentBottom="true" | |
| 58 | + android:layout_marginBottom="5dp" | |
| 59 | + android:src="@mipmap/ic_edit" /> | |
| 60 | + </RelativeLayout> | |
| 61 | + | |
| 48 | 62 | |
| 49 | 63 | <View |
| 50 | 64 | android:id="@+id/view_2" |
| 51 | - android:layout_width="345dp" | |
| 65 | + android:layout_width="match_parent" | |
| 52 | 66 | android:layout_height="50dp" |
| 67 | + android:layout_marginLeft="15dp" | |
| 68 | + android:layout_marginTop="195dp" | |
| 69 | + android:layout_marginRight="15dp" | |
| 53 | 70 | android:background="@drawable/bg_solid_white_10" |
| 54 | 71 | app:layout_constraintLeft_toLeftOf="parent" |
| 55 | 72 | app:layout_constraintRight_toRightOf="parent" |
| 56 | - app:layout_constraintTop_toTopOf="parent" | |
| 57 | - android:layout_marginTop="195dp" | |
| 58 | - /> | |
| 73 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 59 | 74 | |
| 60 | 75 | <TextView |
| 61 | 76 | android:layout_width="wrap_content" |
| 62 | 77 | android:layout_height="wrap_content" |
| 78 | + android:layout_marginLeft="15dp" | |
| 79 | + android:text="昵称" | |
| 63 | 80 | android:textColor="#666666" |
| 64 | 81 | android:textSize="16dp" |
| 65 | - android:text="昵称" | |
| 66 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 67 | 82 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 68 | 83 | app:layout_constraintLeft_toLeftOf="@id/view_2" |
| 69 | - android:layout_marginLeft="15dp" | |
| 70 | - /> | |
| 84 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 85 | + | |
| 71 | 86 | <ImageView |
| 72 | 87 | android:layout_width="5.5dp" |
| 73 | 88 | android:layout_height="9.5dp" |
| 89 | + android:layout_marginRight="15dp" | |
| 74 | 90 | android:background="@mipmap/ycaj" |
| 75 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 76 | 91 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 77 | 92 | app:layout_constraintRight_toRightOf="@id/view_2" |
| 78 | - android:layout_marginRight="15dp" | |
| 79 | - /> | |
| 93 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 80 | 94 | |
| 81 | 95 | <TextView |
| 82 | 96 | android:id="@+id/tv_name" |
| 83 | 97 | android:layout_width="wrap_content" |
| 84 | 98 | android:layout_height="wrap_content" |
| 99 | + android:layout_marginRight="26dp" | |
| 100 | + android:text="请输入" | |
| 85 | 101 | android:textColor="#999999" |
| 86 | 102 | android:textSize="16dp" |
| 87 | - android:text="请输入" | |
| 88 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 89 | 103 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 90 | 104 | app:layout_constraintRight_toRightOf="@id/view_2" |
| 91 | - android:layout_marginRight="26dp" | |
| 92 | - /> | |
| 105 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 93 | 106 | |
| 94 | 107 | <View |
| 95 | 108 | android:id="@+id/view_3" |
| 96 | - android:layout_width="345dp" | |
| 109 | + android:layout_width="match_parent" | |
| 97 | 110 | android:layout_height="50dp" |
| 111 | + android:layout_marginLeft="15dp" | |
| 112 | + android:layout_marginTop="260dp" | |
| 113 | + android:layout_marginRight="15dp" | |
| 98 | 114 | android:background="@drawable/bg_solid_white_10" |
| 99 | 115 | app:layout_constraintLeft_toLeftOf="parent" |
| 100 | 116 | app:layout_constraintRight_toRightOf="parent" |
| 101 | - app:layout_constraintTop_toTopOf="parent" | |
| 102 | - android:layout_marginTop="260dp" | |
| 103 | - /> | |
| 117 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 104 | 118 | |
| 105 | 119 | <TextView |
| 106 | 120 | android:layout_width="wrap_content" |
| 107 | 121 | android:layout_height="wrap_content" |
| 122 | + android:layout_marginLeft="15dp" | |
| 123 | + android:text="性别" | |
| 108 | 124 | android:textColor="#666666" |
| 109 | 125 | android:textSize="16dp" |
| 110 | - android:text="性别" | |
| 111 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 112 | 126 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 113 | 127 | app:layout_constraintLeft_toLeftOf="@id/view_3" |
| 114 | - android:layout_marginLeft="15dp" | |
| 115 | - /> | |
| 128 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 129 | + | |
| 116 | 130 | <ImageView |
| 117 | 131 | android:layout_width="5.5dp" |
| 118 | 132 | android:layout_height="9.5dp" |
| 133 | + android:layout_marginRight="15dp" | |
| 119 | 134 | android:background="@mipmap/ycaj" |
| 120 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 121 | 135 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 122 | 136 | app:layout_constraintRight_toRightOf="@id/view_3" |
| 123 | - android:layout_marginRight="15dp" | |
| 124 | - /> | |
| 137 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 138 | + | |
| 125 | 139 | <TextView |
| 126 | 140 | android:id="@+id/tv_sex" |
| 127 | 141 | android:layout_width="wrap_content" |
| 128 | 142 | android:layout_height="wrap_content" |
| 143 | + android:layout_marginRight="26dp" | |
| 144 | + android:text="请选择" | |
| 129 | 145 | android:textColor="#999999" |
| 130 | 146 | android:textSize="16dp" |
| 131 | - android:text="请选择" | |
| 132 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 133 | 147 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 134 | 148 | app:layout_constraintRight_toRightOf="@id/view_3" |
| 135 | - android:layout_marginRight="26dp" | |
| 136 | - /> | |
| 149 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 137 | 150 | |
| 138 | 151 | <View |
| 139 | 152 | android:id="@+id/view_4" |
| 140 | - android:layout_width="345dp" | |
| 153 | + android:layout_width="match_parent" | |
| 141 | 154 | android:layout_height="50dp" |
| 155 | + android:layout_marginLeft="15dp" | |
| 156 | + android:layout_marginTop="325dp" | |
| 157 | + android:layout_marginRight="15dp" | |
| 142 | 158 | android:background="@drawable/bg_solid_white_10" |
| 143 | 159 | app:layout_constraintLeft_toLeftOf="parent" |
| 144 | 160 | app:layout_constraintRight_toRightOf="parent" |
| 145 | 161 | app:layout_constraintTop_toTopOf="parent" |
| 146 | - android:layout_marginTop="325dp" | |
| 147 | 162 | |
| 148 | 163 | /> |
| 149 | 164 | |
| 150 | 165 | <TextView |
| 151 | 166 | android:layout_width="wrap_content" |
| 152 | 167 | android:layout_height="wrap_content" |
| 168 | + android:layout_marginLeft="15dp" | |
| 169 | + android:text="年级" | |
| 153 | 170 | android:textColor="#666666" |
| 154 | 171 | android:textSize="16dp" |
| 155 | - android:text="年级" | |
| 156 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 157 | 172 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
| 158 | 173 | app:layout_constraintLeft_toLeftOf="@id/view_4" |
| 159 | - android:layout_marginLeft="15dp" | |
| 160 | - /> | |
| 174 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 175 | + | |
| 161 | 176 | <ImageView |
| 162 | 177 | android:layout_width="5.5dp" |
| 163 | 178 | android:layout_height="9.5dp" |
| 179 | + android:layout_marginRight="15dp" | |
| 164 | 180 | android:background="@mipmap/ycaj" |
| 165 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 166 | 181 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
| 167 | 182 | app:layout_constraintRight_toRightOf="@id/view_4" |
| 168 | - android:layout_marginRight="15dp" | |
| 169 | - /> | |
| 183 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 184 | + | |
| 170 | 185 | <TextView |
| 171 | 186 | android:id="@+id/tv_nian" |
| 172 | 187 | android:layout_width="wrap_content" |
| 173 | 188 | android:layout_height="wrap_content" |
| 189 | + android:layout_marginRight="26dp" | |
| 190 | + android:text="请选择" | |
| 174 | 191 | android:textColor="#999999" |
| 175 | 192 | android:textSize="16dp" |
| 176 | - android:text="请选择" | |
| 177 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 178 | 193 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
| 179 | 194 | app:layout_constraintRight_toRightOf="@id/view_4" |
| 180 | - android:layout_marginRight="26dp" | |
| 181 | - /> | |
| 195 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 196 | + | |
| 182 | 197 | <View |
| 183 | 198 | android:id="@+id/view_5" |
| 184 | - android:layout_width="345dp" | |
| 199 | + android:layout_width="match_parent" | |
| 185 | 200 | android:layout_height="50dp" |
| 201 | + android:layout_marginLeft="15dp" | |
| 202 | + android:layout_marginTop="390dp" | |
| 203 | + android:layout_marginRight="15dp" | |
| 186 | 204 | android:background="@drawable/bg_solid_white_10" |
| 187 | 205 | app:layout_constraintLeft_toLeftOf="parent" |
| 188 | 206 | app:layout_constraintRight_toRightOf="parent" |
| 189 | 207 | app:layout_constraintTop_toTopOf="parent" |
| 190 | - android:layout_marginTop="390dp" | |
| 191 | 208 | |
| 192 | 209 | /> |
| 193 | 210 | |
| ... | ... | @@ -195,53 +212,48 @@ |
| 195 | 212 | |
| 196 | 213 | android:layout_width="wrap_content" |
| 197 | 214 | android:layout_height="wrap_content" |
| 215 | + android:layout_marginLeft="15dp" | |
| 216 | + android:text="家长身份" | |
| 198 | 217 | android:textColor="#666666" |
| 199 | 218 | android:textSize="16dp" |
| 200 | - android:text="家长身份" | |
| 201 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 202 | 219 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
| 203 | 220 | app:layout_constraintLeft_toLeftOf="@id/view_5" |
| 204 | - android:layout_marginLeft="15dp" | |
| 205 | - /> | |
| 221 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 222 | + | |
| 206 | 223 | <TextView |
| 207 | 224 | android:id="@+id/tv_shen" |
| 208 | 225 | android:layout_width="wrap_content" |
| 209 | 226 | android:layout_height="wrap_content" |
| 227 | + android:layout_marginRight="26dp" | |
| 228 | + android:text="请选择" | |
| 210 | 229 | android:textColor="#999999" |
| 211 | 230 | android:textSize="16dp" |
| 212 | - android:text="请选择" | |
| 213 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 214 | 231 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
| 215 | 232 | app:layout_constraintRight_toRightOf="@id/view_5" |
| 216 | - android:layout_marginRight="26dp" | |
| 217 | - /> | |
| 233 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 234 | + | |
| 218 | 235 | <ImageView |
| 219 | 236 | android:layout_width="5.5dp" |
| 220 | 237 | android:layout_height="9.5dp" |
| 238 | + android:layout_marginRight="15dp" | |
| 221 | 239 | android:background="@mipmap/ycaj" |
| 222 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 223 | 240 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
| 224 | 241 | app:layout_constraintRight_toRightOf="@id/view_5" |
| 225 | - android:layout_marginRight="15dp" | |
| 226 | - /> | |
| 227 | - | |
| 242 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 228 | 243 | |
| 229 | 244 | |
| 230 | 245 | <Button |
| 231 | 246 | android:id="@+id/btn_next" |
| 232 | 247 | android:layout_width="180dp" |
| 233 | 248 | android:layout_height="40dp" |
| 234 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 235 | - app:layout_constraintRight_toRightOf="parent" | |
| 236 | - app:layout_constraintTop_toTopOf="parent" | |
| 237 | 249 | android:layout_marginTop="500dp" |
| 238 | 250 | android:background="@drawable/bg_solid_btn_grad" |
| 239 | 251 | android:text="确认" |
| 240 | 252 | android:textColor="#999999" |
| 241 | 253 | android:textSize="16dp" |
| 242 | - /> | |
| 243 | - | |
| 244 | - | |
| 254 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 255 | + app:layout_constraintRight_toRightOf="parent" | |
| 256 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 245 | 257 | |
| 246 | 258 | |
| 247 | 259 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 248 | 260 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_changem.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 6 | + android:background="#F4F6F8"> | |
| 8 | 7 | |
| 9 | 8 | <View |
| 10 | 9 | android:id="@+id/view_1" |
| 11 | 10 | android:layout_width="match_parent" |
| 12 | 11 | android:layout_height="44dp" |
| 13 | - app:layout_constraintTop_toTopOf="parent" | |
| 14 | 12 | android:background="@android:color/white" |
| 15 | - /> | |
| 13 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 14 | + | |
| 16 | 15 | <TextView |
| 17 | 16 | android:layout_width="wrap_content" |
| 18 | 17 | android:layout_height="wrap_content" |
| 19 | 18 | android:text="修改密码" |
| 20 | 19 | android:textColor="#333333" |
| 21 | 20 | android:textSize="18dp" |
| 21 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 22 | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 23 | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 24 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 25 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 26 | - /> | |
| 24 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 25 | + | |
| 27 | 26 | <ImageView |
| 28 | 27 | android:id="@+id/iv_back" |
| 29 | 28 | android:layout_width="10dp" |
| 30 | 29 | android:layout_height="16dp" |
| 31 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 32 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 33 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 34 | 30 | android:layout_marginLeft="15dp" |
| 35 | 31 | android:background="@mipmap/icon_back" |
| 36 | - /> | |
| 32 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 33 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 34 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 35 | + | |
| 37 | 36 | <View |
| 38 | 37 | android:layout_width="match_parent" |
| 39 | 38 | android:layout_height="1dp" |
| 40 | 39 | android:background="#EEEEEE" |
| 41 | - app:layout_constraintTop_toBottomOf="@id/view_1" | |
| 42 | - /> | |
| 40 | + app:layout_constraintTop_toBottomOf="@id/view_1" /> | |
| 43 | 41 | |
| 44 | 42 | <View |
| 45 | 43 | android:id="@+id/view_3" |
| 46 | 44 | android:layout_width="match_parent" |
| 47 | 45 | android:layout_height="45dp" |
| 46 | + android:layout_marginTop="80dp" | |
| 48 | 47 | android:background="@android:color/white" |
| 49 | 48 | app:layout_constraintLeft_toLeftOf="parent" |
| 50 | 49 | app:layout_constraintRight_toRightOf="parent" |
| 51 | - app:layout_constraintTop_toTopOf="parent" | |
| 52 | - android:layout_marginTop="80dp" | |
| 53 | - /> | |
| 54 | - <ImageView | |
| 55 | - android:id="@+id/iv_3" | |
| 56 | - android:layout_width="20dp" | |
| 57 | - android:layout_height="16dp" | |
| 58 | - android:background="@mipmap/xs" | |
| 59 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 60 | - app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 61 | - app:layout_constraintRight_toRightOf="@id/view_3" | |
| 62 | - android:layout_marginRight="20dp" | |
| 63 | - /> | |
| 50 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 51 | + | |
| 52 | + | |
| 64 | 53 | <TextView |
| 65 | 54 | android:id="@+id/tv_3" |
| 66 | 55 | android:layout_width="wrap_content" |
| 67 | 56 | android:layout_height="wrap_content" |
| 57 | + android:layout_marginLeft="15dp" | |
| 68 | 58 | android:text="请输入原密码" |
| 69 | 59 | android:textColor="#333333" |
| 70 | 60 | android:textSize="15dp" |
| 71 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 72 | 61 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 73 | 62 | app:layout_constraintLeft_toLeftOf="@id/view_3" |
| 74 | - android:layout_marginLeft="15dp" | |
| 75 | - /> | |
| 63 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 76 | 64 | |
| 77 | 65 | |
| 78 | 66 | <EditText |
| 67 | + android:id="@+id/et_old_password" | |
| 79 | 68 | android:layout_width="0dp" |
| 80 | 69 | android:layout_height="45dp" |
| 81 | - android:background="@android:color/transparent" | |
| 82 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 83 | - app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 84 | - app:layout_constraintLeft_toRightOf="@id/tv_3" | |
| 85 | - app:layout_constraintRight_toRightOf="parent" | |
| 86 | 70 | android:layout_marginLeft="30dp" |
| 87 | 71 | android:layout_marginRight="50dp" |
| 88 | - android:textSize="15dp" | |
| 72 | + android:background="@android:color/transparent" | |
| 89 | 73 | android:gravity="left|center_vertical" |
| 90 | - android:inputType="textPassword" | |
| 91 | 74 | android:hint="请输入密码" |
| 75 | + android:inputType="textPassword" | |
| 92 | 76 | android:textColor="#333333" |
| 93 | 77 | android:textColorHint="#666666" |
| 78 | + android:textSize="15dp" | |
| 79 | + app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 80 | + app:layout_constraintLeft_toRightOf="@id/tv_3" | |
| 81 | + app:layout_constraintRight_toRightOf="parent" | |
| 82 | + app:layout_constraintTop_toTopOf="@id/view_3" | |
| 94 | 83 | |
| 95 | 84 | /> |
| 96 | 85 | |
| ... | ... | @@ -98,133 +87,110 @@ |
| 98 | 87 | android:id="@+id/view_4" |
| 99 | 88 | android:layout_width="match_parent" |
| 100 | 89 | android:layout_height="45dp" |
| 90 | + android:layout_marginTop="125dp" | |
| 101 | 91 | android:background="@android:color/white" |
| 102 | 92 | app:layout_constraintLeft_toLeftOf="parent" |
| 103 | 93 | app:layout_constraintRight_toRightOf="parent" |
| 104 | - app:layout_constraintTop_toTopOf="parent" | |
| 105 | - android:layout_marginTop="125dp" | |
| 106 | - /> | |
| 107 | - <ImageView | |
| 108 | - android:id="@+id/iv_4" | |
| 109 | - android:layout_width="20dp" | |
| 110 | - android:layout_height="16dp" | |
| 111 | - android:background="@mipmap/xs" | |
| 112 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 113 | - app:layout_constraintBottom_toBottomOf="@id/view_4" | |
| 114 | - app:layout_constraintRight_toRightOf="@id/view_4" | |
| 115 | - android:layout_marginRight="20dp" | |
| 116 | - /> | |
| 94 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 95 | + | |
| 96 | + | |
| 117 | 97 | <TextView |
| 118 | 98 | android:id="@+id/tv_4" |
| 119 | 99 | android:layout_width="wrap_content" |
| 120 | 100 | android:layout_height="wrap_content" |
| 101 | + android:layout_marginLeft="15dp" | |
| 121 | 102 | android:text="请输入新密码" |
| 122 | 103 | android:textColor="#333333" |
| 123 | 104 | android:textSize="15dp" |
| 124 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 125 | 105 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
| 126 | 106 | app:layout_constraintLeft_toLeftOf="@id/view_4" |
| 127 | - android:layout_marginLeft="15dp" | |
| 128 | - /> | |
| 107 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 129 | 108 | |
| 130 | 109 | |
| 131 | 110 | <EditText |
| 132 | 111 | android:id="@+id/et_pwd" |
| 133 | 112 | android:layout_width="0dp" |
| 134 | 113 | android:layout_height="45dp" |
| 135 | - android:background="@android:color/transparent" | |
| 136 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 137 | - app:layout_constraintBottom_toBottomOf="@id/view_4" | |
| 138 | - app:layout_constraintLeft_toRightOf="@id/tv_4" | |
| 139 | - app:layout_constraintRight_toRightOf="parent" | |
| 140 | 114 | android:layout_marginLeft="30dp" |
| 141 | 115 | android:layout_marginRight="50dp" |
| 142 | - android:textSize="15dp" | |
| 116 | + android:background="@android:color/transparent" | |
| 143 | 117 | android:gravity="left|center_vertical" |
| 144 | - android:inputType="textPassword" | |
| 145 | 118 | android:hint="请输入密码" |
| 119 | + android:inputType="textPassword" | |
| 146 | 120 | android:textColor="#333333" |
| 147 | 121 | android:textColorHint="#666666" |
| 148 | - /> | |
| 122 | + android:textSize="15dp" | |
| 123 | + app:layout_constraintBottom_toBottomOf="@id/view_4" | |
| 124 | + app:layout_constraintLeft_toRightOf="@id/tv_4" | |
| 125 | + app:layout_constraintRight_toRightOf="parent" | |
| 126 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 149 | 127 | |
| 150 | 128 | |
| 151 | 129 | <View |
| 152 | 130 | android:id="@+id/view_5" |
| 153 | 131 | android:layout_width="match_parent" |
| 154 | 132 | android:layout_height="45dp" |
| 133 | + android:layout_marginTop="171dp" | |
| 155 | 134 | android:background="@android:color/white" |
| 156 | 135 | app:layout_constraintLeft_toLeftOf="parent" |
| 157 | 136 | app:layout_constraintRight_toRightOf="parent" |
| 158 | - app:layout_constraintTop_toTopOf="parent" | |
| 159 | - android:layout_marginTop="171dp" | |
| 160 | - /> | |
| 161 | - <ImageView | |
| 162 | - android:id="@+id/iv_5" | |
| 163 | - android:layout_width="20dp" | |
| 164 | - android:layout_height="16dp" | |
| 165 | - android:background="@mipmap/xs" | |
| 166 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 167 | - app:layout_constraintBottom_toBottomOf="@id/view_5" | |
| 168 | - app:layout_constraintRight_toRightOf="@id/view_5" | |
| 169 | - android:layout_marginRight="20dp" | |
| 170 | - /> | |
| 137 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 138 | + | |
| 139 | + | |
| 171 | 140 | <TextView |
| 172 | 141 | android:id="@+id/tv_5" |
| 173 | 142 | android:layout_width="wrap_content" |
| 174 | 143 | android:layout_height="wrap_content" |
| 144 | + android:layout_marginLeft="15dp" | |
| 175 | 145 | android:text="再次输入新密码" |
| 176 | 146 | android:textColor="#333333" |
| 177 | 147 | android:textSize="15dp" |
| 178 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 179 | 148 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
| 180 | 149 | app:layout_constraintLeft_toLeftOf="@id/view_5" |
| 181 | - android:layout_marginLeft="15dp" | |
| 182 | - /> | |
| 150 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 183 | 151 | |
| 184 | 152 | |
| 185 | 153 | <EditText |
| 154 | + android:id="@+id/et_pwd_2" | |
| 186 | 155 | android:layout_width="0dp" |
| 187 | 156 | android:layout_height="45dp" |
| 188 | - android:background="@android:color/transparent" | |
| 189 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 190 | - app:layout_constraintBottom_toBottomOf="@id/view_5" | |
| 191 | - app:layout_constraintLeft_toRightOf="@id/tv_5" | |
| 192 | - app:layout_constraintRight_toRightOf="parent" | |
| 193 | 157 | android:layout_marginLeft="15dp" |
| 194 | 158 | android:layout_marginRight="50dp" |
| 195 | - android:textSize="15dp" | |
| 159 | + android:background="@android:color/transparent" | |
| 196 | 160 | android:gravity="left|center_vertical" |
| 197 | - android:inputType="textPassword" | |
| 198 | 161 | android:hint="请再次输入密码" |
| 162 | + android:inputType="textPassword" | |
| 199 | 163 | android:textColor="#333333" |
| 200 | 164 | android:textColorHint="#666666" |
| 201 | - /> | |
| 165 | + android:textSize="15dp" | |
| 166 | + app:layout_constraintBottom_toBottomOf="@id/view_5" | |
| 167 | + app:layout_constraintLeft_toRightOf="@id/tv_5" | |
| 168 | + app:layout_constraintRight_toRightOf="parent" | |
| 169 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 170 | + | |
| 202 | 171 | <TextView |
| 203 | 172 | android:layout_width="wrap_content" |
| 204 | 173 | android:layout_height="wrap_content" |
| 174 | + android:layout_marginLeft="15dp" | |
| 175 | + android:layout_marginTop="230dp" | |
| 205 | 176 | android:text="6-16位密码,数字或字母" |
| 206 | 177 | android:textColor="#999999" |
| 207 | 178 | android:textSize="15dp" |
| 208 | 179 | app:layout_constraintLeft_toLeftOf="parent" |
| 209 | - app:layout_constraintTop_toTopOf="parent" | |
| 210 | - android:layout_marginTop="230dp" | |
| 211 | - android:layout_marginLeft="15dp" | |
| 212 | - /> | |
| 180 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 213 | 181 | |
| 214 | 182 | <Button |
| 215 | 183 | android:id="@+id/btn_next" |
| 216 | 184 | android:layout_width="180dp" |
| 217 | 185 | android:layout_height="40dp" |
| 186 | + android:layout_marginTop="310dp" | |
| 187 | + android:background="@drawable/bg_solid_btn" | |
| 218 | 188 | android:text="确认" |
| 219 | 189 | android:textColor="@color/white" |
| 220 | 190 | android:textSize="16dp" |
| 221 | - android:background="@drawable/bg_solid_btn" | |
| 222 | 191 | app:layout_constraintLeft_toLeftOf="parent" |
| 223 | 192 | app:layout_constraintRight_toRightOf="parent" |
| 224 | - app:layout_constraintTop_toTopOf="parent" | |
| 225 | - android:layout_marginTop="310dp" | |
| 226 | - /> | |
| 227 | - | |
| 193 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 228 | 194 | |
| 229 | 195 | |
| 230 | 196 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 231 | 197 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_edit_stu.xml
| ... | ... | @@ -0,0 +1,305 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 4 | + android:layout_width="match_parent" | |
| 5 | + android:layout_height="match_parent" | |
| 6 | + android:background="#F4F6F8"> | |
| 7 | + | |
| 8 | + <View | |
| 9 | + android:id="@+id/view_1" | |
| 10 | + android:layout_width="match_parent" | |
| 11 | + android:layout_height="44dp" | |
| 12 | + android:background="@android:color/white" | |
| 13 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 14 | + | |
| 15 | + <TextView | |
| 16 | + android:layout_width="wrap_content" | |
| 17 | + android:layout_height="wrap_content" | |
| 18 | + android:text="编辑学生" | |
| 19 | + android:textColor="#333333" | |
| 20 | + android:textSize="18dp" | |
| 21 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 22 | + app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 23 | + app:layout_constraintRight_toRightOf="@id/view_1" | |
| 24 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 25 | + | |
| 26 | + <TextView | |
| 27 | + android:id="@+id/tv_cancel" | |
| 28 | + android:layout_width="wrap_content" | |
| 29 | + android:layout_height="wrap_content" | |
| 30 | + android:layout_marginLeft="15dp" | |
| 31 | + android:text="取消" | |
| 32 | + android:textColor="#666666" | |
| 33 | + android:textSize="16dp" | |
| 34 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 35 | + app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 36 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 37 | + | |
| 38 | + <RelativeLayout | |
| 39 | + android:id="@+id/rl_avatar" | |
| 40 | + android:layout_width="75dp" | |
| 41 | + android:layout_height="75dp" | |
| 42 | + android:layout_marginTop="32dp" | |
| 43 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 44 | + app:layout_constraintRight_toRightOf="parent" | |
| 45 | + app:layout_constraintTop_toBottomOf="@id/view_1"> | |
| 46 | + | |
| 47 | + <ImageView | |
| 48 | + android:id="@+id/iv_avatar" | |
| 49 | + android:layout_width="match_parent" | |
| 50 | + android:layout_height="match_parent" | |
| 51 | + android:background="@mipmap/txz" /> | |
| 52 | + | |
| 53 | + <ImageView | |
| 54 | + android:layout_width="20dp" | |
| 55 | + android:layout_height="20dp" | |
| 56 | + android:layout_alignParentRight="true" | |
| 57 | + android:layout_alignParentBottom="true" | |
| 58 | + android:layout_marginBottom="5dp" | |
| 59 | + android:src="@mipmap/ic_edit" /> | |
| 60 | + </RelativeLayout> | |
| 61 | + | |
| 62 | + | |
| 63 | + <View | |
| 64 | + android:id="@+id/view_2" | |
| 65 | + android:layout_width="match_parent" | |
| 66 | + android:layout_marginLeft="15dp" | |
| 67 | + android:layout_marginRight="15dp" | |
| 68 | + android:layout_height="50dp" | |
| 69 | + android:layout_marginTop="195dp" | |
| 70 | + android:background="@drawable/bg_solid_white_10" | |
| 71 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 72 | + app:layout_constraintRight_toRightOf="parent" | |
| 73 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 74 | + | |
| 75 | + <TextView | |
| 76 | + android:layout_width="wrap_content" | |
| 77 | + android:layout_height="wrap_content" | |
| 78 | + android:layout_marginLeft="15dp" | |
| 79 | + android:text="昵称" | |
| 80 | + android:textColor="#666666" | |
| 81 | + android:textSize="16dp" | |
| 82 | + app:layout_constraintBottom_toBottomOf="@id/view_2" | |
| 83 | + app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 84 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 85 | + | |
| 86 | + <ImageView | |
| 87 | + android:layout_width="5.5dp" | |
| 88 | + android:layout_height="9.5dp" | |
| 89 | + android:layout_marginRight="15dp" | |
| 90 | + android:background="@mipmap/ycaj" | |
| 91 | + app:layout_constraintBottom_toBottomOf="@id/view_2" | |
| 92 | + app:layout_constraintRight_toRightOf="@id/view_2" | |
| 93 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 94 | + | |
| 95 | + <TextView | |
| 96 | + android:id="@+id/tv_name" | |
| 97 | + android:layout_width="wrap_content" | |
| 98 | + android:layout_height="wrap_content" | |
| 99 | + android:layout_marginRight="26dp" | |
| 100 | + android:text="请输入" | |
| 101 | + android:textColor="#333333" | |
| 102 | + android:textSize="16dp" | |
| 103 | + app:layout_constraintBottom_toBottomOf="@id/view_2" | |
| 104 | + app:layout_constraintRight_toRightOf="@id/view_2" | |
| 105 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 106 | + | |
| 107 | + <View | |
| 108 | + android:id="@+id/view_3" | |
| 109 | + android:layout_width="match_parent" | |
| 110 | + android:layout_marginLeft="15dp" | |
| 111 | + android:layout_marginRight="15dp" | |
| 112 | + android:layout_height="50dp" | |
| 113 | + android:layout_marginTop="260dp" | |
| 114 | + android:background="@drawable/bg_solid_white_10" | |
| 115 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 116 | + app:layout_constraintRight_toRightOf="parent" | |
| 117 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 118 | + | |
| 119 | + <TextView | |
| 120 | + android:layout_width="wrap_content" | |
| 121 | + android:layout_height="wrap_content" | |
| 122 | + android:layout_marginLeft="15dp" | |
| 123 | + android:text="性别" | |
| 124 | + android:textColor="#666666" | |
| 125 | + android:textSize="16dp" | |
| 126 | + app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 127 | + app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 128 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 129 | + | |
| 130 | + <ImageView | |
| 131 | + android:layout_width="5.5dp" | |
| 132 | + android:layout_height="9.5dp" | |
| 133 | + android:layout_marginRight="15dp" | |
| 134 | + android:background="@mipmap/ycaj" | |
| 135 | + app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 136 | + app:layout_constraintRight_toRightOf="@id/view_3" | |
| 137 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 138 | + | |
| 139 | + <TextView | |
| 140 | + android:id="@+id/tv_sex" | |
| 141 | + android:layout_width="wrap_content" | |
| 142 | + android:layout_height="wrap_content" | |
| 143 | + android:layout_marginRight="26dp" | |
| 144 | + android:text="请选择" | |
| 145 | + android:textColor="#333333" | |
| 146 | + android:textSize="16dp" | |
| 147 | + app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 148 | + app:layout_constraintRight_toRightOf="@id/view_3" | |
| 149 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 150 | + | |
| 151 | + <View | |
| 152 | + android:id="@+id/view_4" | |
| 153 | + android:layout_width="match_parent" | |
| 154 | + android:layout_marginLeft="15dp" | |
| 155 | + android:layout_marginRight="15dp" | |
| 156 | + android:layout_height="50dp" | |
| 157 | + android:layout_marginTop="325dp" | |
| 158 | + android:background="@drawable/bg_solid_white_10" | |
| 159 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 160 | + app:layout_constraintRight_toRightOf="parent" | |
| 161 | + app:layout_constraintTop_toTopOf="parent" | |
| 162 | + | |
| 163 | + /> | |
| 164 | + | |
| 165 | + <TextView | |
| 166 | + android:layout_width="wrap_content" | |
| 167 | + android:layout_height="wrap_content" | |
| 168 | + android:layout_marginLeft="15dp" | |
| 169 | + android:text="年级" | |
| 170 | + android:textColor="#666666" | |
| 171 | + android:textSize="16dp" | |
| 172 | + app:layout_constraintBottom_toBottomOf="@id/view_4" | |
| 173 | + app:layout_constraintLeft_toLeftOf="@id/view_4" | |
| 174 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 175 | + | |
| 176 | + <ImageView | |
| 177 | + android:layout_width="5.5dp" | |
| 178 | + android:layout_height="9.5dp" | |
| 179 | + android:layout_marginRight="15dp" | |
| 180 | + android:background="@mipmap/ycaj" | |
| 181 | + app:layout_constraintBottom_toBottomOf="@id/view_4" | |
| 182 | + app:layout_constraintRight_toRightOf="@id/view_4" | |
| 183 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 184 | + | |
| 185 | + <TextView | |
| 186 | + android:id="@+id/tv_nian" | |
| 187 | + android:layout_width="wrap_content" | |
| 188 | + android:layout_height="wrap_content" | |
| 189 | + android:layout_marginRight="26dp" | |
| 190 | + android:text="请选择" | |
| 191 | + android:textColor="#333333" | |
| 192 | + android:textSize="16dp" | |
| 193 | + app:layout_constraintBottom_toBottomOf="@id/view_4" | |
| 194 | + app:layout_constraintRight_toRightOf="@id/view_4" | |
| 195 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 196 | + | |
| 197 | + <View | |
| 198 | + android:id="@+id/view_5" | |
| 199 | + android:layout_width="match_parent" | |
| 200 | + android:layout_marginLeft="15dp" | |
| 201 | + android:layout_marginRight="15dp" | |
| 202 | + android:layout_height="50dp" | |
| 203 | + android:layout_marginTop="390dp" | |
| 204 | + android:background="@drawable/bg_solid_white_10" | |
| 205 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 206 | + app:layout_constraintRight_toRightOf="parent" | |
| 207 | + app:layout_constraintTop_toTopOf="parent" | |
| 208 | + | |
| 209 | + /> | |
| 210 | + | |
| 211 | + <TextView | |
| 212 | + | |
| 213 | + android:layout_width="wrap_content" | |
| 214 | + android:layout_height="wrap_content" | |
| 215 | + android:layout_marginLeft="15dp" | |
| 216 | + android:text="家长身份" | |
| 217 | + android:textColor="#666666" | |
| 218 | + android:textSize="16dp" | |
| 219 | + app:layout_constraintBottom_toBottomOf="@id/view_5" | |
| 220 | + app:layout_constraintLeft_toLeftOf="@id/view_5" | |
| 221 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 222 | + | |
| 223 | + <TextView | |
| 224 | + android:id="@+id/tv_shen" | |
| 225 | + android:layout_width="wrap_content" | |
| 226 | + android:layout_height="wrap_content" | |
| 227 | + android:layout_marginRight="26dp" | |
| 228 | + android:text="请选择" | |
| 229 | + android:textColor="#333333" | |
| 230 | + android:textSize="16dp" | |
| 231 | + app:layout_constraintBottom_toBottomOf="@id/view_5" | |
| 232 | + app:layout_constraintRight_toRightOf="@id/view_5" | |
| 233 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 234 | + | |
| 235 | + <ImageView | |
| 236 | + android:layout_width="5.5dp" | |
| 237 | + android:layout_height="9.5dp" | |
| 238 | + android:layout_marginRight="15dp" | |
| 239 | + android:background="@mipmap/ycaj" | |
| 240 | + app:layout_constraintBottom_toBottomOf="@id/view_5" | |
| 241 | + app:layout_constraintRight_toRightOf="@id/view_5" | |
| 242 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 243 | + | |
| 244 | + <View | |
| 245 | + android:id="@+id/view_6" | |
| 246 | + android:layout_width="match_parent" | |
| 247 | + android:layout_marginLeft="15dp" | |
| 248 | + android:layout_marginRight="15dp" | |
| 249 | + android:layout_height="50dp" | |
| 250 | + android:layout_marginTop="455dp" | |
| 251 | + android:background="@drawable/bg_solid_white_10" | |
| 252 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 253 | + app:layout_constraintRight_toRightOf="parent" | |
| 254 | + app:layout_constraintTop_toTopOf="parent" | |
| 255 | + | |
| 256 | + /> | |
| 257 | + | |
| 258 | + <TextView | |
| 259 | + android:layout_width="wrap_content" | |
| 260 | + android:layout_height="wrap_content" | |
| 261 | + android:layout_marginLeft="15dp" | |
| 262 | + android:text="绑定老师" | |
| 263 | + android:textColor="#666666" | |
| 264 | + android:textSize="16dp" | |
| 265 | + app:layout_constraintBottom_toBottomOf="@id/view_6" | |
| 266 | + app:layout_constraintLeft_toLeftOf="@id/view_6" | |
| 267 | + app:layout_constraintTop_toTopOf="@id/view_6" /> | |
| 268 | + | |
| 269 | + <ImageView | |
| 270 | + android:id="@+id/iv_teacher" | |
| 271 | + android:layout_width="28dp" | |
| 272 | + android:layout_height="28dp" | |
| 273 | + android:layout_marginRight="10dp" | |
| 274 | + app:layout_constraintBottom_toBottomOf="@id/view_6" | |
| 275 | + app:layout_constraintRight_toLeftOf="@+id/tv_teacher" | |
| 276 | + app:layout_constraintTop_toTopOf="@id/view_6" /> | |
| 277 | + | |
| 278 | + <TextView | |
| 279 | + android:id="@+id/tv_teacher" | |
| 280 | + android:layout_width="wrap_content" | |
| 281 | + android:layout_height="wrap_content" | |
| 282 | + android:layout_marginRight="15dp" | |
| 283 | + android:text="未绑定" | |
| 284 | + android:textColor="#333333" | |
| 285 | + android:textSize="16dp" | |
| 286 | + app:layout_constraintBottom_toBottomOf="@id/view_6" | |
| 287 | + app:layout_constraintRight_toRightOf="@id/view_6" | |
| 288 | + app:layout_constraintTop_toTopOf="@id/view_6" /> | |
| 289 | + | |
| 290 | + | |
| 291 | + <Button | |
| 292 | + android:id="@+id/btn_next" | |
| 293 | + android:layout_width="180dp" | |
| 294 | + android:layout_height="40dp" | |
| 295 | + android:layout_marginTop="570dp" | |
| 296 | + android:background="@drawable/bg_solid_btn_grad" | |
| 297 | + android:text="确认" | |
| 298 | + android:textColor="#999999" | |
| 299 | + android:textSize="16dp" | |
| 300 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 301 | + app:layout_constraintRight_toRightOf="parent" | |
| 302 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 303 | + | |
| 304 | + | |
| 305 | +</androidx.constraintlayout.widget.ConstraintLayout> | |
| 0 | 306 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_login.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="@mipmap/bg" | |
| 7 | - > | |
| 8 | - | |
| 6 | + android:background="@mipmap/bg"> | |
| 9 | 7 | |
| 10 | 8 | |
| 11 | 9 | <TextView |
| 12 | 10 | android:layout_width="wrap_content" |
| 13 | 11 | android:layout_height="wrap_content" |
| 12 | + android:layout_marginLeft="30dp" | |
| 13 | + android:layout_marginTop="64dp" | |
| 14 | 14 | android:text="登陆" |
| 15 | 15 | android:textColor="#333333" |
| 16 | - android:textStyle="bold" | |
| 17 | 16 | android:textSize="25dp" |
| 18 | - android:layout_marginLeft="30dp" | |
| 19 | - android:layout_marginTop="64dp" | |
| 17 | + android:textStyle="bold" | |
| 20 | 18 | app:layout_constraintLeft_toLeftOf="parent" |
| 21 | - app:layout_constraintTop_toTopOf="parent" | |
| 22 | - /> | |
| 19 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 23 | 20 | |
| 24 | 21 | <View |
| 25 | 22 | android:id="@+id/view_1" |
| 26 | 23 | android:layout_width="315dp" |
| 27 | 24 | android:layout_height="50dp" |
| 28 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 29 | - app:layout_constraintRight_toRightOf="parent" | |
| 30 | - app:layout_constraintTop_toTopOf="parent" | |
| 31 | 25 | android:layout_marginTop="166dp" |
| 32 | 26 | android:background="@drawable/bg_solid_white" |
| 33 | - /> | |
| 27 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 28 | + app:layout_constraintRight_toRightOf="parent" | |
| 29 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 34 | 30 | |
| 35 | 31 | <ImageView |
| 36 | 32 | android:id="@+id/iv_1" |
| 37 | 33 | android:layout_width="16dp" |
| 38 | 34 | android:layout_height="18dp" |
| 39 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 35 | + android:layout_marginLeft="20dp" | |
| 36 | + android:background="@mipmap/sjh" | |
| 40 | 37 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 41 | 38 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 42 | - android:background="@mipmap/sjh" | |
| 43 | - android:layout_marginLeft="20dp" | |
| 44 | - /> | |
| 39 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 45 | 40 | |
| 46 | 41 | <ImageView |
| 47 | 42 | android:id="@+id/iv_2" |
| 48 | 43 | android:layout_width="13dp" |
| 49 | 44 | android:layout_height="13dp" |
| 45 | + android:layout_marginRight="20dp" | |
| 50 | 46 | android:background="@mipmap/sc" |
| 51 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 52 | 47 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 53 | 48 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 54 | - android:layout_marginRight="20dp" | |
| 55 | - /> | |
| 49 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 56 | 50 | |
| 57 | 51 | <EditText |
| 58 | 52 | android:id="@+id/et_phone" |
| 59 | 53 | android:layout_width="0dp" |
| 60 | 54 | android:layout_height="0dp" |
| 55 | + android:layout_marginLeft="46dp" | |
| 61 | 56 | android:background="@android:color/transparent" |
| 62 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 63 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 64 | - app:layout_constraintRight_toLeftOf="@id/iv_2" | |
| 65 | - app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 66 | - android:textColorHint="#999999" | |
| 67 | - android:hint="请输入手机号" | |
| 68 | - android:textSize="16dp" | |
| 69 | 57 | android:gravity="left|center_vertical" |
| 58 | + android:hint="请输入手机号" | |
| 70 | 59 | android:inputType="number" |
| 71 | - android:layout_marginLeft="46dp" | |
| 72 | 60 | android:maxLength="11" |
| 73 | - /> | |
| 61 | + android:textColorHint="#999999" | |
| 62 | + android:textSize="16dp" | |
| 63 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 64 | + app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 65 | + app:layout_constraintRight_toLeftOf="@id/iv_2" | |
| 66 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 74 | 67 | |
| 75 | 68 | |
| 76 | 69 | <View |
| 77 | 70 | android:id="@+id/view_2" |
| 78 | 71 | android:layout_width="315dp" |
| 79 | 72 | android:layout_height="50dp" |
| 80 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 81 | - app:layout_constraintRight_toRightOf="parent" | |
| 82 | - app:layout_constraintTop_toTopOf="parent" | |
| 83 | 73 | android:layout_marginTop="241dp" |
| 84 | 74 | android:background="@drawable/bg_solid_white" |
| 85 | - /> | |
| 75 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 76 | + app:layout_constraintRight_toRightOf="parent" | |
| 77 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 86 | 78 | |
| 87 | 79 | <ImageView |
| 88 | 80 | android:id="@+id/iv_3" |
| 89 | 81 | android:layout_width="16dp" |
| 90 | 82 | android:layout_height="18dp" |
| 91 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 83 | + android:layout_marginLeft="20dp" | |
| 84 | + android:background="@mipmap/mm" | |
| 92 | 85 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 93 | 86 | app:layout_constraintLeft_toLeftOf="@id/view_2" |
| 94 | - android:background="@mipmap/mm" | |
| 95 | - android:layout_marginLeft="20dp" | |
| 96 | - /> | |
| 87 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 97 | 88 | |
| 98 | 89 | <ImageView |
| 99 | 90 | android:id="@+id/iv_4" |
| 100 | 91 | android:layout_width="20dp" |
| 101 | 92 | android:layout_height="16dp" |
| 93 | + android:layout_marginRight="20dp" | |
| 102 | 94 | android:background="@mipmap/xs" |
| 103 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 104 | 95 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 105 | 96 | app:layout_constraintRight_toRightOf="@id/view_2" |
| 106 | - android:layout_marginRight="20dp" | |
| 107 | - /> | |
| 97 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 108 | 98 | |
| 109 | 99 | <EditText |
| 110 | 100 | android:id="@+id/et_pwd" |
| 111 | 101 | android:layout_width="0dp" |
| 112 | 102 | android:layout_height="0dp" |
| 103 | + android:layout_marginLeft="46dp" | |
| 104 | + android:layout_marginRight="20dp" | |
| 113 | 105 | android:background="@android:color/transparent" |
| 114 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 106 | + android:gravity="left|center_vertical" | |
| 107 | + android:hint="请输入密码" | |
| 108 | + android:inputType="textPassword" | |
| 109 | + android:textColorHint="#999999" | |
| 110 | + android:textSize="16dp" | |
| 115 | 111 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 116 | 112 | app:layout_constraintLeft_toLeftOf="@id/view_2" |
| 117 | 113 | app:layout_constraintRight_toLeftOf="@id/iv_4" |
| 118 | - android:layout_marginLeft="46dp" | |
| 119 | - android:textColorHint="#999999" | |
| 120 | - android:hint="请输入密码" | |
| 121 | - android:textSize="16dp" | |
| 122 | - android:gravity="left|center_vertical" | |
| 123 | - android:inputType="textPassword" | |
| 124 | - android:layout_marginRight="20dp" | |
| 125 | - /> | |
| 114 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 126 | 115 | |
| 127 | 116 | |
| 128 | 117 | <Button |
| 129 | 118 | android:id="@+id/btn_1" |
| 130 | 119 | android:layout_width="315dp" |
| 131 | 120 | android:layout_height="50dp" |
| 132 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 133 | - app:layout_constraintRight_toRightOf="parent" | |
| 134 | - app:layout_constraintTop_toTopOf="parent" | |
| 135 | 121 | android:layout_marginTop="331dp" |
| 136 | 122 | android:background="@drawable/bg_solid_btn" |
| 123 | + android:text="登陆" | |
| 137 | 124 | android:textColor="@color/white" |
| 138 | 125 | android:textSize="18dp" |
| 139 | - android:text="登陆" | |
| 140 | - /> | |
| 126 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 127 | + app:layout_constraintRight_toRightOf="parent" | |
| 128 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 129 | + | |
| 141 | 130 | <TextView |
| 142 | 131 | android:id="@+id/tv_1" |
| 143 | 132 | android:layout_width="wrap_content" |
| 144 | 133 | android:layout_height="wrap_content" |
| 134 | + android:layout_marginLeft="85dp" | |
| 135 | + android:layout_marginTop="15dp" | |
| 145 | 136 | android:text="没有账号,立即" |
| 146 | 137 | android:textColor="#666666" |
| 147 | 138 | android:textSize="17dp" |
| 148 | 139 | app:layout_constraintLeft_toLeftOf="@id/btn_1" |
| 149 | - app:layout_constraintTop_toBottomOf="@id/btn_1" | |
| 150 | - android:layout_marginLeft="85dp" | |
| 151 | - android:layout_marginTop="15dp" | |
| 152 | - /> | |
| 140 | + app:layout_constraintTop_toBottomOf="@id/btn_1" /> | |
| 141 | + | |
| 153 | 142 | <TextView |
| 154 | 143 | android:id="@+id/tv_2" |
| 155 | 144 | android:layout_width="wrap_content" |
| 156 | 145 | android:layout_height="wrap_content" |
| 146 | + android:layout_marginTop="15dp" | |
| 157 | 147 | android:text="注册" |
| 158 | 148 | android:textColor="#FE5E09" |
| 159 | 149 | android:textSize="17dp" |
| 160 | 150 | app:layout_constraintLeft_toRightOf="@id/tv_1" |
| 161 | - app:layout_constraintTop_toBottomOf="@id/btn_1" | |
| 162 | - android:layout_marginTop="15dp" | |
| 163 | - /> | |
| 151 | + app:layout_constraintTop_toBottomOf="@id/btn_1" /> | |
| 164 | 152 | |
| 165 | 153 | |
| 166 | 154 | <CheckBox |
| 167 | 155 | android:id="@+id/cb_1" |
| 168 | - android:layout_width="13dp" | |
| 169 | - android:layout_height="13dp" | |
| 170 | - app:layout_constraintBottom_toBottomOf="parent" | |
| 171 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 156 | + android:layout_width="wrap_content" | |
| 157 | + android:layout_height="wrap_content" | |
| 172 | 158 | android:layout_marginLeft="67dp" |
| 173 | 159 | android:layout_marginBottom="50dp" |
| 174 | 160 | android:background="@android:color/transparent" |
| 175 | - android:button="@drawable/checked_xc" | |
| 176 | - /> | |
| 161 | + app:layout_constraintBottom_toBottomOf="parent" | |
| 162 | + app:layout_constraintLeft_toLeftOf="parent" /> | |
| 163 | + | |
| 177 | 164 | <TextView |
| 178 | 165 | android:id="@+id/tv_3" |
| 179 | 166 | android:layout_width="wrap_content" |
| 180 | 167 | android:layout_height="wrap_content" |
| 168 | + android:layout_marginLeft="5dp" | |
| 181 | 169 | android:text="已阅读并同意《" |
| 182 | 170 | android:textColor="#999999" |
| 183 | 171 | android:textSize="12dp" |
| 184 | - app:layout_constraintLeft_toRightOf="@id/cb_1" | |
| 185 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 186 | 172 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 187 | - android:layout_marginLeft="5dp" | |
| 188 | - /> | |
| 173 | + app:layout_constraintLeft_toRightOf="@id/cb_1" | |
| 174 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 175 | + | |
| 189 | 176 | <TextView |
| 190 | 177 | android:id="@+id/tv_4" |
| 191 | 178 | android:layout_width="wrap_content" |
| ... | ... | @@ -193,10 +180,10 @@ |
| 193 | 180 | android:text="用户协议" |
| 194 | 181 | android:textColor="#FE5E09" |
| 195 | 182 | android:textSize="12dp" |
| 196 | - app:layout_constraintLeft_toRightOf="@id/tv_3" | |
| 197 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 198 | 183 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 199 | - /> | |
| 184 | + app:layout_constraintLeft_toRightOf="@id/tv_3" | |
| 185 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 186 | + | |
| 200 | 187 | <TextView |
| 201 | 188 | android:id="@+id/tv_5" |
| 202 | 189 | android:layout_width="wrap_content" |
| ... | ... | @@ -204,10 +191,10 @@ |
| 204 | 191 | android:text="》和《" |
| 205 | 192 | android:textColor="#999999" |
| 206 | 193 | android:textSize="12dp" |
| 207 | - app:layout_constraintLeft_toRightOf="@id/tv_4" | |
| 208 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 209 | 194 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 210 | - /> | |
| 195 | + app:layout_constraintLeft_toRightOf="@id/tv_4" | |
| 196 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 197 | + | |
| 211 | 198 | <TextView |
| 212 | 199 | android:id="@+id/tv_6" |
| 213 | 200 | android:layout_width="wrap_content" |
| ... | ... | @@ -215,10 +202,10 @@ |
| 215 | 202 | android:text="隐私政策" |
| 216 | 203 | android:textColor="#FE5E09" |
| 217 | 204 | android:textSize="12dp" |
| 218 | - app:layout_constraintLeft_toRightOf="@id/tv_5" | |
| 219 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 220 | 205 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 221 | - /> | |
| 206 | + app:layout_constraintLeft_toRightOf="@id/tv_5" | |
| 207 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 208 | + | |
| 222 | 209 | <TextView |
| 223 | 210 | android:id="@+id/tv_7" |
| 224 | 211 | android:layout_width="wrap_content" |
| ... | ... | @@ -226,13 +213,9 @@ |
| 226 | 213 | android:text="》" |
| 227 | 214 | android:textColor="#999999" |
| 228 | 215 | android:textSize="12dp" |
| 229 | - app:layout_constraintLeft_toRightOf="@id/tv_6" | |
| 230 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 231 | 216 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 232 | - /> | |
| 233 | - | |
| 234 | - | |
| 235 | - | |
| 217 | + app:layout_constraintLeft_toRightOf="@id/tv_6" | |
| 218 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 236 | 219 | |
| 237 | 220 | |
| 238 | 221 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 239 | 222 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_me.xml
| ... | ... | @@ -43,7 +43,9 @@ |
| 43 | 43 | |
| 44 | 44 | <View |
| 45 | 45 | android:id="@+id/view_3" |
| 46 | - android:layout_width="345dp" | |
| 46 | + android:layout_width="match_parent" | |
| 47 | + android:layout_marginLeft="15dp" | |
| 48 | + android:layout_marginRight="15dp" | |
| 47 | 49 | android:layout_height="68dp" |
| 48 | 50 | android:background="@drawable/bg_solid_white_10" |
| 49 | 51 | app:layout_constraintLeft_toLeftOf="parent" |
| ... | ... | @@ -76,7 +78,9 @@ |
| 76 | 78 | |
| 77 | 79 | <View |
| 78 | 80 | android:id="@+id/view_4" |
| 79 | - android:layout_width="345dp" | |
| 81 | + android:layout_width="match_parent" | |
| 82 | + android:layout_marginLeft="15dp" | |
| 83 | + android:layout_marginRight="15dp" | |
| 80 | 84 | android:layout_height="111dp" |
| 81 | 85 | android:background="@drawable/bg_solid_white_10" |
| 82 | 86 | app:layout_constraintLeft_toLeftOf="parent" |
| ... | ... | @@ -131,7 +135,9 @@ |
| 131 | 135 | |
| 132 | 136 | <View |
| 133 | 137 | android:id="@+id/view_5" |
| 134 | - android:layout_width="345dp" | |
| 138 | + android:layout_width="match_parent" | |
| 139 | + android:layout_marginLeft="15dp" | |
| 140 | + android:layout_marginRight="15dp" | |
| 135 | 141 | android:layout_height="132dp" |
| 136 | 142 | android:background="@drawable/bg_solid_white_10" |
| 137 | 143 | app:layout_constraintLeft_toLeftOf="parent" | ... | ... |
app/src/main/res/layout/activity_register.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="@mipmap/bg" | |
| 7 | - > | |
| 8 | - | |
| 6 | + android:background="@mipmap/bg"> | |
| 9 | 7 | |
| 10 | 8 | |
| 11 | 9 | <TextView |
| 12 | 10 | android:layout_width="wrap_content" |
| 13 | 11 | android:layout_height="wrap_content" |
| 12 | + android:layout_marginLeft="30dp" | |
| 13 | + android:layout_marginTop="64dp" | |
| 14 | 14 | android:text="注册" |
| 15 | 15 | android:textColor="#333333" |
| 16 | - android:textStyle="bold" | |
| 17 | 16 | android:textSize="25dp" |
| 18 | - android:layout_marginLeft="30dp" | |
| 19 | - android:layout_marginTop="64dp" | |
| 17 | + android:textStyle="bold" | |
| 20 | 18 | app:layout_constraintLeft_toLeftOf="parent" |
| 21 | - app:layout_constraintTop_toTopOf="parent" | |
| 22 | - /> | |
| 19 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 23 | 20 | |
| 24 | 21 | <View |
| 25 | 22 | android:id="@+id/view_1" |
| 26 | 23 | android:layout_width="315dp" |
| 27 | 24 | android:layout_height="50dp" |
| 28 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 29 | - app:layout_constraintRight_toRightOf="parent" | |
| 30 | - app:layout_constraintTop_toTopOf="parent" | |
| 31 | 25 | android:layout_marginTop="166dp" |
| 32 | 26 | android:background="@drawable/bg_solid_white" |
| 33 | - /> | |
| 27 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 28 | + app:layout_constraintRight_toRightOf="parent" | |
| 29 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 34 | 30 | |
| 35 | 31 | <ImageView |
| 36 | 32 | android:id="@+id/iv_1" |
| 37 | 33 | android:layout_width="16dp" |
| 38 | 34 | android:layout_height="18dp" |
| 39 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 35 | + android:layout_marginLeft="20dp" | |
| 36 | + android:background="@mipmap/sjh" | |
| 40 | 37 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 41 | 38 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 42 | - android:background="@mipmap/sjh" | |
| 43 | - android:layout_marginLeft="20dp" | |
| 44 | - /> | |
| 39 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 45 | 40 | |
| 46 | 41 | <ImageView |
| 47 | 42 | android:id="@+id/iv_2" |
| 48 | 43 | android:layout_width="13dp" |
| 49 | 44 | android:layout_height="13dp" |
| 45 | + android:layout_marginRight="20dp" | |
| 50 | 46 | android:background="@mipmap/sc" |
| 51 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 52 | 47 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 53 | 48 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 54 | - android:layout_marginRight="20dp" | |
| 55 | - /> | |
| 49 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 56 | 50 | |
| 57 | 51 | <EditText |
| 58 | 52 | android:id="@+id/et_phone" |
| 59 | 53 | android:layout_width="0dp" |
| 60 | 54 | android:layout_height="0dp" |
| 55 | + android:layout_marginLeft="46dp" | |
| 61 | 56 | android:background="@android:color/transparent" |
| 62 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 63 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 64 | - app:layout_constraintRight_toLeftOf="@id/iv_2" | |
| 65 | - app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 66 | - android:textColorHint="#999999" | |
| 67 | - android:hint="请输入手机号" | |
| 68 | - android:textSize="16dp" | |
| 69 | 57 | android:gravity="left|center_vertical" |
| 58 | + android:hint="请输入手机号" | |
| 70 | 59 | android:inputType="number" |
| 71 | - android:layout_marginLeft="46dp" | |
| 72 | 60 | android:maxLength="11" |
| 73 | 61 | android:textColor="#333333" |
| 74 | - /> | |
| 62 | + android:textColorHint="#999999" | |
| 63 | + android:textSize="16dp" | |
| 64 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 65 | + app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 66 | + app:layout_constraintRight_toLeftOf="@id/iv_2" | |
| 67 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 75 | 68 | |
| 76 | 69 | |
| 77 | 70 | <View |
| 78 | 71 | android:id="@+id/view_2" |
| 79 | 72 | android:layout_width="315dp" |
| 80 | 73 | android:layout_height="50dp" |
| 81 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 82 | - app:layout_constraintRight_toRightOf="parent" | |
| 83 | - app:layout_constraintTop_toTopOf="parent" | |
| 84 | 74 | android:layout_marginTop="241dp" |
| 85 | 75 | android:background="@drawable/bg_solid_white" |
| 86 | - /> | |
| 76 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 77 | + app:layout_constraintRight_toRightOf="parent" | |
| 78 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 87 | 79 | |
| 88 | 80 | <ImageView |
| 89 | 81 | android:id="@+id/iv_3" |
| 90 | 82 | android:layout_width="16dp" |
| 91 | 83 | android:layout_height="18dp" |
| 92 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 84 | + android:layout_marginLeft="20dp" | |
| 85 | + android:background="@mipmap/mm" | |
| 93 | 86 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 94 | 87 | app:layout_constraintLeft_toLeftOf="@id/view_2" |
| 95 | - android:background="@mipmap/mm" | |
| 96 | - android:layout_marginLeft="20dp" | |
| 97 | - /> | |
| 88 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 98 | 89 | |
| 99 | 90 | <ImageView |
| 100 | 91 | android:id="@+id/iv_4" |
| 101 | 92 | android:layout_width="20dp" |
| 102 | 93 | android:layout_height="16dp" |
| 94 | + android:layout_marginRight="20dp" | |
| 103 | 95 | android:background="@mipmap/xs" |
| 104 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 105 | 96 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 106 | 97 | app:layout_constraintRight_toRightOf="@id/view_2" |
| 107 | - android:layout_marginRight="20dp" | |
| 108 | - /> | |
| 98 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 109 | 99 | |
| 110 | 100 | <EditText |
| 111 | 101 | android:id="@+id/et_pwd" |
| 112 | 102 | android:layout_width="0dp" |
| 113 | 103 | android:layout_height="0dp" |
| 114 | - android:background="@android:color/transparent" | |
| 115 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 116 | - app:layout_constraintBottom_toBottomOf="@id/view_2" | |
| 117 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 118 | - app:layout_constraintRight_toLeftOf="@id/iv_4" | |
| 119 | 104 | android:layout_marginLeft="46dp" |
| 120 | - android:textColorHint="#999999" | |
| 121 | - android:hint="请输入密码" | |
| 122 | - android:textSize="16dp" | |
| 105 | + android:layout_marginRight="20dp" | |
| 106 | + android:background="@android:color/transparent" | |
| 123 | 107 | android:gravity="left|center_vertical" |
| 108 | + android:hint="请输入密码" | |
| 124 | 109 | android:inputType="textPassword" |
| 125 | - android:layout_marginRight="20dp" | |
| 126 | 110 | android:textColor="#333333" |
| 127 | - /> | |
| 111 | + android:textColorHint="#999999" | |
| 112 | + android:textSize="16dp" | |
| 113 | + app:layout_constraintBottom_toBottomOf="@id/view_2" | |
| 114 | + app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 115 | + app:layout_constraintRight_toLeftOf="@id/iv_4" | |
| 116 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 128 | 117 | |
| 129 | 118 | |
| 130 | 119 | <View |
| 131 | 120 | android:id="@+id/view_3" |
| 132 | 121 | android:layout_width="315dp" |
| 133 | 122 | android:layout_height="50dp" |
| 134 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 135 | - app:layout_constraintRight_toRightOf="parent" | |
| 136 | - app:layout_constraintTop_toTopOf="parent" | |
| 137 | 123 | android:layout_marginTop="316dp" |
| 138 | 124 | android:background="@drawable/bg_solid_white" |
| 139 | - /> | |
| 125 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 126 | + app:layout_constraintRight_toRightOf="parent" | |
| 127 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 140 | 128 | |
| 141 | 129 | <ImageView |
| 142 | 130 | android:id="@+id/iv_5" |
| 143 | 131 | android:layout_width="16dp" |
| 144 | 132 | android:layout_height="18dp" |
| 145 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 133 | + android:layout_marginLeft="20dp" | |
| 134 | + android:background="@mipmap/mm" | |
| 146 | 135 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 147 | 136 | app:layout_constraintLeft_toLeftOf="@id/view_3" |
| 148 | - android:background="@mipmap/mm" | |
| 149 | - android:layout_marginLeft="20dp" | |
| 150 | - /> | |
| 137 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 151 | 138 | |
| 152 | 139 | <ImageView |
| 153 | 140 | android:id="@+id/iv_6" |
| 154 | 141 | android:layout_width="20dp" |
| 155 | 142 | android:layout_height="16dp" |
| 143 | + android:layout_marginRight="20dp" | |
| 156 | 144 | android:background="@mipmap/xs" |
| 157 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 158 | 145 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 159 | 146 | app:layout_constraintRight_toRightOf="@id/view_3" |
| 160 | - android:layout_marginRight="20dp" | |
| 161 | - /> | |
| 147 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 162 | 148 | |
| 163 | 149 | <EditText |
| 164 | 150 | android:id="@+id/et_pwd_2" |
| 165 | 151 | android:layout_width="0dp" |
| 166 | 152 | android:layout_height="0dp" |
| 167 | - android:background="@android:color/transparent" | |
| 168 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 169 | - app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 170 | - app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 171 | - app:layout_constraintRight_toLeftOf="@id/iv_6" | |
| 172 | 153 | android:layout_marginLeft="46dp" |
| 173 | - android:textColorHint="#999999" | |
| 174 | - android:hint="再次输入密码" | |
| 175 | - android:textSize="16dp" | |
| 154 | + android:layout_marginRight="20dp" | |
| 155 | + android:background="@android:color/transparent" | |
| 176 | 156 | android:gravity="left|center_vertical" |
| 157 | + android:hint="再次输入密码" | |
| 177 | 158 | android:inputType="textPassword" |
| 178 | - android:layout_marginRight="20dp" | |
| 179 | 159 | android:textColor="#333333" |
| 180 | - /> | |
| 160 | + android:textColorHint="#999999" | |
| 161 | + android:textSize="16dp" | |
| 162 | + app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 163 | + app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 164 | + app:layout_constraintRight_toLeftOf="@id/iv_6" | |
| 165 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 166 | + | |
| 181 | 167 | <TextView |
| 182 | 168 | android:layout_width="wrap_content" |
| 183 | 169 | android:layout_height="wrap_content" |
| 184 | - app:layout_constraintTop_toBottomOf="@id/view_3" | |
| 185 | - app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 186 | 170 | android:layout_marginLeft="45dp" |
| 187 | 171 | android:layout_marginTop="10dp" |
| 188 | - android:textSize="13dp" | |
| 189 | 172 | android:text="6-16位密码,数字或字母" |
| 190 | 173 | android:textColor="#999999" |
| 191 | - /> | |
| 174 | + android:textSize="13dp" | |
| 175 | + app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 176 | + app:layout_constraintTop_toBottomOf="@id/view_3" /> | |
| 192 | 177 | |
| 193 | 178 | <Button |
| 194 | 179 | android:id="@+id/btn_1" |
| 195 | 180 | android:layout_width="315dp" |
| 196 | 181 | android:layout_height="50dp" |
| 197 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 198 | - app:layout_constraintRight_toRightOf="parent" | |
| 199 | - app:layout_constraintTop_toTopOf="parent" | |
| 200 | 182 | android:layout_marginTop="428dp" |
| 201 | 183 | android:background="@drawable/bg_solid_btn" |
| 184 | + android:text="注册" | |
| 202 | 185 | android:textColor="@color/white" |
| 203 | 186 | android:textSize="18dp" |
| 204 | - android:text="注册" | |
| 205 | - /> | |
| 187 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 188 | + app:layout_constraintRight_toRightOf="parent" | |
| 189 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 190 | + | |
| 206 | 191 | <TextView |
| 207 | 192 | android:id="@+id/tv_1" |
| 208 | 193 | android:layout_width="wrap_content" |
| 209 | 194 | android:layout_height="wrap_content" |
| 195 | + android:layout_marginLeft="85dp" | |
| 196 | + android:layout_marginTop="15dp" | |
| 210 | 197 | android:text="已有账号,立即" |
| 211 | 198 | android:textColor="#666666" |
| 212 | 199 | android:textSize="17dp" |
| 213 | 200 | app:layout_constraintLeft_toLeftOf="@id/btn_1" |
| 214 | - app:layout_constraintTop_toBottomOf="@id/btn_1" | |
| 215 | - android:layout_marginLeft="85dp" | |
| 216 | - android:layout_marginTop="15dp" | |
| 217 | - /> | |
| 201 | + app:layout_constraintTop_toBottomOf="@id/btn_1" /> | |
| 202 | + | |
| 218 | 203 | <TextView |
| 219 | 204 | android:id="@+id/tv_2" |
| 220 | 205 | android:layout_width="wrap_content" |
| 221 | 206 | android:layout_height="wrap_content" |
| 207 | + android:layout_marginTop="15dp" | |
| 222 | 208 | android:text="登陆" |
| 223 | 209 | android:textColor="#FE5E09" |
| 224 | 210 | android:textSize="17dp" |
| 225 | 211 | app:layout_constraintLeft_toRightOf="@id/tv_1" |
| 226 | - app:layout_constraintTop_toBottomOf="@id/btn_1" | |
| 227 | - android:layout_marginTop="15dp" | |
| 228 | - /> | |
| 212 | + app:layout_constraintTop_toBottomOf="@id/btn_1" /> | |
| 229 | 213 | |
| 230 | 214 | |
| 231 | 215 | <CheckBox |
| 232 | 216 | android:id="@+id/cb_1" |
| 233 | - android:layout_width="13dp" | |
| 234 | - android:layout_height="13dp" | |
| 235 | - app:layout_constraintBottom_toBottomOf="parent" | |
| 236 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 217 | + android:layout_width="wrap_content" | |
| 218 | + android:layout_height="wrap_content" | |
| 237 | 219 | android:layout_marginLeft="67dp" |
| 238 | 220 | android:layout_marginBottom="50dp" |
| 239 | 221 | android:background="@android:color/transparent" |
| 240 | - android:button="@drawable/checked_xc" | |
| 241 | - /> | |
| 222 | + app:layout_constraintBottom_toBottomOf="parent" | |
| 223 | + app:layout_constraintLeft_toLeftOf="parent" /> | |
| 224 | + | |
| 242 | 225 | <TextView |
| 243 | 226 | android:id="@+id/tv_3" |
| 244 | 227 | android:layout_width="wrap_content" |
| 245 | 228 | android:layout_height="wrap_content" |
| 229 | + android:layout_marginLeft="5dp" | |
| 246 | 230 | android:text="已阅读并同意《" |
| 247 | 231 | android:textColor="#999999" |
| 248 | 232 | android:textSize="12dp" |
| 249 | - app:layout_constraintLeft_toRightOf="@id/cb_1" | |
| 250 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 251 | 233 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 252 | - android:layout_marginLeft="5dp" | |
| 253 | - /> | |
| 234 | + app:layout_constraintLeft_toRightOf="@id/cb_1" | |
| 235 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 236 | + | |
| 254 | 237 | <TextView |
| 255 | 238 | android:id="@+id/tv_4" |
| 256 | 239 | android:layout_width="wrap_content" |
| ... | ... | @@ -258,10 +241,10 @@ |
| 258 | 241 | android:text="用户协议" |
| 259 | 242 | android:textColor="#FE5E09" |
| 260 | 243 | android:textSize="12dp" |
| 261 | - app:layout_constraintLeft_toRightOf="@id/tv_3" | |
| 262 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 263 | 244 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 264 | - /> | |
| 245 | + app:layout_constraintLeft_toRightOf="@id/tv_3" | |
| 246 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 247 | + | |
| 265 | 248 | <TextView |
| 266 | 249 | android:id="@+id/tv_5" |
| 267 | 250 | android:layout_width="wrap_content" |
| ... | ... | @@ -269,10 +252,10 @@ |
| 269 | 252 | android:text="》和《" |
| 270 | 253 | android:textColor="#999999" |
| 271 | 254 | android:textSize="12dp" |
| 272 | - app:layout_constraintLeft_toRightOf="@id/tv_4" | |
| 273 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 274 | 255 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 275 | - /> | |
| 256 | + app:layout_constraintLeft_toRightOf="@id/tv_4" | |
| 257 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 258 | + | |
| 276 | 259 | <TextView |
| 277 | 260 | android:id="@+id/tv_6" |
| 278 | 261 | android:layout_width="wrap_content" |
| ... | ... | @@ -280,10 +263,10 @@ |
| 280 | 263 | android:text="隐私政策" |
| 281 | 264 | android:textColor="#FE5E09" |
| 282 | 265 | android:textSize="12dp" |
| 283 | - app:layout_constraintLeft_toRightOf="@id/tv_5" | |
| 284 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 285 | 266 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 286 | - /> | |
| 267 | + app:layout_constraintLeft_toRightOf="@id/tv_5" | |
| 268 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 269 | + | |
| 287 | 270 | <TextView |
| 288 | 271 | android:id="@+id/tv_7" |
| 289 | 272 | android:layout_width="wrap_content" |
| ... | ... | @@ -291,13 +274,9 @@ |
| 291 | 274 | android:text="》" |
| 292 | 275 | android:textColor="#999999" |
| 293 | 276 | android:textSize="12dp" |
| 294 | - app:layout_constraintLeft_toRightOf="@id/tv_6" | |
| 295 | - app:layout_constraintTop_toTopOf="@id/cb_1" | |
| 296 | 277 | app:layout_constraintBottom_toBottomOf="@id/cb_1" |
| 297 | - /> | |
| 298 | - | |
| 299 | - | |
| 300 | - | |
| 278 | + app:layout_constraintLeft_toRightOf="@id/tv_6" | |
| 279 | + app:layout_constraintTop_toTopOf="@id/cb_1" /> | |
| 301 | 280 | |
| 302 | 281 | |
| 303 | 282 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 304 | 283 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_select_stu.xml
| ... | ... | @@ -1,45 +0,0 @@ |
| 1 | -<?xml version="1.0" encoding="utf-8"?> | |
| 2 | -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | - android:layout_width="match_parent" | |
| 4 | - android:layout_height="match_parent" | |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 8 | - | |
| 9 | - <View | |
| 10 | - android:id="@+id/view_1" | |
| 11 | - android:layout_width="match_parent" | |
| 12 | - android:layout_height="44dp" | |
| 13 | - app:layout_constraintTop_toTopOf="parent" | |
| 14 | - android:background="@android:color/white" | |
| 15 | - /> | |
| 16 | - <TextView | |
| 17 | - android:layout_width="wrap_content" | |
| 18 | - android:layout_height="wrap_content" | |
| 19 | - android:text="选择学生" | |
| 20 | - android:textColor="#333333" | |
| 21 | - android:textSize="18dp" | |
| 22 | - app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 23 | - app:layout_constraintRight_toRightOf="@id/view_1" | |
| 24 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 25 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 26 | - /> | |
| 27 | - | |
| 28 | - | |
| 29 | - <Button | |
| 30 | - android:layout_width="180dp" | |
| 31 | - android:layout_height="40dp" | |
| 32 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 33 | - app:layout_constraintRight_toRightOf="parent" | |
| 34 | - app:layout_constraintTop_toTopOf="parent" | |
| 35 | - android:layout_marginTop="500dp" | |
| 36 | - android:background="@drawable/bg_solid_btn" | |
| 37 | - android:text="确认" | |
| 38 | - android:textColor="#FFFFFF" | |
| 39 | - android:textSize="16dp" | |
| 40 | - /> | |
| 41 | - | |
| 42 | - | |
| 43 | - | |
| 44 | - | |
| 45 | -</androidx.constraintlayout.widget.ConstraintLayout> | |
| 46 | 0 | \ No newline at end of file |
app/src/main/res/layout/activity_set_jia.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 6 | + android:background="#F4F6F8"> | |
| 8 | 7 | |
| 9 | 8 | <View |
| 10 | 9 | android:id="@+id/view_1" |
| 11 | 10 | android:layout_width="match_parent" |
| 12 | 11 | android:layout_height="44dp" |
| 13 | - app:layout_constraintTop_toTopOf="parent" | |
| 14 | 12 | android:background="@android:color/white" |
| 15 | - /> | |
| 13 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 14 | + | |
| 16 | 15 | <TextView |
| 17 | 16 | android:layout_width="wrap_content" |
| 18 | 17 | android:layout_height="wrap_content" |
| 19 | 18 | android:text="家长身份" |
| 20 | 19 | android:textColor="#333333" |
| 21 | 20 | android:textSize="18dp" |
| 21 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 22 | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 23 | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 24 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 25 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 26 | - /> | |
| 24 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 25 | + | |
| 27 | 26 | <TextView |
| 28 | 27 | android:id="@+id/tv_cancel" |
| 29 | 28 | android:layout_width="wrap_content" |
| 30 | 29 | android:layout_height="wrap_content" |
| 30 | + android:layout_marginLeft="15dp" | |
| 31 | 31 | android:text="取消" |
| 32 | 32 | android:textColor="#666666" |
| 33 | 33 | android:textSize="16dp" |
| 34 | - app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 35 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 36 | 34 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 37 | - android:layout_marginLeft="15dp" | |
| 38 | - /> | |
| 35 | + app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 36 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 37 | + | |
| 39 | 38 | <TextView |
| 40 | 39 | android:id="@+id/tv_ok" |
| 41 | 40 | android:layout_width="wrap_content" |
| 42 | 41 | android:layout_height="wrap_content" |
| 42 | + android:layout_marginRight="15dp" | |
| 43 | 43 | android:text="确认" |
| 44 | 44 | android:textColor="#FE5E09" |
| 45 | 45 | android:textSize="16dp" |
| 46 | - app:layout_constraintRight_toRightOf="@id/view_1" | |
| 47 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 48 | 46 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 49 | - android:layout_marginRight="15dp" | |
| 50 | - /> | |
| 47 | + app:layout_constraintRight_toRightOf="@id/view_1" | |
| 48 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 49 | + | |
| 51 | 50 | <TextView |
| 52 | 51 | android:layout_width="wrap_content" |
| 53 | 52 | android:layout_height="wrap_content" |
| 54 | - android:text="请选择身份" | |
| 55 | - app:layout_constraintBottom_toTopOf="@id/view_2" | |
| 56 | - android:layout_marginBottom="15dp" | |
| 57 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 58 | 53 | android:layout_marginLeft="15dp" |
| 54 | + android:layout_marginBottom="15dp" | |
| 55 | + android:text="请选择身份" | |
| 59 | 56 | android:textColor="#666666" |
| 60 | 57 | android:textSize="16dp" |
| 61 | - /> | |
| 58 | + app:layout_constraintBottom_toTopOf="@id/view_2" | |
| 59 | + app:layout_constraintLeft_toLeftOf="parent" /> | |
| 62 | 60 | |
| 63 | 61 | <View |
| 64 | 62 | android:id="@+id/view_2" |
| 65 | - android:layout_width="345dp" | |
| 63 | + android:layout_width="match_parent" | |
| 66 | 64 | android:layout_height="50dp" |
| 65 | + android:layout_marginLeft="15dp" | |
| 66 | + android:layout_marginTop="109dp" | |
| 67 | + android:layout_marginRight="15dp" | |
| 67 | 68 | android:background="@drawable/bg_solid_white_10" |
| 68 | 69 | app:layout_constraintLeft_toLeftOf="parent" |
| 69 | 70 | app:layout_constraintRight_toRightOf="parent" |
| 70 | - app:layout_constraintTop_toTopOf="parent" | |
| 71 | - android:layout_marginTop="109dp" | |
| 72 | - /> | |
| 71 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 73 | 72 | |
| 74 | 73 | |
| 75 | 74 | <TextView |
| 76 | 75 | android:layout_width="wrap_content" |
| 77 | 76 | android:layout_height="wrap_content" |
| 78 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 79 | - app:layout_constraintRight_toRightOf="@id/view_2" | |
| 80 | - app:layout_constraintTop_toTopOf="@+id/view_2" | |
| 81 | - app:layout_constraintBottom_toBottomOf="@+id/view_2" | |
| 77 | + android:text="爸爸" | |
| 82 | 78 | android:textColor="#333333" |
| 83 | 79 | android:textSize="16dp" |
| 84 | - android:text="爸爸" | |
| 85 | - /> | |
| 80 | + app:layout_constraintBottom_toBottomOf="@+id/view_2" | |
| 81 | + app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 82 | + app:layout_constraintRight_toRightOf="@id/view_2" | |
| 83 | + app:layout_constraintTop_toTopOf="@+id/view_2" /> | |
| 86 | 84 | |
| 87 | 85 | <ImageView |
| 88 | 86 | android:id="@+id/iv_1" |
| 89 | 87 | android:layout_width="13dp" |
| 90 | 88 | android:layout_height="13dp" |
| 89 | + android:layout_marginRight="20dp" | |
| 91 | 90 | android:background="@mipmap/wsyq" |
| 92 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 93 | 91 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 94 | 92 | app:layout_constraintRight_toRightOf="@id/view_2" |
| 95 | - android:layout_marginRight="20dp" | |
| 96 | - /> | |
| 93 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 97 | 94 | |
| 98 | 95 | <View |
| 99 | 96 | android:id="@+id/view_3" |
| 100 | - android:layout_width="345dp" | |
| 97 | + android:layout_width="match_parent" | |
| 101 | 98 | android:layout_height="50dp" |
| 99 | + android:layout_marginLeft="15dp" | |
| 100 | + android:layout_marginTop="175dp" | |
| 101 | + android:layout_marginRight="15dp" | |
| 102 | 102 | android:background="@drawable/bg_solid_white_10" |
| 103 | 103 | app:layout_constraintLeft_toLeftOf="parent" |
| 104 | 104 | app:layout_constraintRight_toRightOf="parent" |
| 105 | - app:layout_constraintTop_toTopOf="parent" | |
| 106 | - android:layout_marginTop="175dp" | |
| 107 | - /> | |
| 105 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 108 | 106 | |
| 109 | 107 | |
| 110 | 108 | <TextView |
| 111 | 109 | android:layout_width="wrap_content" |
| 112 | 110 | android:layout_height="wrap_content" |
| 113 | - app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 114 | - app:layout_constraintRight_toRightOf="@id/view_3" | |
| 115 | - app:layout_constraintTop_toTopOf="@+id/view_3" | |
| 116 | - app:layout_constraintBottom_toBottomOf="@+id/view_3" | |
| 111 | + android:text="妈妈" | |
| 117 | 112 | android:textColor="#333333" |
| 118 | 113 | android:textSize="16dp" |
| 119 | - android:text="妈妈" | |
| 120 | - /> | |
| 114 | + app:layout_constraintBottom_toBottomOf="@+id/view_3" | |
| 115 | + app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 116 | + app:layout_constraintRight_toRightOf="@id/view_3" | |
| 117 | + app:layout_constraintTop_toTopOf="@+id/view_3" /> | |
| 121 | 118 | |
| 122 | 119 | <ImageView |
| 123 | 120 | android:id="@+id/iv_2" |
| 124 | 121 | android:layout_width="13dp" |
| 125 | 122 | android:layout_height="13dp" |
| 123 | + android:layout_marginRight="20dp" | |
| 126 | 124 | android:background="@mipmap/wsyq" |
| 127 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 128 | 125 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 129 | 126 | app:layout_constraintRight_toRightOf="@id/view_3" |
| 130 | - android:layout_marginRight="20dp" | |
| 131 | - /> | |
| 127 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 128 | + | |
| 132 | 129 | <View |
| 133 | 130 | android:id="@+id/view_4" |
| 134 | - android:layout_width="345dp" | |
| 131 | + android:layout_width="match_parent" | |
| 135 | 132 | android:layout_height="50dp" |
| 133 | + android:layout_marginLeft="15dp" | |
| 134 | + android:layout_marginTop="240dp" | |
| 135 | + android:layout_marginRight="15dp" | |
| 136 | 136 | android:background="@drawable/bg_solid_white_10" |
| 137 | 137 | app:layout_constraintLeft_toLeftOf="parent" |
| 138 | 138 | app:layout_constraintRight_toRightOf="parent" |
| 139 | - app:layout_constraintTop_toTopOf="parent" | |
| 140 | - android:layout_marginTop="240dp" | |
| 141 | - /> | |
| 139 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 142 | 140 | |
| 143 | 141 | |
| 144 | 142 | <TextView |
| 145 | 143 | android:layout_width="wrap_content" |
| 146 | 144 | android:layout_height="wrap_content" |
| 147 | - app:layout_constraintLeft_toLeftOf="@id/view_4" | |
| 148 | - app:layout_constraintRight_toRightOf="@id/view_4" | |
| 149 | - app:layout_constraintTop_toTopOf="@+id/view_4" | |
| 150 | - app:layout_constraintBottom_toBottomOf="@+id/view_4" | |
| 145 | + android:text="爷爷" | |
| 151 | 146 | android:textColor="#333333" |
| 152 | 147 | android:textSize="16dp" |
| 153 | - android:text="爷爷" | |
| 154 | - /> | |
| 148 | + app:layout_constraintBottom_toBottomOf="@+id/view_4" | |
| 149 | + app:layout_constraintLeft_toLeftOf="@id/view_4" | |
| 150 | + app:layout_constraintRight_toRightOf="@id/view_4" | |
| 151 | + app:layout_constraintTop_toTopOf="@+id/view_4" /> | |
| 155 | 152 | |
| 156 | 153 | <ImageView |
| 157 | 154 | android:id="@+id/iv_3" |
| 158 | 155 | android:layout_width="13dp" |
| 159 | 156 | android:layout_height="13dp" |
| 157 | + android:layout_marginRight="20dp" | |
| 160 | 158 | android:background="@mipmap/wsyq" |
| 161 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 162 | 159 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
| 163 | 160 | app:layout_constraintRight_toRightOf="@id/view_4" |
| 164 | - android:layout_marginRight="20dp" | |
| 165 | - /> | |
| 161 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 162 | + | |
| 166 | 163 | <View |
| 167 | 164 | android:id="@+id/view_5" |
| 168 | - android:layout_width="345dp" | |
| 165 | + android:layout_width="match_parent" | |
| 169 | 166 | android:layout_height="50dp" |
| 167 | + android:layout_marginLeft="15dp" | |
| 168 | + android:layout_marginTop="304dp" | |
| 169 | + android:layout_marginRight="15dp" | |
| 170 | 170 | android:background="@drawable/bg_solid_white_10" |
| 171 | 171 | app:layout_constraintLeft_toLeftOf="parent" |
| 172 | 172 | app:layout_constraintRight_toRightOf="parent" |
| 173 | - app:layout_constraintTop_toTopOf="parent" | |
| 174 | - android:layout_marginTop="304dp" | |
| 175 | - /> | |
| 173 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 176 | 174 | |
| 177 | 175 | |
| 178 | 176 | <TextView |
| 179 | 177 | android:layout_width="wrap_content" |
| 180 | 178 | android:layout_height="wrap_content" |
| 181 | - app:layout_constraintLeft_toLeftOf="@id/view_5" | |
| 182 | - app:layout_constraintRight_toRightOf="@id/view_5" | |
| 183 | - app:layout_constraintTop_toTopOf="@+id/view_5" | |
| 184 | - app:layout_constraintBottom_toBottomOf="@+id/view_5" | |
| 179 | + android:text="奶奶" | |
| 185 | 180 | android:textColor="#333333" |
| 186 | 181 | android:textSize="16dp" |
| 187 | - android:text="奶奶" | |
| 188 | - /> | |
| 182 | + app:layout_constraintBottom_toBottomOf="@+id/view_5" | |
| 183 | + app:layout_constraintLeft_toLeftOf="@id/view_5" | |
| 184 | + app:layout_constraintRight_toRightOf="@id/view_5" | |
| 185 | + app:layout_constraintTop_toTopOf="@+id/view_5" /> | |
| 189 | 186 | |
| 190 | 187 | <ImageView |
| 191 | 188 | android:id="@+id/iv_4" |
| 192 | 189 | android:layout_width="13dp" |
| 193 | 190 | android:layout_height="13dp" |
| 191 | + android:layout_marginRight="20dp" | |
| 194 | 192 | android:background="@mipmap/wsyq" |
| 195 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 196 | 193 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
| 197 | 194 | app:layout_constraintRight_toRightOf="@id/view_5" |
| 198 | - android:layout_marginRight="20dp" | |
| 199 | - /> | |
| 195 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 196 | + | |
| 200 | 197 | <View |
| 201 | 198 | android:id="@+id/view_6" |
| 202 | - android:layout_width="345dp" | |
| 199 | + android:layout_width="match_parent" | |
| 203 | 200 | android:layout_height="50dp" |
| 201 | + android:layout_marginLeft="15dp" | |
| 202 | + android:layout_marginTop="370dp" | |
| 203 | + android:layout_marginRight="15dp" | |
| 204 | 204 | android:background="@drawable/bg_solid_white_10" |
| 205 | 205 | app:layout_constraintLeft_toLeftOf="parent" |
| 206 | 206 | app:layout_constraintRight_toRightOf="parent" |
| 207 | - app:layout_constraintTop_toTopOf="parent" | |
| 208 | - android:layout_marginTop="370dp" | |
| 209 | - /> | |
| 207 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 210 | 208 | |
| 211 | 209 | |
| 212 | 210 | <TextView |
| 213 | 211 | android:layout_width="wrap_content" |
| 214 | 212 | android:layout_height="wrap_content" |
| 215 | - app:layout_constraintLeft_toLeftOf="@id/view_6" | |
| 216 | - app:layout_constraintRight_toRightOf="@id/view_6" | |
| 217 | - app:layout_constraintTop_toTopOf="@+id/view_6" | |
| 218 | - app:layout_constraintBottom_toBottomOf="@+id/view_6" | |
| 213 | + android:text="外公" | |
| 219 | 214 | android:textColor="#333333" |
| 220 | 215 | android:textSize="16dp" |
| 221 | - android:text="外公" | |
| 222 | - /> | |
| 216 | + app:layout_constraintBottom_toBottomOf="@+id/view_6" | |
| 217 | + app:layout_constraintLeft_toLeftOf="@id/view_6" | |
| 218 | + app:layout_constraintRight_toRightOf="@id/view_6" | |
| 219 | + app:layout_constraintTop_toTopOf="@+id/view_6" /> | |
| 223 | 220 | |
| 224 | 221 | <ImageView |
| 225 | 222 | android:id="@+id/iv_5" |
| 226 | 223 | android:layout_width="13dp" |
| 227 | 224 | android:layout_height="13dp" |
| 225 | + android:layout_marginRight="20dp" | |
| 228 | 226 | android:background="@mipmap/wsyq" |
| 229 | - app:layout_constraintTop_toTopOf="@id/view_6" | |
| 230 | 227 | app:layout_constraintBottom_toBottomOf="@id/view_6" |
| 231 | 228 | app:layout_constraintRight_toRightOf="@id/view_6" |
| 232 | - android:layout_marginRight="20dp" | |
| 233 | - /> | |
| 229 | + app:layout_constraintTop_toTopOf="@id/view_6" /> | |
| 230 | + | |
| 234 | 231 | <View |
| 235 | 232 | android:id="@+id/view_7" |
| 236 | - android:layout_width="345dp" | |
| 233 | + android:layout_width="match_parent" | |
| 237 | 234 | android:layout_height="50dp" |
| 235 | + android:layout_marginLeft="15dp" | |
| 236 | + android:layout_marginTop="434dp" | |
| 237 | + android:layout_marginRight="15dp" | |
| 238 | 238 | android:background="@drawable/bg_solid_white_10" |
| 239 | 239 | app:layout_constraintLeft_toLeftOf="parent" |
| 240 | 240 | app:layout_constraintRight_toRightOf="parent" |
| 241 | - app:layout_constraintTop_toTopOf="parent" | |
| 242 | - android:layout_marginTop="434dp" | |
| 243 | - /> | |
| 241 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 244 | 242 | |
| 245 | 243 | |
| 246 | 244 | <TextView |
| 247 | 245 | android:layout_width="wrap_content" |
| 248 | 246 | android:layout_height="wrap_content" |
| 249 | - app:layout_constraintLeft_toLeftOf="@id/view_7" | |
| 250 | - app:layout_constraintRight_toRightOf="@id/view_7" | |
| 251 | - app:layout_constraintTop_toTopOf="@+id/view_7" | |
| 252 | - app:layout_constraintBottom_toBottomOf="@+id/view_7" | |
| 247 | + android:text="外婆" | |
| 253 | 248 | android:textColor="#333333" |
| 254 | 249 | android:textSize="16dp" |
| 255 | - android:text="外婆" | |
| 256 | - /> | |
| 250 | + app:layout_constraintBottom_toBottomOf="@+id/view_7" | |
| 251 | + app:layout_constraintLeft_toLeftOf="@id/view_7" | |
| 252 | + app:layout_constraintRight_toRightOf="@id/view_7" | |
| 253 | + app:layout_constraintTop_toTopOf="@+id/view_7" /> | |
| 257 | 254 | |
| 258 | 255 | <ImageView |
| 259 | 256 | android:id="@+id/iv_6" |
| 260 | 257 | android:layout_width="13dp" |
| 261 | 258 | android:layout_height="13dp" |
| 259 | + android:layout_marginRight="20dp" | |
| 262 | 260 | android:background="@mipmap/wsyq" |
| 263 | - app:layout_constraintTop_toTopOf="@id/view_7" | |
| 264 | 261 | app:layout_constraintBottom_toBottomOf="@id/view_7" |
| 265 | 262 | app:layout_constraintRight_toRightOf="@id/view_7" |
| 266 | - android:layout_marginRight="20dp" | |
| 267 | - /> | |
| 268 | - | |
| 263 | + app:layout_constraintTop_toTopOf="@id/view_7" /> | |
| 269 | 264 | |
| 270 | 265 | |
| 271 | 266 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 272 | 267 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_set_nian.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 6 | + android:background="#F4F6F8"> | |
| 8 | 7 | |
| 9 | 8 | <View |
| 10 | 9 | android:id="@+id/view_1" |
| 11 | 10 | android:layout_width="match_parent" |
| 12 | 11 | android:layout_height="44dp" |
| 13 | - app:layout_constraintTop_toTopOf="parent" | |
| 14 | 12 | android:background="@android:color/white" |
| 15 | - /> | |
| 13 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 14 | + | |
| 16 | 15 | <TextView |
| 17 | 16 | android:layout_width="wrap_content" |
| 18 | 17 | android:layout_height="wrap_content" |
| 19 | 18 | android:text="年级" |
| 20 | 19 | android:textColor="#333333" |
| 21 | 20 | android:textSize="18dp" |
| 21 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 22 | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 23 | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 24 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 25 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 26 | - /> | |
| 24 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 25 | + | |
| 27 | 26 | <TextView |
| 28 | 27 | android:id="@+id/tv_cancel" |
| 29 | 28 | android:layout_width="wrap_content" |
| 30 | 29 | android:layout_height="wrap_content" |
| 30 | + android:layout_marginLeft="15dp" | |
| 31 | 31 | android:text="取消" |
| 32 | 32 | android:textColor="#666666" |
| 33 | 33 | android:textSize="16dp" |
| 34 | - app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 35 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 36 | 34 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 37 | - android:layout_marginLeft="15dp" | |
| 38 | - /> | |
| 35 | + app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 36 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 37 | + | |
| 39 | 38 | <TextView |
| 40 | 39 | android:id="@+id/tv_ok" |
| 41 | 40 | android:layout_width="wrap_content" |
| 42 | 41 | android:layout_height="wrap_content" |
| 42 | + android:layout_marginRight="15dp" | |
| 43 | 43 | android:text="确认" |
| 44 | 44 | android:textColor="#FE5E09" |
| 45 | 45 | android:textSize="16dp" |
| 46 | - app:layout_constraintRight_toRightOf="@id/view_1" | |
| 47 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 48 | 46 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 49 | - android:layout_marginRight="15dp" | |
| 50 | - /> | |
| 47 | + app:layout_constraintRight_toRightOf="@id/view_1" | |
| 48 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 49 | + | |
| 51 | 50 | <TextView |
| 52 | 51 | android:layout_width="wrap_content" |
| 53 | 52 | android:layout_height="wrap_content" |
| 54 | - android:text="请选择年级" | |
| 55 | - app:layout_constraintBottom_toTopOf="@id/view_2" | |
| 56 | - android:layout_marginBottom="15dp" | |
| 57 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 58 | 53 | android:layout_marginLeft="15dp" |
| 54 | + android:layout_marginBottom="15dp" | |
| 55 | + android:text="请选择年级" | |
| 59 | 56 | android:textColor="#666666" |
| 60 | 57 | android:textSize="16dp" |
| 61 | - /> | |
| 58 | + app:layout_constraintBottom_toTopOf="@id/view_2" | |
| 59 | + app:layout_constraintLeft_toLeftOf="parent" /> | |
| 62 | 60 | |
| 63 | 61 | <View |
| 64 | 62 | android:id="@+id/view_2" |
| 65 | - android:layout_width="345dp" | |
| 63 | + android:layout_width="match_parent" | |
| 66 | 64 | android:layout_height="50dp" |
| 65 | + android:layout_marginLeft="15dp" | |
| 66 | + android:layout_marginTop="109dp" | |
| 67 | + android:layout_marginRight="15dp" | |
| 67 | 68 | android:background="@drawable/bg_solid_white_10" |
| 68 | 69 | app:layout_constraintLeft_toLeftOf="parent" |
| 69 | 70 | app:layout_constraintRight_toRightOf="parent" |
| 70 | - app:layout_constraintTop_toTopOf="parent" | |
| 71 | - android:layout_marginTop="109dp" | |
| 72 | - /> | |
| 71 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 73 | 72 | |
| 74 | 73 | |
| 75 | 74 | <TextView |
| 76 | 75 | android:id="@+id/tv_nian" |
| 77 | 76 | android:layout_width="wrap_content" |
| 78 | 77 | android:layout_height="wrap_content" |
| 79 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 80 | - app:layout_constraintTop_toTopOf="@+id/view_2" | |
| 81 | - app:layout_constraintBottom_toBottomOf="@+id/view_2" | |
| 78 | + android:layout_marginLeft="15dp" | |
| 79 | + android:text="七年级" | |
| 82 | 80 | android:textColor="#333333" |
| 83 | 81 | android:textSize="16dp" |
| 84 | - android:text="一年纪" | |
| 85 | - android:layout_marginLeft="15dp" | |
| 86 | - /> | |
| 82 | + app:layout_constraintBottom_toBottomOf="@+id/view_2" | |
| 83 | + app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 84 | + app:layout_constraintTop_toTopOf="@+id/view_2" /> | |
| 87 | 85 | |
| 88 | 86 | <ImageView |
| 89 | 87 | android:layout_width="5.5dp" |
| 90 | 88 | android:layout_height="9.5dp" |
| 89 | + android:layout_marginRight="15dp" | |
| 91 | 90 | android:background="@mipmap/ycaj" |
| 92 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 93 | 91 | app:layout_constraintBottom_toBottomOf="@id/view_2" |
| 94 | 92 | app:layout_constraintRight_toRightOf="@id/view_2" |
| 95 | - android:layout_marginRight="15dp" | |
| 96 | - /> | |
| 93 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 97 | 94 | |
| 98 | 95 | <TextView |
| 99 | 96 | android:layout_width="wrap_content" |
| 100 | 97 | android:layout_height="wrap_content" |
| 101 | - android:text="请选择学期" | |
| 102 | - app:layout_constraintBottom_toTopOf="@id/view_3" | |
| 103 | - android:layout_marginBottom="15dp" | |
| 104 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 105 | 98 | android:layout_marginLeft="15dp" |
| 99 | + android:layout_marginBottom="15dp" | |
| 100 | + android:text="请选择学期" | |
| 106 | 101 | android:textColor="#666666" |
| 107 | 102 | android:textSize="16dp" |
| 108 | - /> | |
| 103 | + app:layout_constraintBottom_toTopOf="@id/view_3" | |
| 104 | + app:layout_constraintLeft_toLeftOf="parent" /> | |
| 109 | 105 | |
| 110 | 106 | <View |
| 111 | 107 | android:id="@+id/view_3" |
| 112 | - android:layout_width="345dp" | |
| 108 | + android:layout_width="match_parent" | |
| 113 | 109 | android:layout_height="50dp" |
| 110 | + android:layout_marginLeft="15dp" | |
| 111 | + android:layout_marginTop="209dp" | |
| 112 | + android:layout_marginRight="15dp" | |
| 114 | 113 | android:background="@drawable/bg_solid_white_10" |
| 115 | 114 | app:layout_constraintLeft_toLeftOf="parent" |
| 116 | 115 | app:layout_constraintRight_toRightOf="parent" |
| 117 | - app:layout_constraintTop_toTopOf="parent" | |
| 118 | - android:layout_marginTop="209dp" | |
| 119 | - /> | |
| 116 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 120 | 117 | |
| 121 | 118 | <ImageView |
| 122 | 119 | android:layout_width="5.5dp" |
| 123 | 120 | android:layout_height="9.5dp" |
| 121 | + android:layout_marginRight="15dp" | |
| 124 | 122 | android:background="@mipmap/ycaj" |
| 125 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 126 | 123 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 127 | 124 | app:layout_constraintRight_toRightOf="@id/view_3" |
| 128 | - android:layout_marginRight="15dp" | |
| 129 | - /> | |
| 125 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 130 | 126 | |
| 131 | 127 | <TextView |
| 132 | 128 | android:id="@+id/tv_xq" |
| 133 | 129 | android:layout_width="wrap_content" |
| 134 | 130 | android:layout_height="wrap_content" |
| 135 | - app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 136 | - app:layout_constraintTop_toTopOf="@+id/view_3" | |
| 137 | - app:layout_constraintBottom_toBottomOf="@+id/view_3" | |
| 131 | + android:layout_marginLeft="15dp" | |
| 132 | + android:text="上学期" | |
| 138 | 133 | android:textColor="#333333" |
| 139 | 134 | android:textSize="16dp" |
| 140 | - android:text="上学期" | |
| 141 | - android:layout_marginLeft="15dp" | |
| 142 | - /> | |
| 143 | - | |
| 135 | + app:layout_constraintBottom_toBottomOf="@+id/view_3" | |
| 136 | + app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 137 | + app:layout_constraintTop_toTopOf="@+id/view_3" /> | |
| 144 | 138 | |
| 145 | 139 | |
| 146 | 140 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 147 | 141 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_set_nick.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 6 | + android:background="#F4F6F8"> | |
| 8 | 7 | |
| 9 | 8 | <View |
| 10 | 9 | android:id="@+id/view_1" |
| 11 | 10 | android:layout_width="match_parent" |
| 12 | 11 | android:layout_height="44dp" |
| 13 | - app:layout_constraintTop_toTopOf="parent" | |
| 14 | 12 | android:background="@android:color/white" |
| 15 | - /> | |
| 13 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 14 | + | |
| 16 | 15 | <TextView |
| 17 | 16 | android:layout_width="wrap_content" |
| 18 | 17 | android:layout_height="wrap_content" |
| 19 | 18 | android:text="昵称" |
| 20 | 19 | android:textColor="#333333" |
| 21 | 20 | android:textSize="18dp" |
| 21 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 22 | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 23 | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 24 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 25 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 26 | - /> | |
| 24 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 25 | + | |
| 27 | 26 | <TextView |
| 28 | 27 | android:id="@+id/tv_cancel" |
| 29 | 28 | android:layout_width="wrap_content" |
| 30 | 29 | android:layout_height="wrap_content" |
| 30 | + android:layout_marginLeft="15dp" | |
| 31 | 31 | android:text="取消" |
| 32 | 32 | android:textColor="#666666" |
| 33 | 33 | android:textSize="16dp" |
| 34 | - app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 35 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 36 | 34 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 37 | - android:layout_marginLeft="15dp" | |
| 38 | - /> | |
| 35 | + app:layout_constraintLeft_toLeftOf="@id/view_1" | |
| 36 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 37 | + | |
| 39 | 38 | <TextView |
| 40 | 39 | android:id="@+id/tv_ok" |
| 41 | 40 | android:layout_width="wrap_content" |
| 42 | 41 | android:layout_height="wrap_content" |
| 42 | + android:layout_marginRight="15dp" | |
| 43 | 43 | android:text="确认" |
| 44 | 44 | android:textColor="#FE5E09" |
| 45 | 45 | android:textSize="16dp" |
| 46 | - app:layout_constraintRight_toRightOf="@id/view_1" | |
| 47 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 48 | 46 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 49 | - android:layout_marginRight="15dp" | |
| 50 | - /> | |
| 47 | + app:layout_constraintRight_toRightOf="@id/view_1" | |
| 48 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 51 | 49 | |
| 52 | 50 | |
| 53 | 51 | <View |
| 54 | 52 | android:id="@+id/view_3" |
| 55 | - android:layout_width="345dp" | |
| 53 | + android:layout_width="match_parent" | |
| 56 | 54 | android:layout_height="50dp" |
| 55 | + android:layout_marginLeft="15dp" | |
| 56 | + android:layout_marginTop="109dp" | |
| 57 | + android:layout_marginRight="15dp" | |
| 57 | 58 | android:background="@drawable/bg_solid_white_10" |
| 58 | 59 | app:layout_constraintLeft_toLeftOf="parent" |
| 59 | 60 | app:layout_constraintRight_toRightOf="parent" |
| 60 | - app:layout_constraintTop_toTopOf="parent" | |
| 61 | - android:layout_marginTop="109dp" | |
| 62 | - /> | |
| 61 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 62 | + | |
| 63 | 63 | <EditText |
| 64 | 64 | android:id="@+id/et_1" |
| 65 | 65 | android:layout_width="0dp" |
| 66 | 66 | android:layout_height="0dp" |
| 67 | - app:layout_constraintLeft_toLeftOf="@+id/view_3" | |
| 68 | - app:layout_constraintRight_toRightOf="@+id/view_3" | |
| 69 | - app:layout_constraintTop_toTopOf="@+id/view_3" | |
| 70 | - app:layout_constraintBottom_toBottomOf="@+id/view_3" | |
| 71 | 67 | android:layout_marginLeft="5dp" |
| 72 | 68 | android:layout_marginRight="5dp" |
| 73 | - android:textSize="16dp" | |
| 74 | - android:textColorHint="#999999" | |
| 75 | 69 | android:hint="请设置2-10个字符,不包括无效字符" |
| 76 | 70 | android:textColor="#333333" |
| 77 | - /> | |
| 71 | + android:textColorHint="#999999" | |
| 72 | + android:textSize="16dp" | |
| 73 | + app:layout_constraintBottom_toBottomOf="@+id/view_3" | |
| 74 | + app:layout_constraintLeft_toLeftOf="@+id/view_3" | |
| 75 | + app:layout_constraintRight_toRightOf="@+id/view_3" | |
| 76 | + app:layout_constraintTop_toTopOf="@+id/view_3" /> | |
| 78 | 77 | |
| 79 | 78 | <TextView |
| 80 | 79 | android:layout_width="wrap_content" |
| 81 | 80 | android:layout_height="wrap_content" |
| 81 | + android:layout_marginLeft="15dp" | |
| 82 | + android:layout_marginBottom="15dp" | |
| 82 | 83 | android:text="请输入昵称" |
| 84 | + android:textColor="#666666" | |
| 83 | 85 | app:layout_constraintBottom_toTopOf="@id/et_1" |
| 84 | - android:layout_marginBottom="15dp" | |
| 85 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 86 | - android:layout_marginLeft="15dp" | |
| 87 | - /> | |
| 86 | + app:layout_constraintLeft_toLeftOf="parent" /> | |
| 88 | 87 | |
| 89 | 88 | |
| 90 | 89 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 91 | 90 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/activity_set_sex.xml
| ... | ... | @@ -52,7 +52,9 @@ |
| 52 | 52 | |
| 53 | 53 | <View |
| 54 | 54 | android:id="@+id/view_2" |
| 55 | - android:layout_width="345dp" | |
| 55 | + android:layout_width="match_parent" | |
| 56 | + android:layout_marginLeft="15dp" | |
| 57 | + android:layout_marginRight="15dp" | |
| 56 | 58 | android:layout_height="50dp" |
| 57 | 59 | android:background="@drawable/bg_solid_white_10" |
| 58 | 60 | app:layout_constraintLeft_toLeftOf="parent" |
| ... | ... | @@ -108,7 +110,9 @@ |
| 108 | 110 | |
| 109 | 111 | <View |
| 110 | 112 | android:id="@+id/view_3" |
| 111 | - android:layout_width="345dp" | |
| 113 | + android:layout_width="match_parent" | |
| 114 | + android:layout_marginLeft="15dp" | |
| 115 | + android:layout_marginRight="15dp" | |
| 112 | 116 | android:layout_height="50dp" |
| 113 | 117 | android:background="@drawable/bg_solid_white_10" |
| 114 | 118 | app:layout_constraintLeft_toLeftOf="parent" | ... | ... |
app/src/main/res/layout/activity_setac.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 6 | + android:background="#F4F6F8"> | |
| 8 | 7 | |
| 9 | 8 | <View |
| 10 | 9 | android:id="@+id/view_1" |
| 11 | 10 | android:layout_width="match_parent" |
| 12 | 11 | android:layout_height="44dp" |
| 13 | - app:layout_constraintTop_toTopOf="parent" | |
| 14 | 12 | android:background="@android:color/white" |
| 15 | - /> | |
| 13 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 14 | + | |
| 16 | 15 | <TextView |
| 17 | 16 | android:layout_width="wrap_content" |
| 18 | 17 | android:layout_height="wrap_content" |
| 19 | 18 | android:text="账号设置" |
| 20 | 19 | android:textColor="#333333" |
| 21 | 20 | android:textSize="18dp" |
| 21 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 22 | 22 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 23 | 23 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 24 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 25 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 26 | - /> | |
| 24 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 25 | + | |
| 27 | 26 | <ImageView |
| 28 | 27 | android:id="@+id/iv_back" |
| 29 | 28 | android:layout_width="10dp" |
| 30 | 29 | android:layout_height="16dp" |
| 31 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 32 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 33 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 34 | 30 | android:layout_marginLeft="15dp" |
| 35 | 31 | android:background="@mipmap/icon_back" |
| 36 | - /> | |
| 32 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 33 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 34 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 35 | + | |
| 37 | 36 | <View |
| 38 | 37 | android:layout_width="match_parent" |
| 39 | 38 | android:layout_height="1dp" |
| 40 | 39 | android:background="#EEEEEE" |
| 41 | - app:layout_constraintTop_toBottomOf="@id/view_1" | |
| 42 | - /> | |
| 40 | + app:layout_constraintTop_toBottomOf="@id/view_1" /> | |
| 43 | 41 | |
| 44 | 42 | <View |
| 45 | 43 | android:id="@+id/view_3" |
| 46 | - android:layout_width="345dp" | |
| 44 | + android:layout_width="match_parent" | |
| 47 | 45 | android:layout_height="80dp" |
| 46 | + android:layout_marginLeft="15dp" | |
| 47 | + android:layout_marginTop="90dp" | |
| 48 | + android:layout_marginRight="15dp" | |
| 48 | 49 | android:background="@drawable/bg_solid_white_10" |
| 49 | 50 | app:layout_constraintLeft_toLeftOf="parent" |
| 50 | 51 | app:layout_constraintRight_toRightOf="parent" |
| 51 | - app:layout_constraintTop_toTopOf="parent" | |
| 52 | - android:layout_marginTop="90dp" | |
| 53 | - /> | |
| 52 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 53 | + | |
| 54 | 54 | <ImageView |
| 55 | 55 | android:id="@+id/iv_3" |
| 56 | 56 | android:layout_width="57dp" |
| 57 | 57 | android:layout_height="57dp" |
| 58 | - android:background="@mipmap/txz" | |
| 59 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 58 | + android:layout_marginRight="31dp" | |
| 59 | + android:background="@mipmap/ic_parent_avatar" | |
| 60 | 60 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 61 | 61 | app:layout_constraintRight_toRightOf="@id/view_3" |
| 62 | - android:layout_marginRight="31dp" | |
| 63 | - /> | |
| 62 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 63 | + | |
| 64 | 64 | <TextView |
| 65 | 65 | android:id="@+id/tv_3" |
| 66 | 66 | android:layout_width="wrap_content" |
| 67 | 67 | android:layout_height="wrap_content" |
| 68 | + android:layout_marginLeft="15dp" | |
| 68 | 69 | android:text="头像" |
| 69 | 70 | android:textColor="#333333" |
| 70 | 71 | android:textSize="15dp" |
| 71 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 72 | 72 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 73 | 73 | app:layout_constraintLeft_toLeftOf="@id/view_3" |
| 74 | - android:layout_marginLeft="15dp" | |
| 75 | - /> | |
| 74 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 75 | + | |
| 76 | 76 | <ImageView |
| 77 | 77 | android:layout_width="5.5dp" |
| 78 | 78 | android:layout_height="9.5dp" |
| 79 | + android:layout_marginRight="15dp" | |
| 79 | 80 | android:background="@mipmap/ycaj" |
| 80 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 81 | 81 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 82 | 82 | app:layout_constraintRight_toRightOf="@id/view_3" |
| 83 | - android:layout_marginRight="15dp" | |
| 84 | - /> | |
| 83 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 85 | 84 | |
| 86 | 85 | <View |
| 87 | 86 | android:id="@+id/view_4" |
| 88 | - android:layout_width="345dp" | |
| 87 | + android:layout_width="match_parent" | |
| 89 | 88 | android:layout_height="90dp" |
| 89 | + android:layout_marginLeft="15dp" | |
| 90 | + android:layout_marginTop="185dp" | |
| 91 | + android:layout_marginRight="15dp" | |
| 90 | 92 | android:background="@drawable/bg_solid_white_10" |
| 91 | 93 | app:layout_constraintLeft_toLeftOf="parent" |
| 92 | 94 | app:layout_constraintRight_toRightOf="parent" |
| 93 | - app:layout_constraintTop_toTopOf="parent" | |
| 94 | - android:layout_marginTop="185dp" | |
| 95 | - /> | |
| 95 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 96 | 96 | |
| 97 | 97 | <TextView |
| 98 | 98 | android:id="@+id/tv_4" |
| 99 | 99 | android:layout_width="wrap_content" |
| 100 | 100 | android:layout_height="wrap_content" |
| 101 | + android:layout_marginLeft="15dp" | |
| 102 | + android:layout_marginTop="15dp" | |
| 101 | 103 | android:text="账户" |
| 102 | 104 | android:textColor="#333333" |
| 103 | 105 | android:textSize="15dp" |
| 104 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 105 | 106 | app:layout_constraintLeft_toLeftOf="@id/view_4" |
| 106 | - android:layout_marginLeft="15dp" | |
| 107 | - android:layout_marginTop="15dp" | |
| 108 | - /> | |
| 107 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 108 | + | |
| 109 | 109 | <TextView |
| 110 | 110 | android:id="@+id/tv_5" |
| 111 | 111 | android:layout_width="wrap_content" |
| 112 | 112 | android:layout_height="wrap_content" |
| 113 | + android:layout_marginLeft="15dp" | |
| 114 | + android:layout_marginTop="60dp" | |
| 113 | 115 | android:text="密码" |
| 114 | 116 | android:textColor="#333333" |
| 115 | 117 | android:textSize="15dp" |
| 116 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 117 | 118 | app:layout_constraintLeft_toLeftOf="@id/view_4" |
| 118 | - android:layout_marginLeft="15dp" | |
| 119 | - android:layout_marginTop="60dp" | |
| 120 | - /> | |
| 119 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 120 | + | |
| 121 | 121 | <TextView |
| 122 | 122 | android:id="@+id/tv_6" |
| 123 | 123 | android:layout_width="wrap_content" |
| 124 | 124 | android:layout_height="wrap_content" |
| 125 | + android:layout_marginTop="15dp" | |
| 126 | + android:layout_marginRight="15dp" | |
| 125 | 127 | android:text="123" |
| 126 | 128 | android:textColor="#666666" |
| 127 | 129 | android:textSize="15dp" |
| 128 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 129 | 130 | app:layout_constraintRight_toRightOf="@id/view_4" |
| 130 | - android:layout_marginRight="15dp" | |
| 131 | - android:layout_marginTop="15dp" | |
| 132 | - /> | |
| 131 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 132 | + | |
| 133 | 133 | <ImageView |
| 134 | 134 | android:layout_width="5.5dp" |
| 135 | 135 | android:layout_height="9.5dp" |
| 136 | + android:layout_marginRight="15dp" | |
| 136 | 137 | android:background="@mipmap/ycaj" |
| 137 | - app:layout_constraintTop_toTopOf="@id/tv_7" | |
| 138 | 138 | app:layout_constraintBottom_toBottomOf="@id/tv_7" |
| 139 | 139 | app:layout_constraintRight_toRightOf="@id/view_4" |
| 140 | - android:layout_marginRight="15dp" | |
| 141 | - /> | |
| 140 | + app:layout_constraintTop_toTopOf="@id/tv_7" /> | |
| 141 | + | |
| 142 | 142 | <TextView |
| 143 | 143 | android:id="@+id/tv_7" |
| 144 | 144 | android:layout_width="wrap_content" |
| 145 | 145 | android:layout_height="wrap_content" |
| 146 | + android:layout_marginTop="60dp" | |
| 147 | + android:layout_marginRight="31dp" | |
| 146 | 148 | android:text="已设置" |
| 147 | 149 | android:textColor="#666666" |
| 148 | 150 | android:textSize="15dp" |
| 149 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 150 | 151 | app:layout_constraintRight_toRightOf="@id/view_4" |
| 151 | - android:layout_marginRight="31dp" | |
| 152 | - android:layout_marginTop="60dp" | |
| 153 | - /> | |
| 154 | - | |
| 152 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 155 | 153 | |
| 154 | + <Button | |
| 155 | + android:id="@+id/logout" | |
| 156 | + android:layout_width="315dp" | |
| 157 | + android:layout_height="50dp" | |
| 158 | + android:layout_marginBottom="120dp" | |
| 159 | + android:background="@drawable/bg_solid_btn" | |
| 160 | + android:text="退出登录" | |
| 161 | + android:textColor="@color/white" | |
| 162 | + android:textSize="18dp" | |
| 163 | + app:layout_constraintBottom_toBottomOf="parent" | |
| 164 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 165 | + app:layout_constraintRight_toRightOf="parent" /> | |
| 156 | 166 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 157 | 167 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/bottom_sheet_layout.xml
| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | + android:layout_width="match_parent" | |
| 4 | + android:layout_height="wrap_content" | |
| 5 | + android:orientation="vertical" | |
| 6 | + android:background="@drawable/shape_bottom_sheet_dialog"> | |
| 7 | + | |
| 8 | + <TextView | |
| 9 | + android:id="@+id/take_photo" | |
| 10 | + android:layout_width="match_parent" | |
| 11 | + android:layout_height="50dp" | |
| 12 | + android:text="拍照" | |
| 13 | + android:textSize="15sp" | |
| 14 | + android:textColor="#191919" | |
| 15 | + android:gravity="center"/> | |
| 16 | + | |
| 17 | + | |
| 18 | + <View | |
| 19 | + android:layout_width="match_parent" | |
| 20 | + android:layout_height="1dp" | |
| 21 | + android:background="#F5F5F5"/> | |
| 22 | + <TextView | |
| 23 | + android:id="@+id/choose_photo" | |
| 24 | + android:layout_width="match_parent" | |
| 25 | + android:layout_height="50dp" | |
| 26 | + android:text="从相册选择" | |
| 27 | + android:textSize="15sp" | |
| 28 | + android:textColor="#191919" | |
| 29 | + android:gravity="center"/> | |
| 30 | + | |
| 31 | + <View | |
| 32 | + android:layout_width="match_parent" | |
| 33 | + android:layout_height="10dp" | |
| 34 | + android:background="#F5F5F5"/> | |
| 35 | + <TextView | |
| 36 | + android:id="@+id/cancel" | |
| 37 | + android:layout_width="match_parent" | |
| 38 | + android:layout_height="50dp" | |
| 39 | + android:text="取消" | |
| 40 | + android:textSize="15sp" | |
| 41 | + android:textColor="#191919" | |
| 42 | + android:gravity="center"/> | |
| 43 | + | |
| 44 | +</LinearLayout> | |
| 0 | 45 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/choose_activity.xml
| ... | ... | @@ -0,0 +1,38 @@ |
| 1 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 2 | + android:layout_width="match_parent" | |
| 3 | + android:layout_height="match_parent" | |
| 4 | + android:background="#F4F6F8"> | |
| 5 | + | |
| 6 | + <TextView | |
| 7 | + android:id="@+id/tv_title" | |
| 8 | + android:layout_width="match_parent" | |
| 9 | + android:layout_height="44dp" | |
| 10 | + android:background="@color/white" | |
| 11 | + android:gravity="center" | |
| 12 | + android:text="选择学生" | |
| 13 | + android:textColor="#333333" | |
| 14 | + android:textSize="18sp" /> | |
| 15 | + | |
| 16 | + <androidx.recyclerview.widget.RecyclerView | |
| 17 | + android:id="@+id/recycle" | |
| 18 | + android:layout_width="match_parent" | |
| 19 | + android:layout_height="wrap_content" | |
| 20 | + android:layout_above="@+id/tv_confirm" | |
| 21 | + android:layout_below="@+id/tv_title" | |
| 22 | + android:layout_marginBottom="20dp" /> | |
| 23 | + | |
| 24 | + <TextView | |
| 25 | + android:id="@+id/tv_confirm" | |
| 26 | + android:layout_width="180dp" | |
| 27 | + android:layout_height="40dp" | |
| 28 | + android:layout_alignParentBottom="true" | |
| 29 | + android:layout_centerHorizontal="true" | |
| 30 | + android:layout_marginBottom="120dp" | |
| 31 | + android:background="@drawable/bg_solid_btn" | |
| 32 | + android:gravity="center" | |
| 33 | + android:text="确认" | |
| 34 | + | |
| 35 | + android:textColor="@color/white" | |
| 36 | + android:textSize="16sp" /> | |
| 37 | + | |
| 38 | +</RelativeLayout> | ... | ... |
app/src/main/res/layout/fragment_home.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 6 | + android:background="#F4F6F8"> | |
| 8 | 7 | |
| 9 | 8 | <View |
| 10 | 9 | android:id="@+id/view_1" |
| 11 | 10 | android:layout_width="match_parent" |
| 12 | 11 | android:layout_height="44dp" |
| 13 | - app:layout_constraintTop_toTopOf="parent" | |
| 14 | 12 | android:background="@android:color/white" |
| 15 | - /> | |
| 13 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 14 | + | |
| 16 | 15 | <ImageView |
| 17 | 16 | android:id="@+id/iv_1" |
| 18 | 17 | android:layout_width="10dp" |
| 19 | 18 | android:layout_height="16dp" |
| 20 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 21 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 22 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 23 | 19 | android:layout_marginLeft="15dp" |
| 24 | 20 | android:background="@mipmap/icon_back" |
| 25 | - /> | |
| 21 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 22 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 23 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 26 | 24 | |
| 27 | 25 | <ImageView |
| 28 | 26 | android:id="@+id/iv_2" |
| 29 | 27 | android:layout_width="31dp" |
| 30 | 28 | android:layout_height="31dp" |
| 31 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 32 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 33 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 34 | 29 | android:layout_marginLeft="35dp" |
| 35 | 30 | android:background="@mipmap/txz" |
| 36 | - /> | |
| 31 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 32 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 33 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 34 | + | |
| 37 | 35 | <TextView |
| 38 | 36 | android:id="@+id/tv_name" |
| 39 | 37 | android:layout_width="wrap_content" |
| 40 | 38 | android:layout_height="wrap_content" |
| 39 | + android:layout_marginLeft="6.5dp" | |
| 41 | 40 | android:textColor="#333333" |
| 42 | 41 | android:textSize="15dp" |
| 43 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 44 | 42 | app:layout_constraintBottom_toBottomOf="@id/view_1" |
| 45 | 43 | app:layout_constraintLeft_toRightOf="@id/iv_2" |
| 46 | - android:layout_marginLeft="6.5dp" | |
| 47 | - /> | |
| 44 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 45 | + | |
| 48 | 46 | <ImageView |
| 49 | 47 | android:id="@+id/iv_3" |
| 50 | 48 | android:layout_width="8dp" |
| 51 | 49 | android:layout_height="5dp" |
| 52 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 53 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 54 | - app:layout_constraintLeft_toRightOf="@id/tv_name" | |
| 55 | 50 | android:layout_marginLeft="5dp" |
| 56 | 51 | android:background="@mipmap/xxan" |
| 57 | - /> | |
| 52 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 53 | + app:layout_constraintLeft_toRightOf="@id/tv_name" | |
| 54 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 58 | 55 | |
| 59 | 56 | <ImageView |
| 60 | 57 | android:id="@+id/iv_sapmiao" |
| 61 | - android:layout_width="345dp" | |
| 58 | + android:layout_width="match_parent" | |
| 62 | 59 | android:layout_height="167dp" |
| 63 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 64 | - app:layout_constraintRight_toRightOf="parent" | |
| 65 | - app:layout_constraintTop_toTopOf="parent" | |
| 60 | + android:layout_marginLeft="15dp" | |
| 66 | 61 | android:layout_marginTop="60dp" |
| 62 | + android:layout_marginRight="15dp" | |
| 67 | 63 | android:background="@mipmap/ssss" |
| 68 | - /> | |
| 64 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 65 | + app:layout_constraintRight_toRightOf="parent" | |
| 66 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 69 | 67 | |
| 70 | 68 | |
| 71 | - <View | |
| 69 | + <LinearLayout | |
| 72 | 70 | android:id="@+id/view_2" |
| 73 | - android:layout_width="345dp" | |
| 71 | + android:layout_width="match_parent" | |
| 74 | 72 | android:layout_height="100dp" |
| 73 | + android:layout_marginLeft="15dp" | |
| 74 | + android:layout_marginTop="240dp" | |
| 75 | + android:layout_marginRight="15dp" | |
| 76 | + android:background="@drawable/bg_solid_white_10" | |
| 77 | + android:orientation="horizontal" | |
| 75 | 78 | app:layout_constraintLeft_toLeftOf="parent" |
| 76 | 79 | app:layout_constraintRight_toRightOf="parent" |
| 77 | - app:layout_constraintTop_toTopOf="parent" | |
| 78 | - android:background="@drawable/bg_solid_white_10" | |
| 79 | - android:layout_marginTop="240dp" | |
| 80 | - /> | |
| 80 | + app:layout_constraintTop_toTopOf="parent"> | |
| 81 | 81 | |
| 82 | - <ImageView | |
| 83 | - android:id="@+id/iv_21" | |
| 84 | - android:layout_width="50dp" | |
| 85 | - android:layout_height="50dp" | |
| 86 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 87 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 88 | - android:layout_marginLeft="10dp" | |
| 89 | - android:layout_marginTop="15dp" | |
| 90 | - android:background="@mipmap/yyxz" | |
| 91 | - /> | |
| 92 | - <TextView | |
| 93 | - android:layout_width="wrap_content" | |
| 94 | - android:layout_height="wrap_content" | |
| 95 | - android:textColor="#333333" | |
| 96 | - android:textSize="13dp" | |
| 97 | - android:text="应用管理" | |
| 98 | - android:layout_marginTop="8dp" | |
| 99 | - app:layout_constraintLeft_toLeftOf="@id/iv_21" | |
| 100 | - app:layout_constraintRight_toRightOf="@id/iv_21" | |
| 101 | - app:layout_constraintTop_toBottomOf="@id/iv_21" | |
| 102 | - /> | |
| 103 | - <ImageView | |
| 104 | - android:id="@+id/iv_22" | |
| 105 | - android:layout_width="50dp" | |
| 106 | - android:layout_height="50dp" | |
| 107 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 108 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 109 | - android:layout_marginLeft="101dp" | |
| 110 | - android:layout_marginTop="15dp" | |
| 111 | - android:background="@mipmap/xxxt" | |
| 112 | - /> | |
| 113 | - <TextView | |
| 114 | - android:layout_width="wrap_content" | |
| 115 | - android:layout_height="wrap_content" | |
| 116 | - android:textColor="#333333" | |
| 117 | - android:textSize="13dp" | |
| 118 | - android:text="小星错题" | |
| 119 | - android:layout_marginTop="8dp" | |
| 120 | - app:layout_constraintLeft_toLeftOf="@id/iv_22" | |
| 121 | - app:layout_constraintRight_toRightOf="@id/iv_22" | |
| 122 | - app:layout_constraintTop_toBottomOf="@id/iv_22" | |
| 123 | - /> | |
| 124 | - <ImageView | |
| 125 | - android:id="@+id/iv_23" | |
| 126 | - android:layout_width="50dp" | |
| 127 | - android:layout_height="50dp" | |
| 128 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 129 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 130 | - android:layout_marginLeft="194dp" | |
| 131 | - android:layout_marginTop="15dp" | |
| 132 | - android:background="@mipmap/ffsj" | |
| 133 | - /> | |
| 134 | - <TextView | |
| 135 | - android:layout_width="wrap_content" | |
| 136 | - android:layout_height="wrap_content" | |
| 137 | - android:textColor="#333333" | |
| 138 | - android:textSize="13dp" | |
| 139 | - android:text="分发试卷" | |
| 140 | - android:layout_marginTop="8dp" | |
| 141 | - app:layout_constraintLeft_toLeftOf="@id/iv_23" | |
| 142 | - app:layout_constraintRight_toRightOf="@id/iv_23" | |
| 143 | - app:layout_constraintTop_toBottomOf="@id/iv_23" | |
| 144 | - /> | |
| 145 | - <ImageView | |
| 146 | - android:id="@+id/iv_24" | |
| 147 | - android:layout_width="50dp" | |
| 148 | - android:layout_height="50dp" | |
| 149 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 150 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 151 | - android:layout_marginLeft="285dp" | |
| 152 | - android:layout_marginTop="15dp" | |
| 153 | - android:background="@mipmap/sbgl" | |
| 154 | - /> | |
| 155 | - <TextView | |
| 156 | - android:layout_width="wrap_content" | |
| 157 | - android:layout_height="wrap_content" | |
| 158 | - android:textColor="#333333" | |
| 159 | - android:textSize="13dp" | |
| 160 | - android:text="设备管理" | |
| 161 | - android:layout_marginTop="8dp" | |
| 162 | - app:layout_constraintLeft_toLeftOf="@id/iv_24" | |
| 163 | - app:layout_constraintRight_toRightOf="@id/iv_24" | |
| 164 | - app:layout_constraintTop_toBottomOf="@id/iv_24" | |
| 165 | - /> | |
| 82 | + <LinearLayout | |
| 83 | + android:layout_width="0dp" | |
| 84 | + android:layout_height="wrap_content" | |
| 85 | + android:layout_weight="1" | |
| 86 | + android:orientation="vertical"> | |
| 166 | 87 | |
| 167 | - <View | |
| 88 | + <ImageView | |
| 89 | + android:id="@+id/iv_21" | |
| 90 | + android:layout_width="50dp" | |
| 91 | + android:layout_height="50dp" | |
| 92 | + android:layout_gravity="center_horizontal" | |
| 93 | + android:layout_marginTop="15dp" | |
| 94 | + android:background="@mipmap/yyxz" /> | |
| 95 | + | |
| 96 | + <TextView | |
| 97 | + android:layout_width="wrap_content" | |
| 98 | + android:layout_height="wrap_content" | |
| 99 | + android:layout_gravity="center_horizontal" | |
| 100 | + android:layout_marginTop="8dp" | |
| 101 | + android:text="应用管理" | |
| 102 | + android:textColor="#333333" | |
| 103 | + android:textSize="13dp" | |
| 104 | + app:layout_constraintLeft_toLeftOf="@id/iv_21" | |
| 105 | + app:layout_constraintRight_toRightOf="@id/iv_21" | |
| 106 | + app:layout_constraintTop_toBottomOf="@id/iv_21" /> | |
| 107 | + </LinearLayout> | |
| 108 | + | |
| 109 | + <LinearLayout | |
| 110 | + android:layout_width="0dp" | |
| 111 | + android:layout_height="wrap_content" | |
| 112 | + android:layout_weight="1" | |
| 113 | + android:orientation="vertical"> | |
| 114 | + | |
| 115 | + <ImageView | |
| 116 | + android:id="@+id/iv_22" | |
| 117 | + android:layout_width="50dp" | |
| 118 | + android:layout_height="50dp" | |
| 119 | + android:layout_gravity="center_horizontal" | |
| 120 | + android:layout_marginTop="15dp" | |
| 121 | + android:background="@mipmap/xxxt" | |
| 122 | + app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 123 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 124 | + | |
| 125 | + <TextView | |
| 126 | + android:layout_width="wrap_content" | |
| 127 | + android:layout_height="wrap_content" | |
| 128 | + android:layout_gravity="center_horizontal" | |
| 129 | + android:layout_marginTop="8dp" | |
| 130 | + android:text="小星错题" | |
| 131 | + android:textColor="#333333" | |
| 132 | + android:textSize="13dp" | |
| 133 | + app:layout_constraintLeft_toLeftOf="@id/iv_22" | |
| 134 | + app:layout_constraintRight_toRightOf="@id/iv_22" | |
| 135 | + app:layout_constraintTop_toBottomOf="@id/iv_22" /> | |
| 136 | + </LinearLayout> | |
| 137 | + | |
| 138 | + <LinearLayout | |
| 139 | + android:layout_width="0dp" | |
| 140 | + android:layout_height="wrap_content" | |
| 141 | + android:layout_weight="1" | |
| 142 | + android:orientation="vertical"> | |
| 143 | + | |
| 144 | + <ImageView | |
| 145 | + android:id="@+id/iv_23" | |
| 146 | + android:layout_width="50dp" | |
| 147 | + android:layout_height="50dp" | |
| 148 | + android:layout_gravity="center_horizontal" | |
| 149 | + android:layout_marginTop="15dp" | |
| 150 | + android:background="@mipmap/ffsj" | |
| 151 | + app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 152 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 153 | + | |
| 154 | + <TextView | |
| 155 | + android:layout_width="wrap_content" | |
| 156 | + android:layout_height="wrap_content" | |
| 157 | + android:layout_gravity="center_horizontal" | |
| 158 | + android:layout_marginTop="8dp" | |
| 159 | + android:text="分发试卷" | |
| 160 | + android:textColor="#333333" | |
| 161 | + android:textSize="13dp" | |
| 162 | + app:layout_constraintLeft_toLeftOf="@id/iv_23" | |
| 163 | + app:layout_constraintRight_toRightOf="@id/iv_23" | |
| 164 | + app:layout_constraintTop_toBottomOf="@id/iv_23" /> | |
| 165 | + </LinearLayout> | |
| 166 | + | |
| 167 | + <LinearLayout | |
| 168 | + android:layout_width="0dp" | |
| 169 | + android:layout_height="wrap_content" | |
| 170 | + android:layout_weight="1" | |
| 171 | + android:orientation="vertical"> | |
| 172 | + | |
| 173 | + <ImageView | |
| 174 | + android:id="@+id/iv_24" | |
| 175 | + android:layout_width="50dp" | |
| 176 | + android:layout_height="50dp" | |
| 177 | + android:layout_gravity="center_horizontal" | |
| 178 | + android:layout_marginTop="15dp" | |
| 179 | + android:background="@mipmap/sbgl" | |
| 180 | + app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 181 | + app:layout_constraintTop_toTopOf="@id/view_2" /> | |
| 182 | + | |
| 183 | + <TextView | |
| 184 | + android:layout_width="wrap_content" | |
| 185 | + android:layout_height="wrap_content" | |
| 186 | + android:layout_gravity="center_horizontal" | |
| 187 | + android:layout_marginTop="8dp" | |
| 188 | + android:text="设备管理" | |
| 189 | + android:textColor="#333333" | |
| 190 | + android:textSize="13dp" | |
| 191 | + app:layout_constraintLeft_toLeftOf="@id/iv_24" | |
| 192 | + app:layout_constraintRight_toRightOf="@id/iv_24" | |
| 193 | + app:layout_constraintTop_toBottomOf="@id/iv_24" /> | |
| 194 | + </LinearLayout> | |
| 195 | + </LinearLayout> | |
| 196 | + | |
| 197 | + <RelativeLayout | |
| 168 | 198 | android:id="@+id/view_3" |
| 169 | - android:layout_width="345dp" | |
| 170 | - android:layout_height="225dp" | |
| 199 | + android:layout_width="match_parent" | |
| 200 | + android:layout_height="match_parent" | |
| 201 | + android:layout_marginLeft="15dp" | |
| 202 | + android:layout_marginTop="357dp" | |
| 203 | + android:layout_marginRight="15dp" | |
| 204 | + android:layout_marginBottom="20dp" | |
| 205 | + android:background="@drawable/bg_solid_white_10" | |
| 206 | + android:orientation="vertical" | |
| 171 | 207 | app:layout_constraintLeft_toLeftOf="parent" |
| 172 | 208 | app:layout_constraintRight_toRightOf="parent" |
| 173 | - app:layout_constraintTop_toTopOf="parent" | |
| 174 | - android:background="@drawable/bg_solid_white_10" | |
| 175 | - android:layout_marginTop="357dp" | |
| 176 | - /> | |
| 177 | - <TextView | |
| 178 | - android:id="@+id/tv_31" | |
| 179 | - android:layout_width="wrap_content" | |
| 180 | - android:layout_height="wrap_content" | |
| 181 | - android:textColor="#333333" | |
| 182 | - android:textSize="15dp" | |
| 183 | - android:text="本周学习计划" | |
| 184 | - android:layout_marginTop="15dp" | |
| 185 | - app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 186 | - app:layout_constraintRight_toRightOf="@id/view_3" | |
| 187 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 188 | - /> | |
| 189 | - <View | |
| 190 | - android:layout_width="25dp" | |
| 191 | - android:layout_height="1dp" | |
| 192 | - android:background="#EEEEEE" | |
| 193 | - app:layout_constraintRight_toLeftOf="@+id/tv_31" | |
| 194 | - app:layout_constraintTop_toTopOf="@id/tv_31" | |
| 195 | - app:layout_constraintBottom_toBottomOf="@id/tv_31" | |
| 196 | - android:layout_marginRight="10dp" | |
| 197 | - /> | |
| 198 | - <View | |
| 199 | - android:layout_width="25dp" | |
| 200 | - android:layout_height="1dp" | |
| 201 | - android:background="#EEEEEE" | |
| 202 | - app:layout_constraintLeft_toRightOf="@+id/tv_31" | |
| 203 | - app:layout_constraintTop_toTopOf="@id/tv_31" | |
| 204 | - app:layout_constraintBottom_toBottomOf="@id/tv_31" | |
| 205 | - android:layout_marginLeft="10dp" | |
| 206 | - /> | |
| 207 | - <ImageView | |
| 208 | - android:layout_width="103dp" | |
| 209 | - android:layout_height="66dp" | |
| 210 | - android:background="@mipmap/zwjh" | |
| 211 | - app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 212 | - app:layout_constraintRight_toRightOf="@id/view_3" | |
| 213 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 214 | - android:layout_marginTop="77dp" | |
| 215 | - /> | |
| 216 | - <TextView | |
| 217 | - android:layout_width="wrap_content" | |
| 218 | - android:layout_height="wrap_content" | |
| 219 | - android:textColor="#666666" | |
| 220 | - android:textSize="12dp" | |
| 221 | - android:text="本周学习计划" | |
| 222 | - android:layout_marginTop="161dp" | |
| 223 | - app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 224 | - app:layout_constraintRight_toRightOf="@id/view_3" | |
| 225 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 226 | - /> | |
| 209 | + app:layout_constraintTop_toTopOf="parent"> | |
| 210 | + | |
| 211 | + <RelativeLayout | |
| 212 | + android:id="@+id/rl_schedule" | |
| 213 | + android:layout_width="match_parent" | |
| 214 | + android:layout_height="wrap_content" | |
| 215 | + android:layout_marginTop="15dp" | |
| 216 | + android:layout_marginRight="10dp"> | |
| 217 | + | |
| 218 | + <TextView | |
| 219 | + android:id="@+id/tv_31" | |
| 220 | + android:layout_width="wrap_content" | |
| 221 | + android:layout_height="wrap_content" | |
| 222 | + android:layout_centerHorizontal="true" | |
| 223 | + android:text="本周学习计划" | |
| 224 | + android:textColor="#333333" | |
| 225 | + android:textSize="15dp" /> | |
| 226 | + | |
| 227 | + | |
| 228 | + <View | |
| 229 | + android:layout_width="25dp" | |
| 230 | + android:layout_height="1dp" | |
| 231 | + android:layout_centerVertical="true" | |
| 232 | + android:layout_marginRight="10dp" | |
| 233 | + android:layout_toLeftOf="@+id/tv_31" | |
| 234 | + android:background="#EEEEEE" /> | |
| 235 | + | |
| 236 | + <View | |
| 237 | + android:layout_width="25dp" | |
| 238 | + android:layout_height="1dp" | |
| 239 | + android:layout_centerVertical="true" | |
| 240 | + android:layout_marginLeft="10dp" | |
| 241 | + android:layout_toRightOf="@+id/tv_31" | |
| 242 | + android:background="#EEEEEE" /> | |
| 243 | + </RelativeLayout> | |
| 244 | + | |
| 245 | + | |
| 246 | + <ImageView | |
| 247 | + android:id="@+id/iv_empty" | |
| 248 | + android:layout_width="103dp" | |
| 249 | + android:layout_height="66dp" | |
| 250 | + android:layout_below="@+id/rl_schedule" | |
| 251 | + android:layout_centerHorizontal="true" | |
| 252 | + android:layout_gravity="center_horizontal" | |
| 253 | + android:layout_marginTop="48dp" | |
| 254 | + android:background="@mipmap/zwjh" /> | |
| 255 | + | |
| 256 | + <TextView | |
| 257 | + android:id="@+id/tv_empty" | |
| 258 | + android:layout_width="wrap_content" | |
| 259 | + android:layout_height="wrap_content" | |
| 260 | + android:layout_below="@+id/iv_empty" | |
| 261 | + android:layout_centerHorizontal="true" | |
| 262 | + android:layout_gravity="center_horizontal" | |
| 263 | + android:layout_marginTop="18dp" | |
| 264 | + android:text="暂无学习计划" | |
| 265 | + android:textColor="#666666" | |
| 266 | + android:textSize="12dp" /> | |
| 227 | 267 | |
| 268 | + <androidx.recyclerview.widget.RecyclerView | |
| 269 | + android:id="@+id/recycle" | |
| 270 | + android:layout_width="match_parent" | |
| 271 | + android:layout_height="match_parent" | |
| 272 | + android:layout_below="@+id/rl_schedule" /> | |
| 273 | + </RelativeLayout> | |
| 228 | 274 | |
| 229 | 275 | |
| 230 | 276 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 231 | 277 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/fragment_me.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 3 | 4 | android:layout_width="match_parent" |
| 4 | 5 | android:layout_height="match_parent" |
| 5 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 6 | - android:background="#F4F6F8" | |
| 7 | - > | |
| 6 | + android:background="#F4F6F8"> | |
| 8 | 7 | |
| 9 | 8 | <androidx.constraintlayout.widget.Group |
| 10 | 9 | android:id="@+id/group_1" |
| 11 | 10 | android:layout_width="wrap_content" |
| 12 | 11 | android:layout_height="wrap_content" |
| 13 | - app:constraint_referenced_ids="iv_toux,tv_name,tv_phone,view_2,tv_title,iv_21,iv_22,iv_23,tv_21,tv_22,tv_23" | |
| 14 | - android:visibility="gone" | |
| 15 | - /> | |
| 12 | + android:visibility="visible" /> | |
| 16 | 13 | |
| 17 | 14 | <View |
| 18 | 15 | android:id="@+id/view_1" |
| 19 | 16 | android:layout_width="match_parent" |
| 20 | 17 | android:layout_height="44dp" |
| 21 | - app:layout_constraintTop_toTopOf="parent" | |
| 22 | 18 | android:background="@android:color/white" |
| 23 | - /> | |
| 19 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 20 | + | |
| 24 | 21 | <TextView |
| 25 | 22 | android:layout_width="wrap_content" |
| 26 | 23 | android:layout_height="wrap_content" |
| 27 | 24 | android:text="个人中心" |
| 28 | 25 | android:textColor="#333333" |
| 29 | 26 | android:textSize="18dp" |
| 27 | + app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 30 | 28 | app:layout_constraintLeft_toLeftOf="@id/view_1" |
| 31 | 29 | app:layout_constraintRight_toRightOf="@id/view_1" |
| 32 | - app:layout_constraintTop_toTopOf="@id/view_1" | |
| 33 | - app:layout_constraintBottom_toBottomOf="@id/view_1" | |
| 34 | - /> | |
| 30 | + app:layout_constraintTop_toTopOf="@id/view_1" /> | |
| 35 | 31 | |
| 36 | - <ImageView | |
| 37 | - android:id="@+id/iv_bann" | |
| 38 | - android:layout_width="345dp" | |
| 39 | - android:layout_height="167dp" | |
| 40 | - android:background="@mipmap/smdlaa" | |
| 41 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 42 | - app:layout_constraintRight_toRightOf="parent" | |
| 43 | - app:layout_constraintTop_toTopOf="parent" | |
| 44 | - android:layout_marginTop="63dp" | |
| 45 | - android:visibility="visible" | |
| 46 | - /> | |
| 47 | 32 | |
| 48 | 33 | <ImageView |
| 49 | 34 | android:id="@+id/iv_toux" |
| 50 | 35 | android:layout_width="57dp" |
| 51 | 36 | android:layout_height="57dp" |
| 52 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 53 | - app:layout_constraintTop_toTopOf="parent" | |
| 54 | 37 | android:layout_marginLeft="15dp" |
| 55 | 38 | android:layout_marginTop="63dp" |
| 56 | - android:background="@mipmap/txz" | |
| 57 | - /> | |
| 39 | + android:background="@mipmap/ic_parent_avatar" | |
| 40 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 41 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 58 | 42 | |
| 59 | 43 | <TextView |
| 60 | 44 | android:id="@+id/tv_name" |
| 61 | 45 | android:layout_width="wrap_content" |
| 62 | 46 | android:layout_height="wrap_content" |
| 63 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 64 | - app:layout_constraintTop_toTopOf="parent" | |
| 65 | 47 | android:layout_marginLeft="88dp" |
| 66 | 48 | android:layout_marginTop="72dp" |
| 67 | - android:textSize="20dp" | |
| 68 | - android:textColor="#333333" | |
| 69 | 49 | android:text="名字" |
| 70 | - /> | |
| 50 | + android:textColor="#333333" | |
| 51 | + android:textSize="20dp" | |
| 52 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 53 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 54 | + | |
| 71 | 55 | <TextView |
| 72 | 56 | android:id="@+id/tv_phone" |
| 73 | 57 | android:layout_width="wrap_content" |
| 74 | 58 | android:layout_height="wrap_content" |
| 75 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 76 | - app:layout_constraintTop_toTopOf="parent" | |
| 77 | 59 | android:layout_marginLeft="88dp" |
| 78 | 60 | android:layout_marginTop="98dp" |
| 61 | + android:text="1231223123" | |
| 79 | 62 | android:textColor="#999999" |
| 80 | 63 | android:textSize="17dp" |
| 81 | - android:text="1231223123" | |
| 82 | - /> | |
| 83 | - | |
| 64 | + android:visibility="gone" | |
| 65 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 66 | + app:layout_constraintTop_toTopOf="parent" /> | |
| 84 | 67 | |
| 85 | 68 | |
| 86 | - <View | |
| 69 | + <LinearLayout | |
| 87 | 70 | android:id="@+id/view_2" |
| 88 | - android:layout_width="345dp" | |
| 71 | + android:layout_width="match_parent" | |
| 89 | 72 | android:layout_height="140dp" |
| 90 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 91 | - app:layout_constraintRight_toRightOf="parent" | |
| 92 | - app:layout_constraintTop_toTopOf="parent" | |
| 73 | + android:layout_marginLeft="15dp" | |
| 93 | 74 | android:layout_marginTop="140dp" |
| 75 | + android:layout_marginRight="15dp" | |
| 94 | 76 | android:background="@drawable/bg_solid_white_10" |
| 95 | - /> | |
| 96 | - | |
| 97 | - <TextView | |
| 98 | - android:id="@+id/tv_title" | |
| 99 | - android:layout_width="wrap_content" | |
| 100 | - android:layout_height="wrap_content" | |
| 101 | - android:text="学生" | |
| 102 | - android:textColor="#333333" | |
| 103 | - android:textSize="16dp" | |
| 104 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 105 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 106 | - android:layout_marginLeft="15dp" | |
| 107 | - android:layout_marginTop="15dp" | |
| 108 | - /> | |
| 109 | - | |
| 110 | - <ImageView | |
| 111 | - android:id="@+id/iv_21" | |
| 112 | - android:layout_width="56dp" | |
| 113 | - android:layout_height="56dp" | |
| 114 | - android:background="@mipmap/tjxss" | |
| 115 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 116 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 117 | - android:layout_marginLeft="15dp" | |
| 118 | - android:layout_marginTop="44dp" | |
| 119 | - /> | |
| 120 | - <TextView | |
| 121 | - android:id="@+id/tv_21" | |
| 122 | - android:layout_width="wrap_content" | |
| 123 | - android:layout_height="wrap_content" | |
| 124 | - app:layout_constraintLeft_toLeftOf="@id/iv_21" | |
| 125 | - app:layout_constraintRight_toRightOf="@id/iv_21" | |
| 126 | - app:layout_constraintTop_toBottomOf="@id/iv_21" | |
| 127 | - android:layout_marginTop="10dp" | |
| 128 | - android:textColor="#000000" | |
| 129 | - android:textSize="13dp" | |
| 130 | - android:text="添加学生" | |
| 131 | - /> | |
| 132 | - <ImageView | |
| 133 | - android:id="@+id/iv_22" | |
| 134 | - android:layout_width="56dp" | |
| 135 | - android:layout_height="56dp" | |
| 136 | - android:background="@mipmap/tjxss" | |
| 137 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 138 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 139 | - android:layout_marginLeft="144dp" | |
| 140 | - android:layout_marginTop="44dp" | |
| 141 | - /> | |
| 142 | - <TextView | |
| 143 | - android:id="@+id/tv_22" | |
| 144 | - android:layout_width="wrap_content" | |
| 145 | - android:layout_height="wrap_content" | |
| 146 | - app:layout_constraintLeft_toLeftOf="@id/iv_22" | |
| 147 | - app:layout_constraintRight_toRightOf="@id/iv_22" | |
| 148 | - app:layout_constraintTop_toBottomOf="@id/iv_22" | |
| 149 | - android:layout_marginTop="10dp" | |
| 150 | - android:textColor="#000000" | |
| 151 | - android:textSize="13dp" | |
| 152 | - android:text="添加学生" | |
| 153 | - /> | |
| 154 | - <ImageView | |
| 155 | - android:id="@+id/iv_23" | |
| 156 | - android:layout_width="56dp" | |
| 157 | - android:layout_height="56dp" | |
| 158 | - android:background="@mipmap/tjxss" | |
| 159 | - app:layout_constraintLeft_toLeftOf="@id/view_2" | |
| 160 | - app:layout_constraintTop_toTopOf="@id/view_2" | |
| 161 | - android:layout_marginLeft="274dp" | |
| 162 | - android:layout_marginTop="44dp" | |
| 163 | - /> | |
| 164 | - <TextView | |
| 165 | - android:id="@+id/tv_23" | |
| 166 | - android:layout_width="wrap_content" | |
| 167 | - android:layout_height="wrap_content" | |
| 168 | - app:layout_constraintLeft_toLeftOf="@id/iv_23" | |
| 169 | - app:layout_constraintRight_toRightOf="@id/iv_23" | |
| 170 | - app:layout_constraintTop_toBottomOf="@id/iv_23" | |
| 171 | - android:layout_marginTop="10dp" | |
| 172 | - android:textColor="#000000" | |
| 173 | - android:textSize="13dp" | |
| 174 | - android:text="添加学生" | |
| 175 | - /> | |
| 176 | - | |
| 177 | - | |
| 178 | - | |
| 179 | - | |
| 180 | - | |
| 181 | - | |
| 77 | + android:orientation="vertical" | |
| 78 | + app:layout_constraintLeft_toLeftOf="parent" | |
| 79 | + app:layout_constraintRight_toRightOf="parent" | |
| 80 | + app:layout_constraintTop_toTopOf="parent"> | |
| 182 | 81 | |
| 82 | + <TextView | |
| 83 | + android:id="@+id/tv_title" | |
| 84 | + android:layout_width="wrap_content" | |
| 85 | + android:layout_height="wrap_content" | |
| 86 | + android:layout_marginLeft="15dp" | |
| 87 | + android:layout_marginTop="15dp" | |
| 88 | + android:text="学生" | |
| 89 | + android:textColor="#333333" | |
| 90 | + android:textSize="16dp" /> | |
| 183 | 91 | |
| 92 | + <androidx.recyclerview.widget.RecyclerView | |
| 93 | + android:id="@+id/recycle" | |
| 94 | + android:layout_width="match_parent" | |
| 95 | + android:layout_height="match_parent" | |
| 96 | + android:layout_marginLeft="15dp" | |
| 97 | + android:layout_marginRight="15dp" /> | |
| 98 | + </LinearLayout> | |
| 184 | 99 | |
| 185 | 100 | <View |
| 186 | 101 | android:id="@+id/view_3" |
| 187 | - android:layout_width="345dp" | |
| 102 | + android:layout_width="match_parent" | |
| 188 | 103 | android:layout_height="45dp" |
| 104 | + android:layout_marginLeft="15dp" | |
| 105 | + android:layout_marginTop="15dp" | |
| 106 | + android:layout_marginRight="15dp" | |
| 107 | + android:background="@drawable/bg_solid_white_10_top" | |
| 189 | 108 | app:layout_constraintLeft_toLeftOf="parent" |
| 190 | 109 | app:layout_constraintRight_toRightOf="parent" |
| 191 | - app:layout_goneMarginTop="241dp" | |
| 192 | 110 | app:layout_constraintTop_toBottomOf="@id/view_2" |
| 193 | - android:layout_marginTop="15dp" | |
| 194 | - android:background="@drawable/bg_solid_white_10_top" | |
| 195 | - /> | |
| 111 | + app:layout_goneMarginTop="241dp" /> | |
| 112 | + | |
| 196 | 113 | <ImageView |
| 197 | 114 | android:layout_width="6.8dp" |
| 198 | 115 | android:layout_height="12dp" |
| 116 | + android:layout_marginRight="15dp" | |
| 199 | 117 | android:background="@mipmap/ycaj" |
| 200 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 201 | 118 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 202 | 119 | app:layout_constraintRight_toRightOf="@id/view_3" |
| 203 | - android:layout_marginRight="15dp" | |
| 204 | - /> | |
| 120 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 121 | + | |
| 205 | 122 | <ImageView |
| 206 | 123 | android:layout_width="14dp" |
| 207 | 124 | android:layout_height="14dp" |
| 208 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 209 | - app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 210 | - app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 211 | 125 | android:layout_marginLeft="15dp" |
| 212 | 126 | android:background="@mipmap/szz" |
| 213 | - /> | |
| 127 | + app:layout_constraintBottom_toBottomOf="@id/view_3" | |
| 128 | + app:layout_constraintLeft_toLeftOf="@id/view_3" | |
| 129 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 214 | 130 | |
| 215 | 131 | <TextView |
| 216 | 132 | android:layout_width="wrap_content" |
| 217 | 133 | android:layout_height="wrap_content" |
| 134 | + android:layout_marginLeft="40dp" | |
| 135 | + android:text="账户设置" | |
| 218 | 136 | android:textColor="#333333" |
| 219 | 137 | android:textSize="15dp" |
| 220 | - android:text="账户设置" | |
| 221 | - app:layout_constraintTop_toTopOf="@id/view_3" | |
| 222 | 138 | app:layout_constraintBottom_toBottomOf="@id/view_3" |
| 223 | 139 | app:layout_constraintLeft_toLeftOf="@id/view_3" |
| 224 | - android:layout_marginLeft="40dp" | |
| 225 | - /> | |
| 140 | + app:layout_constraintTop_toTopOf="@id/view_3" /> | |
| 141 | + | |
| 226 | 142 | <View |
| 227 | 143 | android:id="@+id/view_4" |
| 228 | - android:layout_width="345dp" | |
| 144 | + android:layout_width="match_parent" | |
| 229 | 145 | android:layout_height="45dp" |
| 146 | + android:layout_marginLeft="15dp" | |
| 147 | + android:layout_marginRight="15dp" | |
| 148 | + android:background="@android:color/white" | |
| 230 | 149 | app:layout_constraintLeft_toLeftOf="parent" |
| 231 | 150 | app:layout_constraintRight_toRightOf="parent" |
| 232 | - app:layout_constraintTop_toBottomOf="@id/view_3" | |
| 233 | - android:background="@android:color/white" | |
| 234 | - /> | |
| 151 | + app:layout_constraintTop_toBottomOf="@id/view_3" /> | |
| 152 | + | |
| 235 | 153 | <ImageView |
| 236 | 154 | android:layout_width="6.8dp" |
| 237 | 155 | android:layout_height="12dp" |
| 156 | + android:layout_marginRight="15dp" | |
| 238 | 157 | android:background="@mipmap/ycaj" |
| 239 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 240 | 158 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
| 241 | 159 | app:layout_constraintRight_toRightOf="@id/view_4" |
| 242 | - android:layout_marginRight="15dp" | |
| 243 | - /> | |
| 160 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 161 | + | |
| 244 | 162 | <ImageView |
| 245 | 163 | android:layout_width="14dp" |
| 246 | 164 | android:layout_height="14dp" |
| 247 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 248 | - app:layout_constraintBottom_toBottomOf="@id/view_4" | |
| 249 | - app:layout_constraintLeft_toLeftOf="@id/view_4" | |
| 250 | 165 | android:layout_marginLeft="15dp" |
| 251 | 166 | android:background="@mipmap/yincs" |
| 252 | - /> | |
| 167 | + app:layout_constraintBottom_toBottomOf="@id/view_4" | |
| 168 | + app:layout_constraintLeft_toLeftOf="@id/view_4" | |
| 169 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 253 | 170 | |
| 254 | 171 | <TextView |
| 255 | 172 | android:layout_width="wrap_content" |
| 256 | 173 | android:layout_height="wrap_content" |
| 174 | + android:layout_marginLeft="40dp" | |
| 175 | + android:text="隐私设置" | |
| 257 | 176 | android:textColor="#333333" |
| 258 | 177 | android:textSize="15dp" |
| 259 | - android:text="隐私设置" | |
| 260 | - app:layout_constraintTop_toTopOf="@id/view_4" | |
| 261 | 178 | app:layout_constraintBottom_toBottomOf="@id/view_4" |
| 262 | 179 | app:layout_constraintLeft_toLeftOf="@id/view_4" |
| 263 | - android:layout_marginLeft="40dp" | |
| 264 | - /> | |
| 180 | + app:layout_constraintTop_toTopOf="@id/view_4" /> | |
| 265 | 181 | |
| 266 | 182 | <View |
| 267 | 183 | android:id="@+id/view_5" |
| 268 | - android:layout_width="345dp" | |
| 184 | + android:layout_width="match_parent" | |
| 269 | 185 | android:layout_height="45dp" |
| 186 | + android:layout_marginLeft="15dp" | |
| 187 | + android:layout_marginRight="15dp" | |
| 188 | + android:background="@android:color/white" | |
| 270 | 189 | app:layout_constraintLeft_toLeftOf="parent" |
| 271 | 190 | app:layout_constraintRight_toRightOf="parent" |
| 272 | - app:layout_constraintTop_toBottomOf="@id/view_4" | |
| 273 | - android:background="@android:color/white" | |
| 274 | - /> | |
| 191 | + app:layout_constraintTop_toBottomOf="@id/view_4" /> | |
| 192 | + | |
| 275 | 193 | <ImageView |
| 276 | 194 | android:layout_width="6.8dp" |
| 277 | 195 | android:layout_height="12dp" |
| 196 | + android:layout_marginRight="15dp" | |
| 278 | 197 | android:background="@mipmap/ycaj" |
| 279 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 280 | 198 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
| 281 | 199 | app:layout_constraintRight_toRightOf="@id/view_5" |
| 282 | - android:layout_marginRight="15dp" | |
| 283 | - /> | |
| 200 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 201 | + | |
| 284 | 202 | <ImageView |
| 285 | 203 | android:layout_width="14dp" |
| 286 | 204 | android:layout_height="14dp" |
| 287 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 288 | - app:layout_constraintBottom_toBottomOf="@id/view_5" | |
| 289 | - app:layout_constraintLeft_toLeftOf="@id/view_5" | |
| 290 | 205 | android:layout_marginLeft="15dp" |
| 291 | 206 | android:background="@mipmap/gywmm" |
| 292 | - /> | |
| 207 | + app:layout_constraintBottom_toBottomOf="@id/view_5" | |
| 208 | + app:layout_constraintLeft_toLeftOf="@id/view_5" | |
| 209 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 293 | 210 | |
| 294 | 211 | <TextView |
| 295 | 212 | android:layout_width="wrap_content" |
| 296 | 213 | android:layout_height="wrap_content" |
| 214 | + android:layout_marginLeft="40dp" | |
| 215 | + android:text="关于我们" | |
| 297 | 216 | android:textColor="#333333" |
| 298 | 217 | android:textSize="15dp" |
| 299 | - android:text="关于我们" | |
| 300 | - app:layout_constraintTop_toTopOf="@id/view_5" | |
| 301 | 218 | app:layout_constraintBottom_toBottomOf="@id/view_5" |
| 302 | 219 | app:layout_constraintLeft_toLeftOf="@id/view_5" |
| 303 | - android:layout_marginLeft="40dp" | |
| 304 | - /> | |
| 220 | + app:layout_constraintTop_toTopOf="@id/view_5" /> | |
| 221 | + | |
| 305 | 222 | <View |
| 306 | 223 | android:id="@+id/view_6" |
| 307 | - android:layout_width="345dp" | |
| 224 | + android:layout_width="match_parent" | |
| 308 | 225 | android:layout_height="45dp" |
| 226 | + android:layout_marginLeft="15dp" | |
| 227 | + android:layout_marginRight="15dp" | |
| 228 | + android:background="@drawable/bg_solid_white_10_bottom" | |
| 309 | 229 | app:layout_constraintLeft_toLeftOf="parent" |
| 310 | 230 | app:layout_constraintRight_toRightOf="parent" |
| 311 | - app:layout_constraintTop_toBottomOf="@id/view_5" | |
| 312 | - android:background="@drawable/bg_solid_white_10_bottom" | |
| 313 | - /> | |
| 231 | + app:layout_constraintTop_toBottomOf="@id/view_5" /> | |
| 314 | 232 | |
| 315 | 233 | <ImageView |
| 316 | 234 | android:layout_width="14dp" |
| 317 | 235 | android:layout_height="14dp" |
| 318 | - app:layout_constraintTop_toTopOf="@id/view_6" | |
| 319 | - app:layout_constraintBottom_toBottomOf="@id/view_6" | |
| 320 | - app:layout_constraintLeft_toLeftOf="@id/view_6" | |
| 321 | 236 | android:layout_marginLeft="15dp" |
| 322 | 237 | android:background="@mipmap/banb" |
| 323 | - /> | |
| 238 | + app:layout_constraintBottom_toBottomOf="@id/view_6" | |
| 239 | + app:layout_constraintLeft_toLeftOf="@id/view_6" | |
| 240 | + app:layout_constraintTop_toTopOf="@id/view_6" /> | |
| 324 | 241 | |
| 325 | 242 | <TextView |
| 326 | 243 | android:layout_width="wrap_content" |
| 327 | 244 | android:layout_height="wrap_content" |
| 245 | + android:layout_marginLeft="40dp" | |
| 246 | + android:text="当前版本" | |
| 328 | 247 | android:textColor="#333333" |
| 329 | 248 | android:textSize="15dp" |
| 330 | - android:text="当前版本" | |
| 331 | - app:layout_constraintTop_toTopOf="@id/view_6" | |
| 332 | 249 | app:layout_constraintBottom_toBottomOf="@id/view_6" |
| 333 | 250 | app:layout_constraintLeft_toLeftOf="@id/view_6" |
| 334 | - android:layout_marginLeft="40dp" | |
| 335 | - /> | |
| 251 | + app:layout_constraintTop_toTopOf="@id/view_6" /> | |
| 252 | + | |
| 336 | 253 | <TextView |
| 337 | 254 | android:layout_width="wrap_content" |
| 338 | 255 | android:layout_height="wrap_content" |
| 256 | + android:layout_marginRight="15dp" | |
| 257 | + android:text="V1.0" | |
| 339 | 258 | android:textColor="#333333" |
| 340 | 259 | android:textSize="15dp" |
| 341 | - android:text="V1.0" | |
| 342 | - app:layout_constraintTop_toTopOf="@id/view_6" | |
| 343 | 260 | app:layout_constraintBottom_toBottomOf="@id/view_6" |
| 344 | 261 | app:layout_constraintRight_toRightOf="@id/view_6" |
| 345 | - android:layout_marginRight="15dp" | |
| 346 | - /> | |
| 347 | - | |
| 262 | + app:layout_constraintTop_toTopOf="@id/view_6" /> | |
| 348 | 263 | |
| 349 | 264 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 350 | 265 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/item_child.xml
| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 2 | + android:layout_width="75dp" | |
| 3 | + android:layout_height="wrap_content" | |
| 4 | + android:layout_marginLeft="15dp" | |
| 5 | + android:layout_marginRight="15dp" | |
| 6 | + android:orientation="vertical"> | |
| 7 | + | |
| 8 | + <ImageView | |
| 9 | + android:id="@+id/iv_avatar" | |
| 10 | + android:layout_width="56dp" | |
| 11 | + android:layout_height="56dp" | |
| 12 | + android:layout_centerHorizontal="true" | |
| 13 | + android:layout_marginTop="8dp" | |
| 14 | + android:background="@mipmap/tjxss" /> | |
| 15 | + | |
| 16 | + <ImageView | |
| 17 | + android:id="@+id/iv_vip" | |
| 18 | + android:layout_width="20dp" | |
| 19 | + android:layout_height="18dp" | |
| 20 | + android:layout_alignRight="@+id/iv_avatar" | |
| 21 | + android:src="@mipmap/ic_vip" /> | |
| 22 | + | |
| 23 | + <TextView | |
| 24 | + android:id="@+id/tv_name" | |
| 25 | + android:layout_width="wrap_content" | |
| 26 | + android:layout_height="wrap_content" | |
| 27 | + android:layout_below="@+id/iv_avatar" | |
| 28 | + android:layout_centerHorizontal="true" | |
| 29 | + android:layout_marginTop="10dp" | |
| 30 | + android:ellipsize="end" | |
| 31 | + android:singleLine="true" | |
| 32 | + android:text="添加学生" | |
| 33 | + android:textColor="#000000" | |
| 34 | + android:textSize="13dp" /> | |
| 35 | +</RelativeLayout> | |
| 36 | + | ... | ... |
app/src/main/res/layout/item_child_choose.xml
| ... | ... | @@ -0,0 +1,74 @@ |
| 1 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 2 | + android:id="@+id/rl_child" | |
| 3 | + android:layout_width="match_parent" | |
| 4 | + android:layout_height="70dp" | |
| 5 | + android:layout_marginLeft="15dp" | |
| 6 | + android:layout_marginTop="15dp" | |
| 7 | + android:layout_marginRight="15dp" | |
| 8 | + android:background="@drawable/bg_solid_white_10"> | |
| 9 | + | |
| 10 | + <ImageView | |
| 11 | + android:id="@+id/iv_avatar" | |
| 12 | + android:layout_width="50dp" | |
| 13 | + android:layout_height="50dp" | |
| 14 | + android:layout_centerVertical="true" | |
| 15 | + android:layout_marginLeft="20dp" /> | |
| 16 | + | |
| 17 | + <ImageView | |
| 18 | + android:id="@+id/iv_vip" | |
| 19 | + android:layout_width="20dp" | |
| 20 | + android:layout_height="18dp" | |
| 21 | + android:layout_alignRight="@+id/iv_avatar" | |
| 22 | + android:src="@mipmap/ic_vip" /> | |
| 23 | + | |
| 24 | + <TextView | |
| 25 | + android:id="@+id/tv_name" | |
| 26 | + android:layout_width="wrap_content" | |
| 27 | + android:layout_height="wrap_content" | |
| 28 | + android:layout_centerVertical="true" | |
| 29 | + android:layout_marginLeft="15dp" | |
| 30 | + android:layout_toRightOf="@+id/iv_avatar" | |
| 31 | + android:textColor="#333333" | |
| 32 | + android:textSize="16sp" /> | |
| 33 | + | |
| 34 | + <ImageView | |
| 35 | + android:id="@+id/iv_select" | |
| 36 | + android:layout_width="15dp" | |
| 37 | + android:layout_height="15dp" | |
| 38 | + android:layout_alignParentRight="true" | |
| 39 | + android:src="@mipmap/wsyq" | |
| 40 | + android:layout_centerVertical="true" | |
| 41 | + android:layout_marginRight="20dp" /> | |
| 42 | + | |
| 43 | + <RelativeLayout | |
| 44 | + android:id="@+id/rl_add" | |
| 45 | + android:layout_width="match_parent" | |
| 46 | + android:layout_height="match_parent" | |
| 47 | + android:background="@drawable/bg_solid_white_10" | |
| 48 | + android:visibility="gone"> | |
| 49 | + | |
| 50 | + <LinearLayout | |
| 51 | + android:layout_width="wrap_content" | |
| 52 | + android:layout_height="wrap_content" | |
| 53 | + android:layout_centerInParent="true" | |
| 54 | + android:orientation="horizontal"> | |
| 55 | + | |
| 56 | + <ImageView | |
| 57 | + android:layout_width="20dp" | |
| 58 | + android:layout_height="20dp" | |
| 59 | + android:layout_gravity="center_vertical" | |
| 60 | + android:gravity="center_vertical" | |
| 61 | + android:src="@mipmap/ic_add" /> | |
| 62 | + | |
| 63 | + <TextView | |
| 64 | + android:layout_width="wrap_content" | |
| 65 | + android:layout_height="wrap_content" | |
| 66 | + android:layout_gravity="center_vertical" | |
| 67 | + android:layout_marginLeft="8dp" | |
| 68 | + android:gravity="center_vertical" | |
| 69 | + android:text="添加学生" | |
| 70 | + android:textColor="#FE5E09" | |
| 71 | + android:textSize="16sp" /> | |
| 72 | + </LinearLayout> | |
| 73 | + </RelativeLayout> | |
| 74 | +</RelativeLayout> | |
| 0 | 75 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/item_schedule.xml
| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 2 | + android:layout_width="match_parent" | |
| 3 | + android:layout_height="wrap_content" | |
| 4 | + android:layout_marginLeft="15dp" | |
| 5 | + android:layout_marginTop="15dp" | |
| 6 | + android:layout_marginRight="15dp" | |
| 7 | + android:orientation="vertical"> | |
| 8 | + | |
| 9 | + <LinearLayout | |
| 10 | + android:layout_width="wrap_content" | |
| 11 | + android:layout_height="wrap_content" | |
| 12 | + android:orientation="horizontal"> | |
| 13 | + | |
| 14 | + <View | |
| 15 | + android:layout_width="1dp" | |
| 16 | + android:layout_height="15dp" | |
| 17 | + android:layout_gravity="center_vertical" | |
| 18 | + android:background="#FE5E09" /> | |
| 19 | + | |
| 20 | + <TextView | |
| 21 | + android:id="@+id/tv_date" | |
| 22 | + android:layout_width="wrap_content" | |
| 23 | + android:layout_height="wrap_content" | |
| 24 | + android:layout_gravity="center_vertical" | |
| 25 | + android:layout_marginLeft="10dp" | |
| 26 | + android:textColor="#333333" | |
| 27 | + android:textSize="13sp" /> | |
| 28 | + </LinearLayout> | |
| 29 | + | |
| 30 | + <LinearLayout | |
| 31 | + android:id="@+id/ll_schedule" | |
| 32 | + android:layout_width="match_parent" | |
| 33 | + android:layout_height="wrap_content" | |
| 34 | + android:orientation="vertical" /> | |
| 35 | +</LinearLayout> | |
| 0 | 36 | \ No newline at end of file | ... | ... |
app/src/main/res/layout/item_video.xml
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 2 | + android:layout_width="match_parent" | |
| 3 | + android:layout_height="wrap_content"> | |
| 4 | + | |
| 5 | + <TextView | |
| 6 | + android:id="@+id/tv_name" | |
| 7 | + android:layout_width="match_parent" | |
| 8 | + android:layout_height="35dp" | |
| 9 | + android:layout_marginTop="15dp" | |
| 10 | + android:background="@drawable/bg_item_video_10" | |
| 11 | + android:gravity="center" | |
| 12 | + android:singleLine="true" | |
| 13 | + android:textColor="#333333" | |
| 14 | + android:textSize="13sp" /> | |
| 15 | +</LinearLayout> | |
| 0 | 16 | \ No newline at end of file | ... | ... |
app/src/main/res/mipmap-hdpi/gx.png
app/src/main/res/mipmap-hdpi/ic_add.png
3.3 KB
app/src/main/res/mipmap-hdpi/ic_avatar_female.png
168 KB
app/src/main/res/mipmap-hdpi/ic_avatar_male.png
202 KB
app/src/main/res/mipmap-hdpi/ic_edit.png
2.39 KB
app/src/main/res/mipmap-hdpi/ic_parent_avatar.png
182 KB
app/src/main/res/mipmap-hdpi/ic_teacher_female.png
164 KB
app/src/main/res/mipmap-hdpi/ic_teacher_male.png
169 KB
app/src/main/res/mipmap-hdpi/ic_vip.png
8.46 KB
app/src/main/res/mipmap-hdpi/ssss.png
app/src/main/res/mipmap-hdpi/wsyq.png
app/src/main/res/values/styles.xml
| ... | ... | @@ -20,6 +20,13 @@ |
| 20 | 20 | <item name="android:textSize">11dp</item> |
| 21 | 21 | <item name="android:drawablePadding">2dp</item> |
| 22 | 22 | </style> |
| 23 | - | |
| 24 | - | |
| 23 | + <!--实现BottomSheetDialog圆角效果--> | |
| 24 | + <style name="BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog"> | |
| 25 | + <item name="bottomSheetStyle">@style/bottomSheetStyleWrapper</item> | |
| 26 | + </style> | |
| 27 | + <style name="bottomSheetStyleWrapper" parent="Widget.Design.BottomSheet.Modal"> | |
| 28 | + <item name="android:background">@android:color/transparent</item> | |
| 29 | + <item name="android:navigationBarColor">@android:color/transparent</item> | |
| 30 | + <item name="behavior_peekHeight">500dp</item> | |
| 31 | + </style> | |
| 25 | 32 | </resources> |
| 26 | 33 | \ No newline at end of file | ... | ... |
app/src/main/res/values/themes.xml
| 1 | 1 | <resources xmlns:tools="http://schemas.android.com/tools"> |
| 2 | 2 | <!-- Base application theme. --> |
| 3 | - <style name="Theme.Parent" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | |
| 3 | + <style name="Theme.Parent" parent="Theme.AppCompat.Light.DarkActionBar"> | |
| 4 | 4 | <!-- Primary brand color. --> |
| 5 | 5 | <item name="colorPrimary">@color/purple_500</item> |
| 6 | 6 | <item name="colorPrimaryVariant">@color/purple_700</item> | ... | ... |
app/src/main/res/xml/file_provider_paths.xml
build.gradle
| ... | ... | @@ -16,8 +16,8 @@ buildscript { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | url = [ |
| 19 | - server_url: "https://mgr.hjx.com", //http 请求指令 | |
| 20 | - | |
| 19 | + server_url : "http://192.168.3.11:8088", //http 请求指令 | |
| 20 | + server_url_online: "https://mgr.hjx.com", //http 请求指令 | |
| 21 | 21 | ] |
| 22 | 22 | |
| 23 | 23 | |
| ... | ... | @@ -49,7 +49,7 @@ buildscript { |
| 49 | 49 | commons_codec : 'commons-codec:commons-codec:1.7', |
| 50 | 50 | eventbus : 'org.greenrobot:eventbus:3.2.0', |
| 51 | 51 | eventbus2 : 'org.simple:androideventbus:1.0.5.1', |
| 52 | - glide : 'com.github.bumptech.glide:glide:3.7.0', | |
| 52 | + glide : 'com.github.bumptech.glide:glide:4.6.1', | |
| 53 | 53 | permissions : 'com.github.getActivity:XXPermissions:11.6', |
| 54 | 54 | orcode : 'cn.yipianfengye.android:zxing-library:2.2' |
| 55 | 55 | // push : 'com.umeng.sdk:push:4.1.0', | ... | ... |
libs/common/build.gradle
| ... | ... | @@ -25,13 +25,12 @@ android { |
| 25 | 25 | buildTypes { |
| 26 | 26 | debug { |
| 27 | 27 | minifyEnabled false |
| 28 | - buildConfigField("String", "SERVER_URL", "\"${url.server_url}\"") | |
| 29 | - | |
| 28 | + buildConfigField("String", "SERVER_URL", "\"${url.server_url_online}\"") | |
| 30 | 29 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| 31 | 30 | } |
| 32 | 31 | release { |
| 33 | 32 | minifyEnabled false |
| 34 | - buildConfigField("String", "SERVER_URL", "\"${url.server_url}\"") | |
| 33 | + buildConfigField("String", "SERVER_URL", "\"${url.server_url_online}\"") | |
| 35 | 34 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
| 36 | 35 | } |
| 37 | 36 | } | ... | ... |
libs/common/src/main/java/com/prws/common/base/BaseFragment.java
| ... | ... | @@ -14,6 +14,8 @@ import androidx.fragment.app.Fragment; |
| 14 | 14 | |
| 15 | 15 | import org.simple.eventbus.EventBus; |
| 16 | 16 | |
| 17 | +import butterknife.ButterKnife; | |
| 18 | +import butterknife.Unbinder; | |
| 17 | 19 | import io.reactivex.disposables.CompositeDisposable; |
| 18 | 20 | import io.reactivex.disposables.Disposable; |
| 19 | 21 | |
| ... | ... | @@ -21,7 +23,7 @@ public abstract class BaseFragment extends Fragment { |
| 21 | 23 | |
| 22 | 24 | protected View mRootView; |
| 23 | 25 | |
| 24 | - | |
| 26 | + private Unbinder unbinder; | |
| 25 | 27 | @Override |
| 26 | 28 | public void onCreate(@Nullable Bundle savedInstanceState) { |
| 27 | 29 | super.onCreate(savedInstanceState); |
| ... | ... | @@ -39,6 +41,7 @@ public abstract class BaseFragment extends Fragment { |
| 39 | 41 | } else { |
| 40 | 42 | mRootView = inflater.inflate(getLayoutRes(), container, false); |
| 41 | 43 | } |
| 44 | + unbinder = ButterKnife.bind(this, mRootView); | |
| 42 | 45 | return mRootView; |
| 43 | 46 | } |
| 44 | 47 | |
| ... | ... | @@ -82,7 +85,9 @@ public abstract class BaseFragment extends Fragment { |
| 82 | 85 | public void onDestroy() { |
| 83 | 86 | super.onDestroy(); |
| 84 | 87 | EventBus.getDefault().unregister(this); |
| 85 | - | |
| 88 | + if (unbinder != null) { | |
| 89 | + unbinder.unbind(); | |
| 90 | + } | |
| 86 | 91 | } |
| 87 | 92 | |
| 88 | 93 | ... | ... |
libs/common/src/main/java/com/prws/common/bean/Grade.java
| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | +package com.prws.common.bean; | |
| 2 | + | |
| 3 | +public class Grade { | |
| 4 | + private int id; | |
| 5 | + private String grade; | |
| 6 | + | |
| 7 | + public void setId(int id) { | |
| 8 | + this.id = id; | |
| 9 | + } | |
| 10 | + | |
| 11 | + public void setGrade(String grade) { | |
| 12 | + this.grade = grade; | |
| 13 | + } | |
| 14 | + | |
| 15 | + public int getId() { | |
| 16 | + return id; | |
| 17 | + } | |
| 18 | + | |
| 19 | + public String getGrade() { | |
| 20 | + return grade; | |
| 21 | + } | |
| 22 | +} | ... | ... |
libs/common/src/main/java/com/prws/common/bean/GradeAndSubject.java
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +package com.prws.common.bean; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | + | |
| 5 | +public class GradeAndSubject { | |
| 6 | + private List<Subject> subjects; | |
| 7 | + private Grade grade; | |
| 8 | + | |
| 9 | + public void setSubjects(List<Subject> subjects) { | |
| 10 | + this.subjects = subjects; | |
| 11 | + } | |
| 12 | + | |
| 13 | + public void setGrade(Grade grade) { | |
| 14 | + this.grade = grade; | |
| 15 | + } | |
| 16 | + | |
| 17 | + public List<Subject> getSubjects() { | |
| 18 | + return subjects; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public Grade getGrade() { | |
| 22 | + return grade; | |
| 23 | + } | |
| 24 | +} | ... | ... |
libs/common/src/main/java/com/prws/common/bean/ResponseResult.java
| ... | ... | @@ -0,0 +1,69 @@ |
| 1 | +package com.prws.common.bean; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.google.gson.annotations.SerializedName; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * 统一响应类 | |
| 8 | + * | |
| 9 | + * @author wfs | |
| 10 | + * @version 1.0 | |
| 11 | + * @date 2023/6/27 10:27 | |
| 12 | + */ | |
| 13 | + | |
| 14 | +public class ResponseResult<T> { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 状态码 | |
| 18 | + */ | |
| 19 | + @SerializedName(value = "code", alternate = "S") | |
| 20 | + private Integer code; | |
| 21 | + /** | |
| 22 | + * 提示信息,如果有错误时,前端可以获取该字段进行提示 | |
| 23 | + */ | |
| 24 | + @SerializedName(value = "msg", alternate = "M") | |
| 25 | + private String msg; | |
| 26 | + /** | |
| 27 | + * 查询到的结果数据, | |
| 28 | + */ | |
| 29 | + @SerializedName(value = "data", alternate = "D") | |
| 30 | + private T data; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 成功标识 | |
| 34 | + */ | |
| 35 | + private Boolean success; | |
| 36 | + | |
| 37 | + | |
| 38 | + public void setCode(Integer code) { | |
| 39 | + this.code = code; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setMsg(String msg) { | |
| 43 | + this.msg = msg; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setData(T data) { | |
| 47 | + this.data = data; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setSuccess(Boolean success) { | |
| 51 | + this.success = success; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public Integer getCode() { | |
| 55 | + return code; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public String getMsg() { | |
| 59 | + return msg; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public T getData() { | |
| 63 | + return data; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public Boolean getSuccess() { | |
| 67 | + return success; | |
| 68 | + } | |
| 69 | +} | ... | ... |
libs/common/src/main/java/com/prws/common/bean/ScheduleBean.java
| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | +package com.prws.common.bean; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.List; | |
| 5 | + | |
| 6 | +public class ScheduleBean implements Serializable { | |
| 7 | + private String startDate; | |
| 8 | + private String endDate; | |
| 9 | + private long totalTime; | |
| 10 | + private long studyTime; | |
| 11 | + private List<Video> list; | |
| 12 | + | |
| 13 | + public void setStartDate(String startDate) { | |
| 14 | + this.startDate = startDate; | |
| 15 | + } | |
| 16 | + | |
| 17 | + public void setEndDate(String endDate) { | |
| 18 | + this.endDate = endDate; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public void setTotalTime(long totalTime) { | |
| 22 | + this.totalTime = totalTime; | |
| 23 | + } | |
| 24 | + | |
| 25 | + public void setStudyTime(long studyTime) { | |
| 26 | + this.studyTime = studyTime; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setList(List<Video> list) { | |
| 30 | + this.list = list; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public String getStartDate() { | |
| 34 | + return startDate; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public String getEndDate() { | |
| 38 | + return endDate; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public long getTotalTime() { | |
| 42 | + return totalTime; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public long getStudyTime() { | |
| 46 | + return studyTime; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public List<Video> getList() { | |
| 50 | + return list; | |
| 51 | + } | |
| 52 | +} | ... | ... |
libs/common/src/main/java/com/prws/common/bean/Subject.java
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +package com.prws.common.bean; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 5 | +public class Subject implements Serializable { | |
| 6 | + private int id; | |
| 7 | + private String subject; | |
| 8 | + | |
| 9 | + public void setId(int id) { | |
| 10 | + this.id = id; | |
| 11 | + } | |
| 12 | + | |
| 13 | + public void setSubject(String subject) { | |
| 14 | + this.subject = subject; | |
| 15 | + } | |
| 16 | + | |
| 17 | + public int getId() { | |
| 18 | + return id; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public String getSubject() { | |
| 22 | + return subject; | |
| 23 | + } | |
| 24 | +} | ... | ... |
libs/common/src/main/java/com/prws/common/bean/Video.java
| ... | ... | @@ -0,0 +1,170 @@ |
| 1 | +package com.prws.common.bean; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | +import java.util.Date; | |
| 5 | + | |
| 6 | +public class Video implements Serializable { | |
| 7 | + | |
| 8 | + private Integer chapterId; | |
| 9 | + private String chapterName; | |
| 10 | + private Integer sectionId; | |
| 11 | + private String sectionName; | |
| 12 | + private Integer sectionChildId; | |
| 13 | + private String sectionChildName; | |
| 14 | + private Integer resourceId; | |
| 15 | + private String resourceName; | |
| 16 | + private String resourceUrl; | |
| 17 | + private Long resourceTime; | |
| 18 | + private String handoutName; | |
| 19 | + private String handoutUrl; | |
| 20 | + private Integer handoutId; | |
| 21 | + private Long playTime; | |
| 22 | + private String grade; | |
| 23 | + private String subject; | |
| 24 | + | |
| 25 | + private Date studyTime; | |
| 26 | + | |
| 27 | + public void setStudyTime(Date studyTime) { | |
| 28 | + this.studyTime = studyTime; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public Date getStudyTime() { | |
| 32 | + return studyTime; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public void setHandoutId(Integer handoutId) { | |
| 36 | + this.handoutId = handoutId; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public Integer getHandoutId() { | |
| 40 | + return handoutId; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setSubject(String subject) { | |
| 44 | + this.subject = subject; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public String getSubject() { | |
| 48 | + return subject; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setPlayTime(Long playTime) { | |
| 52 | + this.playTime = playTime; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setGrade(String grade) { | |
| 56 | + this.grade = grade; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public String getGrade() { | |
| 60 | + return grade; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public Long getPlayTime() { | |
| 64 | + return playTime; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public Integer getChapterId() { | |
| 68 | + return chapterId; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setChapterId(Integer chapterId) { | |
| 72 | + this.chapterId = chapterId; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public String getChapterName() { | |
| 76 | + return chapterName; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setChapterName(String chapterName) { | |
| 80 | + this.chapterName = chapterName; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public Integer getSectionId() { | |
| 84 | + return sectionId; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setSectionId(Integer sectionId) { | |
| 88 | + this.sectionId = sectionId; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public String getSectionName() { | |
| 92 | + return sectionName; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setSectionName(String sectionName) { | |
| 96 | + this.sectionName = sectionName; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public Integer getSectionChildId() { | |
| 100 | + return sectionChildId; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setSectionChildId(Integer sectionChildId) { | |
| 104 | + this.sectionChildId = sectionChildId; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public String getSectionChildName() { | |
| 108 | + return sectionChildName; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setSectionChildName(String sectionChildName) { | |
| 112 | + this.sectionChildName = sectionChildName; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public Integer getResourceId() { | |
| 116 | + return resourceId; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public void setResourceId(Integer resourceId) { | |
| 120 | + this.resourceId = resourceId; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public String getResourceName() { | |
| 124 | + return resourceName; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public void setResourceName(String resourceName) { | |
| 128 | + this.resourceName = resourceName; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public String getResourceUrl() { | |
| 132 | + return resourceUrl; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public void setResourceUrl(String resourceUrl) { | |
| 136 | + this.resourceUrl = resourceUrl; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public Long getResourceTime() { | |
| 140 | + return resourceTime; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public void setResourceTime(Long resourceTime) { | |
| 144 | + this.resourceTime = resourceTime; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public String getHandoutName() { | |
| 148 | + return handoutName; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public void setHandoutName(String handoutName) { | |
| 152 | + this.handoutName = handoutName; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public String getHandoutUrl() { | |
| 156 | + return handoutUrl; | |
| 157 | + } | |
| 158 | + | |
| 159 | + public void setHandoutUrl(String handoutUrl) { | |
| 160 | + this.handoutUrl = handoutUrl; | |
| 161 | + } | |
| 162 | + | |
| 163 | + public Long getRecodeTime() { | |
| 164 | + return playTime; | |
| 165 | + } | |
| 166 | + | |
| 167 | + public void setRecodeTime(Long recodeTime) { | |
| 168 | + this.playTime = recodeTime; | |
| 169 | + } | |
| 170 | +} | ... | ... |
libs/common/src/main/java/com/prws/common/net/NetWorks.java
| 1 | 1 | package com.prws.common.net; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | - | |
| 5 | - | |
| 6 | 4 | import com.google.gson.Gson; |
| 7 | 5 | import com.prws.common.BuildConfig; |
| 8 | 6 | import com.prws.common.bean.BaseEntity; |
| 7 | +import com.prws.common.bean.GradeAndSubject; | |
| 8 | +import com.prws.common.bean.ResponseResult; | |
| 9 | +import com.prws.common.bean.ScheduleBean; | |
| 10 | +import com.prws.common.utils.SharedPreferencesUtil; | |
| 9 | 11 | |
| 10 | 12 | import java.io.File; |
| 13 | +import java.util.HashMap; | |
| 11 | 14 | import java.util.List; |
| 12 | 15 | import java.util.Map; |
| 13 | 16 | |
| ... | ... | @@ -20,15 +23,18 @@ import okhttp3.MultipartBody; |
| 20 | 23 | import okhttp3.RequestBody; |
| 21 | 24 | import okhttp3.ResponseBody; |
| 22 | 25 | import retrofit2.Call; |
| 26 | +import retrofit2.Callback; | |
| 23 | 27 | import retrofit2.http.Body; |
| 24 | 28 | import retrofit2.http.DELETE; |
| 25 | 29 | import retrofit2.http.FieldMap; |
| 26 | 30 | import retrofit2.http.FormUrlEncoded; |
| 27 | 31 | import retrofit2.http.GET; |
| 32 | +import retrofit2.http.Header; | |
| 28 | 33 | import retrofit2.http.Headers; |
| 29 | 34 | import retrofit2.http.Multipart; |
| 30 | 35 | import retrofit2.http.POST; |
| 31 | 36 | import retrofit2.http.Part; |
| 37 | +import retrofit2.http.PartMap; | |
| 32 | 38 | import retrofit2.http.Path; |
| 33 | 39 | import retrofit2.http.Query; |
| 34 | 40 | import retrofit2.http.QueryMap; |
| ... | ... | @@ -38,7 +44,7 @@ import retrofit2.http.Url; |
| 38 | 44 | /** |
| 39 | 45 | * 类名称:NetWorks |
| 40 | 46 | * 创建人: |
| 41 | - * | |
| 47 | + * <p> | |
| 42 | 48 | * 类描述:网络请求的操作类 |
| 43 | 49 | */ |
| 44 | 50 | public class NetWorks extends RetrofitUtils { |
| ... | ... | @@ -53,7 +59,7 @@ public class NetWorks extends RetrofitUtils { |
| 53 | 59 | protected static final String CACHE_CONTROL_NETWORK = "max-age=0"; |
| 54 | 60 | |
| 55 | 61 | |
| 56 | - private interface NetService{ | |
| 62 | + private interface NetService { | |
| 57 | 63 | |
| 58 | 64 | |
| 59 | 65 | @GET("/api/v1/user/logout") |
| ... | ... | @@ -61,20 +67,20 @@ public class NetWorks extends RetrofitUtils { |
| 61 | 67 | |
| 62 | 68 | @Multipart |
| 63 | 69 | @POST("/api/v1/user/upLoadAvatar") |
| 64 | - Observable<ResponseBody> upLoadAvatar(@Part List<MultipartBody.Part> partLis); | |
| 70 | + Observable<ResponseBody> upLoadAvatar(@Header("Authorization") String token, @Part List<MultipartBody.Part> partLis); | |
| 65 | 71 | |
| 66 | 72 | |
| 67 | 73 | @Headers("Content-Type: application/json") |
| 68 | 74 | @POST("/api/v1/user/editUser") |
| 69 | - Observable<ResponseBody> editUser(@Body RequestBody body); | |
| 75 | + Observable<ResponseBody> editUser(@Header("Authorization") String token, @Body RequestBody body); | |
| 70 | 76 | |
| 71 | 77 | @Headers("Content-Type: application/json") |
| 72 | 78 | @POST("/api/v1/user/changePassword") |
| 73 | - Observable<ResponseBody> changePassword(@Body RequestBody body); | |
| 79 | + Observable<ResponseBody> changePassword(@Header("Authorization") String token, @Body RequestBody body); | |
| 74 | 80 | |
| 75 | 81 | |
| 76 | - @GET("/api/v1/user/searchById?") | |
| 77 | - Observable<ResponseBody> searchById(@Query("userId") String userId); | |
| 82 | + @GET("/api/v1/user/searchById") | |
| 83 | + Observable<ResponseBody> searchById(@Header("Authorization") String token, @Query("userId") String userId); | |
| 78 | 84 | |
| 79 | 85 | |
| 80 | 86 | @Headers("Content-Type: application/json") |
| ... | ... | @@ -82,17 +88,17 @@ public class NetWorks extends RetrofitUtils { |
| 82 | 88 | Observable<ResponseBody> login(@Body RequestBody body); |
| 83 | 89 | |
| 84 | 90 | @GET("/api/v1/resource/listGradeAndSubject") |
| 85 | - Observable<ResponseBody> listGradeAndSubject(); | |
| 91 | + Observable<ResponseResult<List<GradeAndSubject>>> listGradeAndSubject(@Header("Authorization") String token); | |
| 86 | 92 | |
| 87 | 93 | |
| 88 | 94 | @GET("/api/v1/manager/generalQrCode") |
| 89 | 95 | Observable<ResponseBody> generalQrCode(); |
| 90 | 96 | |
| 91 | 97 | @GET("/api/v1/parent/scanAndLogin?") |
| 92 | - Observable<ResponseBody> scanAndLogin(@Query("code") String code); | |
| 98 | + Observable<ResponseBody> scanAndLogin(@Header("Authorization") String token, @Query("code") String code); | |
| 93 | 99 | |
| 94 | 100 | @GET("/api/v1/parent/getChildrenList") |
| 95 | - Observable<ResponseBody> getChildrenList(); | |
| 101 | + Observable<ResponseBody> getChildrenList(@Header("Authorization") String token); | |
| 96 | 102 | |
| 97 | 103 | |
| 98 | 104 | @Headers("Content-Type: application/json") |
| ... | ... | @@ -101,84 +107,118 @@ public class NetWorks extends RetrofitUtils { |
| 101 | 107 | |
| 102 | 108 | |
| 103 | 109 | @GET("/api/v1/parent/listChildren") |
| 104 | - Observable<ResponseBody> listChildren(); | |
| 110 | + Observable<ResponseBody> listChildren(@Header("Authorization") String token); | |
| 105 | 111 | |
| 106 | 112 | |
| 107 | 113 | @Headers("Content-Type: application/json") |
| 108 | 114 | @POST("/api/v1/parent/registerStudent") |
| 109 | - Observable<ResponseBody> registerStudent(@Body RequestBody body); | |
| 115 | + Observable<ResponseBody> registerStudent(@Header("Authorization") String token, @Body RequestBody body); | |
| 110 | 116 | |
| 111 | 117 | @Headers("Content-Type: application/json") |
| 112 | 118 | @POST("/api/v1/parent/bindTeacher") |
| 113 | - Observable<ResponseBody> bindTeacher(@Body RequestBody body); | |
| 119 | + Observable<ResponseBody> bindTeacher(@Header("Authorization") String token, @Body RequestBody body); | |
| 114 | 120 | |
| 121 | + @Multipart | |
| 122 | + @POST("/api/v1/user/upLoadAvatar") | |
| 123 | + Observable<ResponseResult<Map<String, String>>> uploadAvatar(@Header("Authorization") String token, @Part() MultipartBody.Part file); | |
| 115 | 124 | |
| 116 | 125 | |
| 126 | + @Multipart | |
| 127 | + @POST("/api/v1/student/editStudentAvatar") | |
| 128 | + Observable<ResponseResult<Map<String, String>>> uploadAvatar(@Header("Authorization") String token, @Part() MultipartBody.Part file, @PartMap Map<String, Object> map); | |
| 117 | 129 | |
| 130 | + @Headers("Content-Type: application/json") | |
| 131 | + @POST("/api/v1/parent/editChild") | |
| 132 | + Observable<ResponseResult> editStudent(@Header("Authorization") String token, @Body RequestBody body); | |
| 118 | 133 | |
| 134 | + @GET("/api/v1/student/getStudyPlanForThisWeek") | |
| 135 | + Observable<ResponseResult<ScheduleBean>> getWeekPlan(@Header("Authorization") String token, @Query("stuId") String stuId); | |
| 119 | 136 | } |
| 120 | 137 | |
| 121 | 138 | |
| 139 | + public static String getHeader() { | |
| 140 | + return (String) SharedPreferencesUtil.getData("token", ""); | |
| 141 | + } | |
| 122 | 142 | |
| 123 | 143 | public static void logout(Observer<ResponseBody> observer) { |
| 124 | - setSubscribe(service_url.logout(),observer); | |
| 144 | + setSubscribe(service_url.logout(), observer); | |
| 125 | 145 | } |
| 126 | 146 | |
| 147 | + public static void editStudent(RequestBody body, Observer<ResponseResult> observable) { | |
| 148 | + setSubscribe(service_url.editStudent(getHeader(), body), observable); | |
| 149 | + } | |
| 127 | 150 | |
| 151 | + public static void getWeekPlan(String id, Observer<ResponseResult<ScheduleBean>> observer) { | |
| 152 | + setSubscribe(service_url.getWeekPlan(getHeader(), id), observer); | |
| 153 | + } | |
| 128 | 154 | |
| 129 | - public static void upLoadAvatar(List<MultipartBody.Part> partLis,Observer<ResponseBody> observer) { | |
| 130 | - setSubscribe(service_url.upLoadAvatar(partLis),observer); | |
| 155 | + public static void uploadStudentAvatar(File file, String stuId, Observer<ResponseResult<Map<String, String>>> observer) { | |
| 156 | + RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); | |
| 157 | + MultipartBody.Part part = MultipartBody.Part.createFormData("file", file.getName(), requestBody); | |
| 158 | + Map<String, Object> map = new HashMap<>(); | |
| 159 | + map.put("stuId", stuId); | |
| 160 | + setSubscribe(service_url.uploadAvatar(getHeader(), part, map), observer); | |
| 131 | 161 | } |
| 132 | 162 | |
| 163 | + public static void uploadAvatar(File file, Observer<ResponseResult<Map<String, String>>> observer) { | |
| 164 | + RequestBody requestBody = RequestBody.create(MediaType.parse("multipart/form-data"), file); | |
| 165 | + MultipartBody.Part part = MultipartBody.Part.createFormData("file", file.getName(), requestBody); | |
| 166 | + setSubscribe(service_url.uploadAvatar(getHeader(), part), observer); | |
| 167 | + } | |
| 133 | 168 | |
| 134 | - public static void editUser(RequestBody body,Observer<ResponseBody> observer) { | |
| 135 | - setSubscribe(service_url.editUser(body),observer); | |
| 169 | + public static void upLoadAvatar(List<MultipartBody.Part> partLis, Observer<ResponseBody> observer) { | |
| 170 | + setSubscribe(service_url.upLoadAvatar(getHeader(), partLis), observer); | |
| 136 | 171 | } |
| 137 | 172 | |
| 138 | - public static void changePassword(RequestBody body,Observer<ResponseBody> observer) { | |
| 139 | - setSubscribe(service_url.changePassword(body),observer); | |
| 173 | + | |
| 174 | + public static void editUser(RequestBody body, Observer<ResponseBody> observer) { | |
| 175 | + setSubscribe(service_url.editUser(getHeader(), body), observer); | |
| 140 | 176 | } |
| 141 | 177 | |
| 178 | + public static void changePassword(RequestBody body, Observer<ResponseBody> observer) { | |
| 179 | + setSubscribe(service_url.changePassword(getHeader(), body), observer); | |
| 180 | + } | |
| 142 | 181 | |
| 143 | - public static void searchById(String userId,Observer<ResponseBody> observer) { | |
| 144 | - setSubscribe(service_url.searchById(userId),observer); | |
| 182 | + | |
| 183 | + public static void searchById(String userId, Observer<ResponseBody> observer) { | |
| 184 | + setSubscribe(service_url.searchById(getHeader(), userId), observer); | |
| 145 | 185 | } |
| 146 | 186 | |
| 147 | 187 | |
| 148 | - public static void login(RequestBody body,Observer<ResponseBody> observer) { | |
| 149 | - setSubscribe(service_url.login(body),observer); | |
| 188 | + public static void login(RequestBody body, Observer<ResponseBody> observer) { | |
| 189 | + setSubscribe(service_url.login(body), observer); | |
| 150 | 190 | } |
| 151 | 191 | |
| 152 | - public static void listGradeAndSubject(Observer<ResponseBody> observer) { | |
| 153 | - setSubscribe(service_url.listGradeAndSubject(),observer); | |
| 192 | + public static void listGradeAndSubject(Observer<ResponseResult<List<GradeAndSubject>>> observer) { | |
| 193 | + setSubscribe(service_url.listGradeAndSubject(getHeader()), observer); | |
| 154 | 194 | } |
| 155 | 195 | |
| 156 | 196 | |
| 157 | - public static void scanAndLogin(String code,Observer<ResponseBody> observer) { | |
| 158 | - setSubscribe(service_url.scanAndLogin(code),observer); | |
| 197 | + public static void scanAndLogin(String code, Observer<ResponseBody> observer) { | |
| 198 | + setSubscribe(service_url.scanAndLogin(getHeader(), code), observer); | |
| 159 | 199 | } |
| 160 | 200 | |
| 161 | 201 | public static void getChildrenList(Observer<ResponseBody> observer) { |
| 162 | - setSubscribe(service_url.getChildrenList(),observer); | |
| 202 | + setSubscribe(service_url.getChildrenList(getHeader()), observer); | |
| 163 | 203 | } |
| 164 | 204 | |
| 165 | 205 | |
| 166 | - public static void registerParent(RequestBody body,Observer<ResponseBody> observer) { | |
| 167 | - setSubscribe(service_url.registerParent(body),observer); | |
| 206 | + public static void registerParent(RequestBody body, Observer<ResponseBody> observer) { | |
| 207 | + setSubscribe(service_url.registerParent(body), observer); | |
| 168 | 208 | } |
| 169 | 209 | |
| 170 | 210 | |
| 171 | 211 | public static void listChildren(Observer<ResponseBody> observer) { |
| 172 | - setSubscribe(service_url.listChildren(),observer); | |
| 212 | + setSubscribe(service_url.listChildren(getHeader()), observer); | |
| 173 | 213 | } |
| 174 | 214 | |
| 175 | 215 | |
| 176 | - public static void registerStudent(RequestBody body,Observer<ResponseBody> observer) { | |
| 177 | - setSubscribe(service_url.registerStudent(body),observer); | |
| 216 | + public static void registerStudent(RequestBody body, Observer<ResponseBody> observer) { | |
| 217 | + setSubscribe(service_url.registerStudent(getHeader(), body), observer); | |
| 178 | 218 | } |
| 179 | 219 | |
| 180 | - public static void bindTeacher(RequestBody body,Observer<ResponseBody> observer) { | |
| 181 | - setSubscribe(service_url.bindTeacher(body),observer); | |
| 220 | + public static void bindTeacher(RequestBody body, Observer<ResponseBody> observer) { | |
| 221 | + setSubscribe(service_url.bindTeacher(getHeader(), body), observer); | |
| 182 | 222 | } |
| 183 | 223 | |
| 184 | 224 | |
| ... | ... | @@ -186,13 +226,14 @@ public class NetWorks extends RetrofitUtils { |
| 186 | 226 | return RequestBody.create(MediaType.parse("text/plain"), new Gson().toJson(map)); |
| 187 | 227 | } |
| 188 | 228 | |
| 189 | - public static RequestBody getArrayRequestBody(List list){ | |
| 229 | + public static RequestBody getArrayRequestBody(List list) { | |
| 190 | 230 | return RequestBody.create(MediaType.parse("text/plain"), new Gson().toJson(list)); |
| 191 | 231 | } |
| 192 | 232 | |
| 193 | 233 | public static RequestBody getFileRequestBody(File file) { |
| 194 | 234 | return RequestBody.create(MediaType.parse("application/octet-stream"), file); |
| 195 | 235 | } |
| 236 | + | |
| 196 | 237 | public static RequestBody getFileRequestBody(byte[] bytes) { |
| 197 | 238 | return RequestBody.create(MediaType.parse("multipart/form-data"), bytes); |
| 198 | 239 | } |
| ... | ... | @@ -200,6 +241,7 @@ public class NetWorks extends RetrofitUtils { |
| 200 | 241 | public static RequestBody getObjectRequestBody(Object obj) { |
| 201 | 242 | return RequestBody.create(MediaType.parse("text/plain"), new Gson().toJson(obj)); |
| 202 | 243 | } |
| 244 | + | |
| 203 | 245 | public static RequestBody getStringRequestBody(String str) { |
| 204 | 246 | return RequestBody.create(MediaType.parse("text/plain"), str); |
| 205 | 247 | } | ... | ... |
libs/common/src/main/java/com/prws/common/utils/GlideHelper.java
| ... | ... | @@ -27,11 +27,8 @@ public class GlideHelper { |
| 27 | 27 | .load(url) |
| 28 | 28 | // .format(DecodeFormat.PREFER_RGB_565) |
| 29 | 29 | // 取消动画,防止第一次加载不出来 |
| 30 | - .dontAnimate() | |
| 31 | 30 | //加载缩略图 |
| 32 | 31 | .thumbnail(0.3f) |
| 33 | - .skipMemoryCache(true) | |
| 34 | - .diskCacheStrategy(DiskCacheStrategy.ALL) | |
| 35 | 32 | .into(imageView); |
| 36 | 33 | } |
| 37 | 34 | } |
| ... | ... | @@ -49,11 +46,8 @@ public class GlideHelper { |
| 49 | 46 | .load(resourceId) |
| 50 | 47 | // .format(DecodeFormat.PREFER_RGB_565) |
| 51 | 48 | // 取消动画,防止第一次加载不出来 |
| 52 | - .dontAnimate() | |
| 53 | 49 | //加载缩略图 |
| 54 | 50 | .thumbnail(0.3f) |
| 55 | - .skipMemoryCache(true) | |
| 56 | - .diskCacheStrategy(DiskCacheStrategy.ALL) | |
| 57 | 51 | .into(imageView); |
| 58 | 52 | } |
| 59 | 53 | } |
| ... | ... | @@ -71,14 +65,10 @@ public class GlideHelper { |
| 71 | 65 | if (mContext != null) { |
| 72 | 66 | Glide.with(mContext.getApplicationContext()) |
| 73 | 67 | .load(url) |
| 74 | - .override(w, h) | |
| 75 | 68 | // .format(DecodeFormat.PREFER_RGB_565) |
| 76 | 69 | // 取消动画,防止第一次加载不出来 |
| 77 | - .dontAnimate() | |
| 78 | 70 | //加载缩略图 |
| 79 | 71 | .thumbnail(0.3f) |
| 80 | - .skipMemoryCache(true) | |
| 81 | - .diskCacheStrategy(DiskCacheStrategy.ALL) | |
| 82 | 72 | .into(imageView); |
| 83 | 73 | } |
| 84 | 74 | } |
| ... | ... | @@ -95,11 +85,8 @@ public class GlideHelper { |
| 95 | 85 | Glide.with(mContext.getApplicationContext()) |
| 96 | 86 | .load(file) |
| 97 | 87 | // 取消动画,防止第一次加载不出来 |
| 98 | - .dontAnimate() | |
| 99 | 88 | //加载缩略图 |
| 100 | 89 | .thumbnail(0.3f) |
| 101 | - .skipMemoryCache(true) | |
| 102 | - .diskCacheStrategy(DiskCacheStrategy.ALL) | |
| 103 | 90 | .into(imageView); |
| 104 | 91 | } |
| 105 | 92 | } | ... | ... |
libs/common/src/main/java/com/prws/common/utils/ScreenUtils.java
| ... | ... | @@ -2,6 +2,7 @@ package com.prws.common.utils; |
| 2 | 2 | |
| 3 | 3 | import android.app.Activity; |
| 4 | 4 | import android.app.Dialog; |
| 5 | +import android.content.Context; | |
| 5 | 6 | import android.view.View; |
| 6 | 7 | import android.view.Window; |
| 7 | 8 | import android.view.WindowManager; |
| ... | ... | @@ -117,4 +118,9 @@ public class ScreenUtils { |
| 117 | 118 | // | SYSTEM_UI_FLAG_IMMERSIVE_GESTURE_ISOLATED; |
| 118 | 119 | window.getDecorView().setSystemUiVisibility(uiOptions); |
| 119 | 120 | } |
| 121 | + | |
| 122 | + public static int dpToPx(Context context, int dpValue) { | |
| 123 | + float scale = context.getResources().getDisplayMetrics().density; | |
| 124 | + return Math.round(dpValue * scale); | |
| 125 | + } | |
| 120 | 126 | } | ... | ... |
libs/common/src/main/java/com/prws/common/utils/SharedPreferencesUtil.java
| ... | ... | @@ -262,4 +262,11 @@ public class SharedPreferencesUtil { |
| 262 | 262 | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | + public static void clear(Context context) { | |
| 266 | + SharedPreferences preferences = context.getSharedPreferences("config", Context.MODE_PRIVATE); | |
| 267 | + SharedPreferences.Editor editor = preferences.edit(); | |
| 268 | + editor.clear(); | |
| 269 | + editor.commit(); | |
| 270 | + } | |
| 271 | + | |
| 265 | 272 | } | ... | ... |
libs/common/src/main/res/drawable/shape_bottom_sheet_dialog.xml
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | |
| 2 | +<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | + android:shape="rectangle"> | |
| 4 | + | |
| 5 | + <corners android:topLeftRadius="20dp" | |
| 6 | + android:topRightRadius="20dp"/> | |
| 7 | + <solid android:color="@color/white"/> | |
| 8 | + | |
| 9 | +</shape> | |
| 0 | 10 | \ No newline at end of file | ... | ... |