From aae87b894f72a719a850ec32ad6944bd5c743331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 9 Sep 2013 13:19:43 +0200 Subject: [PATCH] Update actionbarsherlock from 4.2 to 4.4 --- .../ActionBarSherlock/AndroidManifest.xml | 7 +- libraries/ActionBarSherlock/build.gradle | 27 +- libraries/ActionBarSherlock/build.xml | 92 ------ libraries/ActionBarSherlock/pom.xml | 261 +++++++++--------- .../ActionBarSherlock/proguard-project.txt | 20 -- .../abs__dialog_full_holo_dark.9.png | Bin 1414 -> 0 bytes .../abs__dialog_full_holo_light.9.png | Bin 1537 -> 0 bytes .../abs__ic_commit_search_api_holo_dark.png | Bin 0 -> 597 bytes .../abs__ic_commit_search_api_holo_light.png | Bin 0 -> 616 bytes .../res/drawable-hdpi/abs__ic_search.png | Bin 2280 -> 2558 bytes .../res/drawable-hdpi/abs__toast_frame.9.png | Bin 0 -> 1319 bytes .../abs__dialog_full_holo_dark.9.png | Bin 882 -> 0 bytes .../abs__dialog_full_holo_light.9.png | Bin 1003 -> 0 bytes .../abs__ic_commit_search_api_holo_dark.png | Bin 0 -> 511 bytes .../abs__ic_commit_search_api_holo_light.png | Bin 0 -> 532 bytes .../res/drawable-mdpi/abs__toast_frame.9.png | Bin 0 -> 839 bytes .../abs__dialog_full_holo_dark.9.png | Bin 2159 -> 0 bytes .../abs__dialog_full_holo_light.9.png | Bin 2302 -> 0 bytes .../abs__ic_commit_search_api_holo_dark.png | Bin 0 -> 703 bytes .../abs__ic_commit_search_api_holo_light.png | Bin 0 -> 712 bytes .../res/drawable-xhdpi/abs__toast_frame.9.png | Bin 0 -> 1956 bytes .../layout-xlarge/abs__screen_action_bar.xml | 1 + .../abs__screen_action_bar_overlay.xml | 3 +- .../layout/abs__action_bar_tab_bar_view.xml | 4 +- .../res/layout/abs__dialog_title_holo.xml | 46 --- .../res/layout/abs__list_menu_item_layout.xml | 59 ---- .../res/layout/abs__screen_action_bar.xml | 3 +- .../layout/abs__screen_action_bar_overlay.xml | 3 +- .../res/layout/abs__search_view.xml | 2 +- .../res/layout/abs__simple_dropdown_hint.xml | 2 +- .../abs__dimens.xml | 2 +- .../res/values-large/abs__dimens.xml | 29 -- .../res/values-sw600dp/abs__dimens.xml | 2 +- .../res/values-v14/abs__themes.xml | 5 - .../res/values/abs__attrs.xml | 2 +- .../res/values/abs__colors.xml | 3 - .../res/values/abs__dimens.xml | 12 - .../res/values/abs__strings.xml | 4 - .../res/values/abs__styles.xml | 56 ++-- .../res/values/abs__themes.xml | 84 ++---- .../src/android/support/v4/app/Watson.java | 21 +- .../actionbarsherlock/ActionBarSherlock.java | 26 +- .../app/SherlockActivity.java | 6 + .../app/SherlockDialogFragment.java | 6 +- .../app/SherlockExpandableListActivity.java | 6 + .../app/SherlockFragment.java | 6 +- .../app/SherlockFragmentActivity.java | 25 +- .../app/SherlockListActivity.java | 6 + .../app/SherlockListFragment.java | 6 +- .../app/SherlockPreferenceActivity.java | 6 + .../internal/ActionBarSherlockCompat.java | 258 ++++++++--------- .../internal/ActionBarSherlockNative.java | 79 +++--- .../internal/ResourcesCompat.java | 91 +++++- .../internal/app/ActionBarImpl.java | 9 +- .../internal/app/ActionBarWrapper.java | 12 + .../animation/ValueAnimator.java | 1 + .../view/menu/ActionMenuItemView.java | 3 +- .../internal/view/menu/MenuBuilder.java | 6 + .../internal/view/menu/MenuPopupHelper.java | 35 ++- .../internal/view/menu/MenuWrapper.java | 21 ++ .../internal/widget/ActionBarContainer.java | 9 +- .../internal/widget/ActionBarView.java | 87 +----- .../internal/widget/CapitalizingButton.java | 23 +- .../widget/FakeDialogPhoneWindow.java | 64 ----- .../internal/widget/IcsColorDrawable.java | 12 +- .../internal/widget/IcsLinearLayout.java | 150 +--------- .../internal/widget/IcsListPopupWindow.java | 25 +- .../internal/widget/IcsToast.java | 60 ++++ .../internal/widget/PopupWindowCompat.java | 178 ++++++++++++ .../widget/ScrollingTabContainerView.java | 2 +- .../internal/widget/TabsLinearLayout.java | 113 ++++++++ .../widget/ActivityChooserView.java | 18 +- .../actionbarsherlock/widget/SearchView.java | 4 +- .../widget/SuggestionsAdapter.java | 33 ++- .../internal/ManifestParsingTest.java | 37 --- .../internal/ResourcesCompatTest.java | 23 ++ 76 files changed, 1091 insertions(+), 1105 deletions(-) delete mode 100644 libraries/ActionBarSherlock/build.xml delete mode 100644 libraries/ActionBarSherlock/proguard-project.txt delete mode 100644 libraries/ActionBarSherlock/res/drawable-hdpi/abs__dialog_full_holo_dark.9.png delete mode 100644 libraries/ActionBarSherlock/res/drawable-hdpi/abs__dialog_full_holo_light.9.png create mode 100644 libraries/ActionBarSherlock/res/drawable-hdpi/abs__ic_commit_search_api_holo_dark.png create mode 100644 libraries/ActionBarSherlock/res/drawable-hdpi/abs__ic_commit_search_api_holo_light.png create mode 100644 libraries/ActionBarSherlock/res/drawable-hdpi/abs__toast_frame.9.png delete mode 100644 libraries/ActionBarSherlock/res/drawable-mdpi/abs__dialog_full_holo_dark.9.png delete mode 100644 libraries/ActionBarSherlock/res/drawable-mdpi/abs__dialog_full_holo_light.9.png create mode 100644 libraries/ActionBarSherlock/res/drawable-mdpi/abs__ic_commit_search_api_holo_dark.png create mode 100644 libraries/ActionBarSherlock/res/drawable-mdpi/abs__ic_commit_search_api_holo_light.png create mode 100644 libraries/ActionBarSherlock/res/drawable-mdpi/abs__toast_frame.9.png delete mode 100644 libraries/ActionBarSherlock/res/drawable-xhdpi/abs__dialog_full_holo_dark.9.png delete mode 100644 libraries/ActionBarSherlock/res/drawable-xhdpi/abs__dialog_full_holo_light.9.png create mode 100644 libraries/ActionBarSherlock/res/drawable-xhdpi/abs__ic_commit_search_api_holo_dark.png create mode 100644 libraries/ActionBarSherlock/res/drawable-xhdpi/abs__ic_commit_search_api_holo_light.png create mode 100644 libraries/ActionBarSherlock/res/drawable-xhdpi/abs__toast_frame.9.png delete mode 100644 libraries/ActionBarSherlock/res/layout/abs__dialog_title_holo.xml delete mode 100644 libraries/ActionBarSherlock/res/layout/abs__list_menu_item_layout.xml delete mode 100644 libraries/ActionBarSherlock/res/values-large/abs__dimens.xml delete mode 100644 libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java create mode 100644 libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java create mode 100644 libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/PopupWindowCompat.java create mode 100644 libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/TabsLinearLayout.java delete mode 100644 libraries/ActionBarSherlock/test/com/actionbarsherlock/internal/ManifestParsingTest.java create mode 100644 libraries/ActionBarSherlock/test/com/actionbarsherlock/internal/ResourcesCompatTest.java diff --git a/libraries/ActionBarSherlock/AndroidManifest.xml b/libraries/ActionBarSherlock/AndroidManifest.xml index 7b8a84824..ca0fb7cee 100644 --- a/libraries/ActionBarSherlock/AndroidManifest.xml +++ b/libraries/ActionBarSherlock/AndroidManifest.xml @@ -1,6 +1,5 @@ - - - - + + + diff --git a/libraries/ActionBarSherlock/build.gradle b/libraries/ActionBarSherlock/build.gradle index 102d66946..41bbe1d9b 100644 --- a/libraries/ActionBarSherlock/build.gradle +++ b/libraries/ActionBarSherlock/build.gradle @@ -1,27 +1,18 @@ -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:0.4.1' - } -} - apply plugin: 'android-library' dependencies { - compile files('libs/android-support-v4.jar') + compile 'com.android.support:support-v4:18.0.+' } android { - compileSdkVersion 17 - buildToolsVersion '17' + compileSdkVersion 14 + buildToolsVersion '17.0.0' - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] - res.srcDirs = ['res'] - } + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + res.srcDirs = ['res'] } + } } diff --git a/libraries/ActionBarSherlock/build.xml b/libraries/ActionBarSherlock/build.xml deleted file mode 100644 index a10a91491..000000000 --- a/libraries/ActionBarSherlock/build.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libraries/ActionBarSherlock/pom.xml b/libraries/ActionBarSherlock/pom.xml index 3b6ce40ce..57d8d7c1c 100644 --- a/libraries/ActionBarSherlock/pom.xml +++ b/libraries/ActionBarSherlock/pom.xml @@ -1,148 +1,141 @@ - 4.0.0 + 4.0.0 - actionbarsherlock - ActionBarSherlock - apklib + + com.actionbarsherlock + parent + 4.4.0 + ../pom.xml + - - com.actionbarsherlock - parent - 4.2.0 - ../pom.xml - + actionbarsherlock + ActionBarSherlock + apklib - - - com.google.android - android - provided - - - com.google.android - support-v4 - + + + com.google.android + android + provided + + + com.google.android + support-v4 + - - junit - junit - test - - + + junit + junit + test + + + org.easytesting + fest-assert-core + test + + + org.robolectric + robolectric + test + + - - src - test + + src + test - - - com.jayway.maven.plugins.android.generation2 - android-maven-plugin - true - - ignored - - + + + com.jayway.maven.plugins.android.generation2 + android-maven-plugin + true + - - org.apache.maven.plugins - maven-javadoc-plugin - - true - - + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + - - com.google.code.maven-replacer-plugin - maven-replacer-plugin - 1.4.0 - - - process-sources - - replace - - - - - false - target/generated-sources/r/com/actionbarsherlock/R.java - target/generated-sources/r/com/actionbarsherlock/R.java - false - static final int - static int - - + + com.google.code.maven-replacer-plugin + maven-replacer-plugin + + + process-sources + + replace + + + + + false + target/generated-sources/r/com/actionbarsherlock/R.java + target/generated-sources/r/com/actionbarsherlock/R.java + false + static final int + static int + + - - org.apache.maven.plugins - maven-checkstyle-plugin - - ../checkstyle.xml - - - - verify - - checkstyle - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + package + + attach-artifact + + + + + jar + ${project.build.directory}/${project.build.finalName}.jar + + + aar + ${project.basedir}/build/libs/${project.artifactId}-${gradle.version}.aar + + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - 1.7 - - - package - - attach-artifact - - - - - jar - ${project.build.directory}/${project.build.finalName}.jar - - - - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - com.google.code.maven-replacer-plugin - maven-replacer-plugin - [1.4.0,) - - replace - - - - - - - - - - - - - + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + com.google.code.maven-replacer-plugin + maven-replacer-plugin + [1.4.0,) + + replace + + + + + + + + + + + + + diff --git a/libraries/ActionBarSherlock/proguard-project.txt b/libraries/ActionBarSherlock/proguard-project.txt deleted file mode 100644 index f2fe1559a..000000000 --- a/libraries/ActionBarSherlock/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/libraries/ActionBarSherlock/res/drawable-hdpi/abs__dialog_full_holo_dark.9.png b/libraries/ActionBarSherlock/res/drawable-hdpi/abs__dialog_full_holo_dark.9.png deleted file mode 100644 index 79e56f522b2837bd9f579b28f037ad5eafaaee8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1414 zcmV;11$p|3P)cSnqT^=WQ7*OFqW%ysfqGq3fLYCng$eebY1E zq0h)!qMt>^T{!1KLrdv5=!(bMwnfb7mMF4BgVA@!3k##^X|etG%o8VLfn)&kp1$5* zAHx|3EF9@?)w)=}!OothSF(h}LSVs2n}u~V8rR2gA&m?6GFm9LT5i!5ovh2$`aOLf zDMwpCv(UIN+s(qhT71rU;E=VYR%2(wIy9)U9BqNMU?EvKj~0!zxmxOREjkZzh+iq_n}2*GaEP(@ILD!5 zWBguqUH^M`clY;tz5a@wsI&tR0g7j89WEv$&WS`s3jmAj>+65+@9$R+4-crSDsl+t zoXD~ai^by4tE;Qe>-G9CHN@f2j4rXz#$jzQA^^+B$H$Mix3`1-5a+ZsO@p#5Q53}= z0G4QnFC7vyL_!;@%<@Jv>_k)mSUx>Hz18n=PE3d}%kYsC@*I)N0NNv^lI%s;wg9j! z%knLLgEIoQ+bysY63^&#(^_eOc(NT6QxTdoZI(#S<~ro`ne!tS(gH7T&zUX-UZRk7 zy|5!F77`FowzZg?X(M)KAw}<4SRP51e8qZ>m)V;$Z3?tS#CiaZ^hhEi?U_=yRh(%c zcGk9kwMUBGYjYt@pHyCSltyExNUHHFevMy@-l#r~QEjQ;(4?Q~r4samHh{FF{bU7StYxgeBAZQ`6E7N`VLYGS_ z;oj>aHT`D+d1$*FJhVBd!G+`uf(ywR1Q(Js2reXN5G)~C&xiARXWFDHmGF81Z6U>K z;#g%)oXa8RP+ENtZO$MZBP0)Pm&4Jv?h_KbHF>VdnKo?a-t;CVB(9^gh389`0#_~3 z>r7%ovdX{d8amFjk%uF>Vp~*9sp-GKg_vAO(?{&AZLdjA|Mdo3?oA8H>)1>mc|==# zB~EQxV&cD40$n%8&w#s-rjOWJ+ddiIQXYxR!^y#)tE&3)24CJ80l~J_MCXPu>Ml3AI+9BHcJ4%0r(Kw z@2dYHj4#nGKH!fqjRVUuh**Aw_CvMrs{b>Lm!YwzO4di>6N@*}Phg5Tw&B1fy2S@v zNaMh=r`Sx3>1SxA8q+hl==5I;NtblfC(XkF^KkH7ZKuDGcq0~@mC!ryi=K7WXgde? zOwz>rq{P&!A!(hIr~D!&pe-W#G7`?LQYh|`P7hzs(O!weT#2|xih3m$l64(P7wFd8 z$(YnkvI-Blh{l8EAha{kf+|%%mTX6hk;YCcRo{6`6g>|oKBz>Tb24JLyVyI4p!izS z!8wv9b%$RIiIZ@y?B&nGjRPyvaF~-xlb-U|=!P~^8?n&FNw@wIvQA!p;xDy1AK0dR zu~CaAl^btMM>A?9->NQ&|AnVmzdt!!WF>xutSl`;$84s2a_=ari#ecl- zo|KSyJXTD=1$2JI1Ql!6el7Y8-dCZ-i%gs^mMBu<;eLzP8a;YIXA&Hxi>7JtAFa#2 UvCQ(L;{X5v07*qoM6N<$g1g$KMgRZ+ diff --git a/libraries/ActionBarSherlock/res/drawable-hdpi/abs__dialog_full_holo_light.9.png b/libraries/ActionBarSherlock/res/drawable-hdpi/abs__dialog_full_holo_light.9.png deleted file mode 100644 index e029f210b9a81ed4765d31e90b6e49dc8aa37bed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1537 zcmV+c2LAbpP)P*hY@RCILOyI+)4*Y%ioMH6eaT8-v42qXrI z0|4iGEk=d4Xm52^#H?WUz%bBygG}I|;L!cJM*+u%I9T*&&%x@0sx#0Qk0mTmeRX1h$MIxNMY&% zsz{Hz01C^N@8p~dFgXbIRub%{CUOKKzAQ3rfl0r3M&j^DZL~BnC0R+zNTfH*0>l>% z6xe!^4oO*vg0sbY%(i4Znw@-;nUbs&1zN~PIe02zy)Qcz&8uA?+OU=`?e2Zs5}uJN0M*6C#a{)YX?>^k&iO8v%U{pV&i+9YXUL@sAe1fQs10%V6ikBo z^7Qod_s{$xhgN}Tci-i5`3pX{;N4;1Au(Bm7x@)z#1I9LmdL~RrF4uC5rsHs>tE+w zbjvJ)LKv+{MYbuBrU=TBLj=6Xm=@t7;baF+QjNr0K02$09MPPz_Q^dZ5CLh8#Oov4 z0!TsP8|Jz<^->fRi@r;w5OrSCkw6L?N(J|#V;?nA78HxV{Q97DD=gWeOHxKs4U)p3 zSoD>;waz;geHn?ahed6Tq%7rduPgn zV$nDE$&ajtWS5-`4=n>hvFJNE&bxxNGnt2!k)T-g9UO0!_0BFb6cm%bLuC>qYeBK* zyN@VHxuTkNE#cFa@PaJz!! z*)p0eo;YjAyoc}Lcn`@)ql2XA#Le!l%y)3C`#|D`qk*LC#Leoh&{v9irz@IDt(4j|E-ey3YJCdAoj z17Q35`nvale)TKB+I=4%AAxk%w!OMGAf++t+Mb@Cemp-vW4j&J%V|A%#TR&cd&9%S z1Mctdf1tZ-6W>Id5JKwGXhvG!+}wOSKR^Gos;Zyq!S}5X*>+05G4|7V9G{hQ?!VjH z+iw8YkTX)YMrymYx~{`?w$U_yh$q-O1#m*zu<(hQDx}lJ70s)V5Io{ZN7v2rMwVC7 zhTm_2@1*&pTK&uP8_~o&lye*5+om^+1{h zqafFH?O0X{OUO1M^YAPb=F`bd6<0LB=s!LE=ilN39Gach?DYt$CL6UhXTc;$2zpT2dqqQrIZWT*_yH->_|IcgE|Y&S_AJ4lX{3 zlIkT6RWeyS^JtZ1q^3@yK=Cm?J&*-y*C;dpYgTSF&bztX%>V7a(kL+ra#JUT-|=or zs-McUNbE?uO3e#!@v#wf-Fu%ryG^`~69lNs`%MmnTRbrM$471B$+eE{K4hK$mCQ9h-Z$E`tJc<=E)8`p?U8s&`700000NkvXXu0mjfb2aWW diff --git a/libraries/ActionBarSherlock/res/drawable-hdpi/abs__ic_commit_search_api_holo_dark.png b/libraries/ActionBarSherlock/res/drawable-hdpi/abs__ic_commit_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..83f36a94cf14a772782c40a9d6272ebad6339030 GIT binary patch literal 597 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}trX+877l!}s{b%+Ad7K3vk;OpT z1B~5HX4`=T%L*LRfizez!?|}o;S3Cnv7RoDArXh)PPO%7c9dwFe^aGRMZrs8jZJ%| z?wh@>5uFcs*D%W|cCj125Y$<-R)w+qs7}Yb?2Vpf=11nv3>8egx3Vn#S@pj8KhqR6 zG&EkkPhF*!8m+pTbC#dqiL_;DEXCrpx146woqFTqHxbD;9*+#ciDJuU9g+FiWw>gS zVB|+zwvro%KBPtN4f`h5(PAcTQ*_KY*3L^aYPv-~hnU})iiG*xW}TjAax7EU9No_B za>V+1kL8m|c0tZ*b`x|Nx^tDUT%G&w>a}foUzSY#K-<6eKL1*7+-p{Sv zk!_>Mn#{B)OMQRf|DtR4pA=Yu;IDNplVZ*;1ry%#Z@^GjEpd$~Nl7e8wMs5Z1yT$~ z28M>Z1{S)8W+8?KR;ET)rWU#e=2iv<8Lyj~Q8eV{r(~v8;?^L!&B`9AK@wy`aDG}z od16s2gJVj5QmTSyZen_BP-lj^I5jl^ z$;g>OGbAc|*BLC_!^W%}l=wi_;R6c?C(DXghXh=iT(a7h9Q>lbZLt^6k2Rh(@5*c6 zHXMKa@sI7ISBclZ^f7g4v-++!nvywl7H1a^qxa&h<6Bln#?D-z9l&w!rmCug(G@ZN zip9Q7GZtOTkTBkMLotE%Ap51guFq@(T<`L`*la!%elyI~YHMj96Gz4KdA#Rtq&IX- zJ!-CcHCZcQi^K=d6Pk+VB`+?kXd4^!8_I4vAS@W3b2+)+&M5pw&$`OV#YdHxt?me2 zN}j57|J}PgEE5>@OGUOd?U}p&9hbOcTS@p0ju6Y&%17t!J>;gaCGni-#Jz`f0#sCP zRhEXB@N_$S%`U6cJhE9tXb9`;Qei|6B4IGHXPC zsx8m}MucjKYeY#(Vo9o1a#1RfVlXl=G}JY)&^0s-F*3F?u&^>U)ip4;GB9Y@Qqo7! zkei>9nO2Eg!?*HTlYtr}K{f>ErbP0l+XkK3vuSJ literal 0 HcmV?d00001 diff --git a/libraries/ActionBarSherlock/res/drawable-hdpi/abs__ic_search.png b/libraries/ActionBarSherlock/res/drawable-hdpi/abs__ic_search.png index 4be72f108ba1a4f36da5c3a59b1ed08ddcf7cb8b..bf8bd6670ae4270c33e99cf6ebbe34139b3cdf0c 100644 GIT binary patch delta 2313 zcmV+k3HJ8r5&jb)iBL{Q4GJ0x0000DNk~Le0000m0000m2m}BC0R0Ow43lpI7aIc@ zX+uL$P-t&-Z*ypGa3D!TLm+T+Z)Rz1Wsxk@e+DXph{z}f2n!KD2r&dmE-fm92PFf8 z0D}U90fPfW07D`}J;MTqqYQ5t#Ti`~OBq)%-eVGD3SyeTbb(ozIg)uH^BWdRmJXI% zta_}itoPU~*`~35V-IKF&7s86#qotRk@EtVBi9ygP3{FeQan?6g?K0N3G+?km*HP5 zf1o3s*^S+dw;4e|u{OV@Dk)HD@Ik1y^}D1$Si+bx&O{6K@+I zci&*Y1poYi`oM`nOM`cXTnv2~&J-aRX%!U_T@f=gc2C@c1hz!oq_E_Mlr^b0(>XFM zGBdO0W?#%@&$G|3DA-i^u2{Pyt8`V_n+pBPlB!)bjI~~MQ|li#>NV9gpKX9L$`L--``Ms4P zt4^w@p$KLviB`qTQ)@&A7S4FC@``j+uslQjb_e+FPlL_t(|+O(Kma2wSX$A5P}w5yeE z$(G~9F?9kM211-~5}LGz)L|=PTQd~eWOhWN(h-w z$U_~N#t8%Dqdlyb!p zEJ~V!j)6%%aWn)x*>pGqNXpn0DB<9VKn5!T2suAYfk49`K?>{Xw#PQ#c1QCDp&`Kc zGK2r=Km6XGMwuZ?5eE;6td*kq0D*!|f1DJlXWD=KXiEpoTR@;9P=??8#fd)*lOacu zaxKI{fQpXAnsl;n|2=!>e&kFS^HyUl5q*rIynS-#aq>)HQzlp`KtU%#OIOR0CtGd> z@SP9Nz5ek}uGj#im7m|yb$7=ORYzb9fB4{YmnRs*#;b;y0|+!MS~jNNIh1Nef51m? ze(#@WZJa0(3K|y1H-Sjry1*Nu0c|`%$4{et71dmlz>OY55pr)X4%Blk~A&8#+PCKOgS7$QWZxkz0FfA0^GB_iwEzMI{njQV z%ESad9zit$kP;scnVmoqY;8uXogx8d3<;U3NcC%JSb)sskOWpN@{C%JR`!r!8Y}XV zP?U5ea>j|ws0u(5;7=C`fAEuak&9JR_|TAq6(>NB+Dq@ZNt3p6U zM>MZR!fWHW)oK<3e2Tvwc8iqL?R!iT#Fmdjgk6((YK>J7GZQCrIQX?X*~hW{&#oYa z|NDI;sgzs-p=DeQ^{*e~8dE(%)^ms}m{t zzb6{k5&ln{%OQ%CbH@!#wh5^?p?;S4jBYZVzJ9!2b5 zoeF$P>o%U>PXp^nlE4tUP=zW~p<`f?WUZC>*CS2q!1bOwS-UM~0X`0y-;KQ1M?hiI z_Rqf6k))MoQZ!Ice;xHCX{4FfU8#X@cicq)`OHN-lu3-`cix<3s+go$^Ug!twgK^C zp|`K+T|2;QxtJ=DK8#m=9|7iBTf@duWbMNR}_Ip ztdtuZ_-N>jQP9QiwVQ8gZ;zRPh!#;WM?UR*VKP8cCQp_Uf9^uW!m&j`!=!=cpKbhM zcSB=zCtNO=Q>e`7GriyG==x%am>eQVw+-|^aC~TraqNW%SuxousF+wZTk+>MJ-nkK zU768|>%H$D?6*~vQ`_#}3n&PDRE&|q-7gMJGqw;>37DNs<0MF8e6!&Px3@LMjmA`V zs_0xEJv#hCe-?)s0_tdZb!+!N=7u(7WN`P9O2lG7=ng761_l<^jolGYrihJ;3)IoF zt?t72Rc!&{Y9(T+@m=B*;NfDEM?*zHgo=xYhfjb&!9BQMRp%AdL$bM_b7m6WlTw0E@Nh;-6%FPgTiee*vFD{Be;7lC9lkh46{KYpRi~b|)BC=B zZ^c(C=C!MPjt*tHP7zPa)t=D;N@Tmvo;er!+3d@sxW4`DY-KuQ8!rpa`j zKXZNw#D>4^AQh&6l@Z7QpAuOnyUw3pj3_slvtqyMV{9~lWtqJH!s!bY8=VsaIAQ0n zs>nB1e^Sth(@45+SJ%$DbKbz!j^kV-hqL-3FBL^}mj3VH1HIAk{QpKkxJ@+Tq-Z+2 zxw|u8IQQw}m&h|79X|30vHk*>KPU=9A$XJ zD9-4@SjxD9@g9>HQxMYxrVGr%%#q9sncuKjvUITAV%1}9WxdB{$u^Dc8+$nWZVn}m zE{-ppiJTX>9J#h|YjQ8(k>Z)kE5tjAPnd5SzYPC>VgVh29fGccSA<;P)#Mx4_XJbC+Vc>TImVuz0yBou)wg^D8|^vL|}+`4-? zr~aPu{Sy!K9*aHM|19%`$jgJT^WVz9yYQjulj-MIUl)82|0(e6)SuRWj{pAy01W^S zG}!!iG?Q8bE(`zyVoOIv0RM-N%)gN#7k>Z=c5p#w0000W0000W0EhaVod5s?)k#D_ zR7l6Alv`|6RTPH*eJ*q6*3NW#gHA6qr888i6_f&{1;kE^(h#JCR1LE-C6M<&bS`JkSw0|DJJmFCJ%8=& zz5Z|Qwbxo3_@Bo9TDs5)H}Y8?H^Gl{cd(p{8mHc+6I6~$OwWh2hTAN`jCdqr0n(9# zL|7$5g$M>z{+Cij9xgK%KcM%UvhBN;EO%RNf)EN044%35Q3pozgB>BimWaN80}vQn zCH`ze^6|ALo|qIE0EA(Lf^~)QOB3Yi34hpCFed00$Y{;tHNq-HY)325w z?hSs<_!S(pl&uZ@q@MqH8y0LauAV8a1x38W3Rmj~)ZD(`kg>|}X|$ZMTZg2E3cA>_ z4_Ub}$qaZH$PHk(7!zOa3H}(ad#M;E;%4hP!YSSm>&gH-d&6{pbI?jW)ISgJ!j3E@ zJyhM@-zmlyr!lc68owXf&ckLV}PWF-)?FSq`ZXm<~n>ED%7% z6;(%$k)4{xCdb8Cwie8GTyXcEIxnhjj zedeA)NJzyF{;sq>Ez=npyVwuKqs<2Jt6`&SqQ-4Yb6NN8?PnKHO@uGa2KPk#XLIyjopn&i@?Bxms=OSsD4!e7wW>Kn~%CU@%5^<^H$g+f2H zT%WwHen=&(ol>B~!)h@g3B$-0Z^jn850p9|gL<#M<=3Xc@o-j5Vd|rq2@XsH(EH^* zM{2!3Wpvo#>j@>3iqVGv1_GE%*J+APttlv2YD$5MFf=ge5P$J@e|qR^t8RSp!pYt$Zy}t?I#DMW zV~Q8cBh~kxQrp!b_%ZXTa;U*pWOCWMIuR1AoX)`cBbbJa$U60+wZwgLJ1>HWm{In< zeYCQ*XtF+Nr+;J!4*(jr!U?@r7wici4(yl5I6pvn^ro7q6(Y|6gq{~cAjZfSYy7<2 zNME!*PA#E+nl&6El&D_IVWT>4%DHEYR+7pHj5KDH{T0W)xn4YZE;8$niE1(RCt{2olS1zMi53nQlgTD7hYzO zEbLhfJU5sFr<>s%(zUb>_$paf@S`0;M z@Z5(Dp8HPAQ}#a>7%{ZjiL#Yw6{xLbj7s?ti$GFVIF<;ittA==6^lroM6qIpVnoUh z9g$j78oWwW^lgnqBRS6iPb52m))K7&tnTjaKHuKn{<+y~K7H56GUzY=>=%J^Y#*PNQB~E?05NT*;ME+tT4PHpCpo9q4s1V%O)m~E0Yz;yY#n90IT!7 zcajlyeNejqI5MS%Hhc9(kv;|zkwz~vheQJW=p@SkWZA@qHJ4aK(rvq@M3znHdsARS zL<)UztA!%VCN;rMPPR3ve_$iaWoqAdW1|a2`dCcv?^A{;inM$t_c7-?WEQ*yNvS<6 z8I3*;-sC#?pRZ#g66GODIJA*jph#pEC=!_kibQ6CB9U33NMshqh{Q~jB;`P1Me>pi zOgSN04x#>clSpuABeQUdNQ_F$XL28p6)AbkE?E?l`#UDmm<(QInN03`Pb8b_%}a$s zmW}lD=oEmVh-444xpc^~vHhLQBROSglan%!&GI=Q9hC;?yC*fF%wCe!i!2-IXB(A* zGIbiaeuILs+NH2{|h370@KlJ6tzLwWyA4$e#Z}%nd zkDjJ9cojs1`42$d*Z=mlyr!kHkt&*K%g&GF;5~+S+sc0O#%wwi-V2upcDf?{sb#8F z5pnEXX;co$P~u5RnR~!+*wb%nk8n;MexH{IHm|lPlP=zn7F?k8B9fOc&|daiv%Q?# zj7E78ib{I4u|nx(fM`^TrKr&|$t8bbwrP>{lK^xiqDXlloo}zi?VQO*B0IFX#3GWk z?Mk+_`T%DBzZ6pIgQ1dKn2b%frH+ZDAB4hZk>rh?1AEURX##a}LDGuUVK{v0a0u0I zF??DMpN@1HSQ+eMqZKD6QE(l}z9u!F*R~vNRMKrL&7|kGg*w`b5KFvdqYov@8!JNS zvfi5$xe@{C#G*Eod69<#T_!Q1;IyNpI^Av$r8-INL-HUv$AK?RXrCi;?darRzy~L* de(Smp{{tYnj7r@g(8vG)002ovPDHLkV1ja;ZoU8j literal 0 HcmV?d00001 diff --git a/libraries/ActionBarSherlock/res/drawable-mdpi/abs__dialog_full_holo_dark.9.png b/libraries/ActionBarSherlock/res/drawable-mdpi/abs__dialog_full_holo_dark.9.png deleted file mode 100644 index fb3660eab1c5c380435a3cb29e836585a75346f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 882 zcmV-&1C9KNP)d5lfPH{+~ zs&ZK!$GJ#`+OXn)bEl7O^s7vMLr%~_eO6@BP#xDsWzJIxbKZ~=QHwoEqiCN;6|k~9&?6VGu8wVeg}kjlqBUkXd|o%rApJ7Xx?SmelE6^*`N?mP%?P7H@yM z@176Te{31>^aeVqCP$2D`iM8b&G*loT1#z02OAN3)TGUD#xbYXQgqexFre>@9yw_< zoN>t9>xRrEIA?_IE1YrUo=P<2hNadJXB=4rbb%a&IXb5^sO2P4AoU2`8OJ_N3+RuU z?3bPMlGWJT{|mv5xDeck3qc!^Tkv+yM^@uWqQKxnw{tZ6G_7EN(=@mR#5tHjEptZL zT?o!N^e&F18P*7EfGlP>S;He0o_$19Sz!q7up>N&hdzT z+KgUQr1}UkLQL4KR;yolWSqh_YPX?lMz7!1&pz~~fd%z~_Z{#V_yT+aKE`}mgO%s( z*Zy2en({y`_&;C`{0061zkwyNiuqzpAev$qeWYoU3d{J#NzC8IACaX$H=;%xu?3!~ z#a`2j|4di>P9KpnLiZ0Fl^vDJdHW{hJgNDYHbk!VsHwq51hhtobGl;RmY>GHkg{)E zesWUhFRGl6)Eh$fMU__)%@X*lTj%8LuWk+fh;ux9b*`$4|A#h$uKO0E`Tzg`07*qo IM6N<$f=1Pyg8%>k diff --git a/libraries/ActionBarSherlock/res/drawable-mdpi/abs__dialog_full_holo_light.9.png b/libraries/ActionBarSherlock/res/drawable-mdpi/abs__dialog_full_holo_light.9.png deleted file mode 100644 index f18050ea589eaa31233bc08e4f8a4e361747bc94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1003 zcmV%vbFc60S)hq5aquQtN zO>~Q-PMt}eDy?tfo9G5^U3x~HVu{=o-l^#5`3AXbFq#7CZ= zx~R)Z%-PngELWXE=jG+4wH{HY%RHtL$z+_dj#xsD@Y&isDVlJd1j7%A; z{S3ob2!NCVl}{yrl8B^V**9f-6IC==^T()w$-W%VAY54pg(^F>UjitZxrB-eCn8Lf zB*stQ-rl}17K`6RG#lbS(&{_eIc1V`#=6_}di{5~T>e4x!ZPZXM|a{QRmt`XV*pbC z)5T)(D?{j2cRHWXf1>hHw<=z1GC@s9Ro2lk0Wc$?r`}K3Qx5<^GzKt(+iwt@SwZ#Y z1K3Z>bSEt!roEr8rydA`NJoVD>nPSV+2(05UE>4T005_GAOuI89vS#iG4B18N9tN{ z^Z@tNBTj+gCOB47*w+ z+2Hb~>!f2H1$Hq!D=_Sb+i%D|qnZ-1^bbIwX<}v&QHjdz0&e>kOOQ$(hHgzP5DjJz z0f>y6M3En>w55Wi4nf3bKUf4p>o0~xvY>6}4YBjHqH^B)8ba{Lja`ks{5OurR;$m< ZjQ=n8%sUGgc=rGR002ovPDHLkV1nUn!$<%C diff --git a/libraries/ActionBarSherlock/res/drawable-mdpi/abs__ic_commit_search_api_holo_dark.png b/libraries/ActionBarSherlock/res/drawable-mdpi/abs__ic_commit_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..844c99c22f9c58f86b732fdc864ca3a1f7ef5a8a GIT binary patch literal 511 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE0wix1Z>k4UOiAAEE)4(M`_JqL@;D1TB8!2v z2N=7Z%(epwmK8Xr18D^?ZvQoBE&~H2yQhm|h{y4_lQ-(QIEu9Gw|su~9BYG>3T z<`p7Roqh{%_^tdd;j;0b>)HiVJib^dHRZhfE4qDyk?~Gtt8equiqbxvtv@%Dx%e+* ztHqKpokrI$Us^9~(d}R?T;sm-btuy-6Pe-@#-}B813n&+({H&E#l^7U6xaGWpAJrF zJ1}K?Nt$It@!1Ahzh7SIGk!oK7J6Z5;@0+tTGye1X)N|Sst)@=kM`eLxa+CY>s=R@PU{kI zI+5bExq~-0Gx`KqoZk+Eg;9$CxLGZ0rQc^P;Nof3_xm~J{MYkeI3<4MPuaXsP7N3~ zswJ)wB`Jv|saDBFsX&Us$iUE0*T6#8&@9Bzz{=Ff%G5&Fz}(8fAmepYGm3`X{FKbJ zO57SGw^`W(HAsSN2+mI{DNig)WpGT%PfAtr%uP&B4N6T+sVqF1Y6Dcn;OXk;vd$@? F2>`GzyM6!w literal 0 HcmV?d00001 diff --git a/libraries/ActionBarSherlock/res/drawable-mdpi/abs__ic_commit_search_api_holo_light.png b/libraries/ActionBarSherlock/res/drawable-mdpi/abs__ic_commit_search_api_holo_light.png new file mode 100644 index 0000000000000000000000000000000000000000..86c170e97b106064cfc22fd02e1992a19db85622 GIT binary patch literal 532 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE0wix1Z>k4UOiAAEE)4(M`_JqL@;D1TB8!2v z2N=7Z%(epwmK8Xr18D^?ZvQoBE&~IjjHioZh{y4_m-l)xJBl3r7++>CVDLiu2ai}2 z=f!(o9|d!28}>9#VDAde3F2s)U=r5U6v4GMCsGrGA^taB&NsNRu~(7N_=wE?_;Uwfvf8x zUfqfC)%uod^WNE#A#0wC-`s_lPO^$JUAepa!;4!Rx5SznYWgX1F&IV9lg)V5Rom{& z!#LxCpY!Rdt9-W1n6Q;0__XO^BNq;V?ulMJrn0Zv1Y8?Kd3^85p!{De0qV$jwj5OsmAL;amBv$v_Q~ARB`7(@M${i&7aJQ}UBi6+Ckj b(^G>|6H_V+Po~-c6)||a`njxgN@xNAod(4& literal 0 HcmV?d00001 diff --git a/libraries/ActionBarSherlock/res/drawable-mdpi/abs__toast_frame.9.png b/libraries/ActionBarSherlock/res/drawable-mdpi/abs__toast_frame.9.png new file mode 100644 index 0000000000000000000000000000000000000000..b9105deeefb805737627a38fc0818ac00be90e11 GIT binary patch literal 839 zcmV-N1GxN&P)j~O(aS~>jI*GARALPZW)ym*FPHDWq8I1(U46`4*`nM`D4nMO0(kX7~VWc8B1QAYMk#;(>=Ms+~!;%PV0Gr)z_q{C3C+FM>Baw?0{`#|j2Eey%`+L9N z|3EB+?_LjvCh`apVq4es)8TL!ErNlfs;X}Qej@gm6_n6K>hRD+9{hWJ42J2f4U2rolzf7QueV$hL*? zeq6Ps{oDTy*)c+Hc^mT++1otgPB0_q>{MgURD}oI*F)o7SLQ|BNQ`hyc?#qmEaNF@jv&1X-2A|B{*aCP2@CCrvu6{(w zNRVf+OW!EuQRD=m0q_Fg89)u-Pgg%9cu0fTL!$F&Ei5(YjZL1?AU%UM(r`{cJaB@_p?Zmwe8|2zaHPyRMb2tUt<#|N9Q^takF=<1YkybI$aT RjbH!(002ovPDHLkV1hAGdGG)L literal 0 HcmV?d00001 diff --git a/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__dialog_full_holo_dark.9.png b/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__dialog_full_holo_dark.9.png deleted file mode 100644 index f4970ad1c3278235157ac72f71fc98f159fdc439..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2159 zcmV-#2$1)QP)7pj*K04R=GS>IExgb+dqA%qY@2qDDdSi?}MdX75WMJ|ri_~yampZf~b zyDwJPzURp0aERFLx!K0Z6`{S(+b^7Rq0fZm(kDLm@P!|`&m~8kF)y`OQ+*6SLgj(n*c6WFZ`T<6tC6A%w8 z+L+Kg_>sWYRhaz=AtQLA^@LuUvKr4zS(=h&ATdHMd1uOv+V9M9YYe+zz%fKlM3B!~ zyq*EP{ZyC9dltDoQc<8ZrM^eE_Hte#g^dKR2>{;+o?xX#_XJ<6fcSW3 z(2+n3e1qrFpfvl1x~?#Fy4|E$M6lRgKuT?d8dD>b&VB465lv_ms575+OWy%#u@k+N zI%?Q+K~hGrT_7#|a=gF%@ZrOc@87@w`1bAFU(2$bW3Gd+|4`xmgT=9~$+>Rd`_AEe z?tAPdzh~^4zVA1WkB@)c-QE59<;$19v5OvFA}vv41E1cCHa5&@4N;9-`R?7jpWeKA z^Yg>QL%m+FvDt*4cRX_bt0?zBkB(K>DX%%#=N+5R(_-8y- zVb>j!?$Wbc5y%%}IfCs9*+@_USOKV3tJQDczI|KW-rgqvI6{s^UDwxjUH<~$ckEhw z$wzfwA%@V6dv=Zxn=8;sa(#b)ziOIh-@k{Dz1VCvD9chBW?(0HZ$3-*gQG?|lNRhy zsce!AuP~V46@dEg?(QVrAwo2L-=l3?V9=qSyONQk&Kv_~&Lf1nMm8E$0BV|mEX9~d zNP}Lf5}1xu21h4T$+9&-HQuut%PRmY8i6duXoOerBY}OxLGlJ5BU$zc%^yh8OvsW{ z7(^}+!OmYLNsSuWi7|-^5)oDyq5>gHA{u-eOKk`#f#=$OmM4_(@m{kC%_W5DAmmhR z=d>`52C;YCwuB;r{%j}Ebe_P7K+b^`h8A8*tydWpwYtuV2y(IKDEl%UBLZ0(i3V1m zfUn~Tp;05RlF3Ax+6Y;a8pF(Tjoo`iqE#Ca+!sAl5kbmO&cKL3&H*nkK%{gluy`-t zg(lV{G7z#PI)C*NX293=me{C~cPz9KvLxQ9W=NZ^Ugspsp|?>vp+=TQM}wGdXLXG{ zVi`Ci0$G}v=(F^hV}w+)Oe2t`iJ2g)`#yKX$5zN3ft&-L4rl3d-=WWF22RL{IarUJ z10V#?jlh->hk8-+(B={{f_KC0$_Y6UbF}H| z)iXk95=}<}9Szz&zBnPrq{TEU=*R&0y55rN8c7*TmhI~1gq#|$ON79_OO5CMyD7gV z9}@irgLxzpwBV#1S)NvH5*4HjnIZdKqfiE}-PZx=`o6zC@DCwmFGlT6G>P~~(uABG zK}Q3f7d(yIx@nqEUDtg*;O`-1HeJ_!ZJOp2fHih{)cJyq3PN^{5b9^?iHmLcxw*Od zt7)3gecv~S{b_{c(f57RG|lImo14Ed?FxBAs6Zqt*x!B;W5{pK*JF7#9(y&G-;L+K zAIl#wtZ4Xp+<&dElXaOZRbPeOuW5VVgIpFOP7$z(T3Yv~vHW)|AI5VJTZ64^6BEBSg#y zGM}I)%~}j17KiFDEnOcuUt#E@>0HCEcF3*~0j6Ce`xZm1O5Ih`IeuTN+ty1RWW4eh`~TOU@&BM)3MkQgMM@bdYm8B8c#1 z#@ViWE78D40!D<(#Tx`hXJ-KSDrqoae31hLi8 z$z>DjeP}^jBk1AK*j$2rhW(rzJ{2JYJMmiAitr^tE-^SXloO=ZTOgN*_a2ZHvyBd7 z1l@JghOv{s(P7lwc?A9CfSo}^z#H{B))n$biD&`>gkS9e;$0Z5~J8tXRDNuF002ovPDHLkV1mNB_TK;i diff --git a/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__dialog_full_holo_light.9.png b/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__dialog_full_holo_light.9.png deleted file mode 100644 index 172fc3b5e3caf3357e706be2a1f0d91f357c8e5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2302 zcmV2ok^m97efLZMJ76bgmHN3TVPgynL1iZF^o zv0AMLkI|bD5@Z+S7;_RWD$X2Q#-Gi>; z=tN2`078B~PH0>efZ`B@1i||(&~g>qMGRTwTrQXXbnj39hPAQB*)bIg_=HbA_WGzO zR;yL=j9HSDjSEl*;KYv!A@o|O_=;IUA}l9+ObGitX|Dzg#M7mV*iktr2nZlVbl%^^ zH53Ym36TIhGR!|u7{3PC~!L=Y2z z32ZT8B;zY)i(nCqF!62X25hwu6@!!-aVKznAwf{$S4ay%(<6lhDJ|l}=KVE%xD;tO zjxokGV%Vil6ww-?fi&aiwtz1TI;KLw!36;9iSC?$w}w5ZTIo^H5hBZ^Apum+pFjWp*|TRqUSD7TX^iIhX;RaeQQ zE(9uq^MWzvYwRam(2Co38gn;jAmP?U& z&MGvUhjxmcRMYbSg3kR zZt4g}LPgLEq&hYm(J$si0u;4;IwvxY6?fp6l#|X8fH;pmq-q5ISi1H|(Ge;Lg>w@fkyi)P5d7;2~0$MDQ@!DE$`cg61AQt41xJiqTo9Dlsio7bTA}sD9BZvH#!%wZ zmJ%ND@1^DnZ%X(Ld?$$A6k0J~NE59ixD&!XX{j@~=b>7mwKZvxCyp*B)cAo?C*Y0% z?1kZeY?X^e-9W)XxdpU^5OahW`IAUpYa}@W?W5#&t4q8l2swcYLBS!VH7P;dBP@_? zQAk2?GdMjs_n0oBI`TV#(4X2ifxe2hDg*@upKxQ&K(mtAk|`HJPz)_1HaAZ&&GHf7 zsz6IO?f{EsSe^=LZJ-DtRGZRNi3)(P24xANDG)6Gj(#dNGOP_9D0K*+?F8HR`Nj#&1(CYoj<+oYNw{1t4Y0L^ri-RBp`1VD6hPVuR0IkNiMUb`EeV02O|F6c zauGd$;Lv5&C{!~b&}Udb7lOKhLPE$D=wt2>b>Q`^nt&r(EH@_=La)06a5Fwnfw+Sp z&{C)%=8X_pC077s0o1}imRwSiS1dcYq8ac~BtElCsZ+`Ul=zAmLOFfPAwvBY@Kn$$ zk{zOiq+$R>LAX{rQ>;#)$VHAb@IJ99w*HlMq6mNtA~I*7`@~Y7+@e^8prDZQ`Pk}@ zSYXq1DD{)3Sw!SFBRAo~AvKngUU3Lg#cu0$<^+@bU0;P_H1st~XDv}F6a(QX9$Rbi YKbh+rFQXz7g8%>k07*qoM6N<$g2q=E^8f$< diff --git a/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__ic_commit_search_api_holo_dark.png b/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__ic_commit_search_api_holo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..d8faf900ae775ef8d6cea8390b28a8966f02138f GIT binary patch literal 703 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I0wfs{c7_5;rX+877l!}s{b%+Ad7K3vk;OpT z1B~5HX4`=T%L*LRfwTh{zxwy~(JodEH;O*nr)oi3u+*t#ne{^!|83r$Pej{ldKI)p3(v z6xCHeFXox)qc-_uiqU_`*H!@%uPm1C^7p>jpI5$W!No%nRVqhz=rcO^+<0y(%q6of z)#s$>`$HnTxJ69%Jk;GE>1LCDBWTf+{1-;8x{b+B&B+JK^(1Uo1QhsQUf!^ur@g`A ziT{K0XwKWL3SN4dH=eajKhW^%-o?!hhmGd{Y}$BCaJEmul`B`wtT}G4UC0zra8xcm zWXukPdN=5XGniLZKC2jk`t9X*||y;p~`IWw!ln_zy41;Dx&z{!2?4CY|_m z_gZ4l&AD1CJFK_;uV7xAs|)^fUx(-~o4+LF!kduG;on&%aPmGE z(b?OuGDx*rV*AoV+B0=tD(PICz50Xm{*pCb%jD)Q7We+a<^F4#uKt(xtTnBoYwyPC zcYDt9sPkiNtxu_a!(z)Z literal 0 HcmV?d00001 diff --git a/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__ic_commit_search_api_holo_light.png b/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__ic_commit_search_api_holo_light.png new file mode 100644 index 0000000000000000000000000000000000000000..e7c7280add8f9908ff36a0e502608c8d415e21d4 GIT binary patch literal 712 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I0wfs{c7_5;rX+877l!}s{b%+Ad7K3vk;OpT z1B~5HX4`=T%L*LRfwTh{zxww65w!ZcM8|W7_k0 z8BeX9GkbS%y=C?C;oIQv!*(pmF`w0Px5+2I{$q3h%7WNy zZi)pBR(%)$6lpQ*^BNXjw>vuN<%;XQ2d-Rso0fHN^V2Tlc|Vkb{in~7w3{%;XS0}` z_3Pr@H+L+KHhBJEfAHF!veW$CSHEj<54d6!xqH1oIJhTz{9*sYRK9xVjLHvjNx(=} zEpd$~Nl7e8wMs5Z1yT$~28M>Z1{S)8rXfbgRt6SUrlz_E=2ivnC}Q!>*k zaclTiK5H^igCxj?;QX|b^2DN42FH~Aq*MjZ+{Ezopr E0LOM9g#Z8m literal 0 HcmV?d00001 diff --git a/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__toast_frame.9.png b/libraries/ActionBarSherlock/res/drawable-xhdpi/abs__toast_frame.9.png new file mode 100644 index 0000000000000000000000000000000000000000..9f39a774607a55d3858f037004e4e26e1435629f GIT binary patch literal 1956 zcmV;V2V3}wP) zLZ;B0*6y>%bH)e_F(oy!;?5Z$+Ls%Xklfwh6FRWhP$YPJ%CIZcrh~6M1-0^Zt6L=!~-Yk(emo#{52bCTMhtrJQ{uy=kf zbS-#!-=J&^uO$SCO(4Rz@1^aA{mD5u4gIoa@QhHC7I{LKEi#H7Bf1`Wnb?#_3t#T| zJH(MfM+B`YFCrY6A{P-N!E5151ki0{2s@Vjz=U|>*4s{P5()I(Ufx6XkFGJIHZ_V2 zVWUBfA@q2JSaKc_=m zG4*Nn(bykUct5Z>SD%`G$DVfypYzy#kNG)sefqxdHk-|FA3uKl{oT8Ff8s&x-b|7% znxS5Q9=s+ZM3F$Y=Jo5>-@JPD>ihM2z1(iM=(;W(@LbgVs;KstN9P*rDf?XN_0DDW&G>>gv1IYLx)|g}vY<}&{`~cu*Jj@(*7}pa~sx%&};(EDRq6R?o>C>n7?(XiWFGI+&bX|v(lIRfF zo4{r*K;?4;ojb`%UXg5T18JAHx3^D{4iTd1`(AX{Vy{O%t0eV;E~GW6*U#0FKo3x&R4=ebAaf&` zNzM>iN=EPoII1cq>IFjP1ZZaw(jo#bb=%dogZvaAGJTw9!pb^OP#{OAFxPM^|M$Zor z93$jXDQR_doDqQ#&YqT*U5CYH$ga9~?5tuHKxj9*b#~8s|_LGn~Ia!mnM(`GS z)*pb7Iq?ePs8Dt(8KHCmnt)siCuub@f<4g-J$k(=LgqwkF_$KVhL~C-*ufbU$R*%u za*{4rTvRwJHOk?cf{;1!#6JmHjnE^C0tpY1pv#<3$Wzg&ZHIhx zaIp~~_qQ3+T4VHm-~WB|S0LmB2JMaXh_UE%TKjK&C*X#8!yWQ^n3Ezj1 z$?SH!_v`ig7XbIDj|zYj8SFxU(ZADfOgma@x$C;?wr%g)w*5M#balS3N{CP2_qXfy z`q%60>pwP|%?}!by_UkG)0Ir7ii{aRp>b-7TJgl=O z<9Tab5#nVaBIx^}-46TyHSIq`A9=qS+O0aj$2eMy43S$1Fq)f{4{D2MsPP#D<$6nCV+SJ@jhob4zuvqqt5Iw5aPm%4)<{LbuSqnS}{(fk;I83b= z5s1d#Xmv^>H&$sks_pQQ7Rhn%&Yv|zX=&IVd!fpSJEzqVL4+@27qf^lI?xEj$1_5d zB5A=#1+q5o~SHne!$W%ep4ef{%)49T_}h$T->v0BZvhqxEKu5T!~}{@~878A_>< zh+Pk6@8)vxr20oi@zD!HlV^_=tGDGMgl=^|JzhvDHA?2Sm&@70H#z-nB%l$9B{Bjq zo~866MD7PUUNkr$dXA9H``iZ>!OKihR10t|Hd2cfa;|nj@Lu=NX&Aut=LmKn8yR$j z0Q|z3g)+(E)uYlzvr17Eh$6!QIWb1*i+6XoDNiW{q6tWjD4p>H9~mJx#sO27;4GN| z75k=MpS&zQk=EShPci{eC&ZF~J)uY9r|`)XN-241Uv8`swZe@0O-X%d3Q|L{u*LK{ qe%1uQ^ATh5i;_p>f32gw@9`h#|LAXT%2*=+0000 + android:fitsSystemWindows="true" + android:splitMotionEvents="false"> diff --git a/libraries/ActionBarSherlock/res/layout/abs__action_bar_tab_bar_view.xml b/libraries/ActionBarSherlock/res/layout/abs__action_bar_tab_bar_view.xml index 0d51220c9..9d8f759bc 100644 --- a/libraries/ActionBarSherlock/res/layout/abs__action_bar_tab_bar_view.xml +++ b/libraries/ActionBarSherlock/res/layout/abs__action_bar_tab_bar_view.xml @@ -1,6 +1,6 @@ - \ No newline at end of file +/> diff --git a/libraries/ActionBarSherlock/res/layout/abs__dialog_title_holo.xml b/libraries/ActionBarSherlock/res/layout/abs__dialog_title_holo.xml deleted file mode 100644 index ab2b0ee6c..000000000 --- a/libraries/ActionBarSherlock/res/layout/abs__dialog_title_holo.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - diff --git a/libraries/ActionBarSherlock/res/layout/abs__list_menu_item_layout.xml b/libraries/ActionBarSherlock/res/layout/abs__list_menu_item_layout.xml deleted file mode 100644 index 147f36fe8..000000000 --- a/libraries/ActionBarSherlock/res/layout/abs__list_menu_item_layout.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/libraries/ActionBarSherlock/res/layout/abs__screen_action_bar.xml b/libraries/ActionBarSherlock/res/layout/abs__screen_action_bar.xml index 1fb82fe9a..68dc7dfe5 100644 --- a/libraries/ActionBarSherlock/res/layout/abs__screen_action_bar.xml +++ b/libraries/ActionBarSherlock/res/layout/abs__screen_action_bar.xml @@ -22,7 +22,8 @@ This is an optimized layout for a screen with the Action Bar enabled. android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:fitsSystemWindows="true"> + android:fitsSystemWindows="true" + android:splitMotionEvents="false"> + android:fitsSystemWindows="true" + android:splitMotionEvents="false"> diff --git a/libraries/ActionBarSherlock/res/layout/abs__search_view.xml b/libraries/ActionBarSherlock/res/layout/abs__search_view.xml index 6ba319121..55d2c7345 100644 --- a/libraries/ActionBarSherlock/res/layout/abs__search_view.xml +++ b/libraries/ActionBarSherlock/res/layout/abs__search_view.xml @@ -40,7 +40,7 @@ 9dip - 64dip + 64dip diff --git a/libraries/ActionBarSherlock/res/values-large/abs__dimens.xml b/libraries/ActionBarSherlock/res/values-large/abs__dimens.xml deleted file mode 100644 index 63b12f7f3..000000000 --- a/libraries/ActionBarSherlock/res/values-large/abs__dimens.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - 55% - - 80% - diff --git a/libraries/ActionBarSherlock/res/values-sw600dp/abs__dimens.xml b/libraries/ActionBarSherlock/res/values-sw600dp/abs__dimens.xml index f67853817..175a47fec 100644 --- a/libraries/ActionBarSherlock/res/values-sw600dp/abs__dimens.xml +++ b/libraries/ActionBarSherlock/res/values-sw600dp/abs__dimens.xml @@ -34,5 +34,5 @@ 5 - 64dip + 64dip diff --git a/libraries/ActionBarSherlock/res/values-v14/abs__themes.xml b/libraries/ActionBarSherlock/res/values-v14/abs__themes.xml index 5fac1ab58..75e317b4a 100644 --- a/libraries/ActionBarSherlock/res/values-v14/abs__themes.xml +++ b/libraries/ActionBarSherlock/res/values-v14/abs__themes.xml @@ -26,9 +26,4 @@ false true - - - diff --git a/libraries/ActionBarSherlock/res/values/abs__attrs.xml b/libraries/ActionBarSherlock/res/values/abs__attrs.xml index 32631ca8d..af5873d90 100644 --- a/libraries/ActionBarSherlock/res/values/abs__attrs.xml +++ b/libraries/ActionBarSherlock/res/values/abs__attrs.xml @@ -181,7 +181,7 @@ - + diff --git a/libraries/ActionBarSherlock/res/values/abs__colors.xml b/libraries/ActionBarSherlock/res/values/abs__colors.xml index 625c632ff..b189e727a 100644 --- a/libraries/ActionBarSherlock/res/values/abs__colors.xml +++ b/libraries/ActionBarSherlock/res/values/abs__colors.xml @@ -21,7 +21,4 @@ @color/abs__background_holo_dark #ff4c4c4c #ffb2b2b2 - @color/abs__bright_foreground_holo_light - @color/abs__bright_foreground_holo_dark - #ff33b5e5 diff --git a/libraries/ActionBarSherlock/res/values/abs__dimens.xml b/libraries/ActionBarSherlock/res/values/abs__dimens.xml index 831289e07..9ded21978 100644 --- a/libraries/ActionBarSherlock/res/values/abs__dimens.xml +++ b/libraries/ActionBarSherlock/res/values/abs__dimens.xml @@ -36,18 +36,6 @@ 56dip - - 64dip - - - 65% - - 95% - 8dip diff --git a/libraries/ActionBarSherlock/res/values/abs__strings.xml b/libraries/ActionBarSherlock/res/values/abs__strings.xml index 06a2a2af4..cf0235922 100644 --- a/libraries/ActionBarSherlock/res/values/abs__strings.xml +++ b/libraries/ActionBarSherlock/res/values/abs__strings.xml @@ -29,10 +29,6 @@ See all... - - Select activity - - Share with... Choose an application diff --git a/libraries/ActionBarSherlock/res/values/abs__styles.xml b/libraries/ActionBarSherlock/res/values/abs__styles.xml index 45a18c183..f86c1b823 100644 --- a/libraries/ActionBarSherlock/res/values/abs__styles.xml +++ b/libraries/ActionBarSherlock/res/values/abs__styles.xml @@ -302,25 +302,6 @@ - - - - - - - - + + + + + + + + + + diff --git a/libraries/ActionBarSherlock/res/values/abs__themes.xml b/libraries/ActionBarSherlock/res/values/abs__themes.xml index 634fa798b..6215e048f 100644 --- a/libraries/ActionBarSherlock/res/values/abs__themes.xml +++ b/libraries/ActionBarSherlock/res/values/abs__themes.xml @@ -9,8 +9,6 @@ - @@ -182,58 +204,4 @@ false true - - - - diff --git a/libraries/ActionBarSherlock/src/android/support/v4/app/Watson.java b/libraries/ActionBarSherlock/src/android/support/v4/app/Watson.java index d93de4c6a..8c8ffb018 100644 --- a/libraries/ActionBarSherlock/src/android/support/v4/app/Watson.java +++ b/libraries/ActionBarSherlock/src/android/support/v4/app/Watson.java @@ -3,18 +3,17 @@ package android.support.v4.app; import android.util.Log; import android.view.View; import android.view.Window; +import com.actionbarsherlock.ActionBarSherlock; import com.actionbarsherlock.ActionBarSherlock.OnCreatePanelMenuListener; import com.actionbarsherlock.ActionBarSherlock.OnMenuItemSelectedListener; import com.actionbarsherlock.ActionBarSherlock.OnPreparePanelListener; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; - import java.util.ArrayList; /** I'm in ur package. Stealing ur variables. */ public abstract class Watson extends FragmentActivity implements OnCreatePanelMenuListener, OnPreparePanelListener, OnMenuItemSelectedListener { - private static final boolean DEBUG = false; private static final String TAG = "Watson"; /** Fragment interface for menu creation callback. */ @@ -39,11 +38,11 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe @Override public boolean onCreatePanelMenu(int featureId, Menu menu) { - if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu); if (featureId == Window.FEATURE_OPTIONS_PANEL) { boolean result = onCreateOptionsMenu(menu); - if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] activity create result: " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] activity create result: " + result); MenuInflater inflater = getSupportMenuInflater(); boolean show = false; @@ -73,10 +72,10 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe mCreatedMenus = newMenus; - if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] fragments create result: " + show); result |= show; - if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result); return result; } return false; @@ -84,11 +83,11 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe @Override public boolean onPreparePanel(int featureId, View view, Menu menu) { - if (DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu); if (featureId == Window.FEATURE_OPTIONS_PANEL) { boolean result = onPrepareOptionsMenu(menu); - if (DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result); boolean show = false; if (mFragments.mAdded != null) { @@ -101,11 +100,11 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe } } - if (DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show); result |= show; result &= menu.hasVisibleItems(); - if (DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result); return result; } return false; @@ -113,7 +112,7 @@ public abstract class Watson extends FragmentActivity implements OnCreatePanelMe @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { - if (DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item); if (featureId == Window.FEATURE_OPTIONS_PANEL) { if (onOptionsItemSelected(item)) { diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/ActionBarSherlock.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/ActionBarSherlock.java index ab160f836..2c0312725 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/ActionBarSherlock.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/ActionBarSherlock.java @@ -1,14 +1,5 @@ package com.actionbarsherlock; -import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Iterator; import android.app.Activity; import android.content.Context; import android.content.res.Configuration; @@ -27,6 +18,16 @@ import com.actionbarsherlock.view.ActionMode; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.Iterator; + +import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; /** *

