From 3267623af55dc6385349c17f113a91cae71960fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B0=D1=86=D0=B5=D0=BF=D0=B8=D0=BD?= Date: Mon, 19 Mar 2018 18:13:12 +0300 Subject: [PATCH] [android] Replaced 'eye' icon with checkbox in bookmark category item and refactored it --- .../res/drawable-hdpi/ic_bookmark_hide.png | Bin 644 -> 0 bytes .../res/drawable-hdpi/ic_bookmark_show.png | Bin 361 -> 0 bytes .../res/drawable-mdpi/ic_bookmark_hide.png | Bin 447 -> 0 bytes .../res/drawable-mdpi/ic_bookmark_show.png | Bin 236 -> 0 bytes .../res/drawable-xhdpi/ic_bookmark_hide.png | Bin 832 -> 0 bytes .../res/drawable-xhdpi/ic_bookmark_show.png | Bin 439 -> 0 bytes .../res/drawable-xxhdpi/ic_bookmark_hide.png | Bin 1226 -> 0 bytes .../res/drawable-xxhdpi/ic_bookmark_show.png | Bin 646 -> 0 bytes .../res/drawable-xxxhdpi/ic_bookmark_hide.png | Bin 1633 -> 0 bytes .../res/drawable-xxxhdpi/ic_bookmark_show.png | Bin 870 -> 0 bytes android/res/layout/item_bookmark_category.xml | 75 +++++++++++------- .../bookmarks/BookmarkCategoriesAdapter.java | 3 + .../mapswithme/maps/bookmarks/Holders.java | 41 +++++----- android/src/com/mapswithme/util/UiUtils.java | 40 ++++++---- 14 files changed, 92 insertions(+), 67 deletions(-) delete mode 100644 android/res/drawable-hdpi/ic_bookmark_hide.png delete mode 100644 android/res/drawable-hdpi/ic_bookmark_show.png delete mode 100644 android/res/drawable-mdpi/ic_bookmark_hide.png delete mode 100644 android/res/drawable-mdpi/ic_bookmark_show.png delete mode 100644 android/res/drawable-xhdpi/ic_bookmark_hide.png delete mode 100644 android/res/drawable-xhdpi/ic_bookmark_show.png delete mode 100644 android/res/drawable-xxhdpi/ic_bookmark_hide.png delete mode 100644 android/res/drawable-xxhdpi/ic_bookmark_show.png delete mode 100644 android/res/drawable-xxxhdpi/ic_bookmark_hide.png delete mode 100644 android/res/drawable-xxxhdpi/ic_bookmark_show.png diff --git a/android/res/drawable-hdpi/ic_bookmark_hide.png b/android/res/drawable-hdpi/ic_bookmark_hide.png deleted file mode 100644 index 514453bc47c8a060f3976547ac33004f67de1f83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 644 zcmV-~0(&8!nITdp-{DS!cfzo`id;>9w-GKLbcHe z*HQ(9K-B;_&;;H8Yl@tSIn+d`0uc$buAxC<43r#q;c7QfHKB(pgCM9rVEcd95e8WZ z#v*Ba4UiwRkyQL`G*lkQC;pcOQ{fNUMdXj`Fm2$0KaCWBPlg*%okLQS2f=&DJkTaK zgJi%a$bwNptSNy2sAeIXVV|<_fw4`<;Oa2d@fv20F{~X1StynunZ?a3dxh$DkDw_C zgINJ4*FaKShOxC`O)8o zctO`K6pPI(`wWCbb{jctj_nGw!Z8EMC$hVHpltXC)nF%FOU=a_z*bH<=Tr&J eqerg(Q2+qAN6_JQzIPbP_- zofy2252pX{Gt@~j&P>S%;A~ZsYL#bx=BU8qIS-3E(`6cn?mF>>LwHUg1XrcS?Ie@A)g~lLmXLD zmpZz?ef%HB08hutdK}JJE zftz|+Lk)pMAJ_$FJ-zVvcu(&H&EB3TVhbEX4Y#8R=tmvDF&0I@P012^;$K4vFC=%O z2sny0tYb8afNPQ^JV6a_F@vkDyH+=EcYQY7}D87G+{+&1F;2WC122mgF0J@CX8TFyR)$cj^MN8 zI?iafh>>W8UQFBUX>@=|NgXe3HjUoc4#u%6Hx(V=vCUR79y@_S%*oAQ4Es@v3_~3u_(zZ>i zLZRCCy}=7k_>_}o&A;UXzA%Zh;Ye|dBS!A%v6Ei2$cXK)XwJq=Qfflbkpd~2tHc(gpxxkDmI^`=`R%IQgm@_Pp;T2{0 m$Qgdq3>z)OQE~jRD-_<+82@3GAy8ic0000YyY-gcebxWgYgADVn#HEZrm*Q+M_&aKZOx-pssb>uwMHzK9$!3EOcNAEPtM1WTp8 z5oLlGq+P)5C<}Dsn6v}vh_b+A7?!p+$^;vv4Pr)=1-fuV+P)|gJc63E7o$w@jJA^qg+EBqd zoOj9hm>3DT59g)59T_kYAINqd>rjc&fZMTGqc@`tdZpDcKbpXMn%j$>_%E;+r)3+$ z+(3JmIr6|<9M#@; z(F9)7+)hl01nkz{QOu22(2I-mSsqPb0>0JU(n!EE`CLSAWWgH6%!?LqHwI6w1L&K4MYNNP|V?|hknI$M;oZ%D~--Z0N0PK-Z zKNiMlz%=ZX?QblJoX~>-t?k6L7;RXALD}BNjgbSMmu(O$;%dT79F*-e-o<=$#Rzmq z9qiKRwHOQN#Cp`UHh=+_tc(Oq#~;$ppeM!(9>-Dn3}R*^V2MV%Vl1JGSMj^{e!#>? zz^585jiP$&%6hzk@4jUK0000< KMNUMnLSTY4C~@fk diff --git a/android/res/drawable-xhdpi/ic_bookmark_show.png b/android/res/drawable-xhdpi/ic_bookmark_show.png deleted file mode 100644 index fc1c970353b2ed845fe003fc6f174a39fb21b8a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 439 zcmV;o0Z9IdP){8$34qM7++te5CSj7&u^hb;1z|rCu hwo8U#7=~d)!Y^3$aR_!0A_xEg002ovPDHLkV1h+`x?cbQ diff --git a/android/res/drawable-xxhdpi/ic_bookmark_hide.png b/android/res/drawable-xxhdpi/ic_bookmark_hide.png deleted file mode 100644 index 1f51ae3c1a5f796a43824c91c405698f54100bd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1226 zcmV;*1U37KP)+B{p-5@sglfG#SnZO*Af1h7a@p zqCTkAifD`>7#AQW1~qCH*@K{oC`c$7>{0=ztI!IkpP9I1L;k;>|2h9tXgTNei6{Wq zU<1CuGIT`KcW^$+_O}M5Xo^6;Y_~>J1YVHsE1VdO4hy8Milzv>ChfXtbm+!T*>+%7 zG&=lB+RM=tf#uS!h(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&*!(s{`%E^k|B}JPh04L(%j< oI0q~67Ji48XliO|YC1gp2f!49?G3?)(f|Me07*qoM6N<$f|M&PDF6Tf diff --git a/android/res/drawable-xxhdpi/ic_bookmark_show.png b/android/res/drawable-xxhdpi/ic_bookmark_show.png deleted file mode 100644 index a7a88fed41b55d743604a3c1099f076cdf62748b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 646 zcmV;10(t$3P)(C?yxqk;~e4*Ri*IIQ@GuOhZI%4 z;c%LUS%wdp0vH<4G7vx}AIp;-X9v%ys(@SLb6pgu>KQwe7-kV?_>mmvsDXDlk{sy= zXIN}&oORqoHn+idaUt71)|(#Z7$1-=khs~0j~Iio7(V(EpAR702acNEb5!}|TUvm2tI(_4yYMd>6 zK{vbPz7O5}lG`?P`@)uJpj*_DRdPRuZgI(N3w3lW8t4;s)GfI`fNq15+g;SrXBz{p zOkkjuHU|2qk(Su9tKT)0tNGD}B5p9+)fn!b)h=>7tHWiuLj};T z9gqM3fG`lOX%G8@Ap{uXF2?q0bBDpqhL@;Q#;t07*qoM6N<$f|JM^aR2}S diff --git a/android/res/drawable-xxxhdpi/ic_bookmark_hide.png b/android/res/drawable-xxxhdpi/ic_bookmark_hide.png deleted file mode 100644 index 57520e42180c901700024391e08109c771dbedff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1633 zcmV-n2A=teP)t!(LJz(-W}xf;>Z$bj>3 zJKxgCfT`3l+!nJmGGI^K-dBSyz6@woPvLfwrI7(ss&*>tQgc}v8L$g(uc>|(Uj{U& z$8bBu(#U|xR4bKrsOc?@4A>60XH=ubmjU(aLELt;EDc~H^)r>VsYxwM1K1L`2UVTL zmjQL^Ufi~@EDc~h^&^%2sK&7@4Pay3Zm}#K;5OXW`j>Nx4b-0MICY7-^Vcp_C#rqb zhH7&AZy7MQ`i{!JR$Hsf)n^p*XH;TuXIbp+>O23K&&=MRk3s=C{5ISQ$U(tG(0)YVlv& zQ0=8oQID%`!g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c<7wkDntfjSRR5w+=Ofh07vLYI#OASQa0!Bz|_bG&0~E+**S7eP+=nwcKH8WWXZ$ znaTEh|Qgs$6 f%d#xXvMl=rwykiZzQ4)U00000NkvXXu0mjfDabh0 diff --git a/android/res/drawable-xxxhdpi/ic_bookmark_show.png b/android/res/drawable-xxxhdpi/ic_bookmark_show.png deleted file mode 100644 index 18778755190e168fbc166ec1a642c877537a70c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 870 zcmV-s1DX7ZP)eHTwTIkY?~4K9o^$Rw+ilyI4}kymyU%;u zo`o%(;1UfyqSNz;1}<@eEm-Oo$Ac%ZhBG`vwP&1R4TE5u5B&TUSzKuKdyF1vUJp2rfG3bslGiu|nz(rhgu`&w7PhcM(h+7}n$HcIX zzlh&Zt%(YXuwfz9W5Grd6*QsRFDwq*_}}pY*;*(guW&PuGFp)B1>c5Y_%u!-TN@5i z8lE8q2k(&W6zQ)z{wf|ITMZcl&yzt7vOQq+D-Ayh2R>v9;2>f6CyoOIkjaOG$+(Zd zglow54;y`a&JA!=x@#=Ob^J|ukSz!q-{eaOAe)EHI1N9GbExJF@YxTb+Bs(9@H@_5 zs8&Nl;$99V)ZwDt_p+$MM_4|p$Vz-VdWULV z9Ac_p<1eFus5yf73h*GChl1b@2T^Na+4T6^=pbq>qy+B$L;%&g_#yaZt%ay{ux(=a zd0aqOWx+rB0ixDLLEv5)y1Kx;uJPCL1fAst{?7NHD-T(L-;Q+lg!L%HPvZyybk-EO zU4`zd0(YCxS%4!<%Z|T*TbQUK@KMu;?tJ7zZdYKUTP(=@2l)+5RSdabf~iU&w~H{< z4U!@+UB|>_f5nw6a@j0ftZn}&2zf_K1^_QbN8#0IINmz12MoV(UTatmM{H!VeU@YaB zA4|y&W(|W`Utlyb&v0(hc=}l2c>1UxPq(1acM_&ISCr - - - + - + android:minHeight="@dimen/height_item_edit_bookmark" + android:layout_marginLeft="@dimen/margin_half_plus" + android:layout_marginStart="@dimen/margin_half_plus" + android:layout_marginRight="@dimen/margin_base_plus" + android:layout_marginEnd="@dimen/margin_base_plus"/> - - - + + diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesAdapter.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesAdapter.java index ad5a9246ec..a244515165 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesAdapter.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesAdapter.java @@ -115,6 +115,9 @@ public class BookmarkCategoriesAdapter extends BaseBookmarkCategoryAdapter { + Toast.makeText(getContext(), "Coming soon", Toast.LENGTH_SHORT).show(); + }); } @Override diff --git a/android/src/com/mapswithme/maps/bookmarks/Holders.java b/android/src/com/mapswithme/maps/bookmarks/Holders.java index 64f74383c5..3fe4e9b2a1 100644 --- a/android/src/com/mapswithme/maps/bookmarks/Holders.java +++ b/android/src/com/mapswithme/maps/bookmarks/Holders.java @@ -1,16 +1,13 @@ package com.mapswithme.maps.bookmarks; -import android.graphics.drawable.Drawable; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.RecyclerView; import android.view.View; -import android.widget.ImageView; -import android.widget.SearchView; +import android.widget.CheckBox; import android.widget.TextView; import com.mapswithme.maps.R; -import com.mapswithme.util.Graphics; import com.mapswithme.util.UiUtils; public class Holders @@ -29,34 +26,27 @@ public class Holders @NonNull private final TextView mName; @NonNull - ImageView mVisibilityMarker; + CheckBox mVisibilityMarker; + @NonNull TextView mSize; + @NonNull + View mMore; CategoryViewHolder(@NonNull View root) { super(root); - mName = root.findViewById(R.id.tv__set_name); - mVisibilityMarker = root.findViewById(R.id.iv__set_visible); - mSize = root.findViewById(R.id.tv__set_size); + mName = root.findViewById(R.id.name); + mVisibilityMarker = root.findViewById(R.id.checkbox); + int left = root.getResources().getDimensionPixelOffset(R.dimen.margin_half_plus); + int right = root.getResources().getDimensionPixelOffset(R.dimen.margin_base_plus); + UiUtils.expandTouchAreaForView(mVisibilityMarker, 0, left, 0, right); + mSize = root.findViewById(R.id.size); + mMore = root.findViewById(R.id.more); } void setVisibilityState(boolean visible) { - Drawable drawable; - if (visible) - { - mVisibilityMarker.setBackgroundResource(UiUtils.getStyledResourceId( - mVisibilityMarker.getContext(), R.attr.activeIconBackground)); - drawable = Graphics.tint(mVisibilityMarker.getContext(), R.drawable.ic_bookmark_show, R.attr.activeIconTint); - } - else - { - mVisibilityMarker.setBackgroundResource(UiUtils.getStyledResourceId( - mVisibilityMarker.getContext(), R.attr.steadyIconBackground)); - drawable = Graphics.tint(mVisibilityMarker.getContext(), R.drawable.ic_bookmark_hide, - R.attr.steadyIconTint); - } - mVisibilityMarker.setImageDrawable(drawable); + mVisibilityMarker.setChecked(visible); } void setVisibilityListener(@Nullable View.OnClickListener listener) @@ -64,6 +54,11 @@ public class Holders mVisibilityMarker.setOnClickListener(listener); } + void setMoreListener(@Nullable View.OnClickListener listener) + { + mMore.setOnClickListener(listener); + } + void setName(@NonNull String name) { mName.setText(name); diff --git a/android/src/com/mapswithme/util/UiUtils.java b/android/src/com/mapswithme/util/UiUtils.java index 538449a183..30ffba9477 100644 --- a/android/src/com/mapswithme/util/UiUtils.java +++ b/android/src/com/mapswithme/util/UiUtils.java @@ -484,20 +484,32 @@ public final class UiUtils public static void expandTouchAreaForView(@NonNull final View view, final int extraArea) { final View parent = (View) view.getParent(); - parent.post(new Runnable() - { - @Override - public void run() - { - Rect rect = new Rect(); - view.getHitRect(rect); - rect.top -= extraArea; - rect.left -= extraArea; - rect.right += extraArea; - rect.bottom += extraArea; - parent.setTouchDelegate(new TouchDelegate(rect, view)); - } - }); + parent.post(() -> + { + Rect rect = new Rect(); + view.getHitRect(rect); + rect.top -= extraArea; + rect.left -= extraArea; + rect.right += extraArea; + rect.bottom += extraArea; + parent.setTouchDelegate(new TouchDelegate(rect, view)); + }); + } + + public static void expandTouchAreaForView(@NonNull final View view, final int top, final int left, + final int bottom, final int right) + { + final View parent = (View) view.getParent(); + parent.post(() -> + { + Rect rect = new Rect(); + view.getHitRect(rect); + rect.top -= top; + rect.left -= left; + rect.right += right; + rect.bottom += bottom; + parent.setTouchDelegate(new TouchDelegate(rect, view)); + }); } // utility class