diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2022-02-18 11:48:00 +0000 |
---|---|---|
committer | Docile-Alligator <chineseperson5@gmail.com> | 2022-02-18 11:48:00 +0000 |
commit | f508132f328286d0c1f08f61e326631e2191ef5e (patch) | |
tree | bbcc89b2d508160a6c0f42077b863a98843110d6 /app | |
parent | b933c9d08b6c1e3517313094cc92a443e9403bec (diff) | |
download | infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.gz infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.bz2 infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.lz infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.xz infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.zst infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.zip |
New option: Interface->Comment->Always show the number of child comments. Fix notification icon. Tweak the app icon.
Diffstat (limited to 'app')
6 files changed, 27 insertions, 23 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java index 90626e4d..cbb15ce6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java @@ -116,6 +116,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi private boolean mShowOnlyOneCommentLevelIndicator; private boolean mHideCommentAwards; private boolean mShowAuthorAvatar; + private boolean mAlwaysShowChildCommentCount; private int mDepthThreshold; private CommentRecyclerViewAdapterCallback mCommentRecyclerViewAdapterCallback; private boolean isInitiallyLoading; @@ -239,6 +240,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi mShowOnlyOneCommentLevelIndicator = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ONLY_ONE_COMMENT_LEVEL_INDICATOR, false); mHideCommentAwards = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_COMMENT_AWARDS, false); mShowAuthorAvatar = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_AUTHOR_AVATAR, false); + mAlwaysShowChildCommentCount = sharedPreferences.getBoolean(SharedPreferencesUtils.ALWAYS_SHOW_CHILD_COMMENT_COUNT, false); mDepthThreshold = sharedPreferences.getInt(SharedPreferencesUtils.SHOW_FEWER_TOOLBAR_OPTIONS_THRESHOLD, 5); mCommentRecyclerViewAdapterCallback = commentRecyclerViewAdapterCallback; @@ -463,7 +465,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } if (comment.hasReply()) { - if (comment.getChildCount() > 0 && !comment.isExpanded()) { + if (comment.getChildCount() > 0 && (mAlwaysShowChildCommentCount || !comment.isExpanded())) { ((CommentViewHolder) holder).expandButton.setText("+" + comment.getChildCount()); } if (comment.isExpanded()) { @@ -1550,7 +1552,11 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } else { notifyItemRangeInserted(commentPosition + 1, newList.size()); } - expandButton.setText(""); + if (mAlwaysShowChildCommentCount && comment.getChildCount() > 0) { + expandButton.setText("+" + comment.getChildCount()); + } else { + expandButton.setText(""); + } expandButton.setCompoundDrawablesWithIntrinsicBounds(collapseDrawable, null, null, null); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java index 803ca8ef..3b166d7f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -206,6 +206,7 @@ public class SharedPreferencesUtils { public static final String HIDE_COMMENT_AWARDS = "hide_comment_awards"; public static final String SHOW_FEWER_TOOLBAR_OPTIONS_THRESHOLD = "show_fewer_toolbar_options_threshold"; public static final String SHOW_AUTHOR_AVATAR = "show_author_avatar"; + public static final String ALWAYS_SHOW_CHILD_COMMENT_COUNT = "always_show_child_comment_count"; public static final String DEFAULT_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit_preferences"; public static final String MAIN_PAGE_TABS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.main_page_tabs"; diff --git a/app/src/main/res/drawable-v24/ic_launcher_background.xml b/app/src/main/res/drawable-v24/ic_launcher_background.xml index 8863072a..54004003 100644 --- a/app/src/main/res/drawable-v24/ic_launcher_background.xml +++ b/app/src/main/res/drawable-v24/ic_launcher_background.xml @@ -7,8 +7,9 @@ <group> <clip-path android:pathData="M0,0h300v300h-300z M 0,0"/> <path - android:pathData="M0,300L300,300L300,0L0,0L0,300Z"> - <aapt:attr name="android:fillColor"> + android:pathData="M0,300L300,300L300,0L0,0L0,300Z" + android:fillColor="#FF0C2446"> + <!--<aapt:attr name="android:fillColor"> <gradient android:startY="288.37054" android:startX="150.00029" @@ -27,7 +28,7 @@ <item android:offset="0.9" android:color="#FF081B37"/> <item android:offset="1" android:color="#FF071935"/> </gradient> - </aapt:attr> + </aapt:attr>--> </path> <path android:pathData="M110.172,98.062C110.179,98.427 110.172,98.792 110.149,99.149C110.141,99.248 110.134,99.339 110.125,99.43C110.119,99.59 110.103,99.75 110.081,99.909C110.012,100.48 109.905,101.042 109.761,101.597C109.693,101.894 109.609,102.19 109.51,102.479C109.449,102.677 109.381,102.867 109.313,103.065C108.932,104.083 108.438,105.057 107.83,105.954C107.511,106.425 107.161,106.881 106.781,107.315C106.393,107.756 105.982,108.174 105.541,108.562C104.652,109.36 103.656,110.044 102.561,110.592L102.538,110.599C101.641,111.056 100.683,111.405 99.664,111.656C98.478,111.945 97.284,112.074 96.113,112.059L96.098,112.059C94.722,112.029 93.368,111.793 92.084,111.367C91.133,111.063 90.213,110.645 89.354,110.143C88.852,109.847 88.373,109.52 87.916,109.162C87.43,108.79 86.974,108.379 86.541,107.938C86.26,107.657 85.985,107.36 85.734,107.049C85.438,106.691 85.157,106.319 84.899,105.931C84.739,105.68 84.579,105.422 84.427,105.163C84.214,104.798 84.017,104.418 83.842,104.03C83.591,103.49 83.378,102.928 83.203,102.35C83.119,102.084 83.043,101.81 82.974,101.536C82.861,101.065 82.77,100.601 82.709,100.13C82.693,100.046 82.678,99.963 82.671,99.879L82.671,99.871C82.663,99.826 82.656,99.78 82.656,99.734C82.656,99.712 82.648,99.696 82.648,99.674C82.64,99.613 82.633,99.56 82.633,99.499C82.542,98.548 82.557,97.613 82.663,96.693C82.732,96.047 82.853,95.416 83.013,94.792C83.241,93.91 83.56,93.059 83.956,92.245C84.039,92.063 84.131,91.88 84.23,91.705C84.952,90.367 85.895,89.143 87.02,88.101C88.677,86.566 90.737,85.425 93.087,84.847C95.323,84.3 97.55,84.338 99.634,84.847C99.9,84.916 100.166,84.984 100.424,85.068C101.481,85.387 102.5,85.843 103.442,86.406C103.982,86.725 104.5,87.075 104.986,87.478C105.367,87.767 105.731,88.094 106.073,88.436C106.826,89.181 107.495,90.01 108.073,90.93C108.445,91.531 108.78,92.162 109.069,92.831C109.092,92.884 109.114,92.945 109.138,93.006C109.145,93.028 109.161,93.059 109.168,93.082C109.297,93.401 109.411,93.728 109.518,94.055C109.617,94.351 109.7,94.655 109.776,94.967C109.913,95.537 110.02,96.108 110.088,96.678C110.141,97.142 110.172,97.598 110.172,98.062Z" diff --git a/app/src/main/res/drawable/ic_notification.xml b/app/src/main/res/drawable/ic_notification.xml index 1b6dfc8d..efde2d82 100644 --- a/app/src/main/res/drawable/ic_notification.xml +++ b/app/src/main/res/drawable/ic_notification.xml @@ -1,19 +1,9 @@ -<vector android:height="24dp" android:viewportHeight="178.7" - android:viewportWidth="178.7" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> - <path android:fillColor="#FFB026" android:pathData="M59.106,104.943C58.766,108.82 53.687,111.541 47.763,111.021C41.838,110.502 37.311,106.938 37.651,103.061C37.991,99.184 43.07,96.463 48.995,96.983C54.919,97.503 59.447,101.067 59.106,104.943Z"/> - <path android:fillColor="#FFB026" android:pathData="M102.258,107.79C102.258,112.269 96.306,115.9 88.963,115.9C81.62,115.9 75.668,112.269 75.668,107.79C75.668,103.311 81.62,99.68 88.963,99.68C96.306,99.68 102.258,103.311 102.258,107.79Z"/> - <path android:fillColor="#FFB026" android:pathData="M141.137,102.653C141.689,105.687 137.501,110.287 131.433,111.39C125.365,112.493 119.713,109.682 119.161,106.648C118.61,103.614 123.082,100.26 129.151,99.156C135.219,98.053 140.585,99.618 141.137,102.653Z"/> - <path android:fillColor="#5F63C0" android:pathData="M178.715,92.644C178.715,92.644 169.54,72.905 106.315,63.972L89.358,64.393L72.401,63.972C9.174,72.905 0,92.644 0,92.644C0,92.644 38.462,106.197 89.358,105.884C140.253,106.197 178.715,92.644 178.715,92.644Z"/> - <!--<path android:fillColor="#FB4A4C" android:pathData="M160.126,87.258C160.586,88.959 158.603,90.975 155.696,91.761C152.79,92.546 150.062,91.804 149.602,90.103C149.142,88.402 151.125,86.386 154.031,85.6C156.938,84.815 159.666,85.557 160.126,87.258Z"/> - <path android:fillColor="#FB4A4C" android:pathData="M129.735,93.072C129.906,94.826 127.615,96.484 124.619,96.776C121.623,97.067 119.055,95.882 118.884,94.128C118.714,92.374 121.005,90.716 124.001,90.424C126.997,90.133 129.564,91.318 129.735,93.072Z"/> - <path android:fillColor="#FB4A4C" android:pathData="M94.136,95.857C94.148,97.619 91.717,99.064 88.706,99.084C85.696,99.105 83.245,97.692 83.234,95.93C83.222,94.168 85.653,92.723 88.663,92.703C91.674,92.683 94.124,94.095 94.136,95.857Z"/> - <path android:fillColor="#FB4A4C" android:pathData="M59.464,93.73C59.145,95.463 56.485,96.425 53.525,95.878C50.565,95.332 48.424,93.484 48.743,91.751C49.064,90.018 51.723,89.057 54.683,89.603C57.644,90.149 59.784,91.997 59.464,93.73Z"/> - <path android:fillColor="#FB4A4C" android:pathData="M28.996,86.395C28.766,88.142 26.159,89.24 23.175,88.846C20.189,88.453 17.957,86.717 18.187,84.97C18.418,83.223 21.023,82.126 24.009,82.52C26.993,82.913 29.225,84.648 28.996,86.395Z"/>--> - <path android:fillColor="#FFF0BB" android:pathData="M87.892,89.208C71.541,89.208 52.576,86.016 32.232,76.578L31.926,76.437L31.899,76.102C31.885,75.944 30.662,60.104 36.924,42.768C41.531,30.02 51.04,14.357 70.658,4.823C86.562,-2.907 105.645,-1.398 119.39,9.726C119.874,10.119 120.358,10.525 120.839,10.945C135.506,23.754 143.671,45.214 145.111,74.727L145.127,75.066L144.84,75.245C144.506,75.453 121.833,89.208 87.892,89.208Z"/> - <!--<path android:fillColor="#00B57C" android:pathData="M135.72,63.151C133.991,58.451 131.692,53.135 128.687,47.958C130.489,47.266 131.774,45.531 131.774,43.485C131.774,40.833 129.623,38.682 126.97,38.682C125.592,38.682 124.358,39.271 123.482,40.201C115.263,29.671 103.321,21.651 86.15,23.975C71.072,26.016 60.61,32.117 53.363,39.96C52.507,39.174 51.376,38.682 50.122,38.682C47.47,38.682 45.32,40.833 45.32,43.485C45.32,45.208 46.234,46.706 47.595,47.554C41.177,57.863 38.687,69.633 37.831,79.02C56.055,86.562 73.052,89.208 87.892,89.208C113.061,89.208 132.023,81.648 140.284,77.653C139.118,73.269 137.626,68.338 135.72,63.151Z"/>--> - <!--<path android:fillColor="#032560" android:pathData="M83.377,60.695C84.303,62.182 85.709,63.554 87.344,64.215C90.587,65.525 93.246,63.307 95.119,60.841C95.83,59.906 94.246,58.996 93.544,59.92C91.895,62.091 89.61,63.759 87.055,61.991C86.231,61.421 85.484,60.628 84.953,59.774C84.334,58.779 82.755,59.694 83.377,60.695Z"/>--> - <!--<path android:fillColor="#032560" android:pathData="M77.686,50.012C77.686,51.161 76.754,52.093 75.606,52.093C74.457,52.093 73.525,51.161 73.525,50.012C73.525,48.863 74.457,47.931 75.606,47.931C76.754,47.931 77.686,48.863 77.686,50.012Z"/>--> - <!--<path android:fillColor="#032560" android:pathData="M104.372,50.012C104.372,51.161 103.44,52.093 102.291,52.093C101.143,52.093 100.211,51.161 100.211,50.012C100.211,48.863 101.143,47.931 102.291,47.931C103.44,47.931 104.372,48.863 104.372,50.012Z"/>--> - <!--<path android:fillColor="#FFAB3D" android:pathData="M76.298,58.828C76.298,60.866 74.422,62.518 72.108,62.518C69.794,62.518 67.918,60.866 67.918,58.828C67.918,56.79 69.794,55.139 72.108,55.139C74.422,55.139 76.298,56.79 76.298,58.828Z"/>--> - <!--<path android:fillColor="#FFAB3D" android:pathData="M109.016,58.828C109.016,60.866 107.14,62.518 104.826,62.518C102.511,62.518 100.636,60.866 100.636,58.828C100.636,56.79 102.511,55.139 104.826,55.139C107.14,55.139 109.016,56.79 109.016,58.828Z"/>--> +<vector android:height="24dp" android:viewportHeight="180.75" + android:viewportWidth="180.75" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <clip-path android:pathData="M0,0L0,180.75L180.75,180.75L180.75,0L0,0Z"/> + <path android:fillColor="#F9A745" android:pathData="M60.124,137.368C59.784,141.245 54.705,143.966 48.78,143.446C42.856,142.926 38.328,139.362 38.668,135.485C39.008,131.609 44.086,128.887 50.012,129.407C55.936,129.927 60.464,133.491 60.124,137.368Z"/> + <path android:fillColor="#F9A745" android:pathData="M103.275,140.215C103.275,144.694 97.323,148.326 89.981,148.326C82.637,148.326 76.685,144.694 76.685,140.215C76.685,135.736 82.637,132.106 89.981,132.106C97.323,132.106 103.275,135.736 103.275,140.215Z"/> + <path android:fillColor="#F9A745" android:pathData="M142.154,135.078C142.706,138.112 138.518,142.712 132.451,143.815C126.382,144.918 120.731,142.107 120.179,139.073C119.627,136.039 124.099,132.685 130.168,131.581C136.236,130.478 141.603,132.043 142.154,135.078Z"/> + <path android:fillColor="#5B63AB" android:pathData="M179.732,125.069C179.732,125.069 170.558,105.33 107.332,96.397L90.375,96.817L73.418,96.397C10.192,105.33 1.017,125.069 1.017,125.069C1.017,125.069 39.479,138.622 90.375,138.309C141.271,138.622 179.732,125.069 179.732,125.069Z"/> + <path android:fillColor="#F7E3B3" android:pathData="M88.909,121.633C72.559,121.633 53.593,118.441 33.249,109.004L32.943,108.862L32.917,108.527C32.903,108.369 31.679,92.529 37.942,75.193C42.547,62.445 52.058,46.783 71.675,37.248C87.58,29.518 106.663,31.027 120.408,42.151C120.891,42.544 121.375,42.95 121.857,43.371C136.524,56.18 144.689,77.639 146.128,107.152L146.145,107.491L145.857,107.67C145.524,107.878 122.851,121.633 88.909,121.633Z"/> </vector> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f3d30ba0..2fd5280a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -631,6 +631,7 @@ <string name="settings_show_fewer_toolbar_options_threshold_summary">Level %1$d</string> <string name="settings_show_author_avatar_title">Show Author Avatar</string> <string name="settings_reddit_user_agreement_title">Reddit User Agreement</string> + <string name="settings_always_show_child_comment_count_title">Always Show the Number of Child Comments</string> <string name="no_link_available">Cannot get the link</string> diff --git a/app/src/main/res/xml/comment_preferences.xml b/app/src/main/res/xml/comment_preferences.xml index 76738f73..dd9245e4 100644 --- a/app/src/main/res/xml/comment_preferences.xml +++ b/app/src/main/res/xml/comment_preferences.xml @@ -42,6 +42,11 @@ app:key="hide_comment_awards" android:title="@string/settings_hide_comment_awards_title" /> + <ml.docilealligator.infinityforreddit.customviews.CustomFontSwitchPreference + app:defaultValue="false" + app:key="always_show_child_comment_count" + android:title="@string/settings_always_show_child_comment_count_title" /> + <ml.docilealligator.infinityforreddit.customviews.CustomFontSeekBarPreference app:defaultValue="5" android:max="10" |