Helper for implementing the action bar design pattern across all versions @@ -40,7 +41,7 @@ import com.actionbarsherlock.view.MenuItem; */ public abstract class ActionBarSherlock { protected static final String TAG = "ActionBarSherlock"; - protected static final boolean DEBUG = false; + public static final boolean DEBUG = false; private static final Class[] CONSTRUCTOR_ARGS = new Class[] { Activity.class, int.class }; private static final HashMap> IMPLEMENTATIONS = @@ -791,4 +792,9 @@ public abstract class ActionBarSherlock { * @see ActionMode */ public abstract ActionMode startActionMode(ActionMode.Callback callback); + + /** + * Ensure that the action bar is attached. + */ + public void ensureActionBar() {} } diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockActivity.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockActivity.java index 7b4543640..48a92da65 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockActivity.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockActivity.java @@ -243,6 +243,12 @@ public abstract class SherlockActivity extends Activity implements OnCreatePanel getSherlock().requestFeature((int)featureId); } + @Override + public View findViewById(int id) { + getSherlock().ensureActionBar(); + return super.findViewById(id); + } + /////////////////////////////////////////////////////////////////////////// // Progress Indication diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockDialogFragment.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockDialogFragment.java index a7c856bf0..c139325cd 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockDialogFragment.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockDialogFragment.java @@ -8,9 +8,9 @@ import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnCreateOptionsMenuListener; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnOptionsItemSelectedListener; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnPrepareOptionsMenuListener; +import static android.support.v4.app.Watson.OnCreateOptionsMenuListener; +import static android.support.v4.app.Watson.OnOptionsItemSelectedListener; +import static android.support.v4.app.Watson.OnPrepareOptionsMenuListener; public class SherlockDialogFragment extends DialogFragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener { private SherlockFragmentActivity mActivity; diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockExpandableListActivity.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockExpandableListActivity.java index 078f9b0ca..9f4e81d14 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockExpandableListActivity.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockExpandableListActivity.java @@ -232,6 +232,12 @@ public abstract class SherlockExpandableListActivity extends ExpandableListActiv getSherlock().requestFeature((int)featureId); } + @Override + public View findViewById(int id) { + getSherlock().ensureActionBar(); + return super.findViewById(id); + } + /////////////////////////////////////////////////////////////////////////// // Progress Indication diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java index 0f24e9c85..0bdd068a6 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragment.java @@ -8,9 +8,9 @@ import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnCreateOptionsMenuListener; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnOptionsItemSelectedListener; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnPrepareOptionsMenuListener; +import static android.support.v4.app.Watson.OnCreateOptionsMenuListener; +import static android.support.v4.app.Watson.OnOptionsItemSelectedListener; +import static android.support.v4.app.Watson.OnPrepareOptionsMenuListener; public class SherlockFragment extends Fragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener { private SherlockFragmentActivity mActivity; diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java index 3d092f033..e764c170b 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockFragmentActivity.java @@ -19,7 +19,6 @@ import static com.actionbarsherlock.ActionBarSherlock.OnActionModeStartedListene /** @see {@link android.support.v4.app.Watson} */ public class SherlockFragmentActivity extends Watson implements OnActionModeStartedListener, OnActionModeFinishedListener { - private static final boolean DEBUG = false; private static final String TAG = "SherlockFragmentActivity"; private ActionBarSherlock mSherlock; @@ -139,33 +138,33 @@ public class SherlockFragmentActivity extends Watson implements OnActionModeStar /////////////////////////////////////////////////////////////////////////// public MenuInflater getSupportMenuInflater() { - if (DEBUG) Log.d(TAG, "[getSupportMenuInflater]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getSupportMenuInflater]"); return getSherlock().getMenuInflater(); } public void invalidateOptionsMenu() { - if (DEBUG) Log.d(TAG, "[invalidateOptionsMenu]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[invalidateOptionsMenu]"); getSherlock().dispatchInvalidateOptionsMenu(); } public void supportInvalidateOptionsMenu() { - if (DEBUG) Log.d(TAG, "[supportInvalidateOptionsMenu]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[supportInvalidateOptionsMenu]"); invalidateOptionsMenu(); } @Override public final boolean onCreatePanelMenu(int featureId, android.view.Menu menu) { - if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu); if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativeCreate) { mIgnoreNativeCreate = true; boolean result = getSherlock().dispatchCreateOptionsMenu(menu); mIgnoreNativeCreate = false; - if (DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result); return result; } return super.onCreatePanelMenu(featureId, menu); @@ -178,14 +177,14 @@ public class SherlockFragmentActivity extends Watson implements OnActionModeStar @Override public final boolean onPreparePanel(int featureId, View view, android.view.Menu menu) { - if (DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + ", menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + ", menu: " + menu); if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativePrepare) { mIgnoreNativePrepare = true; boolean result = getSherlock().dispatchPrepareOptionsMenu(menu); mIgnoreNativePrepare = false; - if (DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result); return result; } return super.onPreparePanel(featureId, view, menu); @@ -198,14 +197,14 @@ public class SherlockFragmentActivity extends Watson implements OnActionModeStar @Override public final boolean onMenuItemSelected(int featureId, android.view.MenuItem item) { - if (DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item.getTitle()); if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativeSelected) { mIgnoreNativeSelected = true; boolean result = getSherlock().dispatchOptionsItemSelected(item); mIgnoreNativeSelected = false; - if (DEBUG) Log.d(TAG, "[onMenuItemSelected] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] returning " + result); return result; } return super.onMenuItemSelected(featureId, item); @@ -276,6 +275,12 @@ public class SherlockFragmentActivity extends Watson implements OnActionModeStar getSherlock().requestFeature((int)featureId); } + @Override + public View findViewById(int id) { + getSherlock().ensureActionBar(); + return super.findViewById(id); + } + /////////////////////////////////////////////////////////////////////////// // Progress Indication diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockListActivity.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockListActivity.java index aba6d85e8..7ced7812a 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockListActivity.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockListActivity.java @@ -243,6 +243,12 @@ public abstract class SherlockListActivity extends ListActivity implements OnCre getSherlock().requestFeature((int)featureId); } + @Override + public View findViewById(int id) { + getSherlock().ensureActionBar(); + return super.findViewById(id); + } + /////////////////////////////////////////////////////////////////////////// // Progress Indication diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockListFragment.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockListFragment.java index 13ca3c49f..7c4d09511 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockListFragment.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockListFragment.java @@ -8,9 +8,9 @@ import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnCreateOptionsMenuListener; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnOptionsItemSelectedListener; -import static com.actionbarsherlock.app.SherlockFragmentActivity.OnPrepareOptionsMenuListener; +import static android.support.v4.app.Watson.OnCreateOptionsMenuListener; +import static android.support.v4.app.Watson.OnOptionsItemSelectedListener; +import static android.support.v4.app.Watson.OnPrepareOptionsMenuListener; public class SherlockListFragment extends ListFragment implements OnCreateOptionsMenuListener, OnPrepareOptionsMenuListener, OnOptionsItemSelectedListener { private SherlockFragmentActivity mActivity; diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockPreferenceActivity.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockPreferenceActivity.java index bee72cb25..85c6ab214 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockPreferenceActivity.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/app/SherlockPreferenceActivity.java @@ -243,6 +243,12 @@ public abstract class SherlockPreferenceActivity extends PreferenceActivity impl getSherlock().requestFeature((int)featureId); } + @Override + public View findViewById(int id) { + getSherlock().ensureActionBar(); + return super.findViewById(id); + } + /////////////////////////////////////////////////////////////////////////// // Progress Indication diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java index 5e69275c7..e89850203 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ActionBarSherlockCompat.java @@ -1,11 +1,5 @@ package com.actionbarsherlock.internal; -import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; -import static com.actionbarsherlock.internal.ResourcesCompat.getResources_getBoolean; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import org.xmlpull.v1.XmlPullParser; import android.app.Activity; import android.content.Context; import android.content.pm.ActivityInfo; @@ -28,9 +22,8 @@ import android.view.Window; import android.view.accessibility.AccessibilityEvent; import android.view.animation.Animation; import android.view.animation.AnimationUtils; -import android.widget.FrameLayout; -import android.widget.TextView; import com.actionbarsherlock.ActionBarSherlock; +import com.actionbarsherlock.BuildConfig; import com.actionbarsherlock.R; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.internal.app.ActionBarImpl; @@ -46,6 +39,13 @@ import com.actionbarsherlock.internal.widget.IcsProgressBar; import com.actionbarsherlock.view.ActionMode; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import org.xmlpull.v1.XmlPullParser; + +import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; +import static com.actionbarsherlock.internal.ResourcesCompat.getResources_getBoolean; @ActionBarSherlock.Implementation(api = 7) public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBuilder.Callback, com.actionbarsherlock.view.Window.Callback, MenuPresenter.Callback, android.view.MenuItem.OnMenuItemClickListener { @@ -108,13 +108,6 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu /** Parent view in which the context action bar is displayed. */ private ActionBarContextView mActionModeView; - /** Title view used with dialogs. */ - private TextView mTitleView; - /** Current activity title. */ - private CharSequence mTitle = null; - /** Whether or not this "activity" is floating (i.e., a dialog) */ - private boolean mIsFloating; - /////////////////////////////////////////////////////////////////////////// @@ -123,14 +116,14 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public ActionBar getActionBar() { - if (DEBUG) Log.d(TAG, "[getActionBar]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getActionBar]"); initActionBar(); return aActionBar; } private void initActionBar() { - if (DEBUG) Log.d(TAG, "[initActionBar]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[initActionBar]"); // Initializing the window decor can change window feature flags. // Make sure that we have the correct set before performing the test below. @@ -157,14 +150,14 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void setTitle(CharSequence title) { - if (DEBUG) Log.d(TAG, "[setTitle] title: " + title); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setTitle] title: " + title); dispatchTitleChanged(title, 0); } @Override public ActionMode startActionMode(ActionMode.Callback callback) { - if (DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback); if (mActionMode != null) { mActionMode.finish(); @@ -215,7 +208,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void dispatchConfigurationChanged(Configuration newConfig) { - if (DEBUG) Log.d(TAG, "[dispatchConfigurationChanged] newConfig: " + newConfig); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchConfigurationChanged] newConfig: " + newConfig); if (aActionBar != null) { aActionBar.onConfigurationChanged(newConfig); @@ -224,7 +217,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void dispatchPostResume() { - if (DEBUG) Log.d(TAG, "[dispatchPostResume]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPostResume]"); if (aActionBar != null) { aActionBar.setShowHideAnimationEnabled(true); @@ -233,7 +226,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void dispatchPause() { - if (DEBUG) Log.d(TAG, "[dispatchPause]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPause]"); if (wActionBar != null && wActionBar.isOverflowMenuShowing()) { wActionBar.hideOverflowMenu(); @@ -242,7 +235,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void dispatchStop() { - if (DEBUG) Log.d(TAG, "[dispatchStop]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchStop]"); if (aActionBar != null) { aActionBar.setShowHideAnimationEnabled(false); @@ -251,7 +244,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void dispatchInvalidateOptionsMenu() { - if (DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]"); Bundle savedActionViewStates = null; if (mMenu != null) { @@ -275,7 +268,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public boolean dispatchOpenOptionsMenu() { - if (DEBUG) Log.d(TAG, "[dispatchOpenOptionsMenu]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchOpenOptionsMenu]"); if (!isReservingOverflow()) { return false; @@ -286,7 +279,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public boolean dispatchCloseOptionsMenu() { - if (DEBUG) Log.d(TAG, "[dispatchCloseOptionsMenu]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchCloseOptionsMenu]"); if (!isReservingOverflow()) { return false; @@ -300,7 +293,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void dispatchPostCreate(Bundle savedInstanceState) { - if (DEBUG) Log.d(TAG, "[dispatchOnPostCreate]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchOnPostCreate]"); if (mIsDelegate) { mIsTitleReady = true; @@ -313,7 +306,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public boolean dispatchCreateOptionsMenu(android.view.Menu menu) { - if (DEBUG) { + if (BuildConfig.DEBUG) { Log.d(TAG, "[dispatchCreateOptionsMenu] android.view.Menu: " + menu); Log.d(TAG, "[dispatchCreateOptionsMenu] returning true"); } @@ -322,7 +315,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) { - if (DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu); if (mActionMode != null) { return false; @@ -348,7 +341,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu } boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap); - if (DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); return result; } @@ -359,7 +352,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public boolean dispatchMenuOpened(int featureId, android.view.Menu menu) { - if (DEBUG) Log.d(TAG, "[dispatchMenuOpened] featureId: " + featureId + ", menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchMenuOpened] featureId: " + featureId + ", menu: " + menu); if (featureId == Window.FEATURE_ACTION_BAR || featureId == Window.FEATURE_OPTIONS_PANEL) { if (aActionBar != null) { @@ -373,7 +366,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void dispatchPanelClosed(int featureId, android.view.Menu menu){ - if (DEBUG) Log.d(TAG, "[dispatchPanelClosed] featureId: " + featureId + ", menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPanelClosed] featureId: " + featureId + ", menu: " + menu); if (featureId == Window.FEATURE_ACTION_BAR || featureId == Window.FEATURE_OPTIONS_PANEL) { if (aActionBar != null) { @@ -384,22 +377,16 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void dispatchTitleChanged(CharSequence title, int color) { - if (DEBUG) Log.d(TAG, "[dispatchTitleChanged] title: " + title + ", color: " + color); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchTitleChanged] title: " + title + ", color: " + color); - if (!mIsDelegate || mIsTitleReady) { - if (mTitleView != null) { - mTitleView.setText(title); - } else if (wActionBar != null) { - wActionBar.setWindowTitle(title); - } + if ((!mIsDelegate || mIsTitleReady) && (wActionBar != null)) { + wActionBar.setWindowTitle(title); } - - mTitle = title; } @Override public boolean dispatchKeyEvent(KeyEvent event) { - if (DEBUG) Log.d(TAG, "[dispatchKeyEvent] event: " + event); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchKeyEvent] event: " + event); final int keyCode = event.getKeyCode(); @@ -412,7 +399,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu if (action == KeyEvent.ACTION_UP) { mActionMode.finish(); } - if (DEBUG) Log.d(TAG, "[dispatchKeyEvent] returning true"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchKeyEvent] returning true"); return true; } @@ -421,12 +408,12 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu if (action == KeyEvent.ACTION_UP) { wActionBar.collapseActionView(); } - if (DEBUG) Log.d(TAG, "[dispatchKeyEvent] returning true"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchKeyEvent] returning true"); return true; } } - if (DEBUG) Log.d(TAG, "[dispatchKeyEvent] returning false"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchKeyEvent] returning false"); return false; } @@ -596,7 +583,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public boolean onMenuItemClick(android.view.MenuItem item) { - if (DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item); final MenuItemImpl sherlockItem = mNativeItemMap.get(item); if (sherlockItem != null) { @@ -620,7 +607,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void setProgressBarVisibility(boolean visible) { - if (DEBUG) Log.d(TAG, "[setProgressBarVisibility] visible: " + visible); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarVisibility] visible: " + visible); setFeatureInt(Window.FEATURE_PROGRESS, visible ? Window.PROGRESS_VISIBILITY_ON : Window.PROGRESS_VISIBILITY_OFF); @@ -628,7 +615,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void setProgressBarIndeterminateVisibility(boolean visible) { - if (DEBUG) Log.d(TAG, "[setProgressBarIndeterminateVisibility] visible: " + visible); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarIndeterminateVisibility] visible: " + visible); setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS, visible ? Window.PROGRESS_VISIBILITY_ON : Window.PROGRESS_VISIBILITY_OFF); @@ -636,7 +623,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void setProgressBarIndeterminate(boolean indeterminate) { - if (DEBUG) Log.d(TAG, "[setProgressBarIndeterminate] indeterminate: " + indeterminate); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarIndeterminate] indeterminate: " + indeterminate); setFeatureInt(Window.FEATURE_PROGRESS, indeterminate ? Window.PROGRESS_INDETERMINATE_ON : Window.PROGRESS_INDETERMINATE_OFF); @@ -644,14 +631,14 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void setProgress(int progress) { - if (DEBUG) Log.d(TAG, "[setProgress] progress: " + progress); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgress] progress: " + progress); setFeatureInt(Window.FEATURE_PROGRESS, progress + Window.PROGRESS_START); } @Override public void setSecondaryProgress(int secondaryProgress) { - if (DEBUG) Log.d(TAG, "[setSecondaryProgress] secondaryProgress: " + secondaryProgress); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setSecondaryProgress] secondaryProgress: " + secondaryProgress); setFeatureInt(Window.FEATURE_PROGRESS, secondaryProgress + Window.PROGRESS_SECONDARY_START); @@ -790,23 +777,23 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu /////////////////////////////////////////////////////////////////////////// private int getFeatures() { - if (DEBUG) Log.d(TAG, "[getFeatures] returning " + mFeatures); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getFeatures] returning " + mFeatures); return mFeatures; } @Override public boolean hasFeature(int featureId) { - if (DEBUG) Log.d(TAG, "[hasFeature] featureId: " + featureId); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[hasFeature] featureId: " + featureId); boolean result = (mFeatures & (1 << featureId)) != 0; - if (DEBUG) Log.d(TAG, "[hasFeature] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[hasFeature] returning " + result); return result; } @Override public boolean requestFeature(int featureId) { - if (DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId); if (mContentParent != null) { throw new AndroidRuntimeException("requestFeature() must be called before adding content"); @@ -829,21 +816,21 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void setUiOptions(int uiOptions) { - if (DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions); mUiOptions = uiOptions; } @Override public void setUiOptions(int uiOptions, int mask) { - if (DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions + ", mask: " + mask); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions + ", mask: " + mask); mUiOptions = (mUiOptions & ~mask) | (uiOptions & mask); } @Override public void setContentView(int layoutResId) { - if (DEBUG) Log.d(TAG, "[setContentView] layoutResId: " + layoutResId); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] layoutResId: " + layoutResId); if (mContentParent == null) { installDecor(); @@ -862,7 +849,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void setContentView(View view, ViewGroup.LayoutParams params) { - if (DEBUG) Log.d(TAG, "[setContentView] view: " + view + ", params: " + params); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] view: " + view + ", params: " + params); if (mContentParent == null) { installDecor(); @@ -881,7 +868,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu @Override public void addContentView(View view, ViewGroup.LayoutParams params) { - if (DEBUG) Log.d(TAG, "[addContentView] view: " + view + ", params: " + params); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[addContentView] view: " + view + ", params: " + params); if (mContentParent == null) { installDecor(); @@ -892,7 +879,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu } private void installDecor() { - if (DEBUG) Log.d(TAG, "[installDecor]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[installDecor]"); if (mDecor == null) { mDecor = (ViewGroup)mActivity.getWindow().getDecorView().findViewById(android.R.id.content); @@ -921,84 +908,70 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu } } - mTitleView = (TextView)mDecor.findViewById(android.R.id.title); - if (mTitleView != null) { - if (hasFeature(Window.FEATURE_NO_TITLE)) { - mTitleView.setVisibility(View.GONE); - if (mContentParent instanceof FrameLayout) { - ((FrameLayout)mContentParent).setForeground(null); - } + wActionBar = (ActionBarView)mDecor.findViewById(R.id.abs__action_bar); + if (wActionBar != null) { + wActionBar.setWindowCallback(this); + if (wActionBar.getTitle() == null) { + wActionBar.setWindowTitle(mActivity.getTitle()); + } + if (hasFeature(Window.FEATURE_PROGRESS)) { + wActionBar.initProgress(); + } + if (hasFeature(Window.FEATURE_INDETERMINATE_PROGRESS)) { + wActionBar.initIndeterminateProgress(); + } + + //Since we don't require onCreate dispatching, parse for uiOptions here + int uiOptions = loadUiOptionsFromManifest(mActivity); + if (uiOptions != 0) { + mUiOptions = uiOptions; + } + + boolean splitActionBar = false; + final boolean splitWhenNarrow = (mUiOptions & ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW) != 0; + if (splitWhenNarrow) { + splitActionBar = getResources_getBoolean(mActivity, R.bool.abs__split_action_bar_is_narrow); } else { - mTitleView.setText(mTitle); + splitActionBar = mActivity.getTheme() + .obtainStyledAttributes(R.styleable.SherlockTheme) + .getBoolean(R.styleable.SherlockTheme_windowSplitActionBar, false); } - } else { - wActionBar = (ActionBarView)mDecor.findViewById(R.id.abs__action_bar); - if (wActionBar != null) { - wActionBar.setWindowCallback(this); - if (wActionBar.getTitle() == null) { - wActionBar.setWindowTitle(mActivity.getTitle()); - } - if (hasFeature(Window.FEATURE_PROGRESS)) { - wActionBar.initProgress(); - } - if (hasFeature(Window.FEATURE_INDETERMINATE_PROGRESS)) { - wActionBar.initIndeterminateProgress(); - } + final ActionBarContainer splitView = (ActionBarContainer)mDecor.findViewById(R.id.abs__split_action_bar); + if (splitView != null) { + wActionBar.setSplitView(splitView); + wActionBar.setSplitActionBar(splitActionBar); + wActionBar.setSplitWhenNarrow(splitWhenNarrow); - //Since we don't require onCreate dispatching, parse for uiOptions here - int uiOptions = loadUiOptionsFromManifest(mActivity); - if (uiOptions != 0) { - mUiOptions = uiOptions; - } + mActionModeView = (ActionBarContextView)mDecor.findViewById(R.id.abs__action_context_bar); + mActionModeView.setSplitView(splitView); + mActionModeView.setSplitActionBar(splitActionBar); + mActionModeView.setSplitWhenNarrow(splitWhenNarrow); + } else if (splitActionBar) { + Log.e(TAG, "Requested split action bar with incompatible window decor! Ignoring request."); + } - boolean splitActionBar = false; - final boolean splitWhenNarrow = (mUiOptions & ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW) != 0; - if (splitWhenNarrow) { - splitActionBar = getResources_getBoolean(mActivity, R.bool.abs__split_action_bar_is_narrow); - } else { - splitActionBar = mActivity.getTheme() - .obtainStyledAttributes(R.styleable.SherlockTheme) - .getBoolean(R.styleable.SherlockTheme_windowSplitActionBar, false); - } - final ActionBarContainer splitView = (ActionBarContainer)mDecor.findViewById(R.id.abs__split_action_bar); - if (splitView != null) { - wActionBar.setSplitView(splitView); - wActionBar.setSplitActionBar(splitActionBar); - wActionBar.setSplitWhenNarrow(splitWhenNarrow); - - mActionModeView = (ActionBarContextView)mDecor.findViewById(R.id.abs__action_context_bar); - mActionModeView.setSplitView(splitView); - mActionModeView.setSplitActionBar(splitActionBar); - mActionModeView.setSplitWhenNarrow(splitWhenNarrow); - } else if (splitActionBar) { - Log.e(TAG, "Requested split action bar with incompatible window decor! Ignoring request."); - } - - // Post the panel invalidate for later; avoid application onCreateOptionsMenu - // being called in the middle of onCreate or similar. - mDecor.post(new Runnable() { - @Override - public void run() { - //Invalidate if the panel menu hasn't been created before this. - if (!mIsDestroyed && !mActivity.isFinishing() && mMenu == null) { - dispatchInvalidateOptionsMenu(); - } + // Post the panel invalidate for later; avoid application onCreateOptionsMenu + // being called in the middle of onCreate or similar. + mDecor.post(new Runnable() { + @Override + public void run() { + //Invalidate if the panel menu hasn't been created before this. + if (!mIsDestroyed && !mActivity.isFinishing() && mMenu == null) { + dispatchInvalidateOptionsMenu(); } - }); - } + } + }); } } } private ViewGroup generateLayout() { - if (DEBUG) Log.d(TAG, "[generateLayout]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[generateLayout]"); // Apply data from current theme. TypedArray a = mActivity.getTheme().obtainStyledAttributes(R.styleable.SherlockTheme); - mIsFloating = a.getBoolean(R.styleable.SherlockTheme_android_windowIsFloating, false); - if (!a.hasValue(R.styleable.SherlockTheme_windowActionBar)) { throw new IllegalStateException("You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative."); } @@ -1022,18 +995,10 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu int layoutResource; if (!hasFeature(Window.FEATURE_NO_TITLE)) { - if (mIsFloating) { - //Trash original dialog LinearLayout - mDecor = (ViewGroup)mDecor.getParent(); - mDecor.removeAllViews(); - - layoutResource = R.layout.abs__dialog_title_holo; + if (hasFeature(Window.FEATURE_ACTION_BAR_OVERLAY)) { + layoutResource = R.layout.abs__screen_action_bar_overlay; } else { - if (hasFeature(Window.FEATURE_ACTION_BAR_OVERLAY)) { - layoutResource = R.layout.abs__screen_action_bar_overlay; - } else { - layoutResource = R.layout.abs__screen_action_bar; - } + layoutResource = R.layout.abs__screen_action_bar; } } else if (hasFeature(Window.FEATURE_ACTION_MODE_OVERLAY) && !hasFeature(Window.FEATURE_NO_TITLE)) { layoutResource = R.layout.abs__screen_simple_overlay_action_mode; @@ -1041,7 +1006,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu layoutResource = R.layout.abs__screen_simple; } - if (DEBUG) Log.d(TAG, "[generateLayout] using screen XML " + mActivity.getResources().getString(layoutResource)); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[generateLayout] using screen XML " + mActivity.getResources().getString(layoutResource)); View in = mActivity.getLayoutInflater().inflate(layoutResource, null); mDecor.addView(in, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)); @@ -1086,7 +1051,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu int uiOptions = 0; try { final String thisPackage = activity.getClass().getName(); - if (DEBUG) Log.i(TAG, "Parsing AndroidManifest.xml for " + thisPackage); + if (ActionBarSherlock.DEBUG) Log.i(TAG, "Parsing AndroidManifest.xml for " + thisPackage); final String packageName = activity.getApplicationInfo().packageName; final AssetManager am = activity.createPackageContext(packageName, 0).getAssets(); @@ -1099,10 +1064,10 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu if ("application".equals(name)) { //Check if the has the attribute - if (DEBUG) Log.d(TAG, "Got "); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "Got "); for (int i = xml.getAttributeCount() - 1; i >= 0; i--) { - if (DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i)); + if (ActionBarSherlock.DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i)); if ("uiOptions".equals(xml.getAttributeName(i))) { uiOptions = xml.getAttributeIntValue(i, 0); @@ -1111,13 +1076,13 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu } } else if ("activity".equals(name)) { //Check if the is us and has the attribute - if (DEBUG) Log.d(TAG, "Got "); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "Got "); Integer activityUiOptions = null; String activityPackage = null; boolean isOurActivity = false; for (int i = xml.getAttributeCount() - 1; i >= 0; i--) { - if (DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i)); + if (ActionBarSherlock.DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i)); //We need both uiOptions and name attributes String attrName = xml.getAttributeName(i); @@ -1149,7 +1114,7 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu } catch (Exception e) { e.printStackTrace(); } - if (DEBUG) Log.i(TAG, "Returning " + Integer.toHexString(uiOptions)); + if (ActionBarSherlock.DEBUG) Log.i(TAG, "Returning " + Integer.toHexString(uiOptions)); return uiOptions; } @@ -1200,4 +1165,13 @@ public class ActionBarSherlockCompat extends ActionBarSherlock implements MenuBu mActionMode = null; } } + + @Override + public void ensureActionBar() { + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[ensureActionBar]"); + + if (mDecor == null) { + initActionBar(); + } + } } diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ActionBarSherlockNative.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ActionBarSherlockNative.java index 0824d3848..5a47e0c37 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ActionBarSherlockNative.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ActionBarSherlockNative.java @@ -1,19 +1,21 @@ package com.actionbarsherlock.internal; -import com.actionbarsherlock.ActionBarSherlock; -import com.actionbarsherlock.app.ActionBar; -import com.actionbarsherlock.internal.app.ActionBarWrapper; -import com.actionbarsherlock.internal.view.menu.MenuWrapper; -import com.actionbarsherlock.view.ActionMode; -import com.actionbarsherlock.view.MenuInflater; import android.app.Activity; import android.content.Context; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.View; -import android.view.Window; import android.view.ViewGroup.LayoutParams; +import android.view.Window; +import com.actionbarsherlock.ActionBarSherlock; +import com.actionbarsherlock.app.ActionBar; +import com.actionbarsherlock.internal.app.ActionBarWrapper; +import com.actionbarsherlock.internal.view.menu.MenuItemWrapper; +import com.actionbarsherlock.internal.view.menu.MenuWrapper; +import com.actionbarsherlock.view.ActionMode; +import com.actionbarsherlock.view.MenuInflater; +import com.actionbarsherlock.view.MenuItem; @ActionBarSherlock.Implementation(api = 14) public class ActionBarSherlockNative extends ActionBarSherlock { @@ -28,7 +30,7 @@ public class ActionBarSherlockNative extends ActionBarSherlock { @Override public ActionBar getActionBar() { - if (DEBUG) Log.d(TAG, "[getActionBar]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getActionBar]"); initActionBar(); return mActionBar; @@ -44,77 +46,89 @@ public class ActionBarSherlockNative extends ActionBarSherlock { @Override public void dispatchInvalidateOptionsMenu() { - if (DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]"); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]"); mActivity.getWindow().invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL); + + if (mMenu != null) mMenu.invalidate(); } @Override public boolean dispatchCreateOptionsMenu(android.view.Menu menu) { - if (DEBUG) Log.d(TAG, "[dispatchCreateOptionsMenu] menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchCreateOptionsMenu] menu: " + menu); if (mMenu == null || menu != mMenu.unwrap()) { mMenu = new MenuWrapper(menu); } final boolean result = callbackCreateOptionsMenu(mMenu); - if (DEBUG) Log.d(TAG, "[dispatchCreateOptionsMenu] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchCreateOptionsMenu] returning " + result); return result; } @Override public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) { - if (DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] menu: " + menu); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] menu: " + menu); final boolean result = callbackPrepareOptionsMenu(mMenu); - if (DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result); return result; } @Override public boolean dispatchOptionsItemSelected(android.view.MenuItem item) { - if (DEBUG) Log.d(TAG, "[dispatchOptionsItemSelected] item: " + item.getTitleCondensed()); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchOptionsItemSelected] item: " + item.getTitleCondensed()); - final boolean result = callbackOptionsItemSelected(mMenu.findItem(item)); - if (DEBUG) Log.d(TAG, "[dispatchOptionsItemSelected] returning " + result); + MenuItem wrapped; + if (mMenu == null) { + if (item.getItemId() != android.R.id.home) { + throw new IllegalStateException("Non-home action item clicked before onCreateOptionsMenu with ID " + item.getItemId()); + } + // Create a throw-away wrapper for now. + wrapped = new MenuItemWrapper(item); + } else { + wrapped = mMenu.findItem(item); + } + final boolean result = callbackOptionsItemSelected(wrapped); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchOptionsItemSelected] returning " + result); return result; } @Override public boolean hasFeature(int feature) { - if (DEBUG) Log.d(TAG, "[hasFeature] feature: " + feature); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[hasFeature] feature: " + feature); final boolean result = mActivity.getWindow().hasFeature(feature); - if (DEBUG) Log.d(TAG, "[hasFeature] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[hasFeature] returning " + result); return result; } @Override public boolean requestFeature(int featureId) { - if (DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId); final boolean result = mActivity.getWindow().requestFeature(featureId); - if (DEBUG) Log.d(TAG, "[requestFeature] returning " + result); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[requestFeature] returning " + result); return result; } @Override public void setUiOptions(int uiOptions) { - if (DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions); mActivity.getWindow().setUiOptions(uiOptions); } @Override public void setUiOptions(int uiOptions, int mask) { - if (DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions + ", mask: " + mask); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setUiOptions] uiOptions: " + uiOptions + ", mask: " + mask); mActivity.getWindow().setUiOptions(uiOptions, mask); } @Override public void setContentView(int layoutResId) { - if (DEBUG) Log.d(TAG, "[setContentView] layoutResId: " + layoutResId); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] layoutResId: " + layoutResId); mActivity.getWindow().setContentView(layoutResId); initActionBar(); @@ -122,7 +136,7 @@ public class ActionBarSherlockNative extends ActionBarSherlock { @Override public void setContentView(View view, LayoutParams params) { - if (DEBUG) Log.d(TAG, "[setContentView] view: " + view + ", params: " + params); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] view: " + view + ", params: " + params); mActivity.getWindow().setContentView(view, params); initActionBar(); @@ -130,7 +144,7 @@ public class ActionBarSherlockNative extends ActionBarSherlock { @Override public void addContentView(View view, LayoutParams params) { - if (DEBUG) Log.d(TAG, "[addContentView] view: " + view + ", params: " + params); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[addContentView] view: " + view + ", params: " + params); mActivity.getWindow().addContentView(view, params); initActionBar(); @@ -138,42 +152,42 @@ public class ActionBarSherlockNative extends ActionBarSherlock { @Override public void setTitle(CharSequence title) { - if (DEBUG) Log.d(TAG, "[setTitle] title: " + title); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setTitle] title: " + title); mActivity.getWindow().setTitle(title); } @Override public void setProgressBarVisibility(boolean visible) { - if (DEBUG) Log.d(TAG, "[setProgressBarVisibility] visible: " + visible); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarVisibility] visible: " + visible); mActivity.setProgressBarVisibility(visible); } @Override public void setProgressBarIndeterminateVisibility(boolean visible) { - if (DEBUG) Log.d(TAG, "[setProgressBarIndeterminateVisibility] visible: " + visible); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarIndeterminateVisibility] visible: " + visible); mActivity.setProgressBarIndeterminateVisibility(visible); } @Override public void setProgressBarIndeterminate(boolean indeterminate) { - if (DEBUG) Log.d(TAG, "[setProgressBarIndeterminate] indeterminate: " + indeterminate); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgressBarIndeterminate] indeterminate: " + indeterminate); mActivity.setProgressBarIndeterminate(indeterminate); } @Override public void setProgress(int progress) { - if (DEBUG) Log.d(TAG, "[setProgress] progress: " + progress); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setProgress] progress: " + progress); mActivity.setProgress(progress); } @Override public void setSecondaryProgress(int secondaryProgress) { - if (DEBUG) Log.d(TAG, "[setSecondaryProgress] secondaryProgress: " + secondaryProgress); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setSecondaryProgress] secondaryProgress: " + secondaryProgress); mActivity.setSecondaryProgress(secondaryProgress); } @@ -194,7 +208,7 @@ public class ActionBarSherlockNative extends ActionBarSherlock { @Override public ActionMode startActionMode(com.actionbarsherlock.view.ActionMode.Callback callback) { - if (DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback); + if (ActionBarSherlock.DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback); if (mActionMode != null) { mActionMode.finish(); @@ -288,6 +302,7 @@ public class ActionBarSherlockNative extends ActionBarSherlock { @Override public void invalidate() { mActionMode.invalidate(); + if (mMenu != null) mMenu.invalidate(); } @Override diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ResourcesCompat.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ResourcesCompat.java index 8e1efe8c5..4a3a1ca26 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ResourcesCompat.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/ResourcesCompat.java @@ -1,11 +1,19 @@ package com.actionbarsherlock.internal; +import android.app.Activity; import android.content.Context; +import android.content.res.AssetManager; +import android.content.res.XmlResourceParser; import android.os.Build; import android.util.DisplayMetrics; +import android.util.Log; +import com.actionbarsherlock.ActionBarSherlock; import com.actionbarsherlock.R; +import org.xmlpull.v1.XmlPullParser; public final class ResourcesCompat { + private static final String TAG = "ResourcesCompat"; + //No instances private ResourcesCompat() {} @@ -15,14 +23,14 @@ public final class ResourcesCompat { * can use to simulate filtering based on width and smallest width * qualifiers on pre-3.2. * - * @param context Context to load booleans from on 3.2+ and to fetch the + * @param context Context to load booleans from on 4.0+ and to fetch the * display metrics. * @param id Id of boolean to load. * @return Associated boolean value as reflected by the current display * metrics. */ public static boolean getResources_getBoolean(Context context, int id) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { return context.getResources().getBoolean(id); } @@ -92,4 +100,83 @@ public final class ResourcesCompat { throw new IllegalArgumentException("Unknown integer resource ID " + id); } + + /** + * Attempt to programmatically load the logo from the manifest file of an + * activity by using an XML pull parser. This should allow us to read the + * logo attribute regardless of the platform it is being run on. + * + * @param activity Activity instance. + * @return Logo resource ID. + */ + public static int loadLogoFromManifest(Activity activity) { + int logo = 0; + try { + final String thisPackage = activity.getClass().getName(); + if (ActionBarSherlock.DEBUG) Log.i(TAG, "Parsing AndroidManifest.xml for " + thisPackage); + + final String packageName = activity.getApplicationInfo().packageName; + final AssetManager am = activity.createPackageContext(packageName, 0).getAssets(); + final XmlResourceParser xml = am.openXmlResourceParser("AndroidManifest.xml"); + + int eventType = xml.getEventType(); + while (eventType != XmlPullParser.END_DOCUMENT) { + if (eventType == XmlPullParser.START_TAG) { + String name = xml.getName(); + + if ("application".equals(name)) { + //Check if the has the attribute + if (ActionBarSherlock.DEBUG) Log.d(TAG, "Got "); + + for (int i = xml.getAttributeCount() - 1; i >= 0; i--) { + if (ActionBarSherlock.DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i)); + + if ("logo".equals(xml.getAttributeName(i))) { + logo = xml.getAttributeResourceValue(i, 0); + break; //out of for loop + } + } + } else if ("activity".equals(name)) { + //Check if the is us and has the attribute + if (ActionBarSherlock.DEBUG) Log.d(TAG, "Got "); + Integer activityLogo = null; + String activityPackage = null; + boolean isOurActivity = false; + + for (int i = xml.getAttributeCount() - 1; i >= 0; i--) { + if (ActionBarSherlock.DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i)); + + //We need both uiOptions and name attributes + String attrName = xml.getAttributeName(i); + if ("logo".equals(attrName)) { + activityLogo = xml.getAttributeResourceValue(i, 0); + } else if ("name".equals(attrName)) { + activityPackage = ActionBarSherlockCompat.cleanActivityName(packageName, xml.getAttributeValue(i)); + if (!thisPackage.equals(activityPackage)) { + break; //on to the next + } + isOurActivity = true; + } + + //Make sure we have both attributes before processing + if ((activityLogo != null) && (activityPackage != null)) { + //Our activity, logo specified, override with our value + logo = activityLogo.intValue(); + } + } + if (isOurActivity) { + //If we matched our activity but it had no logo don't + //do any more processing of the manifest + break; + } + } + } + eventType = xml.nextToken(); + } + } catch (Exception e) { + e.printStackTrace(); + } + if (ActionBarSherlock.DEBUG) Log.i(TAG, "Returning " + Integer.toHexString(logo)); + return logo; + } } diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/app/ActionBarImpl.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/app/ActionBarImpl.java index d022a2465..14dc5a7c5 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/app/ActionBarImpl.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/app/ActionBarImpl.java @@ -170,7 +170,12 @@ public class ActionBarImpl extends ActionBar { // Older apps get the home button interaction enabled by default. // Newer apps need to enable it explicitly. - setHomeButtonEnabled(mContext.getApplicationInfo().targetSdkVersion < 14); + boolean homeButtonEnabled = mContext.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.ICE_CREAM_SANDWICH; + + // If the homeAsUp display option is set, always enable the home button. + homeButtonEnabled |= (mActionView.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != 0; + + setHomeButtonEnabled(homeButtonEnabled); setHasEmbeddedTabs(getResources_getBoolean(mContext, R.bool.abs__action_bar_embed_tabs)); @@ -321,7 +326,7 @@ public class ActionBarImpl extends ActionBar { break; default: throw new IllegalStateException( - "setSelectedNavigationIndex not valid for current navigation mode"); + "setSelectedNavigationItem not valid for current navigation mode"); } } diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/app/ActionBarWrapper.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/app/ActionBarWrapper.java index 840cb3d27..fe479d0b8 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/app/ActionBarWrapper.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/app/ActionBarWrapper.java @@ -26,6 +26,10 @@ public class ActionBarWrapper extends ActionBar implements android.app.ActionBar mActionBar = activity.getActionBar(); if (mActionBar != null) { mActionBar.addOnMenuVisibilityListener(this); + + // Fixes issue #746 + int displayOptions = mActionBar.getDisplayOptions(); + mActionBar.setHomeButtonEnabled((displayOptions & DISPLAY_HOME_AS_UP) != 0); } } @@ -132,11 +136,19 @@ public class ActionBarWrapper extends ActionBar implements android.app.ActionBar @Override public void setDisplayOptions(int options) { mActionBar.setDisplayOptions(options); + + // Fixes issue #746 + mActionBar.setHomeButtonEnabled((options & DISPLAY_HOME_AS_UP) != 0); } @Override public void setDisplayOptions(int options, int mask) { mActionBar.setDisplayOptions(options, mask); + + // Fixes issue #746 + if ((mask & DISPLAY_HOME_AS_UP) != 0) { + mActionBar.setHomeButtonEnabled((options & DISPLAY_HOME_AS_UP) != 0); + } } @Override diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/ValueAnimator.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/ValueAnimator.java index d8a12c688..7f0f93efd 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/ValueAnimator.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/ValueAnimator.java @@ -582,6 +582,7 @@ public class ValueAnimator extends Animator { * active animations to process. */ @Override + @SuppressWarnings("fallthrough") public void handleMessage(Message msg) { boolean callAgain = true; ArrayList animations = sAnimations.get(); diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuItemView.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuItemView.java index dcb50f362..7d36c3b22 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuItemView.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuItemView.java @@ -37,6 +37,7 @@ import com.actionbarsherlock.R; import com.actionbarsherlock.internal.view.View_HasStateListenerSupport; import com.actionbarsherlock.internal.view.View_OnAttachStateChangeListener; import com.actionbarsherlock.internal.widget.CapitalizingButton; +import com.actionbarsherlock.internal.widget.IcsToast; import static com.actionbarsherlock.internal.ResourcesCompat.getResources_getBoolean; @@ -263,7 +264,7 @@ public class ActionMenuItemView extends LinearLayout final int midy = screenPos[1] + height / 2; final int screenWidth = context.getResources().getDisplayMetrics().widthPixels; - Toast cheatSheet = Toast.makeText(context, mItemData.getTitle(), Toast.LENGTH_SHORT); + Toast cheatSheet = IcsToast.makeText(context, mItemData.getTitle(), IcsToast.LENGTH_SHORT); if (midy < displayFrame.height()) { // Show along the top; follow action buttons cheatSheet.setGravity(Gravity.TOP | Gravity.RIGHT, diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java index 179b8f037..51bacd7be 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java @@ -31,6 +31,7 @@ import android.content.pm.ResolveInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.drawable.Drawable; +import android.os.Build; import android.os.Bundle; import android.os.Parcelable; import android.util.SparseArray; @@ -353,6 +354,11 @@ public class MenuBuilder implements Menu { SparseArray viewStates = states.getSparseParcelableArray( getActionViewStatesKey()); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB && viewStates == null) { + //Fixes Issue #652 with sdk <= 2.3.6 + return; + } + final int itemCount = size(); for (int i = 0; i < itemCount; i++) { final MenuItem item = getItem(i); diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuPopupHelper.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuPopupHelper.java index f030de310..e49cd3190 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuPopupHelper.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuPopupHelper.java @@ -115,10 +115,20 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On View anchor = mAnchorView; if (anchor != null) { - final boolean addGlobalListener = mTreeObserver == null; - mTreeObserver = anchor.getViewTreeObserver(); // Refresh to latest - if (addGlobalListener) mTreeObserver.addOnGlobalLayoutListener(this); - ((View_HasStateListenerSupport)anchor).addOnAttachStateChangeListener(this); + // Don't attach to the VTO unless the anchor itself is attached to avoid VTO-related leaks. + if (anchor.getWindowToken() != null) { + ViewTreeObserver vto = anchor.getViewTreeObserver(); + if (vto != mTreeObserver) { + if (mTreeObserver != null && mTreeObserver.isAlive()) { + mTreeObserver.removeGlobalOnLayoutListener(this); + } + if ((mTreeObserver = vto) != null) { + vto.addOnGlobalLayoutListener(this); + } + } + } else if (anchor instanceof View_HasStateListenerSupport) { + ((View_HasStateListenerSupport) anchor).addOnAttachStateChangeListener(this); + } mPopup.setAnchorView(anchor); } else { return false; @@ -141,11 +151,11 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On mPopup = null; mMenu.close(); if (mTreeObserver != null) { - if (!mTreeObserver.isAlive()) mTreeObserver = mAnchorView.getViewTreeObserver(); - mTreeObserver.removeGlobalOnLayoutListener(this); + if (mTreeObserver.isAlive()) mTreeObserver.removeGlobalOnLayoutListener(this); mTreeObserver = null; + } else if (mAnchorView instanceof View_HasStateListenerSupport) { + ((View_HasStateListenerSupport) mAnchorView).removeOnAttachStateChangeListener(this); } - ((View_HasStateListenerSupport)mAnchorView).removeOnAttachStateChangeListener(this); } public boolean isShowing() { @@ -207,15 +217,16 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On @Override public void onViewAttachedToWindow(View v) { + ((View_HasStateListenerSupport) v).removeOnAttachStateChangeListener(this); + + // The anchor wasn't attached in tryShow(), attach to the ViewRoot VTO now. + if (mPopup != null && mTreeObserver == null) { + (mTreeObserver = v.getViewTreeObserver()).addOnGlobalLayoutListener(this); + } } @Override public void onViewDetachedFromWindow(View v) { - if (mTreeObserver != null) { - if (!mTreeObserver.isAlive()) mTreeObserver = v.getViewTreeObserver(); - mTreeObserver.removeGlobalOnLayoutListener(this); - } - ((View_HasStateListenerSupport)v).removeOnAttachStateChangeListener(this); } @Override diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuWrapper.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuWrapper.java index 3d4dd42fd..4eb8d09f4 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuWrapper.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/view/menu/MenuWrapper.java @@ -94,11 +94,18 @@ public class MenuWrapper implements Menu { @Override public void removeItem(int id) { + mNativeMap.remove(mNativeMenu.findItem(id)); mNativeMenu.removeItem(id); } @Override public void removeGroup(int groupId) { + for (int i = 0; i < mNativeMenu.size(); i++) { + final android.view.MenuItem item = mNativeMenu.getItem(i); + if (item.getGroupId() == groupId) { + mNativeMap.remove(item); + } + } mNativeMenu.removeGroup(groupId); } @@ -108,6 +115,20 @@ public class MenuWrapper implements Menu { mNativeMenu.clear(); } + public void invalidate() { + if (mNativeMap.isEmpty()) return; + + final WeakHashMap menuMapCopy = new WeakHashMap(mNativeMap.size()); + + for (int i = 0; i < mNativeMenu.size(); i++) { + final android.view.MenuItem item = mNativeMenu.getItem(i); + menuMapCopy.put(item, mNativeMap.get(item)); + } + + mNativeMap.clear(); + mNativeMap.putAll(menuMapCopy); + } + @Override public void setGroupCheckable(int group, boolean checkable, boolean exclusive) { mNativeMenu.setGroupCheckable(group, checkable, exclusive); diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ActionBarContainer.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ActionBarContainer.java index 1d9c68b37..0889825c0 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ActionBarContainer.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ActionBarContainer.java @@ -18,7 +18,6 @@ package com.actionbarsherlock.internal.widget; import android.content.Context; import android.content.res.TypedArray; -import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; @@ -27,7 +26,6 @@ import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; - import com.actionbarsherlock.R; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.internal.nineoldandroids.widget.NineFrameLayout; @@ -65,12 +63,7 @@ public class ActionBarContainer extends NineFrameLayout { //Fix for issue #379 if (mStackedBackground instanceof ColorDrawable && Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { - Bitmap bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); - Canvas c = new Canvas(bitmap); - mStackedBackground.draw(c); - int color = bitmap.getPixel(0, 0); - bitmap.recycle(); - mStackedBackground = new IcsColorDrawable(color); + mStackedBackground = new IcsColorDrawable((ColorDrawable) mStackedBackground); } if (getId() == R.id.abs__split_action_bar) { diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ActionBarView.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ActionBarView.java index 4636de17f..61e55b0a2 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ActionBarView.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ActionBarView.java @@ -16,16 +16,14 @@ package com.actionbarsherlock.internal.widget; -import org.xmlpull.v1.XmlPullParser; +import com.actionbarsherlock.internal.ResourcesCompat; import android.app.Activity; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; -import android.content.res.AssetManager; import android.content.res.Configuration; import android.content.res.TypedArray; -import android.content.res.XmlResourceParser; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Parcel; @@ -49,7 +47,6 @@ import android.widget.TextView; import com.actionbarsherlock.R; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.ActionBar.OnNavigationListener; -import com.actionbarsherlock.internal.ActionBarSherlockCompat; import com.actionbarsherlock.internal.view.menu.ActionMenuItem; import com.actionbarsherlock.internal.view.menu.ActionMenuPresenter; import com.actionbarsherlock.internal.view.menu.ActionMenuView; @@ -70,7 +67,6 @@ import static com.actionbarsherlock.internal.ResourcesCompat.getResources_getBoo */ public class ActionBarView extends AbsActionBarView { private static final String TAG = "ActionBarView"; - private static final boolean DEBUG = false; /** * Display options applied by default @@ -190,7 +186,7 @@ public class ActionBarView extends AbsActionBarView { if (context instanceof Activity) { //Even though native methods existed in API 9 and 10 they don't work //so just parse the manifest to look for the logo pre-Honeycomb - final int resId = loadLogoFromManifest((Activity) context); + final int resId = ResourcesCompat.loadLogoFromManifest((Activity) context); if (resId != 0) { mLogo = context.getResources().getDrawable(resId); } @@ -265,85 +261,6 @@ public class ActionBarView extends AbsActionBarView { mHomeLayout.setFocusable(true); } - /** - * Attempt to programmatically load the logo from the manifest file of an - * activity by using an XML pull parser. This should allow us to read the - * logo attribute regardless of the platform it is being run on. - * - * @param activity Activity instance. - * @return Logo resource ID. - */ - private static int loadLogoFromManifest(Activity activity) { - int logo = 0; - try { - final String thisPackage = activity.getClass().getName(); - if (DEBUG) Log.i(TAG, "Parsing AndroidManifest.xml for " + thisPackage); - - final String packageName = activity.getApplicationInfo().packageName; - final AssetManager am = activity.createPackageContext(packageName, 0).getAssets(); - final XmlResourceParser xml = am.openXmlResourceParser("AndroidManifest.xml"); - - int eventType = xml.getEventType(); - while (eventType != XmlPullParser.END_DOCUMENT) { - if (eventType == XmlPullParser.START_TAG) { - String name = xml.getName(); - - if ("application".equals(name)) { - //Check if the has the attribute - if (DEBUG) Log.d(TAG, "Got "); - - for (int i = xml.getAttributeCount() - 1; i >= 0; i--) { - if (DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i)); - - if ("logo".equals(xml.getAttributeName(i))) { - logo = xml.getAttributeResourceValue(i, 0); - break; //out of for loop - } - } - } else if ("activity".equals(name)) { - //Check if the is us and has the attribute - if (DEBUG) Log.d(TAG, "Got "); - Integer activityLogo = null; - String activityPackage = null; - boolean isOurActivity = false; - - for (int i = xml.getAttributeCount() - 1; i >= 0; i--) { - if (DEBUG) Log.d(TAG, xml.getAttributeName(i) + ": " + xml.getAttributeValue(i)); - - //We need both uiOptions and name attributes - String attrName = xml.getAttributeName(i); - if ("logo".equals(attrName)) { - activityLogo = xml.getAttributeResourceValue(i, 0); - } else if ("name".equals(attrName)) { - activityPackage = ActionBarSherlockCompat.cleanActivityName(packageName, xml.getAttributeValue(i)); - if (!thisPackage.equals(activityPackage)) { - break; //on to the next - } - isOurActivity = true; - } - - //Make sure we have both attributes before processing - if ((activityLogo != null) && (activityPackage != null)) { - //Our activity, logo specified, override with our value - logo = activityLogo.intValue(); - } - } - if (isOurActivity) { - //If we matched our activity but it had no logo don't - //do any more processing of the manifest - break; - } - } - } - eventType = xml.nextToken(); - } - } catch (Exception e) { - e.printStackTrace(); - } - if (DEBUG) Log.i(TAG, "Returning " + Integer.toHexString(logo)); - return logo; - } - /* * Must be public so we can dispatch pre-2.2 via ActionBarImpl. */ diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/CapitalizingButton.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/CapitalizingButton.java index fa3698f3b..9c658d561 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/CapitalizingButton.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/CapitalizingButton.java @@ -12,9 +12,14 @@ public class CapitalizingButton extends Button { private static final boolean IS_GINGERBREAD = Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD; private static final int[] R_styleable_Button = new int[] { + android.R.attr.textAppearance + }; + private static final int R_styleable_Button_textAppearance = 0; + + private static final int[] R_styleable_TextAppearance = new int[] { android.R.attr.textAllCaps }; - private static final int R_styleable_Button_textAllCaps = 0; + private static final int R_styleable_TextAppearance_textAllCaps = 0; private boolean mAllCaps; @@ -22,14 +27,26 @@ public class CapitalizingButton extends Button { super(context, attrs); TypedArray a = context.obtainStyledAttributes(attrs, R_styleable_Button); - mAllCaps = a.getBoolean(R_styleable_Button_textAllCaps, true); + int ap = a.getResourceId(R_styleable_Button_textAppearance, -1); a.recycle(); + if (ap != -1) { + TypedArray appearance = context.obtainStyledAttributes(ap, R_styleable_TextAppearance); + if (appearance != null) { + mAllCaps = appearance.getBoolean(R_styleable_TextAppearance_textAllCaps, true); + appearance.recycle(); + } + } } public void setTextCompat(CharSequence text) { if (SANS_ICE_CREAM && mAllCaps && text != null) { if (IS_GINGERBREAD) { - setText(text.toString().toUpperCase(Locale.ROOT)); + try { + setText(text.toString().toUpperCase(Locale.ROOT)); + } catch (NoSuchFieldError e) { + //Some manufacturer broke Locale.ROOT. See #572. + setText(text.toString().toUpperCase()); + } } else { setText(text.toString().toUpperCase()); } diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java deleted file mode 100644 index ad1b4f0a8..000000000 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/FakeDialogPhoneWindow.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.actionbarsherlock.internal.widget; - -import static android.view.View.MeasureSpec.EXACTLY; -import android.content.Context; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.util.DisplayMetrics; -import android.util.TypedValue; -import android.widget.LinearLayout; -import com.actionbarsherlock.R; - -public class FakeDialogPhoneWindow extends LinearLayout { - final TypedValue mMinWidthMajor = new TypedValue(); - final TypedValue mMinWidthMinor = new TypedValue(); - - public FakeDialogPhoneWindow(Context context, AttributeSet attrs) { - super(context, attrs); - - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SherlockTheme); - - a.getValue(R.styleable.SherlockTheme_windowMinWidthMajor, mMinWidthMajor); - a.getValue(R.styleable.SherlockTheme_windowMinWidthMinor, mMinWidthMinor); - - a.recycle(); - } - - /* Stolen from PhoneWindow */ - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - final DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); - final boolean isPortrait = metrics.widthPixels < metrics.heightPixels; - - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - - int width = getMeasuredWidth(); - boolean measure = false; - - widthMeasureSpec = MeasureSpec.makeMeasureSpec(width, EXACTLY); - - final TypedValue tv = isPortrait ? mMinWidthMinor : mMinWidthMajor; - - if (tv.type != TypedValue.TYPE_NULL) { - final int min; - if (tv.type == TypedValue.TYPE_DIMENSION) { - min = (int)tv.getDimension(metrics); - } else if (tv.type == TypedValue.TYPE_FRACTION) { - min = (int)tv.getFraction(metrics.widthPixels, metrics.widthPixels); - } else { - min = 0; - } - - if (width < min) { - widthMeasureSpec = MeasureSpec.makeMeasureSpec(min, EXACTLY); - measure = true; - } - } - - // TODO: Support height? - - if (measure) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - } - } -} diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsColorDrawable.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsColorDrawable.java index a78b3f71b..3e022e63a 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsColorDrawable.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsColorDrawable.java @@ -1,8 +1,10 @@ package com.actionbarsherlock.internal.widget; +import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; +import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; /** @@ -12,6 +14,14 @@ public class IcsColorDrawable extends Drawable { private int color; private final Paint paint = new Paint(); + public IcsColorDrawable(ColorDrawable drawable) { + Bitmap bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888); + Canvas c = new Canvas(bitmap); + drawable.draw(c); + this.color = bitmap.getPixel(0, 0); + bitmap.recycle(); + } + public IcsColorDrawable(int color) { this.color = color; } @@ -26,7 +36,7 @@ public class IcsColorDrawable extends Drawable { @Override public void setAlpha(int alpha) { if (alpha != (color >>> 24)) { - color = (color & 0x00FFFFFF) & (alpha << 24); + color = (color & 0x00FFFFFF) | (alpha << 24); invalidateSelf(); } } diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsLinearLayout.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsLinearLayout.java index 4947c41df..b7c6ff318 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsLinearLayout.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsLinearLayout.java @@ -3,10 +3,11 @@ package com.actionbarsherlock.internal.widget; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; +import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; +import android.os.Build; import android.util.AttributeSet; import android.view.View; -import android.widget.LinearLayout; import com.actionbarsherlock.internal.nineoldandroids.widget.NineLinearLayout; @@ -20,14 +21,12 @@ import com.actionbarsherlock.internal.nineoldandroids.widget.NineLinearLayout; public class IcsLinearLayout extends NineLinearLayout { private static final int[] R_styleable_LinearLayout = new int[] { /* 0 */ android.R.attr.divider, - /* 1 */ android.R.attr.measureWithLargestChild, /* 2 */ android.R.attr.showDividers, /* 3 */ android.R.attr.dividerPadding, }; private static final int LinearLayout_divider = 0; - private static final int LinearLayout_measureWithLargestChild = 1; - private static final int LinearLayout_showDividers = 2; - private static final int LinearLayout_dividerPadding = 3; + private static final int LinearLayout_showDividers = 1; + private static final int LinearLayout_dividerPadding = 2; /** * Don't show any dividers. @@ -53,8 +52,6 @@ public class IcsLinearLayout extends NineLinearLayout { private int mShowDividers; private int mDividerPadding; - private boolean mUseLargestChild; - public IcsLinearLayout(Context context, AttributeSet attrs) { super(context, attrs); @@ -63,7 +60,6 @@ public class IcsLinearLayout extends NineLinearLayout { setDividerDrawable(a.getDrawable(/*com.android.internal.R.styleable.*/LinearLayout_divider)); mShowDividers = a.getInt(/*com.android.internal.R.styleable.*/LinearLayout_showDividers, SHOW_DIVIDER_NONE); mDividerPadding = a.getDimensionPixelSize(/*com.android.internal.R.styleable.*/LinearLayout_dividerPadding, 0); - mUseLargestChild = a.getBoolean(/*com.android.internal.R.styleable.*/LinearLayout_measureWithLargestChild, false); a.recycle(); } @@ -100,6 +96,12 @@ public class IcsLinearLayout extends NineLinearLayout { if (divider == mDivider) { return; } + + //Fix for issue #379 + if (divider instanceof ColorDrawable && Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { + divider = new IcsColorDrawable((ColorDrawable) divider); + } + mDivider = divider; if (divider != null) { mDividerWidth = divider.getIntrinsicWidth(); @@ -275,136 +277,4 @@ public class IcsLinearLayout extends NineLinearLayout { } return false; } - - /** - * When true, all children with a weight will be considered having - * the minimum size of the largest child. If false, all children are - * measured normally. - * - * @return True to measure children with a weight using the minimum - * size of the largest child, false otherwise. - * - * @attr ref android.R.styleable#LinearLayout_measureWithLargestChild - */ - public boolean isMeasureWithLargestChildEnabled() { - return mUseLargestChild; - } - - /** - * When set to true, all children with a weight will be considered having - * the minimum size of the largest child. If false, all children are - * measured normally. - * - * Disabled by default. - * - * @param enabled True to measure children with a weight using the - * minimum size of the largest child, false otherwise. - * - * @attr ref android.R.styleable#LinearLayout_measureWithLargestChild - */ - public void setMeasureWithLargestChildEnabled(boolean enabled) { - mUseLargestChild = enabled; - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - - if (mUseLargestChild) { - final int orientation = getOrientation(); - switch (orientation) { - case HORIZONTAL: - useLargestChildHorizontal(); - break; - - case VERTICAL: - useLargestChildVertical(); - break; - } - } - } - - private void useLargestChildHorizontal() { - final int childCount = getChildCount(); - - // Find largest child width - int largestChildWidth = 0; - for (int i = 0; i < childCount; i++) { - final View child = getChildAt(i); - largestChildWidth = Math.max(child.getMeasuredWidth(), largestChildWidth); - } - - int totalWidth = 0; - // Re-measure childs - for (int i = 0; i < childCount; i++) { - final View child = getChildAt(i); - - if (child == null || child.getVisibility() == View.GONE) { - continue; - } - - final LinearLayout.LayoutParams lp = - (LinearLayout.LayoutParams) child.getLayoutParams(); - - float childExtra = lp.weight; - if (childExtra > 0) { - child.measure( - MeasureSpec.makeMeasureSpec(largestChildWidth, - MeasureSpec.EXACTLY), - MeasureSpec.makeMeasureSpec(child.getMeasuredHeight(), - MeasureSpec.EXACTLY)); - totalWidth += largestChildWidth; - - } else { - totalWidth += child.getMeasuredWidth(); - } - - totalWidth += lp.leftMargin + lp.rightMargin; - } - - totalWidth += getPaddingLeft() + getPaddingRight(); - setMeasuredDimension(totalWidth, getMeasuredHeight()); - } - - private void useLargestChildVertical() { - final int childCount = getChildCount(); - - // Find largest child width - int largestChildHeight = 0; - for (int i = 0; i < childCount; i++) { - final View child = getChildAt(i); - largestChildHeight = Math.max(child.getMeasuredHeight(), largestChildHeight); - } - - int totalHeight = 0; - // Re-measure childs - for (int i = 0; i < childCount; i++) { - final View child = getChildAt(i); - - if (child == null || child.getVisibility() == View.GONE) { - continue; - } - - final LinearLayout.LayoutParams lp = - (LinearLayout.LayoutParams) child.getLayoutParams(); - - float childExtra = lp.weight; - if (childExtra > 0) { - child.measure( - MeasureSpec.makeMeasureSpec(child.getMeasuredWidth(), - MeasureSpec.EXACTLY), - MeasureSpec.makeMeasureSpec(largestChildHeight, - MeasureSpec.EXACTLY)); - totalHeight += largestChildHeight; - - } else { - totalHeight += child.getMeasuredHeight(); - } - - totalHeight += lp.leftMargin + lp.rightMargin; - } - - totalHeight += getPaddingLeft() + getPaddingRight(); - setMeasuredDimension(getMeasuredWidth(), totalHeight); - } } diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsListPopupWindow.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsListPopupWindow.java index d13c6cea9..9ed87db2f 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsListPopupWindow.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsListPopupWindow.java @@ -36,7 +36,7 @@ public class IcsListPopupWindow { private static final int EXPAND_LIST_TIMEOUT = 250; private Context mContext; - private PopupWindow mPopup; + private final PopupWindowCompat mPopup; private ListAdapter mAdapter; private DropDownListView mDropDownList; @@ -80,7 +80,7 @@ public class IcsListPopupWindow { public IcsListPopupWindow(Context context, AttributeSet attrs, int defStyleAttr) { mContext = context; - mPopup = new PopupWindow(context, attrs, defStyleAttr); + mPopup = new PopupWindowCompat(context, attrs, defStyleAttr); mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED); } @@ -88,9 +88,9 @@ public class IcsListPopupWindow { mContext = context; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { Context wrapped = new ContextThemeWrapper(context, defStyleRes); - mPopup = new PopupWindow(wrapped, attrs, defStyleAttr); + mPopup = new PopupWindowCompat(wrapped, attrs, defStyleAttr); } else { - mPopup = new PopupWindow(context, attrs, defStyleAttr, defStyleRes); + mPopup = new PopupWindowCompat(context, attrs, defStyleAttr, defStyleRes); } mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED); } @@ -258,6 +258,23 @@ public class IcsListPopupWindow { mPopup.setInputMethodMode(mode); } + /** + * Set the selected position of the list. + * Only valid when {@link #isShowing()} == {@code true}. + * + * @param position List position to set as selected. + */ + public void setSelection(int position) { + DropDownListView list = mDropDownList; + if (isShowing() && list != null) { + list.mListSelectionHidden = false; + list.setSelection(position); + if (list.getChoiceMode() != ListView.CHOICE_MODE_NONE) { + list.setItemChecked(position, true); + } + } + } + public void clearListSelection() { final DropDownListView list = mDropDownList; if (list != null) { diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java new file mode 100644 index 000000000..042648b24 --- /dev/null +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/IcsToast.java @@ -0,0 +1,60 @@ + +package com.actionbarsherlock.internal.widget; + +import android.content.Context; +import android.util.Log; +import android.view.Gravity; +import android.os.Build.VERSION; +import android.os.Build.VERSION_CODES; +import android.widget.TextView; +import android.widget.Toast; + +import com.actionbarsherlock.R; + +public class IcsToast extends Toast { + public static final int LENGTH_LONG = Toast.LENGTH_LONG; + public static final int LENGTH_SHORT = Toast.LENGTH_SHORT; + private static final String TAG = "Toast"; + + public static Toast makeText(Context context, CharSequence s, int duration) { + if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) { + return Toast.makeText(context, s, duration); + } + IcsToast toast = new IcsToast(context); + toast.setDuration(duration); + TextView view = new TextView(context); + view.setText(s); + // Original AOSP using reference on @android:color/bright_foreground_dark + // bright_foreground_dark - reference on @android:color/background_light + // background_light - 0xffffffff + view.setTextColor(0xffffffff); + view.setGravity(Gravity.CENTER); + view.setBackgroundResource(R.drawable.abs__toast_frame); + toast.setView(view); + return toast; + } + + public static Toast makeText(Context context, int resId, int duration) { + return makeText(context, context.getResources().getString(resId), duration); + } + + public IcsToast(Context context) { + super(context); + } + + @Override + public void setText(CharSequence s) { + if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) { + super.setText(s); + return; + } + if (getView() == null) { + return; + } + try { + ((TextView) getView()).setText(s); + } catch (ClassCastException e) { + Log.e(TAG, "This Toast was not created with IcsToast.makeText", e); + } + } +} diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/PopupWindowCompat.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/PopupWindowCompat.java new file mode 100644 index 000000000..4c6e3720c --- /dev/null +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/PopupWindowCompat.java @@ -0,0 +1,178 @@ + +package com.actionbarsherlock.internal.widget; + +import java.lang.reflect.Field; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.View; +import android.view.ViewTreeObserver; +import android.view.ViewTreeObserver.OnScrollChangedListener; +import android.widget.PopupWindow; + +/** + * Works around bugs in the handling of {@link ViewTreeObserver} by + * {@link PopupWindow}. + *

