From 0db54b76a98437be9f11867a23b11970565e950b Mon Sep 17 00:00:00 2001 From: ShadowKyogre Date: Fri, 4 Sep 2015 18:07:16 -0700 Subject: [PATCH 1/3] Add Javascript bookmarklets support. Also make searches like like "webkit android 4.4.2 broken" actually searchable and local files viewable. --- AndroidManifest.xml | 7 +++++++ src/org/tint/utils/UrlUtils.java | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ccd73bb..cbe7664 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -43,6 +43,7 @@ + @@ -69,6 +70,12 @@ + + + + + + diff --git a/src/org/tint/utils/UrlUtils.java b/src/org/tint/utils/UrlUtils.java index 84d5a47..9e531e4 100644 --- a/src/org/tint/utils/UrlUtils.java +++ b/src/org/tint/utils/UrlUtils.java @@ -34,7 +34,11 @@ public class UrlUtils { */ public static boolean isUrl(String url) { return - url.contains(".") || + (url.contains(".") && !url.contains(" ")) || /* actually check if it begins with the proper protocol */ + url.startsWith("http://") || + url.startsWith("https://") || + url.startsWith("file://") || + url.startsWith("javascript:") || url.equals(Constants.URL_ABOUT_BLANK) || url.equals(Constants.URL_ABOUT_START) || url.equals(Constants.URL_ABOUT_TUTORIAL); @@ -76,6 +80,7 @@ public static String checkUrl(String url) { if ((!url.startsWith("http://")) && (!url.startsWith("https://")) && (!url.startsWith("file://")) && + (!url.startsWith("javascript:")) && //add bookmarklet support (!url.startsWith(Constants.URL_ABOUT_BLANK)) && (!url.startsWith(Constants.URL_ABOUT_START)) && (!url.startsWith(Constants.URL_ABOUT_TUTORIAL))) { From 8df8b3ea3a6113d3dbac5b6d0bc12c874ff0ae68 Mon Sep 17 00:00:00 2001 From: ShadowKyogre Date: Fri, 4 Sep 2015 18:21:49 -0700 Subject: [PATCH 2/3] Expose the nested folder support to the user. This does quite a few things to address this: - Implement a new folder picker that handles browsing available folders. Much of the code is borrowed from the already existing BookmarksFragment - Add rename and move operations for folders and bookmarks - Expose creating folders in the BookmarksActivity and the new folder picker (even if they're not top level!) - Clean up a lot of how TintBrowser was performing sql queries. It was concatenating the strings manually instead of trying to use the ? notation wherever possible. - Add getting the folder stack for a given folder ID. This allows the folder picker to easily jump to the current bookmark/folder's location when the user wants to move it. - Drawables, since there weren't any for adding folders nor smaller ones for the folder picker UI --- res/drawable-hdpi/ic_add_folder.png | Bin 0 -> 6477 bytes res/drawable-hdpi/ic_folder_mini.png | Bin 0 -> 4914 bytes res/drawable-mdpi/ic_add_folder.png | Bin 0 -> 479 bytes res/drawable-mdpi/ic_folder_mini.png | Bin 0 -> 448 bytes res/layout/bookmarks_fragment.xml | 4 +- res/layout/edit_bookmark_activity.xml | 18 +- res/layout/foldersonly_fragment.xml | 106 ++++ res/layout/foldersonly_row.xml | 59 ++ res/menu/bookmarks_activity_menu.xml | 8 +- res/values/strings.xml | 6 +- src/org/tint/model/FoldersOnlyAdapter.java | 39 ++ src/org/tint/providers/BookmarksWrapper.java | 310 ++++++----- .../tint/ui/activities/BookmarksActivity.java | 19 +- .../ui/activities/EditBookmarkActivity.java | 148 ++--- .../ui/activities/TintBrowserActivity.java | 2 +- .../tint/ui/fragments/BookmarksFragment.java | 192 ++++++- .../ui/fragments/FoldersOnlyFragment.java | 514 ++++++++++++++++++ 17 files changed, 1154 insertions(+), 271 deletions(-) create mode 100644 res/drawable-hdpi/ic_add_folder.png create mode 100644 res/drawable-hdpi/ic_folder_mini.png create mode 100644 res/drawable-mdpi/ic_add_folder.png create mode 100644 res/drawable-mdpi/ic_folder_mini.png create mode 100644 res/layout/foldersonly_fragment.xml create mode 100644 res/layout/foldersonly_row.xml create mode 100644 src/org/tint/model/FoldersOnlyAdapter.java create mode 100644 src/org/tint/ui/fragments/FoldersOnlyFragment.java diff --git a/res/drawable-hdpi/ic_add_folder.png b/res/drawable-hdpi/ic_add_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..8f8fa9f5cbac7c265a674a5a8dfeeda51ca9083e GIT binary patch literal 6477 zcmeH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0{?twueR>zb^v4I}w0iPc z;0Z4t8cHp{_gvr^D+$q>MGjGWlC1h{tJNcMnnJr literal 0 HcmV?d00001 diff --git a/res/drawable-hdpi/ic_folder_mini.png b/res/drawable-hdpi/ic_folder_mini.png new file mode 100644 index 0000000000000000000000000000000000000000..5673da5c57c7445c7c8fc2bbed7ac6a51877e450 GIT binary patch literal 4914 zcmeH}c{E$w9>-5nBxt3kmRut0QYsN+%`w*eTGU(>5fLIHp<=4B=Al}%ODSr2MOxgN zN(>#Yp{`qMZfUg?K~+(DdC_;*egC|F`p5g@t<|&EKKtx_zWZ~2`+N3UzhBY?>+^hI zQ7`}id}gLbHmqLpuyJ#+?tk*2cmaUxSg4(2pbaJ%MyB|C5r{ZgU@WE9M9yV9SC`Vg z{hCbL&E*w>w7uIOk%E)og%>+?baWpeSLXJOW6tP3ytn7`8ndu)%m%SXBOF(%57-o4 z+tJP59wfAeAn@@oF<-*X(z7PXLce{-b_5q+*sdx>Co{BuL?ho?Tvl?%B zM`XKVO|A(^BNFFe_`XwtPa!5#=CLj?t zh`y0gC?vKLFdcu=a%j4bYa#V2)FM&6_0~OKpqZPhENpm+yBAzzTOoS}1o>LUsKmZI zldBR1pel{KqO6_^&3bRN44+?YwEBhQWy%vZ>k5%uDrKjeW7f|n#~2nV=Q0MeuV;&G z7x-4Y`erYQj!IiVa^&E0R;^wNea@Hcnh5^YIMb64Cr_*R)qYMl(~4hRoEg5eooOPD zTdy*VPgmRJi15nSUe2m+80`3?k7urP=_Wm}X;j_s0wH&>jWp3ZwaQuN^s5JPw0ET7 zvzCuY4f0}{!?TEV(aTjD9`71&;YZwsLqua-t;bR99@YH(BIkiP>vShOIcW__x)Twk z-vz3IXq`)eqF|0{(rT^P?bPYY=A#I`ZiR?ASMuUM2c@gD?M7J2lvb5OZd(X{n{nx$ zidQVXwCiPYW0>{sXPvKONA@KaTgA?^S7=QM-V}dqKS1QH;5d_CI}cN+op~{?#EZe@ zY`kGw<-`;*#4;HV5_$L^y7)H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pXl1F1_4h+yJpDaz2$~<66$Suk>(R&GQ=7GZ#NILMf zwoW*V;Hd+5P_9C;Wm@~?1NyGQ=L{lggk_t%e)e3!>R?D}EXcRBD~;vc8$hh5+0z;}s% zoUZ>byTJb`pl~Es)fCJskAQL;M;n5QoXYcE&`yf~UFuHbZbhljzzukPYX<9)D3b->~i6gUYp=V;UDzd2deGxmk&uXq*GO1*vTON{u$mq)tph6gGlreT`95Ar6f^u2lr&FvbtAQp?PY% ztU~xxN2CnJ?ag)l9TvE+c^&52aXlH#b?ENh3f-o++F7KR=Xiq_eD}s zNr5BvaaUN~x?`2jWtpj$Ndd7(Hh1s#11RG0j(ltcK=TnjDzL_xbU9&65YoTBSCV<^ zlBlN5C+*r@z6b$Jx!3-)c{mt(IMQ>!SxJ_Skdg00002VoOIv0RM-N z%)bBt010qNS#tmY3ljhU3ljkVnw%H_000McNliru-w6U1BoPZ%ur>ey02y>eSad^g zZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00B!$L_t(Y$L*B6N&`_4hQCSH%M7 z0Cb!JlK6C$-U#$pmWGxF@pZK360@%bA_8EBk2AsN0CR)@%r9pF)ErK2VXPEDP$ZKO z$nY%BK+O5{4Q8Sql2IzV2nw&e7Jzr0dx-sP%xdx3?nJHd1)qxgKuWSMsKVQ}b1VC;avE3i z(PyeUP{JUIoAz8mC;BZo4G^=}xU@8gHXMT8L$nFKhcA+CYg^q13g4YbKL_v!>>cA_ VW_;i9Ci(yX002ovPDHLkV1nTS#F792 literal 0 HcmV?d00001 diff --git a/res/drawable-mdpi/ic_folder_mini.png b/res/drawable-mdpi/ic_folder_mini.png new file mode 100644 index 0000000000000000000000000000000000000000..1bf35f1ba957b46320c2bec90e19d2e993786a85 GIT binary patch literal 448 zcmV;x0YCnUP)kdg00002VoOIv0RM-N z%)bBt010qNS#tmY3ljhU3ljkVnw%H_000McNliru-w6W%0uPdqw$=au02y>eSad^g zZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00AsXL_t(Y$L&-xN&`U@eSfoRPT&bd zK@brnt+!CGU|}gX$pr*SBiMTY3vUrfdJWOS&L*G`5I3{WVs_X4Gh=pA36j_RnVp?C z@4r8PfEE58V#D}Cf8D-{B}i>ZPQZ$ez|-T-LmWZkYO!ebVihF6r8e#^<-ueKfIlff zidc@y6#-_Q{oM1wE@#IvXU-Tf5ddKF*NtH_!6qgEfUN^fKy$rz2IHjw2nbOL0g~Uj z3dG#6k6>!`5apDf;p5gT + android:gravity="center_vertical|start" + android:layout_weight="1" /> + - +