From 75452b764d0a0edb4c227cb97c0c7f06c8e6300b Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Fri, 25 Oct 2019 21:16:09 +0800 Subject: [PATCH] Disable clicking comment icon in a post to submit a comment. Enlarge the icons in comments. Fix regex used to linkify subreddits and users. --- app/build.gradle | 28 +++++++------- .../CommentAndPostRecyclerViewAdapter.java | 4 +- .../Adapter/PostRecyclerViewAdapter.java | 24 ++++-------- .../infinityforreddit/Utils.java | 4 +- ...p.xml => ic_arrow_downward_black_22dp.xml} | 4 +- ...0dp.xml => ic_arrow_upward_black_22dp.xml} | 4 +- ...20dp.xml => ic_expand_less_black_22dp.xml} | 4 +- .../res/drawable/ic_outline_share_20px.xml | 4 +- .../main/res/drawable/ic_reply_black_20dp.xml | 4 +- app/src/main/res/layout/item_comment.xml | 38 +++++++++---------- app/src/main/res/layout/item_post.xml | 17 +++++++-- build.gradle | 4 +- 12 files changed, 69 insertions(+), 70 deletions(-) rename app/src/main/res/drawable/{ic_arrow_downward_black_20dp.xml => ic_arrow_downward_black_22dp.xml} (59%) rename app/src/main/res/drawable/{ic_arrow_upward_black_20dp.xml => ic_arrow_upward_black_22dp.xml} (59%) rename app/src/main/res/drawable/{ic_expand_less_black_20dp.xml => ic_expand_less_black_22dp.xml} (57%) diff --git a/app/build.gradle b/app/build.gradle index c038f6c7..bb09add8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -34,7 +34,7 @@ repositories { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'androidx.appcompat:appcompat:1.1.0' - implementation 'com.google.android.material:material:1.1.0-alpha10' + implementation 'com.google.android.material:material:1.2.0-alpha01' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v13:1.0.0' @@ -45,9 +45,9 @@ dependencies { implementation 'androidx.browser:browser:1.0.0' implementation 'com.alexvasilkov:gesture-views:2.5.2' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'com.github.bumptech.glide:glide:4.9.0' + implementation 'com.github.bumptech.glide:glide:4.10.0' implementation 'com.github.pwittchen:swipe-rx2:0.3.0' - annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' + annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0' // Room components implementation "androidx.room:room-runtime:$rootProject.roomVersion" annotationProcessor "androidx.room:room-compiler:$rootProject.roomVersion" @@ -55,21 +55,21 @@ dependencies { implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.archLifecycleVersion" annotationProcessor "androidx.lifecycle:lifecycle-common-java8:$rootProject.archLifecycleVersion" implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' - implementation 'io.reactivex.rxjava2:rxjava:2.2.12' - implementation 'com.squareup.retrofit2:retrofit:2.6.1' - implementation 'com.squareup.retrofit2:converter-scalars:2.6.1' + implementation 'io.reactivex.rxjava2:rxjava:2.2.13' + implementation 'com.squareup.retrofit2:retrofit:2.6.2' + implementation 'com.squareup.retrofit2:converter-scalars:2.6.2' implementation 'jp.wasabeef:glide-transformations:4.0.0' - implementation 'com.google.dagger:dagger:2.24' - annotationProcessor 'com.google.dagger:dagger-compiler:2.24' - implementation 'com.jakewharton:butterknife:10.1.0' - annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0' + implementation 'com.google.dagger:dagger:2.25.2' + annotationProcessor 'com.google.dagger:dagger-compiler:2.25.2' + implementation 'com.jakewharton:butterknife:10.2.0' + annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0' implementation 'com.github.santalu:aspect-ratio-imageview:1.0.6' implementation 'androidx.paging:paging-runtime:2.1.0' implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE' - implementation 'io.noties.markwon:core:4.1.1' - implementation 'io.noties.markwon:linkify:4.1.1' - implementation 'io.noties.markwon:ext-strikethrough:4.1.1' - implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.17' + implementation 'io.noties.markwon:core:4.1.2' + implementation 'io.noties.markwon:linkify:4.1.2' + implementation 'io.noties.markwon:ext-strikethrough:4.1.2' + implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19' implementation 'com.github.Ferfalk:SimpleSearchView:0.1.3' implementation 'org.greenrobot:eventbus:3.1.1' implementation 'com.libRG:customtextview:2.2' diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java index 60258204..825a3a1a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java @@ -661,7 +661,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter { - if (mAccessToken == null) { - Toast.makeText(mContext, R.string.login_first, Toast.LENGTH_SHORT).show(); - return; - } - - Intent intent = new Intent(mContext, CommentActivity.class); - intent.putExtra(CommentActivity.EXTRA_PARENT_FULLNAME_KEY, post.getFullName()); - intent.putExtra(CommentActivity.EXTRA_COMMENT_PARENT_TEXT_KEY, post.getTitle()); - intent.putExtra(CommentActivity.EXTRA_IS_REPLYING_KEY, false); - intent.putExtra(CommentActivity.EXTRA_PARENT_DEPTH_KEY, 0); - mContext.startActivity(intent); - }); - ((DataViewHolder) holder).commentsCountTextView.setText(Integer.toString(post.getnComments())); if (post.isSaved()) { @@ -801,6 +790,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter + diff --git a/app/src/main/res/drawable/ic_arrow_upward_black_20dp.xml b/app/src/main/res/drawable/ic_arrow_upward_black_22dp.xml similarity index 59% rename from app/src/main/res/drawable/ic_arrow_upward_black_20dp.xml rename to app/src/main/res/drawable/ic_arrow_upward_black_22dp.xml index 320c0fc8..150d5218 100644 --- a/app/src/main/res/drawable/ic_arrow_upward_black_20dp.xml +++ b/app/src/main/res/drawable/ic_arrow_upward_black_22dp.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/drawable/ic_expand_less_black_20dp.xml b/app/src/main/res/drawable/ic_expand_less_black_22dp.xml similarity index 57% rename from app/src/main/res/drawable/ic_expand_less_black_20dp.xml rename to app/src/main/res/drawable/ic_expand_less_black_22dp.xml index 54ce5912..f7a3985f 100644 --- a/app/src/main/res/drawable/ic_expand_less_black_20dp.xml +++ b/app/src/main/res/drawable/ic_expand_less_black_22dp.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/drawable/ic_outline_share_20px.xml b/app/src/main/res/drawable/ic_outline_share_20px.xml index 4c1a8bbb..52eda61c 100644 --- a/app/src/main/res/drawable/ic_outline_share_20px.xml +++ b/app/src/main/res/drawable/ic_outline_share_20px.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/drawable/ic_reply_black_20dp.xml b/app/src/main/res/drawable/ic_reply_black_20dp.xml index 9cb7e46c..1dd3dfed 100644 --- a/app/src/main/res/drawable/ic_reply_black_20dp.xml +++ b/app/src/main/res/drawable/ic_reply_black_20dp.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/layout/item_comment.xml b/app/src/main/res/layout/item_comment.xml index 9bbccf54..3c1a3330 100644 --- a/app/src/main/res/layout/item_comment.xml +++ b/app/src/main/res/layout/item_comment.xml @@ -79,11 +79,11 @@ android:id="@+id/up_vote_button_item_post_comment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="16dp" + android:layout_marginStart="12dp" android:background="?actionBarItemBackground" android:clickable="true" android:focusable="true" - android:src="@drawable/ic_arrow_upward_black_20dp" + android:src="@drawable/ic_arrow_upward_black_22dp" android:tint="@android:color/tab_indicator_text" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -110,7 +110,7 @@ android:background="?actionBarItemBackground" android:clickable="true" android:focusable="true" - android:src="@drawable/ic_arrow_downward_black_20dp" + android:src="@drawable/ic_arrow_downward_black_22dp" android:tint="@android:color/tab_indicator_text" app:layout_constraintStart_toEndOf="@+id/score_text_view_item_post_comment" app:layout_constraintEnd_toStartOf="@id/more_button_item_post_comment" @@ -129,6 +129,21 @@ android:src="@drawable/ic_outline_more_vert_24px" android:tint="@android:color/tab_indicator_text" android:visibility="gone" + app:layout_constraintEnd_toStartOf="@+id/expand_button_item_post_comment" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + + @@ -142,21 +157,6 @@ android:clickable="true" android:focusable="true" android:tint="@android:color/tab_indicator_text" - app:layout_constraintEnd_toStartOf="@+id/expand_button_item_post_comment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> - - @@ -179,7 +179,7 @@ android:id="@+id/reply_button_item_post_comment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginEnd="16dp" + android:layout_marginEnd="12dp" android:background="?actionBarItemBackground" android:clickable="true" android:focusable="true" diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml index ba132a36..c09582f5 100644 --- a/app/src/main/res/layout/item_post.xml +++ b/app/src/main/res/layout/item_post.xml @@ -80,7 +80,19 @@ android:paddingStart="16dp" android:paddingEnd="16dp" android:textSize="?attr/title_font_18" - android:textColor="@color/primaryTextColor"/> + android:textColor="@color/primaryTextColor" /> + +