Commit 9fdc4a8db325575a4293c4314f7459b2233d94da
1 parent
d8c0c1a275
Exists in
master
代码跑通
Showing
6 changed files
with
22 additions
and
52 deletions
Show diff stats
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; | |
| 5 | 3 | import android.content.Intent; |
| 6 | 4 | import android.text.TextUtils; |
| 7 | 5 | import android.view.View; |
| 8 | 6 | import android.widget.ImageView; |
| 9 | 7 | import android.widget.TextView; |
| 10 | -import android.widget.Toast; | |
| 11 | 8 | |
| 12 | 9 | import androidx.annotation.NonNull; |
| 13 | -import androidx.annotation.Nullable; | |
| 14 | 10 | import androidx.constraintlayout.widget.Group; |
| 15 | 11 | import androidx.recyclerview.widget.LinearLayoutManager; |
| 16 | 12 | import androidx.recyclerview.widget.RecyclerView; |
| ... | ... | @@ -20,18 +16,10 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners; |
| 20 | 16 | import com.bumptech.glide.request.RequestOptions; |
| 21 | 17 | import com.chad.library.adapter.base.BaseQuickAdapter; |
| 22 | 18 | import com.chad.library.adapter.base.BaseViewHolder; |
| 23 | -import com.developer.wang.utils.PermissionUtils; | |
| 24 | 19 | import com.google.gson.Gson; |
| 25 | -import com.google.gson.JsonArray; | |
| 26 | -import com.hjq.permissions.OnPermissionCallback; | |
| 27 | -import com.hjq.permissions.Permission; | |
| 28 | -import com.hjq.permissions.XXPermissions; | |
| 29 | 20 | import com.hjx.parent.AccountActivity; |
| 30 | 21 | import com.hjx.parent.AddStudentActivity; |
| 31 | 22 | import com.hjx.parent.EditStudentActivity; |
| 32 | -import com.hjx.parent.LoginActivity; | |
| 33 | -import com.hjx.parent.MainActivity; | |
| 34 | -import com.hjx.parent.QRActivity; | |
| 35 | 23 | import com.hjx.parent.R; |
| 36 | 24 | import com.hjx.parent.UserActivity; |
| 37 | 25 | import com.hjx.parent.YinsiActivity; |
| ... | ... | @@ -46,12 +34,7 @@ import org.json.JSONArray; |
| 46 | 34 | import org.json.JSONObject; |
| 47 | 35 | |
| 48 | 36 | import java.util.ArrayList; |
| 49 | -import java.util.HashMap; | |
| 50 | -import java.util.List; | |
| 51 | -import java.util.Map; | |
| 52 | 37 | |
| 53 | -import butterknife.BindView; | |
| 54 | -import butterknife.OnClick; | |
| 55 | 38 | import io.reactivex.Observer; |
| 56 | 39 | import io.reactivex.disposables.Disposable; |
| 57 | 40 | import okhttp3.ResponseBody; | ... | ... |
build.gradle
| ... | ... | @@ -42,7 +42,7 @@ buildscript { |
| 42 | 42 | //okhttp |
| 43 | 43 | okhttp : 'com.squareup.okhttp3:okhttp:3.8.1', |
| 44 | 44 | logging : 'com.squareup.okhttp3:logging-interceptor:3.4.1', |
| 45 | - utils : 'com.github.wang-developer:AndroidUtilsDemo:1.0.6', | |
| 45 | +// utils : 'com.github.wang-developer:AndroidUtilsDemo:1.0.6', | |
| 46 | 46 | commons_lang : 'org.apache.commons:commons-lang3:3.7', |
| 47 | 47 | commons_compress: 'org.apache.commons:commons-compress:1.19', |
| 48 | 48 | commons_c_lang : 'commons-lang:commons-lang:2.3', |
| ... | ... | @@ -50,7 +50,7 @@ buildscript { |
| 50 | 50 | eventbus : 'org.greenrobot:eventbus:3.2.0', |
| 51 | 51 | eventbus2 : 'org.simple:androideventbus:1.0.5.1', |
| 52 | 52 | glide : 'com.github.bumptech.glide:glide:4.6.1', |
| 53 | - permissions : 'com.github.getActivity:XXPermissions:11.6', | |
| 53 | + permissions : 'com.github.getActivity:XXPermissions:18.5', | |
| 54 | 54 | orcode : 'cn.yipianfengye.android:zxing-library:2.2' |
| 55 | 55 | // push : 'com.umeng.sdk:push:4.1.0', |
| 56 | 56 | // litepal : 'org.litepal.android:java:3.0.0', |
| ... | ... | @@ -70,10 +70,15 @@ buildscript { |
| 70 | 70 | |
| 71 | 71 | repositories { |
| 72 | 72 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } |
| 73 | + maven { url 'https://maven.aliyun.com/repository/public' } | |
| 73 | 74 | maven { url 'https://maven.aliyun.com/repository/google' } |
| 74 | - maven { url 'https://maven.aliyun.com/repository/central' } | |
| 75 | + maven { url 'https://repo.huaweicloud.com/repository/maven-public/' } | |
| 76 | + //maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } | |
| 77 | + | |
| 75 | 78 | google() |
| 76 | - maven { url 'https://maven.aliyun.com/repository/jcenter' } | |
| 79 | + mavenCentral() | |
| 80 | + gradlePluginPortal() | |
| 81 | + maven { url "https://jitpack.io" } | |
| 77 | 82 | } |
| 78 | 83 | dependencies { |
| 79 | 84 | classpath 'com.android.tools.build:gradle:4.2.2' |
| ... | ... | @@ -91,11 +96,14 @@ buildscript { |
| 91 | 96 | |
| 92 | 97 | allprojects { |
| 93 | 98 | repositories { |
| 94 | - maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' } | |
| 95 | - maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } | |
| 96 | - maven { url 'https://jitpack.io' } | |
| 99 | + maven { url 'https://maven.aliyun.com/repository/public' } | |
| 100 | + maven { url 'https://maven.aliyun.com/repository/google' } | |
| 101 | + maven { url 'https://repo.huaweicloud.com/repository/maven-public/' } | |
| 102 | + //maven { url 'https://mirrors.cloud.tencent.com/nexus/repository/maven-public/' } | |
| 103 | + | |
| 97 | 104 | google() |
| 98 | - maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } | |
| 105 | + mavenCentral() | |
| 106 | + maven { url "https://jitpack.io" } | |
| 99 | 107 | } |
| 100 | 108 | } |
| 101 | 109 | task clean(type: Delete) { | ... | ... |
libs/common/src/main/java/com/prws/common/base/BaseActivity.java
| ... | ... | @@ -26,12 +26,10 @@ import androidx.fragment.app.Fragment; |
| 26 | 26 | import androidx.fragment.app.FragmentTransaction; |
| 27 | 27 | import androidx.lifecycle.Lifecycle; |
| 28 | 28 | |
| 29 | -import com.developer.wang.utils.PermissionUtils; | |
| 30 | 29 | import com.prws.common.R; |
| 31 | 30 | import com.prws.common.net.INetEvent; |
| 32 | 31 | import com.prws.common.utils.LogUtil; |
| 33 | 32 | import com.prws.common.utils.ScreenUtils; |
| 34 | -import com.prws.common.utils.SharedPreferencesUtil; | |
| 35 | 33 | import com.prws.common.view.LoadingView; |
| 36 | 34 | |
| 37 | 35 | import org.simple.eventbus.EventBus; |
| ... | ... | @@ -161,16 +159,6 @@ public abstract class BaseActivity<P extends BasePresenter, CONTRACT> extends Ap |
| 161 | 159 | } |
| 162 | 160 | |
| 163 | 161 | |
| 164 | - private void addNavigationBar() { | |
| 165 | - //判断是否有浮窗权限 | |
| 166 | - if (PermissionUtils.requestWindowManager(this)) { | |
| 167 | - //开启浮窗 | |
| 168 | -// openFloatWindow(); | |
| 169 | - } else { | |
| 170 | - showAlertDialogOfFloatWindow(); | |
| 171 | - } | |
| 172 | - } | |
| 173 | - | |
| 174 | 162 | // public void openFloatWindow() { |
| 175 | 163 | // if (FloatWindow.get("navigation") == null) { |
| 176 | 164 | // NavigationBarView navigationBarView = new NavigationBarView(this); | ... | ... |
libs/common/src/main/java/com/prws/common/config/SettingConfig.java
| ... | ... | @@ -3,8 +3,7 @@ package com.prws.common.config; |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.content.SharedPreferences; |
| 5 | 5 | |
| 6 | -import com.developer.wang.utils.SharedPreferencesUtils; | |
| 7 | -import com.developer.wang.utils.gson.MyGson; | |
| 6 | +import com.google.gson.Gson; | |
| 8 | 7 | import com.prws.common.CommonApplication; |
| 9 | 8 | |
| 10 | 9 | |
| ... | ... | @@ -28,7 +27,7 @@ public class SettingConfig { |
| 28 | 27 | if (json == null || json.length() == 0) { |
| 29 | 28 | mInstance = new SettingConfig(); |
| 30 | 29 | } else { |
| 31 | - mInstance = MyGson.buildGson().fromJson(json, SettingConfig.class); | |
| 30 | + mInstance = new Gson().fromJson(json, SettingConfig.class); | |
| 32 | 31 | } |
| 33 | 32 | } |
| 34 | 33 | } |
| ... | ... | @@ -40,7 +39,7 @@ public class SettingConfig { |
| 40 | 39 | public static void cacheToDisk() { |
| 41 | 40 | SharedPreferences sp = getSharedPreferences(); |
| 42 | 41 | SharedPreferences.Editor editor = sp.edit(); |
| 43 | - editor.putString("SettingConfig", MyGson.buildGson().toJson(getInstance())); | |
| 42 | + editor.putString("SettingConfig", new Gson().toJson(getInstance())); | |
| 44 | 43 | editor.commit(); |
| 45 | 44 | } |
| 46 | 45 | public static SharedPreferences getSharedPreferences(){ | ... | ... |
libs/common/src/main/java/com/prws/common/net/DownloadResponseBody.java
| 1 | 1 | package com.prws.common.net; |
| 2 | 2 | |
| 3 | - | |
| 4 | - | |
| 5 | -import com.developer.wang.utils.MainHandler; | |
| 3 | +import android.os.Handler; | |
| 4 | +import android.os.Looper; | |
| 6 | 5 | |
| 7 | 6 | import okhttp3.MediaType; |
| 8 | 7 | import okhttp3.ResponseBody; |
| ... | ... | @@ -53,7 +52,7 @@ public class DownloadResponseBody extends ResponseBody { |
| 53 | 52 | }catch (final Exception e){ |
| 54 | 53 | e.printStackTrace(); |
| 55 | 54 | if (null != mDownloadListener) { |
| 56 | - MainHandler.getInstance().post(new Runnable() { | |
| 55 | + new Handler(Looper.getMainLooper()).post(new Runnable() { | |
| 57 | 56 | @Override |
| 58 | 57 | public void run() { |
| 59 | 58 | mDownloadListener.onError(e); | ... | ... |
libs/common/src/main/java/com/prws/common/utils/LogcatHelper.java
| ... | ... | @@ -2,9 +2,6 @@ package com.prws.common.utils; |
| 2 | 2 | |
| 3 | 3 | import android.content.Context; |
| 4 | 4 | import android.os.Environment; |
| 5 | -import android.util.Log; | |
| 6 | - | |
| 7 | -import com.developer.wang.utils.DateUtil; | |
| 8 | 5 | |
| 9 | 6 | import java.io.BufferedReader; |
| 10 | 7 | import java.io.File; |
| ... | ... | @@ -12,12 +9,8 @@ import java.io.FileNotFoundException; |
| 12 | 9 | import java.io.FileOutputStream; |
| 13 | 10 | import java.io.IOException; |
| 14 | 11 | import java.io.InputStreamReader; |
| 15 | -import java.nio.file.Files; | |
| 16 | -import java.nio.file.Path; | |
| 17 | -import java.nio.file.attribute.BasicFileAttributes; | |
| 18 | 12 | import java.text.ParseException; |
| 19 | 13 | import java.text.SimpleDateFormat; |
| 20 | -import java.time.Instant; | |
| 21 | 14 | import java.util.Date; |
| 22 | 15 | |
| 23 | 16 | public class LogcatHelper { | ... | ... |