+ * PopupWindow registers an {@link OnScrollChangedListener} with + * {@link ViewTreeObserver}, but does not keep a reference to the observer + * instance that it has registers on. This is problematic when the anchor view + * used by PopupWindow to access the observer is detached from the + * window, as it will revert from the shared ViewTreeObserver owned + * by the ViewRoot to a floating one, meaning + * PopupWindow cannot unregister it's listener anymore and has + * leaked it into the global observer. + *

+ * This class works around this issue by + *

    + *
  • replacing PopupWindow.mOnScrollChangedListener with a no-op + * listener so that any registration or unregistration performed by + * PopupWindow itself has no effect and causes no leaks. + *
  • registering the real listener only with the shared + * ViewTreeObserver and keeping a reference to it to facilitate + * correct unregistration. The reason for not registering on a floating observer + * (before a view is attached) is that there is no safe way to get a reference + * to the shared observer that the floating one will be merged into. This would + * again cause the listener to leak. + *
+ */ +public class PopupWindowCompat extends PopupWindow { + + private static final Field superListenerField; + static { + Field f = null; + try { + f = PopupWindow.class.getDeclaredField("mOnScrollChangedListener"); + f.setAccessible(true); + } catch (NoSuchFieldException e) { + /* ignored */ + } + superListenerField = f; + } + + private static final OnScrollChangedListener NOP = new OnScrollChangedListener() { + @Override + public void onScrollChanged() { + /* do nothing */ + } + }; + + private OnScrollChangedListener mSuperScrollListener; + private ViewTreeObserver mViewTreeObserver; + + public PopupWindowCompat() { + super(); + init(); + } + + public PopupWindowCompat(Context context) { + super(context); + init(); + } + + public PopupWindowCompat(Context context, AttributeSet attrs) { + super(context, attrs); + init(); + } + + public PopupWindowCompat(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + init(); + } + + // @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public PopupWindowCompat(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + init(); + } + + public PopupWindowCompat(int width, int height) { + super(width, height); + init(); + } + + public PopupWindowCompat(View contentView) { + super(contentView); + init(); + } + + public PopupWindowCompat(View contentView, int width, int height, boolean focusable) { + super(contentView, width, height, focusable); + init(); + } + + public PopupWindowCompat(View contentView, int width, int height) { + super(contentView, width, height); + init(); + } + + private void init() { + if (superListenerField != null) { + try { + mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this); + superListenerField.set(this, NOP); + } catch (Exception e) { + mSuperScrollListener = null; + } + } + } + + private void unregisterListener() { + // Don't do anything if we haven't managed to patch the super listener + if (mSuperScrollListener != null && mViewTreeObserver != null) { + if (mViewTreeObserver.isAlive()) { + mViewTreeObserver.removeOnScrollChangedListener(mSuperScrollListener); + } + mViewTreeObserver = null; + } + } + + private void registerListener(View anchor) { + // Don't do anything if we haven't managed to patch the super listener. + // And don't bother attaching the listener if the anchor view isn't + // attached. This means we'll only have to deal with the real VTO owned + // by the ViewRoot. + if (mSuperScrollListener != null) { + ViewTreeObserver vto = (anchor.getWindowToken() != null) ? anchor.getViewTreeObserver() + : null; + if (vto != mViewTreeObserver) { + if (mViewTreeObserver != null && mViewTreeObserver.isAlive()) { + mViewTreeObserver.removeOnScrollChangedListener(mSuperScrollListener); + } + if ((mViewTreeObserver = vto) != null) { + vto.addOnScrollChangedListener(mSuperScrollListener); + } + } + } + } + + @Override + public void showAsDropDown(View anchor, int xoff, int yoff) { + super.showAsDropDown(anchor, xoff, yoff); + registerListener(anchor); + } + + @Override + public void update(View anchor, int xoff, int yoff, int width, int height) { + super.update(anchor, xoff, yoff, width, height); + registerListener(anchor); + } + + @Override + public void update(View anchor, int width, int height) { + super.update(anchor, width, height); + registerListener(anchor); + } + + @Override + public void showAtLocation(View parent, int gravity, int x, int y) { + super.showAtLocation(parent, gravity, x, y); + unregisterListener(); + } + + @Override + public void dismiss() { + super.dismiss(); + unregisterListener(); + } +} diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ScrollingTabContainerView.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ScrollingTabContainerView.java index 48fb5d8b4..eb178e0de 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ScrollingTabContainerView.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/ScrollingTabContainerView.java @@ -186,7 +186,7 @@ public class ScrollingTabContainerView extends NineHorizontalScrollView } private IcsLinearLayout createTabLayout() { - final IcsLinearLayout tabLayout = (IcsLinearLayout) LayoutInflater.from(getContext()) + final TabsLinearLayout tabLayout = (TabsLinearLayout) LayoutInflater.from(getContext()) .inflate(R.layout.abs__action_bar_tab_bar_view, null); tabLayout.setMeasureWithLargestChildEnabled(true); tabLayout.setLayoutParams(new LinearLayout.LayoutParams( diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/TabsLinearLayout.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/TabsLinearLayout.java new file mode 100644 index 000000000..03d09b1f6 --- /dev/null +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/TabsLinearLayout.java @@ -0,0 +1,113 @@ +package com.actionbarsherlock.internal.widget; + +import android.content.Context; +import android.content.res.TypedArray; +import android.util.AttributeSet; +import android.view.View; +import android.widget.LinearLayout; + +public class TabsLinearLayout extends IcsLinearLayout { + private static final int[] R_styleable_LinearLayout = new int[] { + /* 0 */ android.R.attr.measureWithLargestChild, + }; + private static final int LinearLayout_measureWithLargestChild = 0; + + private boolean mUseLargestChild; + + public TabsLinearLayout(Context context, AttributeSet attrs) { + super(context, attrs); + + TypedArray a = context.obtainStyledAttributes(attrs, /*com.android.internal.R.styleable.*/R_styleable_LinearLayout); + mUseLargestChild = a.getBoolean(/*com.android.internal.R.styleable.*/LinearLayout_measureWithLargestChild, false); + + a.recycle(); + } + + /** + * When true, all children with a weight will be considered having + * the minimum size of the largest child. If false, all children are + * measured normally. + * + * @return True to measure children with a weight using the minimum + * size of the largest child, false otherwise. + * + * @attr ref android.R.styleable#LinearLayout_measureWithLargestChild + */ + public boolean isMeasureWithLargestChildEnabled() { + return mUseLargestChild; + } + + /** + * When set to true, all children with a weight will be considered having + * the minimum size of the largest child. If false, all children are + * measured normally. + * + * Disabled by default. + * + * @param enabled True to measure children with a weight using the + * minimum size of the largest child, false otherwise. + * + * @attr ref android.R.styleable#LinearLayout_measureWithLargestChild + */ + public void setMeasureWithLargestChildEnabled(boolean enabled) { + mUseLargestChild = enabled; + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + + final int childCount = getChildCount(); + if (childCount <= 2) return; + + final int mode = MeasureSpec.getMode(widthMeasureSpec); + if (mUseLargestChild && mode == MeasureSpec.UNSPECIFIED) { + final int orientation = getOrientation(); + if (orientation == HORIZONTAL) { + useLargestChildHorizontal(); + } + } + } + + private void useLargestChildHorizontal() { + final int childCount = getChildCount(); + + // Find largest child width + int largestChildWidth = 0; + for (int i = 0; i < childCount; i++) { + final View child = getChildAt(i); + largestChildWidth = Math.max(child.getMeasuredWidth(), largestChildWidth); + } + + int totalWidth = 0; + // Re-measure childs + for (int i = 0; i < childCount; i++) { + final View child = getChildAt(i); + + if (child == null || child.getVisibility() == View.GONE) { + continue; + } + + final LinearLayout.LayoutParams lp = + (LinearLayout.LayoutParams) child.getLayoutParams(); + + float childExtra = lp.weight; + if (childExtra > 0) { + child.measure( + MeasureSpec.makeMeasureSpec(largestChildWidth, + MeasureSpec.EXACTLY), + MeasureSpec.makeMeasureSpec(child.getMeasuredHeight(), + MeasureSpec.EXACTLY)); + totalWidth += largestChildWidth; + + } else { + totalWidth += child.getMeasuredWidth(); + } + + totalWidth += lp.leftMargin + lp.rightMargin; + } + + totalWidth += getPaddingLeft() + getPaddingRight(); + setMeasuredDimension(totalWidth, getMeasuredHeight()); + } +} diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java index e19ea9e9e..7eb7330e4 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java @@ -395,7 +395,11 @@ class ActivityChooserView extends ViewGroup implements ActivityChooserModelClien super.onAttachedToWindow(); ActivityChooserModel dataModel = mAdapter.getDataModel(); if (dataModel != null) { - dataModel.registerObserver(mModelDataSetOberver); + try { + dataModel.registerObserver(mModelDataSetOberver); + } catch (IllegalStateException e) { + // Related to #557. + } } mIsAttachedToWindow = true; } @@ -522,6 +526,9 @@ class ActivityChooserView extends ViewGroup implements ActivityChooserModelClien mDefaultActionButtonContentDescription, label); mDefaultActivityButton.setContentDescription(contentDescription); } + + // Work-around for #415. + mAdapter.setShowDefaultActivity(false, false); } else { mDefaultActivityButton.setVisibility(View.GONE); } @@ -644,7 +651,8 @@ class ActivityChooserView extends ViewGroup implements ActivityChooserModelClien private int mMaxActivityCount = MAX_ACTIVITY_COUNT_DEFAULT; - private boolean mShowDefaultActivity; + // Work-around for #415. + private boolean mShowDefaultActivity = true; private boolean mHighlightDefaultActivity; @@ -661,7 +669,11 @@ class ActivityChooserView extends ViewGroup implements ActivityChooserModelClien } mDataModel = dataModel; if (dataModel != null && isShown()) { - dataModel.registerObserver(mModelDataSetOberver); + try { + dataModel.registerObserver(mModelDataSetOberver); + } catch (IllegalStateException e) { + // Related to #557. + } } notifyDataSetChanged(); } diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/SearchView.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/SearchView.java index c9e7897d4..fb8319645 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/SearchView.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/SearchView.java @@ -1623,8 +1623,8 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { private void forceSuggestionQuery() { try { - Method before = SearchAutoComplete.class.getMethod("doBeforeTextChanged"); - Method after = SearchAutoComplete.class.getMethod("doAfterTextChanged"); + Method before = AutoCompleteTextView.class.getDeclaredMethod("doBeforeTextChanged"); + Method after = AutoCompleteTextView.class.getDeclaredMethod("doAfterTextChanged"); before.setAccessible(true); after.setAccessible(true); before.invoke(mQueryTextView); diff --git a/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java b/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java index bd5cbd718..82d4f0c42 100644 --- a/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java +++ b/libraries/ActionBarSherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java @@ -66,6 +66,7 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene static final int REFINE_ALL = 2; private SearchManager mSearchManager; + private SearchableInfo mSearchable; private SearchView mSearchView; private Context mProviderContext; private WeakHashMap mOutsideDrawablesCache; @@ -94,12 +95,13 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene //private static final long DELETE_KEY_POST_DELAY = 500L; public SuggestionsAdapter(Context context, SearchView searchView, - SearchableInfo mSearchable, WeakHashMap outsideDrawablesCache) { + SearchableInfo searchable, WeakHashMap outsideDrawablesCache) { super(context, R.layout.abs__search_dropdown_item_icons_2line, null, // no initial cursor true); // auto-requery mSearchManager = (SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE); + mSearchable = searchable; mProviderContext = mContext; mSearchView = searchView; @@ -199,25 +201,48 @@ class SuggestionsAdapter extends ResourceCursorAdapter implements OnClickListene } public Cursor getSuggestions(String query, int limit) { + if (mSearchable == null) { + return null; + } + + String authority = mSearchable.getSuggestAuthority(); + if (authority == null) { + return null; + } + Uri.Builder uriBuilder = new Uri.Builder() .scheme(ContentResolver.SCHEME_CONTENT) + .authority(authority) .query("") // TODO: Remove, workaround for a bug in Uri.writeToParcel() .fragment(""); // TODO: Remove, workaround for a bug in Uri.writeToParcel() + // if content path provided, insert it now + final String contentPath = mSearchable.getSuggestPath(); + if (contentPath != null) { + uriBuilder.appendEncodedPath(contentPath); + } + // append standard suggestion query path uriBuilder.appendPath(SearchManager.SUGGEST_URI_PATH_QUERY); + // get the query selection, may be null + String selection = mSearchable.getSuggestSelection(); // inject query, either as selection args or inline - uriBuilder.appendPath(query); + String[] selArgs = null; + if (selection != null) { // use selection if provided + selArgs = new String[] { query }; + } else { // no selection, use REST pattern + uriBuilder.appendPath(query); + } if (limit > 0) { - uriBuilder.appendQueryParameter(SearchManager.SUGGEST_PARAMETER_LIMIT, String.valueOf(limit)); + uriBuilder.appendQueryParameter("limit", String.valueOf(limit)); } Uri uri = uriBuilder.build(); // finally, make the query - return mContext.getContentResolver().query(uri, null, null, null, null); + return mContext.getContentResolver().query(uri, null, selection, selArgs, null); } public void close() { diff --git a/libraries/ActionBarSherlock/test/com/actionbarsherlock/internal/ManifestParsingTest.java b/libraries/ActionBarSherlock/test/com/actionbarsherlock/internal/ManifestParsingTest.java deleted file mode 100644 index 47475c574..000000000 --- a/libraries/ActionBarSherlock/test/com/actionbarsherlock/internal/ManifestParsingTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.actionbarsherlock.internal; - -import org.junit.Test; - -import static com.actionbarsherlock.internal.ActionBarSherlockCompat.cleanActivityName; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; - -public class ManifestParsingTest { - @Test - public void testFullyQualifiedClassName() { - String expected = "com.other.package.SomeClass"; - String actual = cleanActivityName("com.jakewharton.test", "com.other.package.SomeClass"); - assertThat(expected, equalTo(actual)); - } - - @Test - public void testFullyQualifiedClassNameSamePackage() { - String expected = "com.jakewharton.test.SomeClass"; - String actual = cleanActivityName("com.jakewharton.test", "com.jakewharton.test.SomeClass"); - assertThat(expected, equalTo(actual)); - } - - @Test - public void testUnqualifiedClassName() { - String expected = "com.jakewharton.test.SomeClass"; - String actual = cleanActivityName("com.jakewharton.test", "SomeClass"); - assertThat(expected, equalTo(actual)); - } - - @Test - public void testRelativeClassName() { - String expected = "com.jakewharton.test.ui.SomeClass"; - String actual = cleanActivityName("com.jakewharton.test", ".ui.SomeClass"); - assertThat(expected, equalTo(actual)); - } -} \ No newline at end of file diff --git a/libraries/ActionBarSherlock/test/com/actionbarsherlock/internal/ResourcesCompatTest.java b/libraries/ActionBarSherlock/test/com/actionbarsherlock/internal/ResourcesCompatTest.java new file mode 100644 index 000000000..f621d3a96 --- /dev/null +++ b/libraries/ActionBarSherlock/test/com/actionbarsherlock/internal/ResourcesCompatTest.java @@ -0,0 +1,23 @@ +package com.actionbarsherlock.internal; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; + +import static com.actionbarsherlock.internal.ActionBarSherlockCompat.cleanActivityName; +import static org.fest.assertions.api.Assertions.assertThat; + +@RunWith(RobolectricTestRunner.class) +public class ResourcesCompatTest { + @Test + public void testCleanActivityName() { + assertThat(cleanActivityName("com.jakewharton.test", "com.other.package.SomeClass")) // + .isEqualTo("com.other.package.SomeClass"); + assertThat(cleanActivityName("com.jakewharton.test", "com.jakewharton.test.SomeClass")) // + .isEqualTo("com.jakewharton.test.SomeClass"); + assertThat(cleanActivityName("com.jakewharton.test", "SomeClass")) // + .isEqualTo("com.jakewharton.test.SomeClass"); + assertThat(cleanActivityName("com.jakewharton.test", ".ui.SomeClass")) // + .isEqualTo("com.jakewharton.test.ui.SomeClass"); + } +} \ No newline at end of file