From 0bc745ac978b9d9cd20557bc4fed63f9332e86c5 Mon Sep 17 00:00:00 2001 From: L Date: Wed, 23 Oct 2019 11:49:08 +0800 Subject: [PATCH] Add find back password --- app/build.gradle | 40 ++++++++--------- app/src/main/AndroidManifest.xml | 12 ++++-- .../com/dante/diary/base/AboutActivity.java | 2 +- .../main/java/com/dante/diary/base/App.java | 2 + .../com/dante/diary/base/BaseActivity.java | 10 ++--- .../com/dante/diary/base/BaseFragment.java | 12 +++--- .../dante/diary/base/BottomBarActivity.java | 7 ++- .../dante/diary/base/RecyclerFragment.java | 12 +++--- .../com/dante/diary/base/TabPagerAdapter.java | 8 ++-- .../com/dante/diary/base/ViewActivity.java | 5 ++- .../com/dante/diary/chat/ChatService.java | 3 +- .../diary/chat/ConversationActivity.java | 2 +- .../diary/custom/BottomDialogFragment.java | 9 ++-- .../dante/diary/custom/DownloadHelper.java | 5 ++- .../dante/diary/custom/FABScrollBehavior.java | 4 +- .../com/dante/diary/custom/FabBehavior.java | 8 ++-- .../dante/diary/custom/NotificationUtils.java | 3 +- .../diary/custom/PickPictureActivity.java | 3 +- .../com/dante/diary/custom/RecordView.java | 6 ++- .../diary/detail/DiariesViewerActivity.java | 10 ++--- .../diary/detail/DiaryCommentsAdapter.java | 4 +- .../diary/detail/DiaryDetailFragment.java | 41 ++++++++++-------- .../dante/diary/detail/PictureActivity.java | 6 +-- .../dante/diary/detail/PictureFragment.java | 34 +++++++++------ .../com/dante/diary/draw/DrawActivity.java | 4 +- .../diary/draw/dialogs/DrawAttribsDialog.java | 35 +++++++-------- .../diary/draw/dialogs/RequestTextDialog.java | 9 ++-- .../diary/draw/dialogs/SaveBitmapDialog.java | 11 ++--- .../draw/dialogs/SelectChoiceDialog.java | 7 +-- .../dante/diary/edit/EditDiaryActivity.java | 6 +-- .../diary/edit/EditNotebookActivity.java | 28 ++++++------ .../diary/follow/FollowListFragment.java | 6 +-- .../com/dante/diary/follow/TabsFragment.java | 6 +-- .../com/dante/diary/login/LoginActivity.java | 26 +++++++---- .../com/dante/diary/main/MainActivity.java | 3 +- .../dante/diary/main/MainDiaryFragment.java | 29 +++++++------ .../main/java/com/dante/diary/net/API.java | 1 + .../com/dante/diary/net/HttpErrorAction.java | 3 +- .../java/com/dante/diary/net/TimeApi.java | 3 +- .../notification/NotificationListAdapter.java | 3 +- .../NotificationListFragment.java | 5 ++- .../diary/profile/DiaryListFragment.java | 18 +++++--- .../diary/profile/NoteBookListFragment.java | 10 ++--- .../diary/profile/NotebookListAdapter.java | 3 +- .../dante/diary/profile/ProfileFragment.java | 22 ++++------ .../dante/diary/search/SearchActivity.java | 8 ++-- .../setting/ProfilePreferenceFragment.java | 20 +++++---- .../dante/diary/setting/SettingActivity.java | 3 +- .../dante/diary/setting/SettingFragment.java | 4 +- .../diary/timepill/TimePillActivity.java | 2 +- .../timepill/TimePillCreateActivity.java | 8 ++-- .../diary/timepill/TimePillOpenActivity.java | 6 +-- .../java/com/dante/diary/utils/DateUtil.java | 3 +- .../dante/diary/utils/ImageProgresser.java | 13 +++--- .../java/com/dante/diary/utils/Imager.java | 34 ++++++--------- .../java/com/dante/diary/utils/Share.java | 3 +- .../dante/diary/utils/TransitionHelper.java | 7 +-- .../java/com/dante/diary/utils/UiUtils.java | 7 ++- .../utils/WrapContentLinearLayoutManager.java | 5 ++- app/src/main/res/layout/activity_about.xml | 15 ++++--- .../main/res/layout/activity_conversation.xml | 11 ++--- .../res/layout/activity_conversation_list.xml | 9 ++-- .../main/res/layout/activity_create_diary.xml | 10 ++--- .../res/layout/activity_create_notebook.xml | 27 ++++++------ .../res/layout/activity_create_timepill.xml | 10 ++--- .../res/layout/activity_diaries_viewer.xml | 6 +-- app/src/main/res/layout/activity_login.xml | 43 +++++++++++-------- app/src/main/res/layout/activity_main.xml | 11 +++-- .../res/layout/activity_pill_open_content.xml | 4 +- app/src/main/res/layout/activity_search.xml | 15 ++++--- .../main/res/layout/activity_time_pill.xml | 10 ++--- .../res/layout/activity_time_pill_open.xml | 10 ++--- app/src/main/res/layout/activity_viewer.xml | 10 ++--- app/src/main/res/layout/comment_layout.xml | 8 ++-- app/src/main/res/layout/common_toolbar.xml | 2 +- .../res/layout/content_create_timepill.xml | 35 ++++++++------- .../res/layout/fragment_detail_content.xml | 4 +- .../main/res/layout/fragment_diary_detail.xml | 14 +++--- .../main/res/layout/fragment_diary_list.xml | 13 +++--- .../main/res/layout/fragment_diary_main.xml | 15 ++++--- app/src/main/res/layout/fragment_draw.xml | 11 ++--- app/src/main/res/layout/fragment_profile.xml | 16 +++---- app/src/main/res/layout/fragment_recycler.xml | 12 +++--- app/src/main/res/layout/framelayout.xml | 4 +- .../main/res/layout/layout_draw_attribs.xml | 18 ++++---- .../main/res/layout/layout_request_text.xml | 6 +-- .../main/res/layout/layout_save_bitmap.xml | 6 +-- app/src/main/res/layout/list_comments.xml | 5 +-- .../res/layout/list_diary_item_expired.xml | 2 +- .../main/res/layout/list_notebook_item.xml | 4 +- app/src/main/res/layout/tab_pager_layout.xml | 15 +++---- app/src/main/res/menu/menu_detail.xml | 2 +- app/src/main/res/menu/menu_detail_my.xml | 2 +- app/src/main/res/menu/menu_search.xml | 2 +- app/src/main/res/values-en/strings.xml | 1 + app/src/main/res/values-night/colors.xml | 4 +- app/src/main/res/values/colors.xml | 2 + app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/styles.xml | 2 +- .../main/res/xml/network_security_config.xml | 4 ++ build.gradle | 6 +-- gradle.properties | 2 + gradle/wrapper/gradle-wrapper.properties | 4 +- 103 files changed, 545 insertions(+), 477 deletions(-) create mode 100644 app/src/main/res/xml/network_security_config.xml diff --git a/app/build.gradle b/app/build.gradle index d675523..0276616 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,14 +4,14 @@ apply plugin: 'realm-android' apply plugin: 'com.bugtags.library.plugin' android { - compileSdkVersion 27 - buildToolsVersion '27.0.3' + compileSdkVersion 29 + buildToolsVersion '29.0.2' defaultConfig { applicationId "com.dante.diary" minSdkVersion 19 - targetSdkVersion 27 - versionCode 52 - versionName "2.1" + targetSdkVersion 29 + versionCode 53 + versionName "2.2" vectorDrawables.useSupportLibrary = true multiDexEnabled true manifestPlaceholders = [ @@ -83,9 +83,9 @@ dependencies { implementation 'moe.feng:AlipayZeroSdk:1.1' implementation 'com.github.jaychang0917:SimpleText:1.2.1' implementation 'com.bugtags.library:bugtags-lib:2.3.1' - implementation 'com.github.bumptech.glide:glide:3.8.0' - implementation 'com.jakewharton:butterknife:8.8.1' - implementation 'com.google.code.gson:gson:2.8.2' + implementation 'com.github.bumptech.glide:glide:4.9.0' + implementation 'com.jakewharton:butterknife:10.2.0' + implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.blankj:utilcode:1.3.6' implementation 'com.hwangjr.proguard:proguardconfig:1.0.1@aar' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34' @@ -99,9 +99,9 @@ dependencies { implementation 'com.artemzin.rxjava:proguard-rules:1.3.3.0' implementation 'io.reactivex:rxandroid:1.2.1' implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0' - implementation 'com.squareup.retrofit2:retrofit:2.3.0' - implementation 'com.squareup.retrofit2:converter-gson:2.3.0' - implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0' + implementation 'com.squareup.retrofit2:retrofit:2.6.1' + implementation 'com.squareup.retrofit2:converter-gson:2.6.1' + implementation 'com.squareup.okhttp3:logging-interceptor:4.1.0' //============== custom ============== implementation 'uk.co.samuelwall:material-tap-target-prompt:2.1.0' implementation 'com.github.deano2390:FlowTextView:2.0.5' @@ -113,24 +113,24 @@ dependencies { implementation 'com.github.XunMengWinter:CircularAnim:0.3.4' implementation 'io.github.yavski:fab-speed-dial:1.0.6' implementation 'com.classic.common:multiple-status-view:1.2' - implementation 'jp.wasabeef:glide-transformations:2.0.1' + implementation 'jp.wasabeef:glide-transformations:4.1.0' implementation 'cn.leancloud.android:avoscloud-sdk:v4.6.4' implementation('cn.leancloud.android:avoscloud-push:v4.6.4@aar') { transitive = true } // 推送与实时聊天需要的包 //============== official ============== - implementation "com.android.support:design:$supportVersion" - implementation "com.android.support:appcompat-v7:$supportVersion" - implementation "com.android.support:support-v4:$supportVersion" - implementation "com.android.support:cardview-v7:$supportVersion" - implementation "com.android.support:recyclerview-v7:$supportVersion" - implementation 'com.android.support.constraint:constraint-layout:1.1.0' + implementation 'com.google.android.material:material:1.0.0' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.cardview:cardview:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.0.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' //============== debug ============== // implementation 'cn.jiguang.sdk:jpush:3.0.3' // implementation 'cn.jiguang.sdk:jcore:1.1.1' - implementation "com.android.support:support-vector-drawable:$supportVersion" - annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' + implementation 'androidx.vectordrawable:vectordrawable:1.1.0' + annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0' // releaseimplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' // debugimplementation 'com.squareup.leakcanary:leakcanary-android:1.5' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1e2689c..62203d2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,14 +9,18 @@ - + android:networkSecurityConfig="@xml/network_security_config" + android:theme="@style/AppTheme.NoActionBar" + tools:ignore="GoogleAppIndexingWarning,UnusedAttribute"> + @@ -60,7 +64,7 @@ android:name=".login.LoginActivity" android:theme="@style/ViewerTheme.TransNav.Placeholder" android:launchMode="singleTask" - android:windowSoftInputMode="stateHidden|adjustPan"> + android:windowSoftInputMode="stateHidden|adjustResize"> @@ -91,7 +95,7 @@ android:windowSoftInputMode="stateHidden"/> diff --git a/app/src/main/java/com/dante/diary/base/AboutActivity.java b/app/src/main/java/com/dante/diary/base/AboutActivity.java index b3de239..6d66766 100755 --- a/app/src/main/java/com/dante/diary/base/AboutActivity.java +++ b/app/src/main/java/com/dante/diary/base/AboutActivity.java @@ -2,7 +2,6 @@ import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; @@ -15,6 +14,7 @@ import com.dante.diary.utils.AppUtil; import com.dante.diary.utils.SpUtil; +import androidx.annotation.Nullable; import butterknife.BindView; import static com.dante.diary.base.App.context; diff --git a/app/src/main/java/com/dante/diary/base/App.java b/app/src/main/java/com/dante/diary/base/App.java index 7c09207..cb920eb 100644 --- a/app/src/main/java/com/dante/diary/base/App.java +++ b/app/src/main/java/com/dante/diary/base/App.java @@ -14,6 +14,7 @@ import com.dante.diary.chat.PMMessageHandler; import com.dante.diary.login.LoginActivity; +import androidx.appcompat.app.AppCompatDelegate; import io.realm.Realm; /** @@ -51,5 +52,6 @@ public void onCreate() { Utils.init(this); StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); StrictMode.setVmPolicy(builder.build()); + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); } } diff --git a/app/src/main/java/com/dante/diary/base/BaseActivity.java b/app/src/main/java/com/dante/diary/base/BaseActivity.java index e00952c..4583355 100644 --- a/app/src/main/java/com/dante/diary/base/BaseActivity.java +++ b/app/src/main/java/com/dante/diary/base/BaseActivity.java @@ -2,10 +2,6 @@ import android.app.ProgressDialog; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.MotionEvent; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; @@ -14,6 +10,10 @@ import com.dante.diary.R; import com.dante.diary.model.DataBase; +import androidx.annotation.CallSuper; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import butterknife.ButterKnife; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; @@ -66,7 +66,7 @@ private void initSDK() { public void initAppBar() { - toolbar = (Toolbar) findViewById(R.id.toolbar); + toolbar = findViewById(R.id.toolbar); if (null != toolbar) { setSupportActionBar(toolbar); } diff --git a/app/src/main/java/com/dante/diary/base/BaseFragment.java b/app/src/main/java/com/dante/diary/base/BaseFragment.java index 902bc8d..20cd072 100755 --- a/app/src/main/java/com/dante/diary/base/BaseFragment.java +++ b/app/src/main/java/com/dante/diary/base/BaseFragment.java @@ -3,12 +3,6 @@ import android.annotation.TargetApi; import android.os.Build; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.design.widget.AppBarLayout; -import android.support.v4.app.Fragment; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.transition.Fade; import android.transition.Transition; import android.util.Log; @@ -19,7 +13,13 @@ import com.dante.diary.BuildConfig; import com.dante.diary.R; import com.dante.diary.model.DataBase; +import com.google.android.material.appbar.AppBarLayout; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; +import androidx.fragment.app.Fragment; import butterknife.ButterKnife; import rx.Observable; import rx.Subscription; diff --git a/app/src/main/java/com/dante/diary/base/BottomBarActivity.java b/app/src/main/java/com/dante/diary/base/BottomBarActivity.java index f07c3b9..90ad18b 100644 --- a/app/src/main/java/com/dante/diary/base/BottomBarActivity.java +++ b/app/src/main/java/com/dante/diary/base/BottomBarActivity.java @@ -3,9 +3,6 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentTransaction; import android.util.Log; import android.view.View; @@ -19,6 +16,8 @@ import com.ncapdevi.fragnav.FragNavController; import com.roughike.bottombar.BottomBar; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; import butterknife.BindView; import rx.Subscription; @@ -46,7 +45,7 @@ protected void initViews(@Nullable Bundle savedInstanceState) { } controller = new FragNavController(savedInstanceState, getSupportFragmentManager(), R.id.container, this, 4, MAIN); - controller.setTransitionMode(FragmentTransaction.TRANSIT_NONE); +// controller.setTransitionMode(FragmentTransaction.TRANSIT_NONE); initBottomBar(); fetchNotifications(); } diff --git a/app/src/main/java/com/dante/diary/base/RecyclerFragment.java b/app/src/main/java/com/dante/diary/base/RecyclerFragment.java index 987a331..8f2d2c9 100755 --- a/app/src/main/java/com/dante/diary/base/RecyclerFragment.java +++ b/app/src/main/java/com/dante/diary/base/RecyclerFragment.java @@ -2,16 +2,16 @@ import android.os.Handler; -import android.support.annotation.CallSuper; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.content.ContextCompat; -import android.support.v4.widget.SwipeRefreshLayout; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import com.dante.diary.R; import com.dante.diary.utils.SpUtil; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import androidx.annotation.CallSuper; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import butterknife.BindView; /** diff --git a/app/src/main/java/com/dante/diary/base/TabPagerAdapter.java b/app/src/main/java/com/dante/diary/base/TabPagerAdapter.java index 03961b7..594f283 100644 --- a/app/src/main/java/com/dante/diary/base/TabPagerAdapter.java +++ b/app/src/main/java/com/dante/diary/base/TabPagerAdapter.java @@ -1,11 +1,11 @@ package com.dante.diary.base; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; - import java.util.List; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; + /** * Created by yons on 17/3/17. */ diff --git a/app/src/main/java/com/dante/diary/base/ViewActivity.java b/app/src/main/java/com/dante/diary/base/ViewActivity.java index 56de6ce..3a38047 100644 --- a/app/src/main/java/com/dante/diary/base/ViewActivity.java +++ b/app/src/main/java/com/dante/diary/base/ViewActivity.java @@ -3,14 +3,15 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; import com.dante.diary.R; import com.dante.diary.detail.DiaryDetailFragment; import com.dante.diary.profile.DiaryListFragment; import com.dante.diary.profile.ProfileFragment; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + public class ViewActivity extends BaseActivity { public static final String TYPE_PROFILE = "profile"; diff --git a/app/src/main/java/com/dante/diary/chat/ChatService.java b/app/src/main/java/com/dante/diary/chat/ChatService.java index cc311a4..efe94fa 100644 --- a/app/src/main/java/com/dante/diary/chat/ChatService.java +++ b/app/src/main/java/com/dante/diary/chat/ChatService.java @@ -1,6 +1,5 @@ package com.dante.diary.chat; -import android.support.annotation.NonNull; import android.util.Log; import com.avos.avoscloud.im.v2.AVIMClient; @@ -17,6 +16,8 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.NonNull; + /** * Created by yons on 17/4/14. */ diff --git a/app/src/main/java/com/dante/diary/chat/ConversationActivity.java b/app/src/main/java/com/dante/diary/chat/ConversationActivity.java index 6ac730e..3e71b02 100644 --- a/app/src/main/java/com/dante/diary/chat/ConversationActivity.java +++ b/app/src/main/java/com/dante/diary/chat/ConversationActivity.java @@ -3,7 +3,6 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; import android.util.Log; import android.view.Menu; import android.widget.Toast; @@ -37,6 +36,7 @@ import java.util.Date; import java.util.List; +import androidx.annotation.Nullable; import butterknife.BindView; import rx.Subscriber; diff --git a/app/src/main/java/com/dante/diary/custom/BottomDialogFragment.java b/app/src/main/java/com/dante/diary/custom/BottomDialogFragment.java index a16cf90..24869dc 100644 --- a/app/src/main/java/com/dante/diary/custom/BottomDialogFragment.java +++ b/app/src/main/java/com/dante/diary/custom/BottomDialogFragment.java @@ -4,10 +4,6 @@ import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.DialogFragment; -import android.support.v4.app.Fragment; -import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.util.SparseArray; import android.view.Gravity; @@ -19,6 +15,11 @@ import com.dante.diary.R; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.DialogFragment; +import androidx.fragment.app.Fragment; + /** * A BottomDialogFragment that uses for comment. */ diff --git a/app/src/main/java/com/dante/diary/custom/DownloadHelper.java b/app/src/main/java/com/dante/diary/custom/DownloadHelper.java index 1c67233..d2eb621 100644 --- a/app/src/main/java/com/dante/diary/custom/DownloadHelper.java +++ b/app/src/main/java/com/dante/diary/custom/DownloadHelper.java @@ -8,7 +8,6 @@ import android.net.Uri; import android.os.Build; import android.os.Environment; -import android.support.v4.content.FileProvider; import android.text.TextUtils; import android.util.Log; import android.webkit.MimeTypeMap; @@ -20,12 +19,14 @@ import java.io.File; -import static com.bumptech.glide.gifdecoder.GifHeaderParser.TAG; +import androidx.core.content.FileProvider; + /** * Download and install apk file. */ public class DownloadHelper { + private static final String TAG = "DownloadHelper"; private BroadcastReceiver receiver; private String url; private String apkName; diff --git a/app/src/main/java/com/dante/diary/custom/FABScrollBehavior.java b/app/src/main/java/com/dante/diary/custom/FABScrollBehavior.java index 583ec43..8b4ffdf 100644 --- a/app/src/main/java/com/dante/diary/custom/FABScrollBehavior.java +++ b/app/src/main/java/com/dante/diary/custom/FABScrollBehavior.java @@ -1,12 +1,12 @@ package com.dante.diary.custom; import android.content.Context; -import android.support.design.widget.CoordinatorLayout; -import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.view.View; import android.view.animation.LinearInterpolator; +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.view.ViewCompat; import io.github.yavski.fabspeeddial.FabSpeedDial; import io.github.yavski.fabspeeddial.FabSpeedDialBehaviour; diff --git a/app/src/main/java/com/dante/diary/custom/FabBehavior.java b/app/src/main/java/com/dante/diary/custom/FabBehavior.java index 397e5ed..d6a3063 100644 --- a/app/src/main/java/com/dante/diary/custom/FabBehavior.java +++ b/app/src/main/java/com/dante/diary/custom/FabBehavior.java @@ -1,13 +1,15 @@ package com.dante.diary.custom; import android.content.Context; -import android.support.design.widget.CoordinatorLayout; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.util.Log; import android.view.View; +import com.google.android.material.floatingactionbutton.FloatingActionButton; + +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.view.ViewCompat; + public class FabBehavior extends FloatingActionButton.Behavior { private static final String TAG = "FabBehavior"; diff --git a/app/src/main/java/com/dante/diary/custom/NotificationUtils.java b/app/src/main/java/com/dante/diary/custom/NotificationUtils.java index 2f8f014..60394e7 100644 --- a/app/src/main/java/com/dante/diary/custom/NotificationUtils.java +++ b/app/src/main/java/com/dante/diary/custom/NotificationUtils.java @@ -6,7 +6,6 @@ import android.app.TaskStackBuilder; import android.content.Context; import android.content.Intent; -import android.support.v4.app.NotificationCompat; import com.dante.diary.R; import com.dante.diary.chat.ConversationActivity; @@ -15,6 +14,8 @@ import java.util.LinkedList; import java.util.List; +import androidx.core.app.NotificationCompat; + import static com.dante.diary.base.App.context; /** diff --git a/app/src/main/java/com/dante/diary/custom/PickPictureActivity.java b/app/src/main/java/com/dante/diary/custom/PickPictureActivity.java index c13a1c2..30b6810 100644 --- a/app/src/main/java/com/dante/diary/custom/PickPictureActivity.java +++ b/app/src/main/java/com/dante/diary/custom/PickPictureActivity.java @@ -7,7 +7,6 @@ import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; -import android.support.v7.app.AppCompatActivity; import android.util.Log; import com.blankj.utilcode.utils.FileUtils; @@ -22,6 +21,7 @@ import java.io.InputStream; import java.io.OutputStream; +import androidx.appcompat.app.AppCompatActivity; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; @@ -56,6 +56,7 @@ private void pick() { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { photoUri = data.getData(); diff --git a/app/src/main/java/com/dante/diary/custom/RecordView.java b/app/src/main/java/com/dante/diary/custom/RecordView.java index 6e6f60a..82387f5 100644 --- a/app/src/main/java/com/dante/diary/custom/RecordView.java +++ b/app/src/main/java/com/dante/diary/custom/RecordView.java @@ -11,7 +11,6 @@ import android.graphics.PixelFormat; import android.graphics.drawable.Drawable; import android.os.Handler; -import android.support.annotation.Nullable; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; @@ -19,6 +18,9 @@ import com.dante.diary.R; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; + /** * 录音自定义view @@ -100,7 +102,7 @@ private void initView() { invalidate(); mHandler.postDelayed(refresh, SPREAD_SIZE_UPDATE_TIME); }; - bg = mContext.getResources().getDrawable(R.drawable.ic_mic_white_36px, mContext.getTheme()); + bg = ContextCompat.getDrawable(mContext, (R.drawable.ic_mic_white_36px)); bitmapBg = drawableToBitmap(bg); mRecordViewBgPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mRecordViewBgPaint.setColor(mContext.getResources().getColor(R.color.colorPrimary)); diff --git a/app/src/main/java/com/dante/diary/detail/DiariesViewerActivity.java b/app/src/main/java/com/dante/diary/detail/DiariesViewerActivity.java index e68d626..e1a96b8 100644 --- a/app/src/main/java/com/dante/diary/detail/DiariesViewerActivity.java +++ b/app/src/main/java/com/dante/diary/detail/DiariesViewerActivity.java @@ -2,11 +2,6 @@ import android.os.Build; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentStatePagerAdapter; -import android.support.v4.view.ViewPager; import android.transition.Slide; import android.view.Gravity; @@ -19,6 +14,11 @@ import java.util.ArrayList; import java.util.List; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentStatePagerAdapter; +import androidx.viewpager.widget.ViewPager; import butterknife.BindView; import io.realm.Sort; diff --git a/app/src/main/java/com/dante/diary/detail/DiaryCommentsAdapter.java b/app/src/main/java/com/dante/diary/detail/DiaryCommentsAdapter.java index fb3b079..7b8eb9f 100644 --- a/app/src/main/java/com/dante/diary/detail/DiaryCommentsAdapter.java +++ b/app/src/main/java/com/dante/diary/detail/DiaryCommentsAdapter.java @@ -17,8 +17,6 @@ import butterknife.BindView; import jp.wasabeef.glide.transformations.CropCircleTransformation; -import static com.dante.diary.base.App.context; - /** * Created by yons on 17/3/10. */ @@ -70,7 +68,7 @@ protected void convert(BaseViewHolder helper, Comment item) { //评论用户的头像 Glide.with(helper.itemView.getContext()) .load(item.getUser().getAvatarUrl()) - .bitmapTransform(new CropCircleTransformation(context)) + .transform(new CropCircleTransformation()) .into((ImageView) helper.getView(R.id.commentAvatar)); } } diff --git a/app/src/main/java/com/dante/diary/detail/DiaryDetailFragment.java b/app/src/main/java/com/dante/diary/detail/DiaryDetailFragment.java index f2c1fff..80caa21 100644 --- a/app/src/main/java/com/dante/diary/detail/DiaryDetailFragment.java +++ b/app/src/main/java/com/dante/diary/detail/DiaryDetailFragment.java @@ -6,18 +6,9 @@ import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.TextInputLayout; -import android.support.v4.app.Fragment; -import android.support.v4.content.ContextCompat; -import android.support.v4.view.MenuItemCompat; -import android.support.v4.widget.NestedScrollView; -import android.support.v4.widget.SwipeRefreshLayout; -import android.support.v7.widget.RecyclerView; -import android.support.v7.widget.ShareActionProvider; -import android.support.v7.widget.Toolbar; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -35,7 +26,8 @@ import com.blankj.utilcode.utils.ClipboardUtils; import com.blankj.utilcode.utils.IntentUtils; import com.bumptech.glide.Glide; -import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.target.Target; import com.chad.library.adapter.base.BaseQuickAdapter; @@ -59,6 +51,8 @@ import com.dante.diary.utils.TransitionHelper; import com.dante.diary.utils.UiUtils; import com.dante.diary.utils.WrapContentLinearLayoutManager; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.textfield.TextInputLayout; import com.jaychang.st.SimpleText; import org.json.JSONException; @@ -68,6 +62,15 @@ import java.util.HashMap; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.ShareActionProvider; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; +import androidx.core.view.MenuItemCompat; +import androidx.core.widget.NestedScrollView; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import butterknife.BindView; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; @@ -388,7 +391,7 @@ private void inflateDiary() { if (diary.getUser() != null) { Glide.with(this).load(diary.getUser().getAvatarUrl()) - .bitmapTransform(new RoundedCornersTransformation(getContext(), 5, 0)) + .transform(new RoundedCornersTransformation(5, 0)) .into(myAvatar); } getActivity().supportPostponeEnterTransition(); @@ -418,15 +421,15 @@ private void initPicture() { if (!TextUtils.isEmpty(diary.getPhotoThumbUrl())) { boolean gif = diary.getPhotoUrl().endsWith(".gif"); isGif.setVisibility(View.GONE); - Glide.with(this).load(diary.getPhotoThumbUrl()).asBitmap().error(R.drawable.error_holder) - .listener(new RequestListener() { + Glide.with(this).asBitmap().load(diary.getPhotoThumbUrl()).error(R.drawable.error_holder) + .listener(new RequestListener() { @Override - public boolean onException(Exception e, String model, Target target, boolean isFirstResource) { + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { return false; } @Override - public boolean onResourceReady(Bitmap resource, String model, Target target, boolean isFromMemoryCache, boolean isFirstResource) { + public boolean onResourceReady(Bitmap resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { attachPicture.setVisibility(View.VISIBLE); if (gif) { isGif.setVisibility(View.VISIBLE); @@ -446,15 +449,15 @@ public boolean onResourceReady(Bitmap resource, String model, Target tar } final ProgressBar progressBar = ImageProgresser.attachProgress(attachPicture); - Glide.with(this).load(diary.getPhotoUrl()).listener(new RequestListener() { + Glide.with(this).load(diary.getPhotoUrl()).listener(new RequestListener() { @Override - public boolean onException(Exception e, String model, Target target, boolean isFirstResource) { + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { progressBar.setVisibility(View.GONE); return false; } @Override - public boolean onResourceReady(GlideDrawable resource, String model, Target target, boolean isFromMemoryCache, boolean isFirstResource) { + public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { progressBar.setVisibility(View.GONE); TransitionHelper.startViewer(getActivity(), attachPicture, diary.getPhotoUrl()); return false; diff --git a/app/src/main/java/com/dante/diary/detail/PictureActivity.java b/app/src/main/java/com/dante/diary/detail/PictureActivity.java index 414b347..efb0375 100644 --- a/app/src/main/java/com/dante/diary/detail/PictureActivity.java +++ b/app/src/main/java/com/dante/diary/detail/PictureActivity.java @@ -1,14 +1,14 @@ package com.dante.diary.detail; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.design.widget.CoordinatorLayout; -import android.support.v4.app.Fragment; import com.dante.diary.R; import com.dante.diary.base.BaseActivity; import com.dante.diary.base.Constants; +import androidx.annotation.Nullable; +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.fragment.app.Fragment; import butterknife.BindView; public class PictureActivity extends BaseActivity { diff --git a/app/src/main/java/com/dante/diary/detail/PictureFragment.java b/app/src/main/java/com/dante/diary/detail/PictureFragment.java index 6bb94b7..02300ef 100644 --- a/app/src/main/java/com/dante/diary/detail/PictureFragment.java +++ b/app/src/main/java/com/dante/diary/detail/PictureFragment.java @@ -6,16 +6,16 @@ import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.view.ViewCompat; import android.view.View; import com.bumptech.glide.Glide; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.load.resource.gif.GifDrawable; import com.bumptech.glide.request.RequestListener; -import com.bumptech.glide.request.animation.GlideAnimation; import com.bumptech.glide.request.target.SimpleTarget; import com.bumptech.glide.request.target.Target; +import com.bumptech.glide.request.transition.Transition; import com.dante.diary.R; import com.dante.diary.base.BaseFragment; import com.dante.diary.base.Constants; @@ -26,6 +26,12 @@ import com.dante.diary.utils.UiUtils; import com.tbruyelle.rxpermissions.RxPermissions; +import java.util.Objects; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.view.ViewCompat; +import androidx.fragment.app.Fragment; import butterknife.BindView; import ooo.oxo.library.widget.TouchImageView; import rx.Observable; @@ -74,19 +80,19 @@ protected int initLayoutId() { protected void initViews() { url = getArguments().getString(Constants.URL); isGif = getArguments().getBoolean("isGif", false); - log("initviews" + url); if (isGif) { - Glide.with(this).load(url).asGif().listener(new RequestListener() { + Glide.with(this).asGif().load(url).listener(new RequestListener() { @Override - public boolean onException(Exception e, String model, Target target, boolean isFirstResource) { + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { getActivity().onBackPressed(); return false; } @Override - public boolean onResourceReady(GifDrawable resource, String model, Target target, boolean isFromMemoryCache, boolean isFirstResource) { + public boolean onResourceReady(GifDrawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { return false; } + }).into(imageView); imageView.setDoubleTapEnabled(false); } else { @@ -96,9 +102,10 @@ public boolean onResourceReady(GifDrawable resource, String model, Target getActivity().onBackPressed()); + imageView.setSingleTapListener(() -> Objects.requireNonNull(getActivity()).onBackPressed()); if (!isGif) imageView.setOnLongClickListener(this); } @@ -106,18 +113,19 @@ private void load(String url) { Imager.loadDefer(this, url, new SimpleTarget() { @Override - public void onLoadFailed(Exception e, Drawable errorDrawable) { + public void onLoadFailed(@Nullable Drawable errorDrawable) { + super.onLoadFailed(errorDrawable); imageView.setImageResource(R.drawable.error_holder); UiUtils.showSnackLong(imageView, R.string.picture_load_fail, R.string.retry, v -> load(url)); } @Override - public void onResourceReady(Bitmap b, GlideAnimation arg1) { - imageView.setImageBitmap(b); - + public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { + imageView.setImageBitmap(resource); startTransition(); - bitmap = b; + bitmap = resource; + } }); } diff --git a/app/src/main/java/com/dante/diary/draw/DrawActivity.java b/app/src/main/java/com/dante/diary/draw/DrawActivity.java index d0efce4..ca6fdc2 100644 --- a/app/src/main/java/com/dante/diary/draw/DrawActivity.java +++ b/app/src/main/java/com/dante/diary/draw/DrawActivity.java @@ -6,8 +6,6 @@ import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.design.widget.Snackbar; import android.view.Menu; import android.view.MenuItem; @@ -23,10 +21,12 @@ import com.dante.diary.draw.dialogs.SelectChoiceDialog; import com.dante.diary.utils.BitmapUtil; import com.dante.diary.utils.UiUtils; +import com.google.android.material.snackbar.Snackbar; import com.tbruyelle.rxpermissions.RxPermissions; import java.io.File; +import androidx.annotation.Nullable; import butterknife.BindView; import io.github.yavski.fabspeeddial.FabSpeedDial; import io.github.yavski.fabspeeddial.SimpleMenuListenerAdapter; diff --git a/app/src/main/java/com/dante/diary/draw/dialogs/DrawAttribsDialog.java b/app/src/main/java/com/dante/diary/draw/dialogs/DrawAttribsDialog.java index d3c71dd..a0fed15 100644 --- a/app/src/main/java/com/dante/diary/draw/dialogs/DrawAttribsDialog.java +++ b/app/src/main/java/com/dante/diary/draw/dialogs/DrawAttribsDialog.java @@ -4,11 +4,6 @@ import android.graphics.Color; import android.graphics.Paint; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.AppCompatRadioButton; -import android.support.v7.widget.AppCompatSeekBar; import android.view.LayoutInflater; import android.view.View; import android.widget.CompoundButton; @@ -17,6 +12,12 @@ import com.dante.diary.R; +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.widget.AppCompatRadioButton; +import androidx.appcompat.widget.AppCompatSeekBar; +import androidx.fragment.app.DialogFragment; + /** * Created by Ing. Oscar G. Medina Cruz on 07/11/2016. @@ -44,18 +45,18 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { .inflate(R.layout.layout_draw_attribs, null); final View previewColor = view.findViewById(R.id.preview_color); - final AppCompatSeekBar seekBarRed = (AppCompatSeekBar) view.findViewById(R.id.acsb_red); - final AppCompatSeekBar seekBarGreen = (AppCompatSeekBar) view.findViewById(R.id.acsb_green); - final AppCompatSeekBar seekBarBlue = (AppCompatSeekBar) view.findViewById(R.id.acsb_blue); - final TextView textViewRedValue = (TextView) view.findViewById(R.id.tv_current_red); - final TextView textViewGreenValue = (TextView) view.findViewById(R.id.tv_current_green); - final TextView textViewBlueValue = (TextView) view.findViewById(R.id.tv_current_blue); - AppCompatSeekBar seekBarStrokeWidth = (AppCompatSeekBar) view.findViewById(R.id.acsb_stroke_width); - final TextView textViewStrokeWidth = (TextView) view.findViewById(R.id.tv_stroke_width); - AppCompatSeekBar seekBarOpacity = (AppCompatSeekBar) view.findViewById(R.id.acsb_opacity); - final TextView textViewOpacity = (TextView) view.findViewById(R.id.tv_opacity); - AppCompatRadioButton appCompatRadioButtonFill = (AppCompatRadioButton) view.findViewById(R.id.rb_fill); - AppCompatRadioButton appCompatRadioButtonStroke = (AppCompatRadioButton) view.findViewById(R.id.rb_stroke); + final AppCompatSeekBar seekBarRed = view.findViewById(R.id.acsb_red); + final AppCompatSeekBar seekBarGreen = view.findViewById(R.id.acsb_green); + final AppCompatSeekBar seekBarBlue = view.findViewById(R.id.acsb_blue); + final TextView textViewRedValue = view.findViewById(R.id.tv_current_red); + final TextView textViewGreenValue = view.findViewById(R.id.tv_current_green); + final TextView textViewBlueValue = view.findViewById(R.id.tv_current_blue); + AppCompatSeekBar seekBarStrokeWidth = view.findViewById(R.id.acsb_stroke_width); + final TextView textViewStrokeWidth = view.findViewById(R.id.tv_stroke_width); + AppCompatSeekBar seekBarOpacity = view.findViewById(R.id.acsb_opacity); + final TextView textViewOpacity = view.findViewById(R.id.tv_opacity); + AppCompatRadioButton appCompatRadioButtonFill = view.findViewById(R.id.rb_fill); + AppCompatRadioButton appCompatRadioButtonStroke = view.findViewById(R.id.rb_stroke); // final AppCompatSeekBar seekBarFontSize = (AppCompatSeekBar) view.findViewById(R.id.acsb_font_size); // final TextView textViewFontSize = (TextView) view.findViewById(R.id.tv_font_size); // AppCompatCheckBox appCompatCheckBoxAntiAlias = (AppCompatCheckBox) view.findViewById(R.id.chb_anti_alias); diff --git a/app/src/main/java/com/dante/diary/draw/dialogs/RequestTextDialog.java b/app/src/main/java/com/dante/diary/draw/dialogs/RequestTextDialog.java index 779d3f8..15c18a8 100644 --- a/app/src/main/java/com/dante/diary/draw/dialogs/RequestTextDialog.java +++ b/app/src/main/java/com/dante/diary/draw/dialogs/RequestTextDialog.java @@ -4,13 +4,14 @@ import android.app.Dialog; import android.graphics.Bitmap; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.design.widget.TextInputEditText; -import android.support.v4.app.DialogFragment; import android.view.LayoutInflater; import android.view.View; import com.dante.diary.R; +import com.google.android.material.textfield.TextInputEditText; + +import androidx.annotation.NonNull; +import androidx.fragment.app.DialogFragment; /** @@ -43,7 +44,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) { View view = LayoutInflater.from(getContext()) .inflate(R.layout.layout_request_text, null); - final TextInputEditText textInputEditText = (TextInputEditText) view.findViewById(R.id.et_req_text); + final TextInputEditText textInputEditText = view.findViewById(R.id.et_req_text); if (!getArguments().getString(REQ_TEXT).equals("")) textInputEditText.setText(getArguments().getShort(REQ_TEXT)); diff --git a/app/src/main/java/com/dante/diary/draw/dialogs/SaveBitmapDialog.java b/app/src/main/java/com/dante/diary/draw/dialogs/SaveBitmapDialog.java index b9d6c91..85a9508 100644 --- a/app/src/main/java/com/dante/diary/draw/dialogs/SaveBitmapDialog.java +++ b/app/src/main/java/com/dante/diary/draw/dialogs/SaveBitmapDialog.java @@ -5,9 +5,6 @@ import android.graphics.Bitmap; import android.os.Bundle; import android.os.Environment; -import android.support.annotation.NonNull; -import android.support.design.widget.TextInputEditText; -import android.support.v4.app.DialogFragment; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; @@ -17,12 +14,16 @@ import com.dante.diary.R; import com.dante.diary.utils.DateUtil; +import com.google.android.material.textfield.TextInputEditText; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Date; +import androidx.annotation.NonNull; +import androidx.fragment.app.DialogFragment; + /** * Created by Ing. Oscar G. Medina Cruz on 09/11/2016. */ @@ -47,8 +48,8 @@ public static SaveBitmapDialog newInstance() { public Dialog onCreateDialog(Bundle savedInstanceState) { View view = LayoutInflater.from(getContext()) .inflate(R.layout.layout_save_bitmap, null); - ImageView imageView = (ImageView) view.findViewById(R.id.iv_capture_preview); - final TextInputEditText textInputEditText = (TextInputEditText) view.findViewById(R.id.et_file_name); + ImageView imageView = view.findViewById(R.id.iv_capture_preview); + final TextInputEditText textInputEditText = view.findViewById(R.id.et_file_name); fileName = DateUtil.getDisplayDay(new Date()); if (mPreviewBitmap != null) imageView.setImageBitmap(mPreviewBitmap); diff --git a/app/src/main/java/com/dante/diary/draw/dialogs/SelectChoiceDialog.java b/app/src/main/java/com/dante/diary/draw/dialogs/SelectChoiceDialog.java index 5b9ab7d..d4a1298 100644 --- a/app/src/main/java/com/dante/diary/draw/dialogs/SelectChoiceDialog.java +++ b/app/src/main/java/com/dante/diary/draw/dialogs/SelectChoiceDialog.java @@ -3,9 +3,10 @@ import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.app.DialogFragment; -import android.support.v7.app.AlertDialog; + +import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.DialogFragment; /** * Created by Ing. Oscar G. Medina Cruz on 07/11/2016. diff --git a/app/src/main/java/com/dante/diary/edit/EditDiaryActivity.java b/app/src/main/java/com/dante/diary/edit/EditDiaryActivity.java index a787a16..a9fca10 100644 --- a/app/src/main/java/com/dante/diary/edit/EditDiaryActivity.java +++ b/app/src/main/java/com/dante/diary/edit/EditDiaryActivity.java @@ -12,9 +12,6 @@ import android.os.Environment; import android.os.Handler; import android.provider.MediaStore; -import android.support.annotation.Nullable; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.AppCompatDelegate; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -62,6 +59,9 @@ import java.util.Random; import java.util.concurrent.ExecutionException; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.core.content.ContextCompat; import butterknife.BindView; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; diff --git a/app/src/main/java/com/dante/diary/edit/EditNotebookActivity.java b/app/src/main/java/com/dante/diary/edit/EditNotebookActivity.java index 10d81d9..8c9021f 100644 --- a/app/src/main/java/com/dante/diary/edit/EditNotebookActivity.java +++ b/app/src/main/java/com/dante/diary/edit/EditNotebookActivity.java @@ -11,14 +11,6 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.support.annotation.Nullable; -import android.support.design.widget.AppBarLayout; -import android.support.design.widget.TextInputEditText; -import android.support.design.widget.TextInputLayout; -import android.support.v4.content.ContextCompat; -import android.support.v4.view.ViewCompat; -import android.support.v7.app.AppCompatDelegate; -import android.support.v7.widget.Toolbar; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -36,8 +28,8 @@ import com.blankj.utilcode.utils.KeyboardUtils; import com.bumptech.glide.Glide; -import com.bumptech.glide.request.animation.GlideAnimation; import com.bumptech.glide.request.target.SimpleTarget; +import com.bumptech.glide.request.transition.Transition; import com.dante.diary.R; import com.dante.diary.base.BaseActivity; import com.dante.diary.base.Constants; @@ -48,12 +40,21 @@ import com.dante.diary.net.NetService; import com.dante.diary.utils.DateUtil; import com.dante.diary.utils.UiUtils; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.textfield.TextInputEditText; +import com.google.android.material.textfield.TextInputLayout; import java.io.File; import java.util.Calendar; import java.util.Date; import java.util.HashMap; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.appcompat.widget.Toolbar; +import androidx.core.content.ContextCompat; +import androidx.core.view.ViewCompat; import butterknife.BindView; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; @@ -204,18 +205,19 @@ private void initCover() { if (isEditMode) { ViewCompat.setTransitionName(notebookCover, String.valueOf(notebookId)); Glide.with(this) - .load(notebook.getCoverUrl()) .asBitmap() + .load(notebook.getCoverUrl()) .error(R.drawable.portrait_holder) .into(new SimpleTarget() { @Override - public void onLoadFailed(Exception e, Drawable errorDrawable) { + public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { + notebookCover.setImageBitmap(resource); supportStartPostponedEnterTransition(); } @Override - public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) { - notebookCover.setImageBitmap(resource); + public void onLoadFailed(@Nullable Drawable errorDrawable) { + super.onLoadFailed(errorDrawable); supportStartPostponedEnterTransition(); } }); diff --git a/app/src/main/java/com/dante/diary/follow/FollowListFragment.java b/app/src/main/java/com/dante/diary/follow/FollowListFragment.java index 613fdf3..a7f2ebd 100644 --- a/app/src/main/java/com/dante/diary/follow/FollowListFragment.java +++ b/app/src/main/java/com/dante/diary/follow/FollowListFragment.java @@ -2,9 +2,6 @@ import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.LinearLayoutManager; import android.view.View; import android.view.ViewGroup; @@ -20,6 +17,9 @@ import java.util.List; +import androidx.appcompat.app.AlertDialog; +import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.LinearLayoutManager; import rx.Observable; /** diff --git a/app/src/main/java/com/dante/diary/follow/TabsFragment.java b/app/src/main/java/com/dante/diary/follow/TabsFragment.java index 89e16a3..04abcd7 100644 --- a/app/src/main/java/com/dante/diary/follow/TabsFragment.java +++ b/app/src/main/java/com/dante/diary/follow/TabsFragment.java @@ -2,9 +2,6 @@ import android.graphics.Typeface; import android.os.Bundle; -import android.support.design.widget.TabLayout; -import android.support.v4.content.ContextCompat; -import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.TextView; @@ -17,10 +14,13 @@ import com.dante.diary.login.LoginManager; import com.dante.diary.notification.NotificationListFragment; import com.dante.diary.profile.DiaryListFragment; +import com.google.android.material.tabs.TabLayout; import java.util.ArrayList; import java.util.List; +import androidx.core.content.ContextCompat; +import androidx.viewpager.widget.ViewPager; import butterknife.BindView; import static com.dante.diary.base.App.context; diff --git a/app/src/main/java/com/dante/diary/login/LoginActivity.java b/app/src/main/java/com/dante/diary/login/LoginActivity.java index 58e84c2..f17575c 100644 --- a/app/src/main/java/com/dante/diary/login/LoginActivity.java +++ b/app/src/main/java/com/dante/diary/login/LoginActivity.java @@ -5,12 +5,6 @@ import android.content.Intent; import android.os.Bundle; import android.os.Handler; -import android.support.annotation.Nullable; -import android.support.design.widget.TextInputEditText; -import android.support.design.widget.TextInputLayout; -import android.support.v4.view.ViewCompat; -import android.support.v4.view.ViewPropertyAnimatorCompat; -import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -37,21 +31,29 @@ import com.dante.diary.main.MainActivity; import com.dante.diary.model.DataBase; import com.dante.diary.model.User; +import com.dante.diary.net.API; import com.dante.diary.net.HttpErrorAction; import com.dante.diary.setting.SettingFragment; +import com.dante.diary.utils.AppUtil; import com.dante.diary.utils.DateUtil; import com.dante.diary.utils.SpUtil; import com.dante.diary.utils.UiUtils; +import com.google.android.material.textfield.TextInputEditText; +import com.google.android.material.textfield.TextInputLayout; import java.util.Date; import java.util.List; +import androidx.annotation.Nullable; +import androidx.core.view.ViewCompat; +import androidx.core.view.ViewPropertyAnimatorCompat; +import androidx.core.view.ViewPropertyAnimatorListenerAdapter; import butterknife.BindView; import top.wefor.circularanim.CircularAnim; public class LoginActivity extends BaseActivity implements PatternLockViewListener { public static final int STARTUP_DELAY = 400; - public static final int ANIM_DURATION = 1200; + public static final int ANIM_DURATION = 1000; public static final int ITEM_DELAY = 300; private static final String TAG = "LoginActivity"; @BindView(R.id.account) @@ -68,6 +70,8 @@ public class LoginActivity extends BaseActivity implements PatternLockViewListen Button login; @BindView(R.id.register) Button register; + @BindView(R.id.getBackPassword) + TextView getBackPassword; @BindView(R.id.container) LinearLayout container; @BindView(R.id.timePill) @@ -90,7 +94,7 @@ public class LoginActivity extends BaseActivity implements PatternLockViewListen TextInputLayout nameWrapper; @BindView(R.id.pattern_lock) PatternLockView patternView; - private int LOGO_TRANSLATION_Y = -600; + private int LOGO_TRANSLATION_Y = -700; private String nickName; private String password; private int id; @@ -201,6 +205,12 @@ private void init() { password = SpUtil.getString(Constants.PASSWORD); accountEt.setText(emailAccount); pswEt.setText(password); + getBackPassword.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + AppUtil.openBrowser(LoginActivity.this, API.RESET_PASSWORD); + } + }); login.setOnClickListener(v -> { moveSlogan(); CircularAnim.show(reveal).triggerView(login).duration(300).go(() -> { diff --git a/app/src/main/java/com/dante/diary/main/MainActivity.java b/app/src/main/java/com/dante/diary/main/MainActivity.java index 00c35ec..42c68ed 100644 --- a/app/src/main/java/com/dante/diary/main/MainActivity.java +++ b/app/src/main/java/com/dante/diary/main/MainActivity.java @@ -3,7 +3,6 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.support.annotation.Nullable; import android.util.Log; import com.dante.diary.R; @@ -18,6 +17,8 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import androidx.annotation.Nullable; + public class MainActivity extends BottomBarActivity { private static final String TAG = "MainActivity"; private Updater updater; diff --git a/app/src/main/java/com/dante/diary/main/MainDiaryFragment.java b/app/src/main/java/com/dante/diary/main/MainDiaryFragment.java index df15fb1..1a51035 100644 --- a/app/src/main/java/com/dante/diary/main/MainDiaryFragment.java +++ b/app/src/main/java/com/dante/diary/main/MainDiaryFragment.java @@ -7,15 +7,10 @@ import android.app.UiModeManager; import android.content.Context; import android.content.Intent; +import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.support.design.internal.NavigationMenu; -import android.support.design.widget.AppBarLayout; -import android.support.design.widget.CollapsingToolbarLayout; -import android.support.design.widget.CoordinatorLayout; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.Menu; import android.view.MenuInflater; @@ -27,7 +22,8 @@ import android.widget.Toast; import com.bumptech.glide.Glide; -import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.target.Target; import com.chad.library.adapter.base.BaseQuickAdapter; @@ -56,11 +52,19 @@ import com.dante.diary.utils.TransitionHelper; import com.dante.diary.utils.UiUtils; import com.dante.diary.utils.WrapContentLinearLayoutManager; +import com.google.android.material.appbar.AppBarLayout; +import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.google.android.material.internal.NavigationMenu; import com.google.gson.Gson; import java.io.IOException; import java.util.List; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import io.github.yavski.fabspeeddial.FabSpeedDial; import io.github.yavski.fabspeeddial.SimpleMenuListenerAdapter; @@ -323,15 +327,15 @@ private void onPictureClicked(View view, int i) { } final ProgressBar progressBar = ImageProgresser.attachProgress(view); - Glide.with(this).load(url).listener(new RequestListener() { + Glide.with(this).load(url).listener(new RequestListener() { @Override - public boolean onException(Exception e, String model, Target target, boolean isFirstResource) { + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { progressBar.setVisibility(View.GONE); return false; } @Override - public boolean onResourceReady(GlideDrawable resource, String model, Target target, boolean isFromMemoryCache, boolean isFirstResource) { + public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { progressBar.setVisibility(View.GONE); TransitionHelper.startViewer(barActivity, view, url); return false; @@ -525,9 +529,10 @@ public boolean onOptionsItemSelected(MenuItem item) { UiUtils.showSnack(rootView, R.string.android_version_is_old); } else { UiModeManager modeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE); - boolean enableNight = !(modeManager.getNightMode() == UiModeManager.MODE_NIGHT_YES); - modeManager.setNightMode(enableNight ? UiModeManager.MODE_NIGHT_YES : UiModeManager.MODE_NIGHT_NO); + boolean enableNight = (modeManager.getNightMode() == UiModeManager.MODE_NIGHT_NO) || !SpUtil.getBoolean(Constants.IS_NIGHT); + AppCompatDelegate.setDefaultNightMode(enableNight ? AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO); SpUtil.save(Constants.IS_NIGHT, enableNight); +// Objects.requireNonNull(getActivity()).invalidateOptionsMenu(); } } else if (id == R.id.time_pill) { startActivity(new Intent(getActivity(), TimePillActivity.class)); diff --git a/app/src/main/java/com/dante/diary/net/API.java b/app/src/main/java/com/dante/diary/net/API.java index 433ae77..1b84f74 100644 --- a/app/src/main/java/com/dante/diary/net/API.java +++ b/app/src/main/java/com/dante/diary/net/API.java @@ -9,4 +9,5 @@ public class API { public static final String BASE_URL = "https://open.timepill.net/api/"; public static final String GITHUB_RAW = "http://raw.githubusercontent.com/DanteAndroid/TimePill/master/"; public static final String DOWNLOAD_BASE = "https://github.com/DanteAndroid/TimeDiary/releases/download/"; + public static final String RESET_PASSWORD = "https://v2.timepill.net/password/reset"; } diff --git a/app/src/main/java/com/dante/diary/net/HttpErrorAction.java b/app/src/main/java/com/dante/diary/net/HttpErrorAction.java index 3311726..41702be 100644 --- a/app/src/main/java/com/dante/diary/net/HttpErrorAction.java +++ b/app/src/main/java/com/dante/diary/net/HttpErrorAction.java @@ -1,12 +1,11 @@ package com.dante.diary.net; -import android.support.annotation.CallSuper; - import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; +import androidx.annotation.CallSuper; import retrofit2.adapter.rxjava.HttpException; import rx.functions.Action1; diff --git a/app/src/main/java/com/dante/diary/net/TimeApi.java b/app/src/main/java/com/dante/diary/net/TimeApi.java index dd63c80..eda7ee2 100644 --- a/app/src/main/java/com/dante/diary/net/TimeApi.java +++ b/app/src/main/java/com/dante/diary/net/TimeApi.java @@ -1,7 +1,5 @@ package com.dante.diary.net; -import android.support.annotation.Nullable; - import com.dante.diary.model.Comment; import com.dante.diary.model.Diary; import com.dante.diary.model.Notebook; @@ -11,6 +9,7 @@ import java.util.List; import java.util.Map; +import androidx.annotation.Nullable; import okhttp3.MultipartBody; import okhttp3.RequestBody; import okhttp3.ResponseBody; diff --git a/app/src/main/java/com/dante/diary/notification/NotificationListAdapter.java b/app/src/main/java/com/dante/diary/notification/NotificationListAdapter.java index 0f6d4ba..ac43808 100644 --- a/app/src/main/java/com/dante/diary/notification/NotificationListAdapter.java +++ b/app/src/main/java/com/dante/diary/notification/NotificationListAdapter.java @@ -1,6 +1,5 @@ package com.dante.diary.notification; -import android.support.v4.content.ContextCompat; import android.widget.TextView; import com.chad.library.adapter.base.BaseMultiItemQuickAdapter; @@ -12,6 +11,8 @@ import java.util.List; +import androidx.core.content.ContextCompat; + /** * Created by yons on 17/3/17. */ diff --git a/app/src/main/java/com/dante/diary/notification/NotificationListFragment.java b/app/src/main/java/com/dante/diary/notification/NotificationListFragment.java index b6ea236..2d2d4b6 100644 --- a/app/src/main/java/com/dante/diary/notification/NotificationListFragment.java +++ b/app/src/main/java/com/dante/diary/notification/NotificationListFragment.java @@ -1,7 +1,5 @@ package com.dante.diary.notification; -import android.support.v4.content.ContextCompat; -import android.support.v7.widget.LinearLayoutManager; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; @@ -19,6 +17,9 @@ import java.io.IOException; import java.util.List; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.LinearLayoutManager; + /** * Created by yons on 17/3/17. */ diff --git a/app/src/main/java/com/dante/diary/profile/DiaryListFragment.java b/app/src/main/java/com/dante/diary/profile/DiaryListFragment.java index 7de8065..7cec192 100644 --- a/app/src/main/java/com/dante/diary/profile/DiaryListFragment.java +++ b/app/src/main/java/com/dante/diary/profile/DiaryListFragment.java @@ -3,11 +3,9 @@ import android.Manifest; import android.app.Activity; import android.content.Intent; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Environment; -import android.support.design.widget.FloatingActionButton; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; @@ -19,7 +17,8 @@ import com.blankj.utilcode.utils.FileUtils; import com.bumptech.glide.Glide; -import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.target.Target; import com.chad.library.adapter.base.BaseQuickAdapter; @@ -45,6 +44,7 @@ import com.dante.diary.utils.SpUtil; import com.dante.diary.utils.TransitionHelper; import com.dante.diary.utils.UiUtils; +import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.gson.Gson; import com.tbruyelle.rxpermissions.RxPermissions; @@ -52,6 +52,9 @@ import java.util.Collections; import java.util.List; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; import io.realm.Sort; import rx.Observable; @@ -190,17 +193,18 @@ private void onPictureClicked(View view, int i) { } final ProgressBar progressBar = ImageProgresser.attachProgress(view); - Glide.with(this).load(url).listener(new RequestListener() { + Glide.with(this).load(url).listener(new RequestListener() { @Override - public boolean onException(Exception e, String model, Target target, boolean isFirstResource) { + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { progressBar.setVisibility(View.GONE); return false; } @Override - public boolean onResourceReady(GlideDrawable resource, String model, Target target, boolean isFromMemoryCache, boolean isFirstResource) { + public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { progressBar.setVisibility(View.GONE); TransitionHelper.startViewer(getActivity(), view, url); + return false; } }).preload(); diff --git a/app/src/main/java/com/dante/diary/profile/NoteBookListFragment.java b/app/src/main/java/com/dante/diary/profile/NoteBookListFragment.java index 360796b..41fc82b 100644 --- a/app/src/main/java/com/dante/diary/profile/NoteBookListFragment.java +++ b/app/src/main/java/com/dante/diary/profile/NoteBookListFragment.java @@ -2,11 +2,6 @@ import android.content.Intent; import android.os.Bundle; -import android.support.v4.app.ActivityCompat; -import android.support.v4.app.ActivityOptionsCompat; -import android.support.v4.view.ViewCompat; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.StaggeredGridLayoutManager; import android.text.TextUtils; import android.util.Log; import android.view.MenuInflater; @@ -34,6 +29,11 @@ import java.io.IOException; import java.util.Locale; +import androidx.appcompat.app.AlertDialog; +import androidx.core.app.ActivityCompat; +import androidx.core.app.ActivityOptionsCompat; +import androidx.core.view.ViewCompat; +import androidx.recyclerview.widget.StaggeredGridLayoutManager; import butterknife.BindView; import io.realm.RealmResults; diff --git a/app/src/main/java/com/dante/diary/profile/NotebookListAdapter.java b/app/src/main/java/com/dante/diary/profile/NotebookListAdapter.java index d0a8a78..402ea03 100644 --- a/app/src/main/java/com/dante/diary/profile/NotebookListAdapter.java +++ b/app/src/main/java/com/dante/diary/profile/NotebookListAdapter.java @@ -1,7 +1,6 @@ package com.dante.diary.profile; import android.content.Context; -import android.support.v4.content.ContextCompat; import android.view.View; import android.widget.ImageView; import android.widget.TextView; @@ -15,6 +14,8 @@ import java.util.List; +import androidx.core.content.ContextCompat; + /** * Created by yons on 17/3/9. */ diff --git a/app/src/main/java/com/dante/diary/profile/ProfileFragment.java b/app/src/main/java/com/dante/diary/profile/ProfileFragment.java index 2fc4fc2..2e8662e 100644 --- a/app/src/main/java/com/dante/diary/profile/ProfileFragment.java +++ b/app/src/main/java/com/dante/diary/profile/ProfileFragment.java @@ -7,16 +7,7 @@ import android.content.res.ColorStateList; import android.graphics.Typeface; import android.os.Bundle; -import android.support.design.internal.NavigationMenu; -import android.support.design.widget.CollapsingToolbarLayout; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.TabLayout; -import android.support.v4.app.Fragment; -import android.support.v4.content.ContextCompat; -import android.support.v4.view.ViewPager; import android.text.TextUtils; -import android.transition.Explode; -import android.transition.Transition; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -49,11 +40,18 @@ import com.dante.diary.utils.DateUtil; import com.dante.diary.utils.SpUtil; import com.dante.diary.utils.UiUtils; +import com.google.android.material.appbar.CollapsingToolbarLayout; +import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.google.android.material.internal.NavigationMenu; +import com.google.android.material.tabs.TabLayout; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import androidx.core.content.ContextCompat; +import androidx.fragment.app.Fragment; +import androidx.viewpager.widget.ViewPager; import butterknife.BindView; import io.github.yavski.fabspeeddial.FabSpeedDial; import io.github.yavski.fabspeeddial.SimpleMenuListenerAdapter; @@ -131,10 +129,6 @@ protected boolean needNavigation() { return false; } - @Override - protected Transition initTransitions() { - return new Explode(); - } @Override protected int initLayoutId() { @@ -213,7 +207,7 @@ private void loadProfile() { progress.setVisibility(View.GONE); Glide.with(this) .load(user.getAvatarUrl()) - .bitmapTransform(new RoundedCornersTransformation(getContext(), 5, 0)) + .transform(new RoundedCornersTransformation(5, 0)) .into(avatar); if (!LoginManager.isMe(id)) { diff --git a/app/src/main/java/com/dante/diary/search/SearchActivity.java b/app/src/main/java/com/dante/diary/search/SearchActivity.java index 89fc7d0..0abc2fa 100644 --- a/app/src/main/java/com/dante/diary/search/SearchActivity.java +++ b/app/src/main/java/com/dante/diary/search/SearchActivity.java @@ -3,10 +3,6 @@ import android.app.SearchManager; import android.os.Bundle; import android.os.Handler; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.support.v4.view.MenuItemCompat; -import android.support.v7.widget.SearchView; import android.text.TextUtils; import android.util.Log; import android.view.Menu; @@ -18,6 +14,10 @@ import com.dante.diary.base.Constants; import com.dante.diary.profile.DiaryListFragment; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.SearchView; +import androidx.core.view.MenuItemCompat; +import androidx.fragment.app.Fragment; import rx.Observable; public class SearchActivity extends BaseActivity { diff --git a/app/src/main/java/com/dante/diary/setting/ProfilePreferenceFragment.java b/app/src/main/java/com/dante/diary/setting/ProfilePreferenceFragment.java index 836d3d2..e1aa113 100644 --- a/app/src/main/java/com/dante/diary/setting/ProfilePreferenceFragment.java +++ b/app/src/main/java/com/dante/diary/setting/ProfilePreferenceFragment.java @@ -2,6 +2,7 @@ import android.app.AlertDialog; import android.content.Intent; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.preference.EditTextPreference; @@ -9,13 +10,16 @@ import android.preference.Preference; import android.preference.PreferenceFragment; import android.view.MenuItem; +import android.view.View; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import com.blankj.utilcode.utils.ClipboardUtils; import com.bumptech.glide.Glide; -import com.bumptech.glide.load.resource.drawable.GlideDrawable; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; +import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions; import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.target.Target; import com.dante.diary.R; @@ -28,6 +32,7 @@ import java.io.File; +import androidx.annotation.Nullable; import rx.Subscription; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; @@ -89,16 +94,15 @@ private void retrievePicture(Uri uri, String path) { private void loadAvatar(User user) { Glide.with(getActivity()).load(user.getAvatarUrl()) - .crossFade() - .listener(new RequestListener() { - + .transition(DrawableTransitionOptions.withCrossFade()) + .listener(new RequestListener() { @Override - public boolean onException(Exception e, String model, Target target, boolean isFirstResource) { + public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { return false; } @Override - public boolean onResourceReady(GlideDrawable resource, String model, Target target, boolean isFromMemoryCache, boolean isFirstResource) { + public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { findPreference("avatar").setIcon(resource); return true; } @@ -156,7 +160,7 @@ public void onCreate(Bundle savedInstanceState) { break; default: if (introduction.startsWith("男。") || introduction.startsWith("女。")) { - introduction = introduction.substring(2, introduction.length()); + introduction = introduction.substring(2); } else { return true; } @@ -192,7 +196,7 @@ private void initUserInfo() { intro.setSummary(introduction); intro.setOnPreferenceClickListener(preference -> { AlertDialog dialog = new AlertDialog.Builder(getActivity()) - .setView(R.layout.intro_layout).setTitle(R.string.pref_intro) + .setView(View.inflate(getActivity(), R.layout.intro_layout, null)).setTitle(R.string.pref_intro) .create(); dialog.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); diff --git a/app/src/main/java/com/dante/diary/setting/SettingActivity.java b/app/src/main/java/com/dante/diary/setting/SettingActivity.java index f2e1bb8..644ec88 100755 --- a/app/src/main/java/com/dante/diary/setting/SettingActivity.java +++ b/app/src/main/java/com/dante/diary/setting/SettingActivity.java @@ -2,12 +2,13 @@ import android.os.Bundle; -import android.support.annotation.Nullable; import android.view.MenuItem; import com.dante.diary.R; import com.dante.diary.base.BaseActivity; +import androidx.annotation.Nullable; + public class SettingActivity extends BaseActivity { diff --git a/app/src/main/java/com/dante/diary/setting/SettingFragment.java b/app/src/main/java/com/dante/diary/setting/SettingFragment.java index d4cec83..7e48444 100755 --- a/app/src/main/java/com/dante/diary/setting/SettingFragment.java +++ b/app/src/main/java/com/dante/diary/setting/SettingFragment.java @@ -11,7 +11,6 @@ import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.SwitchPreference; -import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; @@ -47,6 +46,7 @@ import java.io.File; import java.util.List; +import androidx.appcompat.app.AppCompatActivity; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; @@ -312,7 +312,7 @@ private boolean clearCache() { private void sendFeedback() { AlertDialog dialog = new AlertDialog.Builder(getActivity()) - .setView(R.layout.intro_layout).setTitle(R.string.set_feedback) + .setView(View.inflate(getActivity(), R.layout.intro_layout, null)).setTitle(R.string.set_feedback) .create(); dialog.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); diff --git a/app/src/main/java/com/dante/diary/timepill/TimePillActivity.java b/app/src/main/java/com/dante/diary/timepill/TimePillActivity.java index c6a9462..80f1f80 100644 --- a/app/src/main/java/com/dante/diary/timepill/TimePillActivity.java +++ b/app/src/main/java/com/dante/diary/timepill/TimePillActivity.java @@ -3,7 +3,6 @@ import android.app.AlertDialog; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; import android.view.View; import android.widget.Button; import android.widget.EditText; @@ -23,6 +22,7 @@ import java.util.List; +import androidx.annotation.Nullable; import butterknife.BindView; import top.wefor.circularanim.CircularAnim; diff --git a/app/src/main/java/com/dante/diary/timepill/TimePillCreateActivity.java b/app/src/main/java/com/dante/diary/timepill/TimePillCreateActivity.java index 5367f12..a99269d 100644 --- a/app/src/main/java/com/dante/diary/timepill/TimePillCreateActivity.java +++ b/app/src/main/java/com/dante/diary/timepill/TimePillCreateActivity.java @@ -7,10 +7,6 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; -import android.support.annotation.Nullable; -import android.support.design.widget.TextInputEditText; -import android.support.design.widget.TextInputLayout; -import android.support.v4.content.ContextCompat; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -42,6 +38,8 @@ import com.dante.diary.utils.ImageProgresser; import com.dante.diary.utils.SpUtil; import com.dante.diary.utils.UiUtils; +import com.google.android.material.textfield.TextInputEditText; +import com.google.android.material.textfield.TextInputLayout; import com.tbruyelle.rxpermissions.RxPermissions; import java.io.FileNotFoundException; @@ -49,6 +47,8 @@ import java.util.Locale; import java.util.Random; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import butterknife.BindView; import rx.Subscription; diff --git a/app/src/main/java/com/dante/diary/timepill/TimePillOpenActivity.java b/app/src/main/java/com/dante/diary/timepill/TimePillOpenActivity.java index 9a61e2d..ed2a409 100644 --- a/app/src/main/java/com/dante/diary/timepill/TimePillOpenActivity.java +++ b/app/src/main/java/com/dante/diary/timepill/TimePillOpenActivity.java @@ -1,7 +1,6 @@ package com.dante.diary.timepill; import android.os.Bundle; -import android.support.annotation.Nullable; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -23,6 +22,7 @@ import java.util.Date; import java.util.Locale; +import androidx.annotation.Nullable; import butterknife.BindView; import hugo.weaving.DebugLog; @@ -56,9 +56,7 @@ public class TimePillOpenActivity extends BaseActivity { public static boolean isValid(String content) { if (!TextUtils.isEmpty(content) && content.length() >= KEY_LENGTH) { - if (content.contains(PREFIX)) { - return true; - } + return content.contains(PREFIX); } return false; } diff --git a/app/src/main/java/com/dante/diary/utils/DateUtil.java b/app/src/main/java/com/dante/diary/utils/DateUtil.java index f4c50a5..b674fb7 100644 --- a/app/src/main/java/com/dante/diary/utils/DateUtil.java +++ b/app/src/main/java/com/dante/diary/utils/DateUtil.java @@ -1,6 +1,5 @@ package com.dante.diary.utils; -import android.support.annotation.NonNull; import android.util.Log; import com.blankj.utilcode.utils.TimeUtils; @@ -11,6 +10,8 @@ import java.util.Date; import java.util.Locale; +import androidx.annotation.NonNull; + /** * deals with string work like copy, parse. */ diff --git a/app/src/main/java/com/dante/diary/utils/ImageProgresser.java b/app/src/main/java/com/dante/diary/utils/ImageProgresser.java index 3397930..fde7b38 100644 --- a/app/src/main/java/com/dante/diary/utils/ImageProgresser.java +++ b/app/src/main/java/com/dante/diary/utils/ImageProgresser.java @@ -1,13 +1,14 @@ package com.dante.diary.utils; import android.content.Context; -import android.support.annotation.NonNull; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.RelativeLayout; +import androidx.annotation.NonNull; + /** * Created by yons on 17/3/16. */ @@ -37,9 +38,8 @@ public static ProgressBar attachProgress(@NonNull View view, ProgressBar progres * 否则会出现图片和Progress都没显示的问题 * * @param view 需要添加Progress的view - * @param progressBar 自定义的Progressbar - * @param width 要添加Progress的view(图片没加载完)的宽(单位dp) - * @param height 要添加Progress的view(图片没加载完)的高(单位dp) + * @param widthInDp 要添加Progress的view(图片没加载完)的宽(单位dp) + * @param heightInDp 要添加Progress的view(图片没加载完)的高(单位dp) * @return 自定义的Progressbar,方便再次调用隐藏 */ @NonNull @@ -53,9 +53,8 @@ public static ProgressBar attachProgress(@NonNull View view, int widthInDp, int * 否则会出现图片和Progress都没显示的问题 * * @param view 需要添加Progress的view - * @param progressBar 自定义的Progressbar - * @param width 要添加Progress的view(图片没加载完)的宽(单位px) - * @param height 要添加Progress的view(图片没加载完)的高(单位px) + * @param widthInPx 要添加Progress的view(图片没加载完)的宽(单位px) + * @param heightInPx 要添加Progress的view(图片没加载完)的高(单位px) * @return 自定义的Progressbar,方便再次调用隐藏 */ @NonNull diff --git a/app/src/main/java/com/dante/diary/utils/Imager.java b/app/src/main/java/com/dante/diary/utils/Imager.java index 5b328c9..175f83b 100644 --- a/app/src/main/java/com/dante/diary/utils/Imager.java +++ b/app/src/main/java/com/dante/diary/utils/Imager.java @@ -3,17 +3,16 @@ import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; -import android.support.v4.app.Fragment; import android.widget.ImageView; import com.bumptech.glide.Glide; +import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions; +import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions; import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.target.SimpleTarget; import com.dante.diary.R; -import jp.wasabeef.glide.transformations.CropCircleTransformation; - -import static com.dante.diary.base.App.context; +import androidx.fragment.app.Fragment; /** * loading img encapsulation. @@ -23,18 +22,19 @@ public class Imager { public static void loadDefer(final Fragment context, String url, SimpleTarget target) { Glide.with(context) - .load(url) .asBitmap() + .load(url) .error(R.drawable.portrait_holder) .into(target); } - public static void load(final Context context, String url, ImageView target, RequestListener listener) { + public static void load(final Context context, String url, ImageView target, RequestListener listener) { Glide.with(context) - .load(url) .asBitmap() + .load(url) .error(R.drawable.error_holder) - .animate(R.anim.fade_in) + .transition(BitmapTransitionOptions.withCrossFade()) +// .animate(R.anim.fade_in) .listener(listener) .into(target); } @@ -45,15 +45,15 @@ public static void load(final Context context, String url, ImageView target) { Glide.with(context) .load(url) .placeholder(R.drawable.image_place_holder) - .animate(R.anim.fade_in) + .transition(DrawableTransitionOptions.withCrossFade()) .error(R.drawable.error_holder) .into(target); } - public static void load(final android.support.v4.app.Fragment fragment, String url, ImageView target) { + public static void load(final Fragment fragment, String url, ImageView target) { Glide.with(fragment) .load(url) - .crossFade() + .transition(DrawableTransitionOptions.withCrossFade()) .error(R.drawable.error_holder) .into(target); } @@ -65,26 +65,18 @@ public static void load(Context context, int resourceId, ImageView view) { } - public static void load(String url, int animationId, ImageView view) { - Glide.with(context) - .load(url) - .animate(animationId) - .into(view); - } public static void loadAvatar(Context context, String url, ImageView avatarView) { if (checkContext(context)) return; Glide.with(context).load(url) - .bitmapTransform(new CropCircleTransformation(context)) + .circleCrop() .into(avatarView); } private static boolean checkContext(Context context) { if (context instanceof Activity) { Activity activity = (Activity) context; - if (activity.isFinishing() || activity.isDestroyed()) { - return true; - } + return activity.isFinishing() || activity.isDestroyed(); } return false; } diff --git a/app/src/main/java/com/dante/diary/utils/Share.java b/app/src/main/java/com/dante/diary/utils/Share.java index 81e5d76..1cb1497 100644 --- a/app/src/main/java/com/dante/diary/utils/Share.java +++ b/app/src/main/java/com/dante/diary/utils/Share.java @@ -4,13 +4,14 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; -import android.support.annotation.NonNull; import com.blankj.utilcode.utils.IntentUtils; import com.dante.diary.R; import com.dante.diary.base.App; import com.dante.diary.custom.Updater; +import androidx.annotation.NonNull; + /** * Util to share data, make share intent, etc. diff --git a/app/src/main/java/com/dante/diary/utils/TransitionHelper.java b/app/src/main/java/com/dante/diary/utils/TransitionHelper.java index 5bddebc..c53f445 100644 --- a/app/src/main/java/com/dante/diary/utils/TransitionHelper.java +++ b/app/src/main/java/com/dante/diary/utils/TransitionHelper.java @@ -3,14 +3,15 @@ import android.app.Activity; import android.content.Intent; import android.os.Build; -import android.support.v4.app.ActivityCompat; -import android.support.v4.app.ActivityOptionsCompat; -import android.support.v4.view.ViewCompat; import android.view.View; import com.dante.diary.base.Constants; import com.dante.diary.detail.PictureActivity; +import androidx.core.app.ActivityCompat; +import androidx.core.app.ActivityOptionsCompat; +import androidx.core.view.ViewCompat; + /** * Created by yons on 17/3/21. */ diff --git a/app/src/main/java/com/dante/diary/utils/UiUtils.java b/app/src/main/java/com/dante/diary/utils/UiUtils.java index 8cb0250..a78f275 100644 --- a/app/src/main/java/com/dante/diary/utils/UiUtils.java +++ b/app/src/main/java/com/dante/diary/utils/UiUtils.java @@ -2,20 +2,19 @@ import android.app.Activity; import android.app.Dialog; -import android.support.design.widget.Snackbar; import android.util.Log; import android.view.View; import android.widget.TextView; import com.dante.diary.R; +import com.google.android.material.snackbar.Snackbar; -import static com.bumptech.glide.gifdecoder.GifHeaderParser.TAG; /** * Util to show hint such as snackBar or dialog. */ public class UiUtils { - + private static final String TAG = "UiUtils"; public static void showSnack(View rootView, int textId) { if (null != rootView) { Snackbar.make(rootView, textId, Snackbar.LENGTH_SHORT).show(); @@ -68,7 +67,7 @@ public static void showDetailDialog(Activity activity, String text) { Dialog dialog = new Dialog(activity); dialog.setContentView(R.layout.intro_detail); dialog.show(); - TextView textView = (TextView) dialog.findViewById(R.id.introduction); + TextView textView = dialog.findViewById(R.id.introduction); textView.setOnClickListener(v1 -> dialog.dismiss()); textView.setText(text); } diff --git a/app/src/main/java/com/dante/diary/utils/WrapContentLinearLayoutManager.java b/app/src/main/java/com/dante/diary/utils/WrapContentLinearLayoutManager.java index 4852c51..e5b8785 100644 --- a/app/src/main/java/com/dante/diary/utils/WrapContentLinearLayoutManager.java +++ b/app/src/main/java/com/dante/diary/utils/WrapContentLinearLayoutManager.java @@ -1,10 +1,11 @@ package com.dante.diary.utils; import android.content.Context; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.util.Log; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + /** * Created by yons on 17/3/7. */ diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 7dd57bd..979be17 100755 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -1,5 +1,5 @@ - - - - - + - + - + diff --git a/app/src/main/res/layout/activity_conversation.xml b/app/src/main/res/layout/activity_conversation.xml index 28ad56f..f18938c 100644 --- a/app/src/main/res/layout/activity_conversation.xml +++ b/app/src/main/res/layout/activity_conversation.xml @@ -1,18 +1,19 @@ - - - - + @@ -52,5 +53,5 @@ app:showAttachmentButton="false"/> - + diff --git a/app/src/main/res/layout/activity_conversation_list.xml b/app/src/main/res/layout/activity_conversation_list.xml index e5d5d66..448b8bc 100644 --- a/app/src/main/res/layout/activity_conversation_list.xml +++ b/app/src/main/res/layout/activity_conversation_list.xml @@ -1,11 +1,12 @@ - - - + - + diff --git a/app/src/main/res/layout/activity_create_diary.xml b/app/src/main/res/layout/activity_create_diary.xml index 8a47f2b..7209c52 100644 --- a/app/src/main/res/layout/activity_create_diary.xml +++ b/app/src/main/res/layout/activity_create_diary.xml @@ -1,5 +1,5 @@ - - - - + - + diff --git a/app/src/main/res/layout/activity_create_notebook.xml b/app/src/main/res/layout/activity_create_notebook.xml index 1f2047c..220e95b 100644 --- a/app/src/main/res/layout/activity_create_notebook.xml +++ b/app/src/main/res/layout/activity_create_notebook.xml @@ -1,5 +1,5 @@ - - - - + - - - - + - - - + @@ -173,6 +174,6 @@ - + - + diff --git a/app/src/main/res/layout/activity_create_timepill.xml b/app/src/main/res/layout/activity_create_timepill.xml index 8a54525..826a2ff 100644 --- a/app/src/main/res/layout/activity_create_timepill.xml +++ b/app/src/main/res/layout/activity_create_timepill.xml @@ -1,5 +1,5 @@ - - - - + - + diff --git a/app/src/main/res/layout/activity_diaries_viewer.xml b/app/src/main/res/layout/activity_diaries_viewer.xml index 0ba8ba1..62424de 100644 --- a/app/src/main/res/layout/activity_diaries_viewer.xml +++ b/app/src/main/res/layout/activity_diaries_viewer.xml @@ -1,15 +1,15 @@ - - - + diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index 94e33e6..8a7ad23 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -42,7 +42,7 @@ android:visibility="invisible" tools:visibility="visible"> - - - + - - + android:textColor="@color/white" /> - - + + - - + + + + - - - + app:layout_behavior="@string/appbar_scrolling_view_behavior"> @@ -37,7 +36,7 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_pill_open_content.xml b/app/src/main/res/layout/activity_pill_open_content.xml index a09faf6..ad89bdb 100644 --- a/app/src/main/res/layout/activity_pill_open_content.xml +++ b/app/src/main/res/layout/activity_pill_open_content.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_search.xml b/app/src/main/res/layout/activity_search.xml index 4ccbd9d..550b63c 100644 --- a/app/src/main/res/layout/activity_search.xml +++ b/app/src/main/res/layout/activity_search.xml @@ -1,5 +1,5 @@ - - - - + - - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_time_pill.xml b/app/src/main/res/layout/activity_time_pill.xml index 0f8cb59..ea5ec4d 100644 --- a/app/src/main/res/layout/activity_time_pill.xml +++ b/app/src/main/res/layout/activity_time_pill.xml @@ -1,5 +1,5 @@ - - - - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_time_pill_open.xml b/app/src/main/res/layout/activity_time_pill_open.xml index d74d1bc..c4f28e1 100644 --- a/app/src/main/res/layout/activity_time_pill_open.xml +++ b/app/src/main/res/layout/activity_time_pill_open.xml @@ -1,26 +1,26 @@ - - - - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_viewer.xml b/app/src/main/res/layout/activity_viewer.xml index 8f0561c..78346e9 100644 --- a/app/src/main/res/layout/activity_viewer.xml +++ b/app/src/main/res/layout/activity_viewer.xml @@ -1,5 +1,5 @@ - - - + - - + diff --git a/app/src/main/res/layout/comment_layout.xml b/app/src/main/res/layout/comment_layout.xml index a558de7..d6b61dd 100644 --- a/app/src/main/res/layout/comment_layout.xml +++ b/app/src/main/res/layout/comment_layout.xml @@ -11,7 +11,7 @@ android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_horizontal_margin"> - - - + \ No newline at end of file diff --git a/app/src/main/res/layout/common_toolbar.xml b/app/src/main/res/layout/common_toolbar.xml index 30b27c6..e92ef37 100644 --- a/app/src/main/res/layout/common_toolbar.xml +++ b/app/src/main/res/layout/common_toolbar.xml @@ -1,5 +1,5 @@ - - - - + - - - - + + - - + - - - + - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_diary_detail.xml b/app/src/main/res/layout/fragment_diary_detail.xml index 6251fed..80207b6 100644 --- a/app/src/main/res/layout/fragment_diary_detail.xml +++ b/app/src/main/res/layout/fragment_diary_detail.xml @@ -1,11 +1,11 @@ - - - + - - + - - + diff --git a/app/src/main/res/layout/fragment_diary_list.xml b/app/src/main/res/layout/fragment_diary_list.xml index abdf880..c036f3f 100644 --- a/app/src/main/res/layout/fragment_diary_list.xml +++ b/app/src/main/res/layout/fragment_diary_list.xml @@ -1,29 +1,30 @@ - - - - + - - + diff --git a/app/src/main/res/layout/fragment_diary_main.xml b/app/src/main/res/layout/fragment_diary_main.xml index 750495f..c3fefbf 100644 --- a/app/src/main/res/layout/fragment_diary_main.xml +++ b/app/src/main/res/layout/fragment_diary_main.xml @@ -1,5 +1,5 @@ - - - - - + - + @@ -81,5 +82,5 @@ - + diff --git a/app/src/main/res/layout/fragment_draw.xml b/app/src/main/res/layout/fragment_draw.xml index bb0bd40..907d91e 100644 --- a/app/src/main/res/layout/fragment_draw.xml +++ b/app/src/main/res/layout/fragment_draw.xml @@ -1,25 +1,26 @@ - - - - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_profile.xml b/app/src/main/res/layout/fragment_profile.xml index 2dc42de..c76eef6 100644 --- a/app/src/main/res/layout/fragment_profile.xml +++ b/app/src/main/res/layout/fragment_profile.xml @@ -1,5 +1,5 @@ - - - - - - + + - - + diff --git a/app/src/main/res/layout/fragment_recycler.xml b/app/src/main/res/layout/fragment_recycler.xml index f07f367..fda34be 100644 --- a/app/src/main/res/layout/fragment_recycler.xml +++ b/app/src/main/res/layout/fragment_recycler.xml @@ -1,5 +1,5 @@ - - - - + - - + diff --git a/app/src/main/res/layout/framelayout.xml b/app/src/main/res/layout/framelayout.xml index fddd08d..51dc761 100644 --- a/app/src/main/res/layout/framelayout.xml +++ b/app/src/main/res/layout/framelayout.xml @@ -1,9 +1,9 @@ - - + diff --git a/app/src/main/res/layout/layout_draw_attribs.xml b/app/src/main/res/layout/layout_draw_attribs.xml index f3bd9c5..2926b21 100644 --- a/app/src/main/res/layout/layout_draw_attribs.xml +++ b/app/src/main/res/layout/layout_draw_attribs.xml @@ -1,5 +1,5 @@ - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_request_text.xml b/app/src/main/res/layout/layout_request_text.xml index a55a4df..4632dae 100644 --- a/app/src/main/res/layout/layout_request_text.xml +++ b/app/src/main/res/layout/layout_request_text.xml @@ -4,18 +4,18 @@ android:layout_height="wrap_content" android:orientation="vertical"> - - - + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_save_bitmap.xml b/app/src/main/res/layout/layout_save_bitmap.xml index 6c2d62f..0526746 100644 --- a/app/src/main/res/layout/layout_save_bitmap.xml +++ b/app/src/main/res/layout/layout_save_bitmap.xml @@ -11,16 +11,16 @@ android:background="@drawable/drawable_transparent_dialog_pattern" android:scaleType="centerInside"/> - - - + \ No newline at end of file diff --git a/app/src/main/res/layout/list_comments.xml b/app/src/main/res/layout/list_comments.xml index 935559a..fc482c8 100644 --- a/app/src/main/res/layout/list_comments.xml +++ b/app/src/main/res/layout/list_comments.xml @@ -38,13 +38,12 @@ tools:text="共 13 条评论" tools:visibility="gone"/> - - + tools:listitem="@layout/list_comment_item"> diff --git a/app/src/main/res/layout/list_diary_item_expired.xml b/app/src/main/res/layout/list_diary_item_expired.xml index 1143a9a..8c037ca 100644 --- a/app/src/main/res/layout/list_diary_item_expired.xml +++ b/app/src/main/res/layout/list_diary_item_expired.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="12dp" - android:background="@color/item_background" + android:background="@color/item_background_expired" android:foreground="?attr/selectableItemBackground" android:orientation="vertical" android:padding="@dimen/activity_horizontal_margin"> diff --git a/app/src/main/res/layout/list_notebook_item.xml b/app/src/main/res/layout/list_notebook_item.xml index ee6264f..c766d8c 100644 --- a/app/src/main/res/layout/list_notebook_item.xml +++ b/app/src/main/res/layout/list_notebook_item.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/tab_pager_layout.xml b/app/src/main/res/layout/tab_pager_layout.xml index 9695dd6..e8ffad8 100644 --- a/app/src/main/res/layout/tab_pager_layout.xml +++ b/app/src/main/res/layout/tab_pager_layout.xml @@ -1,5 +1,5 @@ - - - - + - - + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - + diff --git a/app/src/main/res/menu/menu_detail.xml b/app/src/main/res/menu/menu_detail.xml index 7ec8bcc..16e80c6 100644 --- a/app/src/main/res/menu/menu_detail.xml +++ b/app/src/main/res/menu/menu_detail.xml @@ -4,7 +4,7 @@ \ No newline at end of file diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 7dd3f76..0cbc217 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -329,5 +329,6 @@ A year Custom Three month + Get back password \ No newline at end of file diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 7fad1df..720f5cd 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -10,13 +10,15 @@ @color/cardview_dark_background @color/black - #202020 + #313131 + #acabab #acabab #808080 #acabab #313131 #000000 #9e9e9e + #FF424242 #66000000 #ba000000 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 24e0599..cdf4698 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -10,6 +10,7 @@ #f5f5f5 #ccffffff + #ccffffff #FFFFFF #FFFFFF #BDBDBD @@ -17,6 +18,7 @@ #e7e6e6 #FFFFFF #9e9e9e + #FF424242 #66000000 #ba000000 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fd2a30a..22699a9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -318,4 +318,5 @@ 一年 自定义 三个月 + 找回密码 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 37ef786..5eb8773 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ -