Showing preview only (1,519K chars total). Download the full file or copy to clipboard to get everything.
Repository: way1989/WayHoo
Branch: master
Commit: 2198b8d28a28
Files: 333
Total size: 1.4 MB
Directory structure:
gitextract_c4ix2knx/
├── .gitignore
├── LICENSE
├── README.md
├── Upgrade-lib/
│ ├── .settings/
│ │ └── org.eclipse.jdt.core.prefs
│ ├── AndroidManifest.xml
│ ├── proguard-project.txt
│ ├── project.properties
│ └── src/
│ └── com/
│ └── way/
│ └── upgrade/
│ ├── .MainActivity.java.swp
│ ├── MainActivity.java
│ ├── bean/
│ │ └── UpgradeInfo.java
│ ├── core/
│ │ ├── CheckNewVersionListener.java
│ │ ├── UpgradeInterface.java
│ │ └── UpgradeManager.java
│ ├── job/
│ │ ├── AbstractCheckNewVersionJob.java
│ │ ├── CheckNewVersionJobWithoutClientUrl.java
│ │ └── DownloadNewVersionJob.java
│ ├── locale/
│ │ ├── LocaleChina.java
│ │ ├── LocaleChinaTW.java
│ │ ├── LocaleChinese.java
│ │ ├── LocaleEnglish.java
│ │ ├── LocaleHandler.java
│ │ └── LocaleUS.java
│ ├── parser/
│ │ └── json/
│ │ ├── AbstractJsonParsing.java
│ │ └── FirVersionJsonParsing.java
│ ├── receiver/
│ │ └── DownloadCompleteReveiver.java
│ └── utils/
│ ├── Constants.java
│ ├── ContextUtils.java
│ ├── FileUtils.java
│ ├── Log.java
│ ├── NetUtils.java
│ ├── Preferences.java
│ ├── Utils.java
│ └── thread/
│ ├── Future.java
│ ├── FutureListener.java
│ ├── PriorityThreadFactory.java
│ └── ThreadPool.java
└── WayHoo/
├── .settings/
│ └── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── Upgrade-lib/
│ └── com/
│ └── way/
│ └── upgrade/
│ ├── .MainActivity.java.swp
│ ├── MainActivity.java
│ ├── bean/
│ │ └── UpgradeInfo.java
│ ├── core/
│ │ ├── CheckNewVersionListener.java
│ │ ├── UpgradeInterface.java
│ │ └── UpgradeManager.java
│ ├── job/
│ │ ├── AbstractCheckNewVersionJob.java
│ │ ├── CheckNewVersionJobWithoutClientUrl.java
│ │ └── DownloadNewVersionJob.java
│ ├── locale/
│ │ ├── LocaleChina.java
│ │ ├── LocaleChinaTW.java
│ │ ├── LocaleChinese.java
│ │ ├── LocaleEnglish.java
│ │ ├── LocaleHandler.java
│ │ └── LocaleUS.java
│ ├── parser/
│ │ └── json/
│ │ ├── AbstractJsonParsing.java
│ │ └── FirVersionJsonParsing.java
│ ├── receiver/
│ │ └── DownloadCompleteReveiver.java
│ └── utils/
│ ├── Constants.java
│ ├── ContextUtils.java
│ ├── FileUtils.java
│ ├── Log.java
│ ├── NetUtils.java
│ ├── Preferences.java
│ ├── Utils.java
│ └── thread/
│ ├── Future.java
│ ├── FutureListener.java
│ ├── PriorityThreadFactory.java
│ └── ThreadPool.java
├── jni/
│ ├── Android.mk
│ ├── Application.mk
│ ├── bitmapPort.c
│ ├── bitmapPort.h
│ ├── com_way_util_blur_jni_FrostedGlassUtil.h
│ ├── constants.h
│ ├── frostedGlass.c
│ ├── imageProcess.c
│ └── imageProcess.h
├── libs/
│ ├── Bughd_android_sdk_v1.2.6.jar
│ ├── android-support-v13.jar
│ └── locSDK_5.3.jar
├── proguard-project.txt
├── project.properties
├── res/
│ ├── anim/
│ │ ├── count_down_exit.xml
│ │ ├── fade_out.xml
│ │ ├── in_from_bottom.xml
│ │ ├── in_from_top.xml
│ │ ├── out_from_bottom.xml
│ │ ├── out_from_top.xml
│ │ ├── push_right_out.xml
│ │ ├── slide_in_from_bottom.xml
│ │ ├── slide_in_from_top.xml
│ │ ├── slide_out_to_bottom.xml
│ │ └── slide_out_to_top.xml
│ ├── color/
│ │ ├── vpi__dark_theme.xml
│ │ └── vpi__light_theme.xml
│ ├── drawable/
│ │ ├── city_edit_prs.xml
│ │ ├── city_query_delete.xml
│ │ ├── cityselector_locate_btn_bg.xml
│ │ ├── home_setting_selector.xml
│ │ ├── indicator_bg_bottom.xml
│ │ ├── indicator_bg_top.xml
│ │ ├── item_background.xml
│ │ ├── item_prs.xml
│ │ ├── listview_background.xml
│ │ ├── main_city_name_bg.xml
│ │ ├── main_life_complete_selector.xml
│ │ ├── main_life_edit.xml
│ │ ├── module_bg.xml
│ │ ├── refresh_icon_anim.xml
│ │ ├── resource_circle_progressbar_indeterminate.xml
│ │ ├── setting_top_back.xml
│ │ ├── settings_bg_city_item_down.xml
│ │ ├── settings_bg_city_item_up.xml
│ │ ├── shape_bg.xml
│ │ ├── sidebar_item_background_dark_selector.xml
│ │ ├── sidebar_item_background_light_selector.xml
│ │ ├── sidebar_item_selected_layerlist_dark.xml
│ │ ├── slidingmenu_shadow.xml
│ │ ├── topbar_icon_share_selector.xml
│ │ ├── topbar_icon_side_selector.xml
│ │ ├── update_forecast_selector.xml
│ │ ├── vpi__tab_indicator.xml
│ │ ├── weather_detail_activity_btn_bg.xml
│ │ └── white_border.xml
│ ├── layout/
│ │ ├── about.xml
│ │ ├── activity_main.xml
│ │ ├── activity_main_actionbar.xml
│ │ ├── base_fragment.xml
│ │ ├── city_manager_actionbar.xml
│ │ ├── city_manager_layout.xml
│ │ ├── city_manger_grid_item_add.xml
│ │ ├── city_manger_grid_item_normal.xml
│ │ ├── city_query_actionbar.xml
│ │ ├── city_query_hotcity_grid_item.xml
│ │ ├── city_query_layout.xml
│ │ ├── city_query_list_item.xml
│ │ ├── comm_lay_emptyview.xml
│ │ ├── comm_lay_loadfailed.xml
│ │ ├── comm_lay_loading.xml
│ │ ├── count_down_to_location.xml
│ │ ├── custom_progress_dialog.xml
│ │ ├── feed_back_view.xml
│ │ ├── loading_empty_container.xml
│ │ ├── no_results_message.xml
│ │ ├── notification_weather_multi.xml
│ │ ├── sidemenu_list_item_category.xml
│ │ ├── sidemenu_list_item_item.xml
│ │ ├── sidemenu_listview.xml
│ │ ├── splash_activity_layout.xml
│ │ ├── swipeback_layout.xml
│ │ ├── weather_aqi.xml
│ │ ├── weather_current_condition.xml
│ │ ├── weather_details.xml
│ │ ├── weather_forecast.xml
│ │ ├── weather_forecast_item.xml
│ │ ├── weather_fragment.xml
│ │ ├── weather_index.xml
│ │ ├── weather_index_item.xml
│ │ ├── weather_info_error.xml
│ │ ├── weather_provider_layout_rigo_2x2.xml
│ │ ├── weather_provider_layout_rigo_4x1.xml
│ │ └── weather_provider_layout_rigo_4x2.xml
│ ├── values/
│ │ ├── arrays.xml
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── drawables.xml
│ │ ├── ids.xml
│ │ ├── integers.xml
│ │ ├── menudrawer_attrs.xml
│ │ ├── menudrawer_colors.xml
│ │ ├── menudrawer_ids.xml
│ │ ├── menudrawer_strings.xml
│ │ ├── menudrawer_styles.xml
│ │ ├── strings.xml
│ │ ├── styles.xml
│ │ ├── swipeback_attrs.xml
│ │ ├── swipeback_styles.xml
│ │ ├── vpi__attrs.xml
│ │ ├── vpi__colors.xml
│ │ ├── vpi__defaults.xml
│ │ └── vpi__styles.xml
│ ├── values-hdpi/
│ │ └── dimens.xml
│ ├── values-xhdpi/
│ │ └── dimens.xml
│ ├── values-zh-rCN/
│ │ └── strings.xml
│ └── xml/
│ ├── weather_appwidget_info_rigo_2x2.xml
│ ├── weather_appwidget_info_rigo_4x1.xml
│ └── weather_appwidget_info_rigo_4x2.xml
└── src/
├── com/
│ ├── android/
│ │ └── volley/
│ │ ├── AuthFailureError.java
│ │ ├── Cache.java
│ │ ├── CacheDispatcher.java
│ │ ├── DefaultRetryPolicy.java
│ │ ├── ExecutorDelivery.java
│ │ ├── Network.java
│ │ ├── NetworkDispatcher.java
│ │ ├── NetworkError.java
│ │ ├── NetworkResponse.java
│ │ ├── NoConnectionError.java
│ │ ├── ParseError.java
│ │ ├── Request.java
│ │ ├── RequestQueue.java
│ │ ├── Response.java
│ │ ├── ResponseDelivery.java
│ │ ├── RetryPolicy.java
│ │ ├── ServerError.java
│ │ ├── TimeoutError.java
│ │ ├── VolleyError.java
│ │ ├── VolleyLog.java
│ │ └── toolbox/
│ │ ├── AndroidAuthenticator.java
│ │ ├── Authenticator.java
│ │ ├── BasicNetwork.java
│ │ ├── ByteArrayPool.java
│ │ ├── ClearCacheRequest.java
│ │ ├── DiskBasedCache.java
│ │ ├── HttpClientStack.java
│ │ ├── HttpHeaderParser.java
│ │ ├── HttpStack.java
│ │ ├── HurlStack.java
│ │ ├── ImageLoader.java
│ │ ├── ImageRequest.java
│ │ ├── JsonArrayRequest.java
│ │ ├── JsonObjectRequest.java
│ │ ├── JsonRequest.java
│ │ ├── NetworkImageView.java
│ │ ├── NoCache.java
│ │ ├── PoolingByteArrayOutputStream.java
│ │ ├── RequestFuture.java
│ │ ├── StringRequest.java
│ │ └── Volley.java
│ ├── viewpagerindicator/
│ │ ├── CirclePageIndicator.java
│ │ ├── IconPageIndicator.java
│ │ ├── IconPagerAdapter.java
│ │ ├── IcsLinearLayout.java
│ │ ├── LinePageIndicator.java
│ │ ├── PageIndicator.java
│ │ ├── TabPageIndicator.java
│ │ ├── TitlePageIndicator.java
│ │ └── UnderlinePageIndicator.java
│ └── way/
│ ├── adapter/
│ │ ├── FragmentPagerAdapter.java
│ │ ├── ParallaxPagerTransformer.java
│ │ ├── QueryCityAdapter.java
│ │ ├── SideMenuAdapter.java
│ │ ├── WeatherListAdapter.java
│ │ └── WeatherPagerAdapter.java
│ ├── beans/
│ │ ├── Category.java
│ │ ├── City.java
│ │ ├── Item.java
│ │ └── MainItem.java
│ ├── common/
│ │ └── util/
│ │ ├── L.java
│ │ ├── LocationUtils.java
│ │ ├── LunarCalendar.java
│ │ ├── LunarCalendarConvertUtil.java
│ │ ├── NetUtil.java
│ │ ├── PreferenceUtils.java
│ │ ├── SystemUtils.java
│ │ ├── T.java
│ │ ├── TimeUtils.java
│ │ └── WeatherIconUtils.java
│ ├── db/
│ │ └── CityProvider.java
│ ├── fragment/
│ │ ├── BaseFragment.java
│ │ ├── IExceptionDeclare.java
│ │ ├── ITaskManager.java
│ │ ├── TaskException.java
│ │ ├── TaskManager.java
│ │ ├── WeatherFragment.java
│ │ └── WorkTask.java
│ ├── observablescrollview/
│ │ ├── CacheFragmentStatePagerAdapter.java
│ │ ├── ObservableGridView.java
│ │ ├── ObservableListView.java
│ │ ├── ObservableScrollView.java
│ │ ├── ObservableScrollViewCallbacks.java
│ │ ├── ObservableWebView.java
│ │ ├── ScrollState.java
│ │ ├── ScrollUtils.java
│ │ ├── Scrollable.java
│ │ └── TouchInterceptionFrameLayout.java
│ ├── ui/
│ │ ├── swipeback/
│ │ │ ├── SwipeBackActivity.java
│ │ │ ├── SwipeBackActivityBase.java
│ │ │ ├── SwipeBackActivityHelper.java
│ │ │ ├── SwipeBackLayout.java
│ │ │ └── ViewDragHelper.java
│ │ └── view/
│ │ ├── CountDownView.java
│ │ ├── DragSortGridView.java
│ │ ├── LoadingEmptyContainer.java
│ │ ├── NoResultsContainer.java
│ │ ├── TouchDispatchView.java
│ │ ├── WeatherAqiView.java
│ │ ├── WeatherBaseView.java
│ │ ├── WeatherDetailsView.java
│ │ ├── WeatherForecastView.java
│ │ ├── WeatherIndexView.java
│ │ └── WeatherTypefacedTextView.java
│ ├── util/
│ │ └── blur/
│ │ └── jni/
│ │ ├── BitmapUtils.java
│ │ └── FrostedGlassUtil.java
│ ├── weather/
│ │ └── plugin/
│ │ ├── bean/
│ │ │ ├── AQI.java
│ │ │ ├── Alerts.java
│ │ │ ├── Forecast.java
│ │ │ ├── Index.java
│ │ │ ├── IndexDetail.java
│ │ │ ├── RealTime.java
│ │ │ └── WeatherInfo.java
│ │ ├── spider/
│ │ │ ├── WeatherConstants.java
│ │ │ ├── WeatherController.java
│ │ │ ├── WeatherSpider.java
│ │ │ └── WeatherUtilities.java
│ │ └── util/
│ │ ├── Constants.java
│ │ └── NetUtil.java
│ └── yahoo/
│ ├── AboutActivity.java
│ ├── App.java
│ ├── BaseActivity.java
│ ├── FeedBackActivity.java
│ ├── MainActivity.java
│ ├── ManagerCityActivity.java
│ ├── QueryCityActivity.java
│ └── SplashActivity.java
└── net/
└── simonvt/
└── menudrawer/
├── BuildLayerFrameLayout.java
├── ColorDrawable.java
├── DraggableDrawer.java
├── FloatScroller.java
├── MenuDrawer.java
├── NoClickThroughFrameLayout.java
├── OverlayDrawer.java
├── PeekInterpolator.java
├── Position.java
├── Scroller.java
├── SinusoidalInterpolator.java
├── SlideDrawable.java
├── SlidingDrawer.java
├── SmoothInterpolator.java
├── StaticDrawer.java
├── ViewHelper.java
└── compat/
├── ActionBarHelper.java
├── ActionBarHelperCompat.java
└── ActionBarHelperNative.java
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_
.DS_Store
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Eclipse project files
.classpath
.project
# Proguard folder generated by Eclipse
proguard/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "{}" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright 2014 way
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
威震天气
======
本应用是以变形金刚作为主题元素的实用型Android天气软件,界面高仿雅虎天气,数据来自中国天气网!
##下载apk
[腾讯应用市场](http://sj.qq.com/myapp/detail.htm?apkName=com.way.yahoo)
[百度应用市场](http://shouji.baidu.com/soft/item?docid=6930651&from=as&f=search_app_%E5%A8%81%E9%9C%87%E5%A4%A9%E6%B0%94%40list_1_title%401%40header_all_input)
# **威震天气 Android 客户端项目简析** #
*注:本文假设你已经有Android开发环境*
①.启动Eclipse,将名为WayHoo导入作为主工程,并确保你当前的Android SDK是最新版。<br>
②.将libs目录下相应的库导入Eclipse,并作为主工程的库工程,以免缺少一些必要的资源或类。<br>
③.如果编译出错,请修改项目根目录下的 project.properties 文件。<br>
④.请使用Android 4.0 以上版本的SDK,JDK1.6编译:
> target=android-19
**本项目采用 GPL 授权协议,欢迎大家在这个基础上进行改进,并与大家分享。**
## 联系我
way:
* [邮箱](mailto:way.ping.li@gmail.com "给我发邮件")
* [博客](http://blog.csdn.net/way_ping_li "CSDN博客")
## 测试截图
###高斯模糊效果图







================================================
FILE: Upgrade-lib/.settings/org.eclipse.jdt.core.prefs
================================================
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6
================================================
FILE: Upgrade-lib/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.way.upgrade"
android:versionCode="1"
android:versionName="1.0.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
</manifest>
================================================
FILE: Upgrade-lib/proguard-project.txt
================================================
# 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 *;
#}
================================================
FILE: Upgrade-lib/project.properties
================================================
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-22
android.library=true
================================================
FILE: Upgrade-lib/src/com/way/upgrade/MainActivity.java
================================================
package com.way.upgrade;
import android.app.Activity;
import android.os.Bundle;
import com.way.upgrade.core.UpgradeManager;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final UpgradeManager upgradeMangeer = UpgradeManager.newInstance(this);
upgradeMangeer.askForNewVersion();
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/bean/UpgradeInfo.java
================================================
package com.way.upgrade.bean;
import android.os.Parcel;
import android.os.Parcelable;
/**
* 版本更新信息
*
* @author way
* @since 2014/4/28
*/
public class UpgradeInfo implements Parcelable{
private int id;
/**唯一标识apk*/
private String key;
/** 版本信息 */
private String version;
/** 版本名称 */
private String versionName;
/** 是否有更新 */
private String result;
/** 新版本地址 */
private String url;
/** 版本描述 */
private String description;
/** 已下载的大小 */
private long downloadSize;
private String mustUpdate;
private String changeLog;
private String errorCode;
public static final Parcelable.Creator<UpgradeInfo> CREATOR = new Creator<UpgradeInfo>() {
@Override
public UpgradeInfo[] newArray(int size) {
return new UpgradeInfo[size];
}
@Override
public UpgradeInfo createFromParcel(Parcel source) {
return new UpgradeInfo(source);
}
};
public UpgradeInfo() {
}
public UpgradeInfo(Parcel in) {
id = in.readInt();
key = in.readString();
version = in.readString();
versionName = in.readString();
result = in.readString();
url = in.readString();
description = in.readString();
downloadSize = in.readLong();
result = in.readString();
mustUpdate = in.readString();
changeLog = in.readString();
errorCode = in.readString();
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(id);
dest.writeString(key);
dest.writeString(version);
dest.writeString(versionName);
dest.writeString(result);
dest.writeString(url);
dest.writeString(description);
dest.writeLong(downloadSize);
dest.writeString(result);
dest.writeString(mustUpdate);
dest.writeString(changeLog);
dest.writeString(errorCode);
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public long getDownloadSize() {
return downloadSize;
}
public void setDownloadSize(long downloadSize) {
this.downloadSize = downloadSize;
}
public String getVersionName() {
return versionName;
}
public void setVersionName(String versionName) {
this.versionName = versionName;
}
public String isResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getMustUpdate() {
return mustUpdate;
}
public void setMustUpdate(String mustUpdate) {
this.mustUpdate = mustUpdate;
}
public String getChangeLog() {
return changeLog;
}
public void setChangeLog(String changeLog) {
this.changeLog = changeLog;
}
public String getResult() {
return result;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
@Override
public String toString() {
return "UpgradeInfo [id=" + id + ", key=" + key + ", version="
+ version + ", versionName=" + versionName + ", result="
+ result + ", url=" + url + ", description=" + description
+ ", downloadSize=" + downloadSize + ", mustUpdate="
+ mustUpdate + ", changeLog=" + changeLog
+ ", errorCode=" + errorCode + "]";
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/core/CheckNewVersionListener.java
================================================
package com.way.upgrade.core;
/**
*
* @author way
* @sine 2014/10/29
*/
public interface CheckNewVersionListener {
public void checkNewVersion(boolean result);
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/core/UpgradeInterface.java
================================================
package com.way.upgrade.core;
import com.way.upgrade.bean.UpgradeInfo;
/**
*
* @author way
* @since 2014/4/28
*/
public interface UpgradeInterface {
/**
* 请求服务器是否有新版本,并弹出对话框
*
* @return
*/
public void askForNewVersion();
/**
* 请求服务器是否有新版本
*
* @return
*/
public void askForNewVersionFlag(
CheckNewVersionListener checkversionListener);
/**
* 下载新版本
*
* @return
*/
public void downloadNewVersion(UpgradeInfo upgradeInfo);
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/core/UpgradeManager.java
================================================
package com.way.upgrade.core;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.widget.Toast;
import com.way.upgrade.bean.UpgradeInfo;
import com.way.upgrade.job.CheckNewVersionJobWithoutClientUrl;
import com.way.upgrade.job.DownloadNewVersionJob;
import com.way.upgrade.locale.LocaleChina;
import com.way.upgrade.locale.LocaleChinaTW;
import com.way.upgrade.locale.LocaleChinese;
import com.way.upgrade.locale.LocaleEnglish;
import com.way.upgrade.locale.LocaleHandler;
import com.way.upgrade.locale.LocaleUS;
import com.way.upgrade.utils.Constants;
import com.way.upgrade.utils.ContextUtils;
import com.way.upgrade.utils.thread.Future;
import com.way.upgrade.utils.thread.FutureListener;
import com.way.upgrade.utils.thread.ThreadPool;
/**
*
* @author way
* @since 2014/4/28
*/
public class UpgradeManager extends LocaleHandler implements UpgradeInterface {
private Context mContext;
private static ThreadPool mThreadPool;
private Handler mHandler;
private AlertDialog alertDialog;
private AlertDialog alertDialogForMustUpdate;
private ProgressDialog mProgressDialog;
private Map<String, LocaleHandler> handlers;
private static Future<UpgradeInfo> mFuture;
private CheckNewVersionListener mAskForNewVersionFlagListener;
private FutureListener<UpgradeInfo> mAskForNewVersionListener = new FutureListener<UpgradeInfo>() {
public void onFutureDone(Future<UpgradeInfo> future) {
UpgradeInfo upgradeInfo = future.get();
Message msg = mHandler.obtainMessage();
if (upgradeInfo != null) {
if (upgradeInfo.getErrorCode() != null) {
if (upgradeInfo.getErrorCode().equals(
Constants.ERROR_CODE_NET)) {
msg.what = Constants.MSG_NET_ERROR;
}
} else if (Boolean.parseBoolean(upgradeInfo.getResult())) {
mFuture = future;
msg.what = Constants.MSG_HAVA_NEW_VERSION;
msg.obj = upgradeInfo;
} else if (!Boolean.parseBoolean(upgradeInfo.getResult())) {
msg.what = Constants.MSG_NO_NEW_VERSION;
}
} else {
msg.what = Constants.MSG_NO_NEW_VERSION;
}
mHandler.sendMessage(msg);
};
};
public class AskForNewVersionFlag implements FutureListener<UpgradeInfo> {
@Override
public void onFutureDone(Future<UpgradeInfo> future) {
UpgradeInfo upgradeInfo = future.get();
boolean result = false;
if (upgradeInfo != null) {
result = Boolean.parseBoolean(upgradeInfo.getResult());
}
Message msg = mHandler.obtainMessage();
msg.what = Constants.MSG_VERSION_RESULT;
msg.obj = result;
mHandler.sendMessage(msg);
}
}
public UpgradeManager(Context context) {
createHandlers();
mContext = context;
init();
}
private void init() {
if (mThreadPool == null) {
mThreadPool = new ThreadPool();
}
mHandler = new Handler(mContext.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case Constants.MSG_HAVA_NEW_VERSION:
try {
ContextUtils.closeProgressDialog(mProgressDialog);
UpgradeInfo description = (UpgradeInfo) msg.obj;
showDialog(description);
} catch (Exception e1) {
e1.printStackTrace();
}
break;
case Constants.MSG_NO_NEW_VERSION:
try {
ContextUtils.closeProgressDialog(mProgressDialog);
ContextUtils.showToast(mContext, getToastMessage(),
Toast.LENGTH_SHORT);
} catch (Exception e) {
e.printStackTrace();
}
break;
case Constants.MSG_START_DOWNLOAD:
UpgradeInfo description1 = (UpgradeInfo) msg.obj;
downloadNewVersion(description1);
break;
case Constants.MSG_VERSION_RESULT:
Boolean result = (Boolean) msg.obj;
mAskForNewVersionFlagListener.checkNewVersion(result);
break;
case Constants.MSG_NET_ERROR:
try {
ContextUtils.closeProgressDialog(mProgressDialog);
} catch (Exception e) {
e.printStackTrace();
}
ContextUtils.showToast(mContext, getToastNetErrorMessage(),
Toast.LENGTH_SHORT);
default:
break;
}
}
};
alertDialog = ContextUtils.showAlertDialog(mContext, getDialogTitle(),
"", new int[] { android.R.string.ok, android.R.string.cancel },
new DialogInterface.OnClickListener[] {
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
if (mFuture != null) {
Message msg = mHandler.obtainMessage();
msg.what = Constants.MSG_START_DOWNLOAD;
msg.obj = mFuture.get();
mHandler.sendMessage(msg);
}
}
}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
dialog.dismiss();
}
} });
alertDialogForMustUpdate = ContextUtils
.showAlertDialog(
mContext,
getDialogTitle(),
"",
new int[] { android.R.string.ok },
new DialogInterface.OnClickListener[] { new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
if (mFuture != null) {
Message msg = mHandler.obtainMessage();
msg.what = Constants.MSG_START_DOWNLOAD;
msg.obj = mFuture.get();
mHandler.sendMessage(msg);
}
}
} });
alertDialogForMustUpdate.setCancelable(false);
mProgressDialog = ContextUtils.createProgressDialog(mContext);
mProgressDialog.setTitle(getProgressDialogTitle());
mProgressDialog.setMessage(getProgressDialogMessage());
}
public static UpgradeManager newInstance(Context context) {
return new UpgradeManager(context);
}
private void showProgressDialog() {
if (mProgressDialog != null) {
try {
mProgressDialog.show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public void askForNewVersion() {
showProgressDialog();
mThreadPool.submit(new CheckNewVersionJobWithoutClientUrl(mContext),
mAskForNewVersionListener, ThreadPool.MODE_NETWORK);
}
@Override
public void askForNewVersionFlag(
CheckNewVersionListener checkversionListener) {
if (checkversionListener == null) {
return;
}
mAskForNewVersionFlagListener = checkversionListener;
AskForNewVersionFlag mAskForNewVersionFlagListener = new AskForNewVersionFlag();
mThreadPool.submit(new CheckNewVersionJobWithoutClientUrl(mContext),
mAskForNewVersionFlagListener, ThreadPool.MODE_NETWORK);
}
@Override
public void downloadNewVersion(UpgradeInfo upgradeInfo) {
mThreadPool.submit(new DownloadNewVersionJob(mContext, upgradeInfo),
null, ThreadPool.MODE_CPU);
}
private void createHandlers() {
handlers = new HashMap<String, LocaleHandler>();
handlers.put(LocaleChinese.defaultLocale, new LocaleChinese());
handlers.put(LocaleChinaTW.defaultLocale, new LocaleChinaTW());
handlers.put(LocaleEnglish.defaultLocale, new LocaleEnglish());
handlers.put(Locale.CHINA.toString(), new LocaleChina());
handlers.put(Locale.US.toString(), new LocaleUS());
}
private LocaleHandler lookupHandlerBy(String handlerName) {
LocaleHandler handler = handlers.get(handlerName);
if (handler == null)
return handlers.get(Locale.ENGLISH.getLanguage());
return handlers.get(handlerName);
}
private void showDialog(UpgradeInfo description) {
int mustUpdate = Integer.valueOf(description.getMustUpdate());
boolean result = Boolean.parseBoolean(description.isResult());
String descriptionStr = description.getChangeLog();
Log.i("liweiping", "mustUpdate = " + mustUpdate + ", result = "
+ result + ", alertDialog = " + alertDialog
+ ", alertDialogForMustUpdate = " + alertDialogForMustUpdate);
if (mustUpdate == Constants.NOT_MUST_UPDATE) {
if (alertDialog != null && result) {
alertDialog.setTitle(getDialogTitle());
alertDialog.setMessage(descriptionStr);
alertDialog.show();
}
} else {
if (alertDialogForMustUpdate != null && result) {
alertDialogForMustUpdate.setTitle(getDialogTitle());
alertDialogForMustUpdate.setMessage(descriptionStr);
alertDialogForMustUpdate.show();
}
}
}
private String getLocaleLanguage() {
return Locale.getDefault().toString();
}
@Override
public String getDialogTitle() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getDialogTitle();
}
@Override
public String getProgressDialogTitle() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getProgressDialogTitle();
}
@Override
public String getProgressDialogMessage() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getProgressDialogMessage();
}
@Override
public String getToastMessage() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getToastMessage();
}
@Override
public String getToastNetErrorMessage() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getToastNetErrorMessage();
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/job/AbstractCheckNewVersionJob.java
================================================
package com.way.upgrade.job;
import java.io.IOException;
import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.util.Log;
import com.way.upgrade.bean.UpgradeInfo;
import com.way.upgrade.parser.json.FirVersionJsonParsing;
import com.way.upgrade.utils.Constants;
import com.way.upgrade.utils.NetUtils;
import com.way.upgrade.utils.NetUtils.NETWORK_STATUS;
import com.way.upgrade.utils.thread.ThreadPool;
import com.way.upgrade.utils.thread.ThreadPool.JobContext;
/**
*
* @author way
* @since 2014/4/28
*/
public abstract class AbstractCheckNewVersionJob implements
ThreadPool.Job<UpgradeInfo> {
protected Context mContext;
protected String bundle_id;
protected String api_token;
public AbstractCheckNewVersionJob(Context context) {
this.mContext = context;
try {
ApplicationInfo appInfo = mContext.getPackageManager()
.getApplicationInfo(mContext.getPackageName(),
PackageManager.GET_META_DATA);
bundle_id = appInfo.metaData.getString("bundle_id");
api_token = appInfo.metaData.getString("api_token");
} catch (NameNotFoundException e) {
throw new NullPointerException(
"app_id and token must not null in AndroidManifest.xml "
+ e);
}
Log.i("liweiping", "AbstractCheckNewVersionJob app_id = " + bundle_id
+ ", api_token = " + api_token);
}
@Override
public UpgradeInfo run(JobContext jc) {
UpgradeInfo upgradeInfo = null;
if (NetUtils.getNetworkType(mContext) == NETWORK_STATUS.STATE_NONE_NETWORK) {
Log.i("liweiping", "NETWORK_STATUS.STATE_NONE_NETWORK");
upgradeInfo = new UpgradeInfo();
upgradeInfo.setErrorCode(Constants.ERROR_CODE_NET);
return upgradeInfo;
}
try {
String checkUpdateUrl = String.format(getCheckVersionUrl(), bundle_id,
api_token);
Log.i("liweiping", "checkUpdateUrl = " + checkUpdateUrl);
JSONObject jo = NetUtils.getJSONArrayByGet(checkUpdateUrl);
FirVersionJsonParsing firVersionJsonParsing = new FirVersionJsonParsing(
mContext);
Log.i("liweiping",
"upgradeInfo = " + upgradeInfo + ", checkUpdateUrl = "
+ checkUpdateUrl + ", jo = " + jo.toString());
upgradeInfo = firVersionJsonParsing.readJsonItem(jo);
} catch (Exception e) {
upgradeInfo = new UpgradeInfo();
upgradeInfo.setErrorCode(Constants.ERROR_CODE_NET);
Log.i("liweiping",e.getMessage());
e.printStackTrace();
}
return upgradeInfo;
}
public abstract String getCheckVersionUrl();
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/job/CheckNewVersionJobWithoutClientUrl.java
================================================
package com.way.upgrade.job;
import android.content.Context;
import com.way.upgrade.utils.Constants;
/**
*
* @author way
* @since 2014/4/28
*/
public class CheckNewVersionJobWithoutClientUrl extends
AbstractCheckNewVersionJob {
public CheckNewVersionJobWithoutClientUrl(Context context) {
super(context);
}
@Override
public String getCheckVersionUrl() {
return Constants.BASE_URL;
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/job/DownloadNewVersionJob.java
================================================
package com.way.upgrade.job;
import java.io.File;
import android.app.DownloadManager;
import android.app.DownloadManager.Request;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import com.way.upgrade.bean.UpgradeInfo;
import com.way.upgrade.utils.Constants;
import com.way.upgrade.utils.Preferences;
import com.way.upgrade.utils.thread.ThreadPool;
import com.way.upgrade.utils.thread.ThreadPool.JobContext;
public class DownloadNewVersionJob implements ThreadPool.Job<Void> {
private Context mContext;
private UpgradeInfo mUpgradeInfo;
private boolean allowMobileDownload = false;
private static final long MAX_ALLOWED_DOWNLOAD_BYTES_BY_MOBILE = 3145725;
public DownloadNewVersionJob(Context context, UpgradeInfo upgradeInfo) {
this.mContext = context;
this.mUpgradeInfo = upgradeInfo;
}
@Override
public Void run(JobContext jc) {
try {
if (checkDownloadRunning())
return null;
if (checkApkExist()) {
Intent installApkIntent = new Intent();
installApkIntent.setAction(Intent.ACTION_VIEW);
installApkIntent.setDataAndType(
Uri.parse(Preferences.getDownloadPath(mContext)),
"application/vnd.android.package-archive");
installApkIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
mContext.startActivity(installApkIntent);
} else {
String apkName = mContext.getPackageName()
+ System.currentTimeMillis() + Constants.APK_SUFFIX;
// 系统下载程序
final DownloadManager downloadManager = (DownloadManager) mContext
.getSystemService(mContext.DOWNLOAD_SERVICE);
Long recommendedMaxBytes = DownloadManager
.getRecommendedMaxBytesOverMobile(mContext);
// 可以在移动网络下下载
if (recommendedMaxBytes == null
|| recommendedMaxBytes.longValue() > MAX_ALLOWED_DOWNLOAD_BYTES_BY_MOBILE) {
allowMobileDownload = true;
}
Uri uri = Uri.parse(mUpgradeInfo.getUrl());
final Request request = new Request(uri);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
int NETWORK_TYPE = DownloadManager.Request.NETWORK_WIFI;
if (allowMobileDownload) {
NETWORK_TYPE |= DownloadManager.Request.NETWORK_MOBILE;
}
request.setAllowedNetworkTypes(NETWORK_TYPE);
request.allowScanningByMediaScanner();
request.setShowRunningNotification(true);
request.setVisibleInDownloadsUi(true);
request.setDestinationInExternalPublicDir(
Environment.DIRECTORY_DOWNLOADS, apkName);
PackageManager packageManager = mContext.getPackageManager();
ApplicationInfo applicationInfo = packageManager
.getApplicationInfo(mContext.getPackageName(), 0);
Log.i("liweiping",
"appName = "
+ packageManager
.getApplicationLabel(applicationInfo));
request.setTitle(packageManager
.getApplicationLabel(applicationInfo));
request.setMimeType("application/vnd.android.package-archive");
// id 保存起来跟之后的广播接收器作对比
long id = downloadManager.enqueue(request);
long oldId = Preferences.getDownloadId(mContext);
if (oldId != -1) {
downloadManager.remove(oldId);
}
Preferences.removeAll(mContext);
Preferences.setDownloadId(mContext, id);
Preferences.setUpgradeInfo(mContext, mUpgradeInfo);
Preferences.setDownloadStatus(mContext,
Constants.DOWNLOAD_STATUS_RUNNING);
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private boolean checkApkExist() {
UpgradeInfo prefUpgradeInfo = Preferences.getUpgradeInfo(mContext);
String version = prefUpgradeInfo.getVersion();
String downloadPath = Preferences.getDownloadPath(mContext);
if (version != null && version.trim().length() != 0
&& version.equals(mUpgradeInfo.getVersion())
&& downloadPath != null && downloadPath.trim().length() != 0) {
String path = Uri.parse(downloadPath).getPath();
if (path != null && path.endsWith(Constants.APK_SUFFIX)) {
File file = new File(path);
if (file.exists()) {
return true;
}
}
}
return false;
}
@SuppressWarnings("static-access")
private boolean checkDownloadRunning() {
UpgradeInfo prefUpgradeInfo = Preferences.getUpgradeInfo(mContext);
String version = prefUpgradeInfo.getVersion();
int downloadStatus = Preferences.getDownloadStatus(mContext);
if (version != null && version.trim().length() != 0
&& version.equals(mUpgradeInfo.getVersion())) {
long downloadId = Preferences.getDownloadId(mContext);
if (downloadId != -1) {
final DownloadManager downloadManager = (DownloadManager) mContext
.getSystemService(mContext.DOWNLOAD_SERVICE);
DownloadManager.Query mDownloadQuery = new DownloadManager.Query();
mDownloadQuery.setFilterById(downloadId);
Cursor cursor = downloadManager.query(mDownloadQuery);
if (cursor != null && cursor.moveToFirst()) {
int status = cursor.getInt(cursor
.getColumnIndex(DownloadManager.COLUMN_STATUS));
if (status == DownloadManager.STATUS_RUNNING
|| downloadStatus == Constants.DOWNLOAD_STATUS_RUNNING) {
return true;
}
}
}
}
return false;
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleChina.java
================================================
package com.way.upgrade.locale;
/**
*
* @author way
* @since 2014/10/29
*/
public class LocaleChina extends LocaleChinese {
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleChinaTW.java
================================================
package com.way.upgrade.locale;
/**
*
* @author way
* @since 2014/10/29
*/
public class LocaleChinaTW extends LocaleChinese {
public static final String defaultLocale = "zh_TW";
@Override
public String getDialogTitle() {
return "發現新版本,是否升級?";
}
@Override
public String getProgressDialogTitle() {
return "檢查更新";
}
@Override
public String getProgressDialogMessage() {
return "正在檢查...";
}
@Override
public String getToastMessage() {
return "已是最新版本";
}
@Override
public String getToastNetErrorMessage() {
return "網路異常";
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleChinese.java
================================================
package com.way.upgrade.locale;
/**
*
* @author way
* @since 2014/10/29
*/
public class LocaleChinese extends LocaleHandler {
public static final String defaultLocale = "zh";
@Override
public String getDialogTitle() {
return "发现新版本,是否升级?";
}
@Override
public String getProgressDialogTitle() {
return "检查更新";
}
@Override
public String getProgressDialogMessage() {
return "正在检查...";
}
@Override
public String getToastMessage() {
return "已是最新版本";
}
@Override
public String getToastNetErrorMessage() {
return "网络异常";
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleEnglish.java
================================================
package com.way.upgrade.locale;
public class LocaleEnglish extends LocaleHandler {
public static final String defaultLocale = "en";
@Override
public String getDialogTitle() {
return "Find New Version,Update Now?";
}
@Override
public String getProgressDialogTitle() {
return "Check Update";
}
@Override
public String getProgressDialogMessage() {
return "Checking";
}
@Override
public String getToastMessage() {
return "Is the latest version";
}
@Override
public String getToastNetErrorMessage() {
return "Net Error";
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleHandler.java
================================================
package com.way.upgrade.locale;
/**
*
* @author way
* @since 2014/10/29
*/
public abstract class LocaleHandler {
protected String value;
public abstract String getDialogTitle();
public abstract String getProgressDialogTitle();
public abstract String getProgressDialogMessage();
public abstract String getToastMessage();
public abstract String getToastNetErrorMessage();
public void setUpgradeDescription(String value) {
this.value = value;
}
public String getUpgradeDescription() {
return value;
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleUS.java
================================================
package com.way.upgrade.locale;
public class LocaleUS extends LocaleEnglish {
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/parser/json/AbstractJsonParsing.java
================================================
package com.way.upgrade.parser.json;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public abstract class AbstractJsonParsing<T> {
public abstract T readJsonItem(JSONObject jsonItem) throws JSONException;
/**
* 输入InputStream
*
* @param inStream
* @return
* @throws Exception
*/
public ArrayList<T> readJsonArray(JSONArray jsonArray) {
try {
ArrayList<T> listOperating = new ArrayList<T>();
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject item = jsonArray.getJSONObject(i);
T itemBean = readJsonItem(item);
listOperating.add(itemBean);
}
return listOperating;
} catch (JSONException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/parser/json/FirVersionJsonParsing.java
================================================
package com.way.upgrade.parser.json;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import com.way.upgrade.bean.UpgradeInfo;
import com.way.upgrade.utils.Constants;
import com.way.upgrade.utils.ContextUtils;
public class FirVersionJsonParsing extends AbstractJsonParsing<UpgradeInfo> {
private Context mContext;
public FirVersionJsonParsing(Context context) {
mContext = context;
}
@Override
public UpgradeInfo readJsonItem(JSONObject versionJsonObj)
throws JSONException {
UpgradeInfo upgradeInfo = new UpgradeInfo();
String url = versionJsonObj.getString("installUrl");
String firVersionCode = versionJsonObj.getString("version");
String firVersionName = versionJsonObj.getString("versionShort");
String changeLog = versionJsonObj.getString("changelog");
upgradeInfo.setUrl(url);
upgradeInfo.setVersion(firVersionCode);
boolean result = ContextUtils.getVersionCode(mContext) < Integer
.parseInt(firVersionCode)
|| (ContextUtils.getVersionCode(mContext) == Integer
.parseInt(firVersionCode) && !ContextUtils
.getVersionName(mContext).equals(firVersionName));
upgradeInfo.setResult(String.valueOf(result));
upgradeInfo.setVersionName(firVersionName);
upgradeInfo.setMustUpdate(Constants.NOT_MUST_UPDATE + "");
upgradeInfo.setChangeLog(changeLog);
return upgradeInfo;
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/receiver/DownloadCompleteReveiver.java
================================================
package com.way.upgrade.receiver;
import android.app.DownloadManager;
import android.app.DownloadManager.Query;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import com.way.upgrade.utils.Preferences;
/**
* 下载完成通知接收器
*
* @author way
*
*/
public class DownloadCompleteReveiver extends BroadcastReceiver {
private DownloadManager downloadManager;
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE)) {
long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, 0);
if (id == Preferences.getDownloadId(context)) {
Query query = new Query();
query.setFilterById(id);
downloadManager = (DownloadManager) context
.getSystemService(Context.DOWNLOAD_SERVICE);
Cursor cursor = downloadManager.query(query);
int columnCount = cursor.getColumnCount();
String path = null;
while (cursor.moveToNext()) {
for (int j = 0; j < columnCount; j++) {
String columnName = cursor.getColumnName(j);
String string = cursor.getString(j);
if ("local_uri".equals(columnName)) {
path = string;
}
}
}
cursor.close();
if (path != null) {
Preferences.setDownloadPath(context, path);
Preferences.setDownloadStatus(context, -1);
Intent installApkIntent = new Intent();
installApkIntent.setAction(Intent.ACTION_VIEW);
installApkIntent.setDataAndType(Uri.parse(path),
"application/vnd.android.package-archive");
installApkIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
context.startActivity(installApkIntent);
}
}
} else if (action.equals(DownloadManager.ACTION_NOTIFICATION_CLICKED)) {
long[] ids = intent
.getLongArrayExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS);
if (ids.length > 0 && ids[0] == Preferences.getDownloadId(context)) {
Intent downloadIntent = new Intent();
downloadIntent.setAction(DownloadManager.ACTION_VIEW_DOWNLOADS);
downloadIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
context.startActivity(downloadIntent);
}
}
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/Constants.java
================================================
package com.way.upgrade.utils;
/**
*
* @author way 2014/4/28
*/
public class Constants {
//public static final String BASE_URL = "http://fir.im/api/v2/app/version/%s?token=%s";
public static final String BASE_URL = "http://api.fir.im/apps/latest/%s?api_token=%s";
public static final String DOWNLOAD_FILE_PATH = "/upgrade";
public static final int MSG_HAVA_NEW_VERSION = 1;
public static final int MSG_NO_NEW_VERSION = 2;
public static final int MSG_START_DOWNLOAD = 3;
public static final int MSG_VERSION_RESULT = 4;
public static final int MSG_NET_ERROR = 5;
public static final int MUST_UPDATE = 1;
public static final int NOT_MUST_UPDATE = 0;
public static final String APK_SUFFIX = ".apk";
public static final Integer DOWNLOAD_STATUS_RUNNING = 1;
public static final String ERROR_CODE_NET = "net_error";
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/ContextUtils.java
================================================
package com.way.upgrade.utils;
import java.lang.reflect.Method;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.os.Build;
import android.util.Log;
import android.widget.Toast;
/**
* 上下文操作,如创建对话框,进度条,版本信息...
*
* @author way 2013/12/6
*/
public class ContextUtils {
private static final String TAG = "ContextUtils";
/**
* Show a Toast(Toast.LENGTH_SHORT).
*
* @param text
* the content shown on the Toast.
*/
public static void showToast(Context context, String text, int length) {
Toast.makeText(context, text, length).show();
}
/**
* Show a Toast(Toast.LENGTH_SHORT).
*
* @param text
* the content shown on the Toast.
*/
public static void showToast(Context context, int resId, int length) {
Toast.makeText(context, resId, length).show();
}
public static ProgressDialog createProgressDialog(Context context) {
ProgressDialog dialog = new ProgressDialog(context);
dialog.setIndeterminate(true);
dialog.setCancelable(true);
return dialog;
}
/**
* show progress dialog
*
* @param context
* @param title
* Dialog title
* @param message
* Dialog message
* @return
*/
public static ProgressDialog showProgressDialog(Context context, int title,
int message) {
ProgressDialog dialog = new ProgressDialog(context);
dialog.setTitle(title);
dialog.setMessage(context.getResources().getString(message));
dialog.setIndeterminate(true);
dialog.setCancelable(true);
dialog.show();
return dialog;
}
/**
* close progress dialog
*
* @param progressDialog
*/
public static void closeProgressDialog(Dialog progressDialog) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.cancel();
}
}
/**
*
* @param context
* @param title
* @param message
* @param buttonTexts
* @param listeners
* @return
*/
public static AlertDialog.Builder showDialog(Context context, int title,
int message, int[] buttonTexts, OnClickListener[] listeners) {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
dialog.setTitle(title);
dialog.setMessage(message);
if (buttonTexts.length == 1) {
dialog.setNeutralButton(buttonTexts[0], listeners[0]);
} else if (buttonTexts.length == 2) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNegativeButton(buttonTexts[1], listeners[1]);
} else if (buttonTexts.length == 3) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNeutralButton(buttonTexts[1], listeners[1]);
dialog.setNegativeButton(buttonTexts[2], listeners[2]);
}
dialog.show();
return dialog;
}
/**
*
* @param context
* @param title
* @param message
* @param buttonTexts
* @param listeners
* @return
*/
public static AlertDialog.Builder showDialog(Context context, String title,
String message, int[] buttonTexts, OnClickListener[] listeners) {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
dialog.setTitle(title);
dialog.setMessage(message);
if (buttonTexts.length == 1) {
dialog.setNeutralButton(buttonTexts[0], listeners[0]);
} else if (buttonTexts.length == 2) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNegativeButton(buttonTexts[1], listeners[1]);
} else if (buttonTexts.length == 3) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNeutralButton(buttonTexts[1], listeners[1]);
dialog.setNegativeButton(buttonTexts[2], listeners[2]);
}
dialog.show();
return dialog;
}
/**
*
* @param context
* @param title
* @param message
* @param buttonTexts
* @param listeners
* @return
*/
public static AlertDialog showAlertDialog(Context context, String title,
String message, int[] buttonTexts, OnClickListener[] listeners) {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
dialog.setTitle(title);
dialog.setMessage(message);
if (buttonTexts.length == 1) {
dialog.setNeutralButton(buttonTexts[0], listeners[0]);
} else if (buttonTexts.length == 2) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNegativeButton(buttonTexts[1], listeners[1]);
} else if (buttonTexts.length == 3) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNeutralButton(buttonTexts[1], listeners[1]);
dialog.setNegativeButton(buttonTexts[2], listeners[2]);
}
return dialog.create();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public static String getCustomVersion() {
try {
String className = "android.os.SystemProperties";
String methodName = "get";
String key = "ro.custom.build.version";
Class clazz = Class.forName(className);
// Constructor con = clazz.getEnclosingConstructor();
Method method = clazz.getDeclaredMethod(methodName, String.class);
return (String) method.invoke(clazz, key);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
/**
* 获取版本号
*
* @param context
* @return
*/
public static int getVersionCode(Context context) {
int versionCode = -1;
try {
PackageInfo info = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0);
versionCode = info.versionCode;
} catch (NameNotFoundException e) {
e.printStackTrace();
Log.e(TAG, e.getMessage());
}
return versionCode;
}
/**
* 获取版本信息
*
* @param mContext
* @return
*/
public static String getVersionName(Context context) {
String versionName = null;
try {
PackageInfo info = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0);
versionName = info.versionName;
// int versionCode = info.versionCode;
} catch (NameNotFoundException e) {
e.printStackTrace();
Log.e(TAG, e.getMessage());
}
return versionName;
}
public static String getUserAgent(Context context) {
PackageInfo packageInfo;
try {
packageInfo = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0);
} catch (NameNotFoundException e) {
throw new IllegalStateException("getPackageInfo failed");
}
return String.format("%s/%s; %s/%s/%s/%s; %s/%s/%s",
packageInfo.packageName, packageInfo.versionName, Build.BRAND,
Build.DEVICE, Build.MODEL, Build.ID, Build.VERSION.SDK_INT,
Build.VERSION.RELEASE, Build.VERSION.INCREMENTAL);
}
public static Intent getActivityIntent(Context context, String packageName,
String className) {
PackageManager pm = context.getPackageManager();
Intent intent = new Intent();
ComponentName compoentName = new ComponentName(packageName, className);
intent.setComponent(compoentName);
ResolveInfo ri = pm.resolveActivity(intent,
PackageManager.MATCH_DEFAULT_ONLY);
if (ri != null) {
return intent;
}
return null;
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/FileUtils.java
================================================
package com.way.upgrade.utils;
import java.io.File;
/**
* @author way 2013/12/6
*/
public class FileUtils {
private static final String TAG = "FileUtils";
/**
* @param f
* @throws Exception
*/
public static void createNewFile(File f) throws Exception {
Log.i(TAG, "create file:" + f, Log.APP);
if (!f.getParentFile().exists()) {
f.getParentFile().mkdirs();
}
if (!f.exists()) {
f.createNewFile();
}
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/Log.java
================================================
package com.way.upgrade.utils;
public class Log {
public static final boolean DEBUG = true;
public static final boolean DATA_DEBUG = true;
public static final boolean APP_DEBUG = true;
public static final boolean DISPLAY_DEBUG = false;
public static final int DATA = 0;
public static final int DISPLAY = 1;
public static final int APP = 2;
public static final String TAG = "zhujianwen";
public static void v(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.v(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.v(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.v(tag, msg);
}
}
public static void v(String msg, int mod) {
v(TAG, msg, mod);
}
public static void d(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.d(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.d(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.d(tag, msg);
}
}
public static void d(String msg, int mod) {
d(TAG, msg, mod);
}
public static void i(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.i(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.i(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.i(tag, msg);
}
}
public static void i(String msg, int mod) {
i(TAG, msg, mod);
}
public static void w(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.w(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.w(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.w(tag, msg);
}
}
public static void w(String msg, int mod) {
w(TAG, msg, mod);
}
public static void e(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.e(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.e(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.e(tag, msg);
}
}
public static void e(String msg, int mod) {
e(TAG, msg, mod);
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/NetUtils.java
================================================
package com.way.upgrade.utils;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
/**
* 网络操作
*
* @author way 2013/12/6
*/
public class NetUtils {
private static final String TAG = "NetUtils";
private static final String NETTYPE_WIFI = "WIFI";
private static String multipart_form_data = "multipart/form-data";
private static String twoHyphens = "--";
private static String boundary = java.util.UUID.randomUUID().toString(); // 数据分隔
private static String lineEnd = "\r\n"; // The value is "\r\n" in Windows.
public enum NETWORK_STATUS {
STATE_WIFI, STATE_GPRS, STATE_NONE_NETWORK
}
private NetUtils() {
}
public static NETWORK_STATUS getNetworkType(Context context) {
NETWORK_STATUS ret = NETWORK_STATUS.STATE_NONE_NETWORK;
ConnectivityManager connetManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connetManager == null) {
Log.e(TAG, "isNetWorkAvailable connetManager = null", Log.APP);
return ret;
}
NetworkInfo[] infos = connetManager.getAllNetworkInfo();
if (infos == null) {
return ret;
}
for (int i = 0; i < infos.length && infos[i] != null; i++) {
if (infos[i].isConnected() && infos[i].isAvailable()) {
if (infos[i].getTypeName().equalsIgnoreCase(NETTYPE_WIFI)) {
ret = NETWORK_STATUS.STATE_WIFI;
} else {
ret = NETWORK_STATUS.STATE_GPRS;
}
break;
}
}
Log.i(TAG, "get network stype is : " + ret, Log.APP);
return ret;
}
/**
*
* @param context
* @param typeName
* ("",WIFI,MOBILE)
* @return
*/
public static boolean isNetWorkAvailable(Context context, String typeName) {
Log.i(TAG, ">>> isNetWorkAvailable context = " + context
+ "typeName = " + typeName, Log.APP);
boolean ret = false;
ConnectivityManager connetManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connetManager == null) {
Log.e(TAG, "isNetWorkAvailable connetManager = null", Log.APP);
return ret;
}
NetworkInfo[] infos = connetManager.getAllNetworkInfo();
if (infos == null) {
return ret;
}
if ((typeName == null) || (typeName.length() <= 0)) {
for (int i = 0; i < infos.length && infos[i] != null; i++) {
if (infos[i].isConnected() && infos[i].isAvailable()) {
ret = true;
break;
}
}
} else {
for (int i = 0; i < infos.length && infos[i] != null; i++) {
if (infos[i].getTypeName().equalsIgnoreCase(typeName)
&& infos[i].isConnected() && infos[i].isAvailable()) {
Log.i(TAG,
"isNetWorkAvailable name is : "
+ infos[i].getTypeName(), Log.APP);
ret = true;
break;
}
}
}
Log.i(TAG, "isNetWorkAvailable >>> result is : " + ret, Log.APP);
return ret;
}
/**
*
* @param url
* @return
* @throws IOException
*/
public static synchronized InputStream getInputStreamByGet(String url)
throws IOException {
Log.i(TAG, "<getInputStreamByGet> url:" + url, Log.APP);
HttpURLConnection httpConnection = null;
int currentSize = 0;
if (url == null) {
return null;
}
URL uri = new URL(url);
httpConnection = (HttpURLConnection) uri.openConnection();
httpConnection.setRequestProperty("User-Agent", "PacificHttpClient");
if (currentSize > 0) {
httpConnection.setRequestProperty("RANGE", "bytes=" + currentSize
+ "-");
}
// 设置超时时间
httpConnection.setConnectTimeout(10000);// 限制连接超时5秒钟
httpConnection.setReadTimeout(2 * 10000);
httpConnection.setRequestProperty("Content-type",
"text/html;charset=UTF-8");
httpConnection.setDoOutput(true);
httpConnection.setRequestMethod("GET");
httpConnection.setUseCaches(false);
int requestCode = httpConnection.getResponseCode();
if (requestCode == 200) {
InputStream in = httpConnection.getInputStream();
return in;
}
return null;
}
/**
* post方式从服务器获取json数组
*
* @return
* @throws IOException
* @throws ClientProtocolException
* @throws JSONException
*/
public static JSONArray getJSONArrayByPost(String uri)
throws ClientProtocolException, IOException, JSONException {
Log.i(TAG, "<getJSONArrayByPost> uri:" + uri, Log.APP);
StringBuilder builder = new StringBuilder();
HttpParams httpParameters = new BasicHttpParams();
// Set the default socket timeout (SO_TIMEOUT) in milliseconds which is
// the timeout for waiting for data.
HttpConnectionParams.setConnectionTimeout(httpParameters, 5000);
HttpConnectionParams.setSoTimeout(httpParameters, 10000);
HttpClient client = new DefaultHttpClient(httpParameters);
HttpPost post = new HttpPost(uri);
HttpResponse response = client.execute(post);
BufferedReader reader = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
for (String s = reader.readLine(); s != null; s = reader.readLine()) {
builder.append(s);
}
String jsonString = new String(builder.toString());
if ("{}".equals(jsonString)) {
return null;
}
Log.i(TAG, "<getJSONArrayByPost> jsonString:" + jsonString, Log.DATA);
return new JSONArray(jsonString);
}
/**
* get方式从服务器获取json数组
*
* @return
* @throws IOException
* @throws ClientProtocolException
* @throws JSONException
*/
public static JSONObject getJSONArrayByGet(String uri)
throws ClientProtocolException, IOException, JSONException {
Log.i(TAG, "<getJSONArrayByGet> uri:" + uri, Log.APP);
StringBuilder builder = new StringBuilder();
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(uri);
HttpResponse response = client.execute(get);
BufferedReader reader = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
for (String s = reader.readLine(); s != null; s = reader.readLine()) {
builder.append(s);
}
String jsonString = new String(builder.toString());
if ("{}".equals(jsonString)) {
return null;
}
Log.i(TAG, "<getJSONArrayByGet> jsonString:" + jsonString, Log.DATA);
return new JSONObject(jsonString);
}
/**
* 使用post的方式,提交表单,不包括文件上传(新服务器)
*
* @param actionUrl
* @param params
* @param files
* @return
* @throws IOException
*/
public static boolean uploadParamsByPost(String actionUrl,
Map<String, String> params) throws IOException {
Log.i(TAG, "<uploadParamsByPost> actionUrl:" + actionUrl + " params:"
+ params, Log.APP);
String BOUNDARY = java.util.UUID.randomUUID().toString();
String PREFIX = "--", LINEND = "\r\n";
String MULTIPART_FROM_DATA = "multipart/form-data";
String CHARSET = "UTF-8";
URL uri = new URL(actionUrl);
HttpURLConnection conn = (HttpURLConnection) uri.openConnection();
conn.setReadTimeout(10 * 1000);
conn.setConnectTimeout(10 * 1000);
conn.setDoInput(true);// 允许输入
conn.setDoOutput(true);// 允许输出
conn.setUseCaches(false);
conn.setRequestMethod("POST"); // Post方式
conn.setRequestProperty("connection", "keep-alive");
conn.setRequestProperty("Charsert", "UTF-8");
conn.setRequestProperty("Content-Type", MULTIPART_FROM_DATA
+ ";boundary=" + BOUNDARY);
// 首先组拼文本类型的参数
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> entry : params.entrySet()) {
sb.append(PREFIX);
sb.append(BOUNDARY);
sb.append(LINEND);
sb.append("Content-Disposition: form-data; name=\""
+ entry.getKey() + "\"" + LINEND);
sb.append("Content-Type: text/plain; charset=" + CHARSET + LINEND);
sb.append("Content-Transfer-Encoding: 8bit" + LINEND);
sb.append(LINEND);
sb.append(entry.getValue());
sb.append(LINEND);
}
DataOutputStream outStream = new DataOutputStream(
conn.getOutputStream());
outStream.write(sb.toString().getBytes());
// 请求结束标志
byte[] end_data = (PREFIX + BOUNDARY + PREFIX + LINEND).getBytes();
outStream.write(end_data);
outStream.flush();
outStream.close();
// 得到响应号
int res = conn.getResponseCode();
if (res == 200) {
return true;
}
conn.disconnect();
return false;
}
/**
* 使用post的方式,提交表单,不包括文件上传(老服务器写的代码使用这种方式)
*
* @param actionUrl
* :http://xxx/xxx.json
* @param query
* :Helpers.combinaStr("login_name=#&password=#&email=#&name=",
* listParams);
* @return
*/
public static JSONObject uploadParamsByPost(String actionUrl, String query) {
Log.i(TAG, "<uploadParamsByPost> actionUrl:" + actionUrl + " query:"
+ query, Log.APP);
try {
URL uri = new URL(actionUrl);
HttpURLConnection conn = (HttpURLConnection) uri.openConnection();
conn.setReadTimeout(10 * 1000);
conn.setDoInput(true);// 允许输入
conn.setDoOutput(true);// 允许输出
conn.setUseCaches(false);
conn.setRequestMethod("POST"); // Post方式
conn.setRequestProperty("connection", "keep-alive");
conn.setRequestProperty("Charsert", "UTF-8");
// query is your body
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");// 请求�?
// 必须设置
conn.setRequestProperty("Content-Length", query.toString()
.getBytes("UTF-8").length + "");// 注意是字节长�?
// 不是字符长度
conn.getOutputStream().write(query.toString().getBytes("UTF-8"));
// 得到响应�?
int res = conn.getResponseCode();
if (res == HttpURLConnection.HTTP_OK) {
StringBuffer stringBuffer = new StringBuffer();
String readLine;
BufferedReader responseReader;
// 处理响应流,必须与服务器响应流输出的编码�?��
responseReader = new BufferedReader(new InputStreamReader(
conn.getInputStream(), "UTF-8"));
while ((readLine = responseReader.readLine()) != null) {
stringBuffer.append(readLine).append("/n");
}
responseReader.close();
return new JSONObject(stringBuffer.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public int uploadFilesByPost(String actionUrl, String fileName, File file) {
Log.i(TAG, "<uploadFilesByPost> actionUrl:" + actionUrl + " fileName:"
+ fileName, Log.APP);
String CHARSET = "UTF-8";
// 得到响应�?
int res = 0;
try {
URL uri = new URL(actionUrl);
HttpURLConnection conn = (HttpURLConnection) uri.openConnection();
conn.setReadTimeout(10 * 1000);
conn.setDoInput(true);// 允许输入
conn.setDoOutput(true);// 允许输出
conn.setUseCaches(false);
conn.setRequestMethod("POST"); // Post方式
conn.setRequestProperty("connection", "keep-alive");
conn.setRequestProperty("Charsert", "UTF-8");
conn.setRequestProperty("Content-Type", multipart_form_data
+ ";boundary=" + boundary);
// 输出�?
DataOutputStream outStream = new DataOutputStream(
conn.getOutputStream());
// 发�?文件数据
if (file != null) {
StringBuilder sb1 = new StringBuilder();
sb1.append(twoHyphens);
sb1.append(boundary);
sb1.append(lineEnd);
// actionData 是自己定义的
sb1.append("Content-Disposition: form-data; name=\"actionData\"; filename=\""
+ fileName + "\"" + lineEnd);
sb1.append("Content-Type: application/octet-stream; charset="
+ CHARSET + lineEnd);
sb1.append(lineEnd);
outStream.write(sb1.toString().getBytes());
InputStream is = new FileInputStream(file);
byte[] buffer = new byte[1024];
int len = 0;
while ((len = is.read(buffer)) != -1) {
outStream.write(buffer, 0, len);
}
is.close();
outStream.write(lineEnd.getBytes());
}
// 请求结束标志
byte[] end_data = (twoHyphens + boundary + twoHyphens + lineEnd)
.getBytes();
outStream.write(end_data);
outStream.flush();
res = conn.getResponseCode();
outStream.close();
conn.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
return res;
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/Preferences.java
================================================
package com.way.upgrade.utils;
import android.content.Context;
import android.content.SharedPreferences;
import com.way.upgrade.bean.UpgradeInfo;
/**
*
* @author way 2014/11/3
*/
public class Preferences {
public static final String PREFERENCES_NAME = "com_upgrade_manager";
public static final String KEY_DOWNLOAD_ID = "downloadId";
protected static final String KEY_APPKEY = "key";
protected static final String KEY_VERSION = "version";
protected static final String KEY_URL = "url";
protected static final String KEY_DESCRIPTION = "description";
protected static final String KEY_DOWNLOAD_SIZE = "downloadSize";
protected static final String KEY_DOWNLOAD_PATH = "download_path";
protected static final String KEY_DOWNLOAD_STATUS = "download_status";
public static void setDownloadId(Context context, long downloadId) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.putLong(KEY_DOWNLOAD_ID, downloadId);
editor.commit();
}
public static long getDownloadId(Context context) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
return pref.getLong(KEY_DOWNLOAD_ID, -1);
}
public static void setUpgradeInfo(Context context, UpgradeInfo upgrade) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.putString(KEY_APPKEY, upgrade.getKey());
editor.putString(KEY_VERSION, upgrade.getVersion());
editor.putString(KEY_URL, upgrade.getUrl());
editor.putString(KEY_DESCRIPTION, upgrade.getDescription());
editor.putLong(KEY_DOWNLOAD_SIZE, upgrade.getDownloadSize());
editor.commit();
}
public static UpgradeInfo getUpgradeInfo(Context context) {
UpgradeInfo upgradeInfo = new UpgradeInfo();
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
upgradeInfo.setKey(pref.getString(KEY_APPKEY, ""));
upgradeInfo.setVersion(pref.getString(KEY_VERSION, ""));
upgradeInfo.setUrl(pref.getString(KEY_URL, ""));
upgradeInfo.setDescription(pref.getString(KEY_DESCRIPTION, ""));
upgradeInfo.setDownloadSize(pref.getLong(KEY_DOWNLOAD_SIZE, -1));
return upgradeInfo;
}
public static void setDownloadPath(Context context, String downloadPath) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.putString(KEY_DOWNLOAD_PATH, downloadPath);
editor.commit();
}
public static String getDownloadPath(Context context) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
return pref.getString(KEY_DOWNLOAD_PATH, "");
}
public static void removeAll(Context context) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.clear();
editor.commit();
}
public static void setDownloadStatus(Context context, int downloadId) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.putInt(KEY_DOWNLOAD_STATUS, downloadId);
editor.commit();
}
public static int getDownloadStatus(Context context) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
return pref.getInt(KEY_DOWNLOAD_STATUS, -1);
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/Utils.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils;
import java.io.Closeable;
import java.io.InterruptedIOException;
import java.util.List;
import android.database.Cursor;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.text.TextUtils;
public class Utils {
private static final String TAG = "Utils";
private static final String DEBUG_TAG = "GalleryDebug";
private static final long POLY64REV = 0x95AC9329AC4BC9B5L;
private static final long INITIALCRC = 0xFFFFFFFFFFFFFFFFL;
private static long[] sCrcTable = new long[256];
private static final boolean IS_DEBUG_BUILD = Build.TYPE.equals("eng")
|| Build.TYPE.equals("userdebug");
private static final String MASK_STRING = "********************************";
// Throws AssertionError if the input is false.
public static void assertTrue(boolean cond) {
if (!cond) {
throw new AssertionError();
}
}
// Throws AssertionError with the message. We had a method having the form
// assertTrue(boolean cond, String message, Object ... args);
// However a call to that method will cause memory allocation even if the
// condition is false (due to autoboxing generated by "Object ... args"),
// so we don't use that anymore.
public static void fail(String message, Object... args) {
throw new AssertionError(args.length == 0 ? message : String.format(
message, args));
}
// Throws NullPointerException if the input is null.
public static <T> T checkNotNull(T object) {
if (object == null)
throw new NullPointerException();
return object;
}
// Returns true if two input Object are both null or equal
// to each other.
public static boolean equals(Object a, Object b) {
return (a == b) || (a == null ? false : a.equals(b));
}
// Returns the next power of two.
// Returns the input if it is already power of 2.
// Throws IllegalArgumentException if the input is <= 0 or
// the answer overflows.
public static int nextPowerOf2(int n) {
if (n <= 0 || n > (1 << 30))
throw new IllegalArgumentException("n is invalid: " + n);
n -= 1;
n |= n >> 16;
n |= n >> 8;
n |= n >> 4;
n |= n >> 2;
n |= n >> 1;
return n + 1;
}
// Returns the previous power of two.
// Returns the input if it is already power of 2.
// Throws IllegalArgumentException if the input is <= 0
public static int prevPowerOf2(int n) {
if (n <= 0)
throw new IllegalArgumentException();
return Integer.highestOneBit(n);
}
// Returns the input value x clamped to the range [min, max].
public static int clamp(int x, int min, int max) {
if (x > max)
return max;
if (x < min)
return min;
return x;
}
// Returns the input value x clamped to the range [min, max].
public static float clamp(float x, float min, float max) {
if (x > max)
return max;
if (x < min)
return min;
return x;
}
// Returns the input value x clamped to the range [min, max].
public static long clamp(long x, long min, long max) {
if (x > max)
return max;
if (x < min)
return min;
return x;
}
public static boolean isOpaque(int color) {
return color >>> 24 == 0xFF;
}
public static void swap(int[] array, int i, int j) {
int temp = array[i];
array[i] = array[j];
array[j] = temp;
}
/**
* A function thats returns a 64-bit crc for string
*
* @param in
* input string
* @return a 64-bit crc value
*/
public static final long crc64Long(String in) {
if (in == null || in.length() == 0) {
return 0;
}
return crc64Long(getBytes(in));
}
static {
// http://bioinf.cs.ucl.ac.uk/downloads/crc64/crc64.c
long part;
for (int i = 0; i < 256; i++) {
part = i;
for (int j = 0; j < 8; j++) {
long x = ((int) part & 1) != 0 ? POLY64REV : 0;
part = (part >> 1) ^ x;
}
sCrcTable[i] = part;
}
}
public static final long crc64Long(byte[] buffer) {
long crc = INITIALCRC;
for (int k = 0, n = buffer.length; k < n; ++k) {
crc = sCrcTable[(((int) crc) ^ buffer[k]) & 0xff] ^ (crc >> 8);
}
return crc;
}
public static byte[] getBytes(String in) {
byte[] result = new byte[in.length() * 2];
int output = 0;
for (char ch : in.toCharArray()) {
result[output++] = (byte) (ch & 0xFF);
result[output++] = (byte) (ch >> 8);
}
return result;
}
public static void closeSilently(Closeable c) {
if (c == null)
return;
try {
c.close();
} catch (Throwable t) {
Log.w(TAG, "close fail", Log.APP);
}
}
public static int compare(long a, long b) {
return a < b ? -1 : a == b ? 0 : 1;
}
public static int ceilLog2(float value) {
int i;
for (i = 0; i < 31; i++) {
if ((1 << i) >= value)
break;
}
return i;
}
public static int floorLog2(float value) {
int i;
for (i = 0; i < 31; i++) {
if ((1 << i) > value)
break;
}
return i - 1;
}
public static void closeSilently(ParcelFileDescriptor fd) {
try {
if (fd != null)
fd.close();
} catch (Throwable t) {
Log.w(TAG, "fail to close", Log.APP);
}
}
public static void closeSilently(Cursor cursor) {
try {
if (cursor != null)
cursor.close();
} catch (Throwable t) {
Log.w(TAG, "fail to close", Log.APP);
}
}
public static float interpolateAngle(float source, float target,
float progress) {
// interpolate the angle from source to target
// We make the difference in the range of [-179, 180], this is the
// shortest path to change source to target.
float diff = target - source;
if (diff < 0)
diff += 360f;
if (diff > 180)
diff -= 360f;
float result = source + diff * progress;
return result < 0 ? result + 360f : result;
}
public static float interpolateScale(float source, float target,
float progress) {
return source + progress * (target - source);
}
public static String ensureNotNull(String value) {
return value == null ? "" : value;
}
public static String ensureNotNull(Object obj) {
return obj == null ? "" : obj.toString();
}
public static float parseFloatSafely(String content, float defaultValue) {
if (content == null)
return defaultValue;
try {
return Float.parseFloat(content);
} catch (NumberFormatException e) {
return defaultValue;
}
}
public static int parseIntSafely(String content, int defaultValue) {
if (content == null)
return defaultValue;
try {
return Integer.parseInt(content);
} catch (NumberFormatException e) {
return defaultValue;
}
}
public static boolean isNullOrEmpty(String exifMake) {
return TextUtils.isEmpty(exifMake);
}
public static void waitWithoutInterrupt(Object object) {
try {
object.wait();
} catch (InterruptedException e) {
Log.w(TAG, "unexpected interrupt: " + object, Log.APP);
}
}
public static boolean handleInterrruptedException(Throwable e) {
// A helper to deal with the interrupt exception
// If an interrupt detected, we will setup the bit again.
if (e instanceof InterruptedIOException
|| e instanceof InterruptedException) {
Thread.currentThread().interrupt();
return true;
}
return false;
}
/**
* @return String with special XML characters escaped.
*/
public static String escapeXml(String s) {
StringBuilder sb = new StringBuilder();
for (int i = 0, len = s.length(); i < len; ++i) {
char c = s.charAt(i);
switch (c) {
case '<':
sb.append("<");
break;
case '>':
sb.append(">");
break;
case '\"':
sb.append(""");
break;
case '\'':
sb.append("'");
break;
case '&':
sb.append("&");
break;
default:
sb.append(c);
}
}
return sb.toString();
}
public static String[] copyOf(String[] source, int newSize) {
String[] result = new String[newSize];
newSize = Math.min(source.length, newSize);
System.arraycopy(source, 0, result, 0, newSize);
return result;
}
// Mask information for debugging only. It returns
// <code>info.toString()</code> directly
// for debugging build (i.e., 'eng' and 'userdebug') and returns a mask
// ("****")
// in release build to protect the information (e.g. for privacy issue).
public static String maskDebugInfo(Object info) {
if (info == null)
return null;
String s = info.toString();
int length = Math.min(s.length(), MASK_STRING.length());
return IS_DEBUG_BUILD ? s : MASK_STRING.substring(0, length);
}
// This method should be ONLY used for debugging.
public static void debug(String message, Object... args) {
Log.v(DEBUG_TAG, String.format(message, args), Log.APP);
}
/**
* combina the url. usr the param list repleace the [#] in the url.
*
* @param str
* @param params
* @return
* @exception RuntimeException
* May throw the runtime exception while the method was done.
* @author MichaelHuang
*/
public static String combinaStr(String str, List<String> params)
throws RuntimeException {
try {
String[] strs = str.split("[#]");
String newStr = "";
for (int i = 0; i < strs.length; i++) {
String itemUrl = strs[i];
newStr += itemUrl;
if (i >= 0 && i < params.size())
newStr += params.get(i);
}
Log.i(TAG, "<combinaStr> newStr:" + newStr, Log.DATA);
return newStr;
} catch (Exception e) {
throw new RuntimeException();
}
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/thread/Future.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils.thread;
// This Future differs from the java.util.concurrent.Future in these aspects:
//
// - Once cancel() is called, isCancelled() always returns true. It is a sticky
// flag used to communicate to the implementation. The implmentation may
// ignore that flag. Regardless whether the Future is cancelled, a return
// value will be provided to get(). The implementation may choose to return
// null if it finds the Future is cancelled.
//
// - get() does not throw exceptions.
//
public interface Future<T> {
public void cancel();
public boolean isCancelled();
public boolean isDone();
public T get();
public void waitDone();
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/thread/FutureListener.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils.thread;
/**
*
* @author way
*
* @param <T>
*/
public interface FutureListener<T> {
public void onFutureDone(Future<T> future);
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/thread/PriorityThreadFactory.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils.thread;
import android.os.Process;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
/**
* A thread factory that creates threads with a given thread priority.
*/
public class PriorityThreadFactory implements ThreadFactory {
private final int mPriority;
private final AtomicInteger mNumber = new AtomicInteger();
private final String mName;
public PriorityThreadFactory(String name, int priority) {
mName = name;
mPriority = priority;
}
@Override
public Thread newThread(Runnable r) {
return new Thread(r, mName + '-' + mNumber.getAndIncrement()) {
@Override
public void run() {
Process.setThreadPriority(mPriority);
super.run();
}
};
}
}
================================================
FILE: Upgrade-lib/src/com/way/upgrade/utils/thread/ThreadPool.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils.thread;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import com.way.upgrade.utils.Log;
/**
*
* @author way
*
*/
public class ThreadPool {
private static final String TAG = "ThreadPool";
private static final int CORE_POOL_SIZE = 4;
private static final int MAX_POOL_SIZE = 8;
private static final int KEEP_ALIVE_TIME = 20; // 10 seconds
// Resource type
public static final int MODE_NONE = 0;
public static final int MODE_CPU = 1;
public static final int MODE_NETWORK = 2;
public static final JobContext JOB_CONTEXT_STUB = new JobContextStub();
// M: in order to take full advantage of MT6589 CPU Core, change cpuCounter
// to 4 from 2
ResourceCounter mCpuCounter = new ResourceCounter(4);
ResourceCounter mNetworkCounter = new ResourceCounter(6);
// A Job is like a Callable, but it has an addition JobContext parameter.
public interface Job<T> {
public T run(JobContext jc);
}
public interface JobContext {
boolean isCancelled();
void setCancelListener(CancelListener listener);
boolean setMode(int mode);
}
private static class JobContextStub implements JobContext {
@Override
public boolean isCancelled() {
return false;
}
@Override
public void setCancelListener(CancelListener listener) {
}
@Override
public boolean setMode(int mode) {
return true;
}
}
public interface CancelListener {
public void onCancel();
}
private static class ResourceCounter {
public int value;
public ResourceCounter(int v) {
value = v;
}
}
private final Executor mExecutor;
public ThreadPool() {
this(CORE_POOL_SIZE, MAX_POOL_SIZE);
}
public ThreadPool(int initPoolSize, int maxPoolSize) {
mExecutor = new ThreadPoolExecutor(initPoolSize, maxPoolSize,
KEEP_ALIVE_TIME, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(), new PriorityThreadFactory(
"thread-pool",
android.os.Process.THREAD_PRIORITY_BACKGROUND));
}
// Submit a job to the thread pool. The listener will be called when the
// job is finished (or cancelled).
public <T> Future<T> submit(Job<T> job, FutureListener<T> listener,
int threadMode) {
Log.i(TAG, "<submit> Job:" + job, Log.APP);
Worker<T> w = new Worker<T>(job, listener, threadMode);
mExecutor.execute(w);
return w;
}
public <T> Future<T> submit(Job<T> job) {
return submit(job, null, MODE_CPU);
}
private class Worker<T> implements Runnable, Future<T>, JobContext {
private static final String TAG = "Worker";
private Job<T> mJob;
private FutureListener<T> mListener;
private CancelListener mCancelListener;
private ResourceCounter mWaitOnResource;
private volatile boolean mIsCancelled;
private boolean mIsDone;
private T mResult;
private int mMode;
private int mTargetMode;
public Worker(Job<T> job, FutureListener<T> listener, int threadMode) {
mJob = job;
mListener = listener;
mTargetMode = threadMode;
}
// This is called by a thread in the thread pool.
@Override
public void run() {
Log.i(TAG, "<run> start", Log.APP);
T result = null;
// A job is in CPU mode by default. setMode returns false
// if the job is cancelled.
if (setMode(mTargetMode)) {
try {
result = mJob.run(this);
} catch (Throwable ex) {
}
}
synchronized (this) {
setMode(MODE_NONE);
mResult = result;
mIsDone = true;
notifyAll();
}
if (mListener != null)
mListener.onFutureDone(this);
Log.i(TAG, "<run> end", Log.APP);
}
// Below are the methods for Future.
@Override
public synchronized void cancel() {
if (mIsCancelled)
return;
mIsCancelled = true;
if (mWaitOnResource != null) {
synchronized (mWaitOnResource) {
mWaitOnResource.notifyAll();
}
}
if (mCancelListener != null) {
mCancelListener.onCancel();
}
}
@Override
public boolean isCancelled() {
return mIsCancelled;
}
@Override
public synchronized boolean isDone() {
return mIsDone;
}
@Override
public synchronized T get() {
while (!mIsDone) {
try {
wait();
} catch (Exception ex) {
}
}
return mResult;
}
@Override
public void waitDone() {
get();
}
// Below are the methods for JobContext (only called from the
// thread running the job)
@Override
public synchronized void setCancelListener(CancelListener listener) {
mCancelListener = listener;
if (mIsCancelled && mCancelListener != null) {
mCancelListener.onCancel();
}
}
@Override
public boolean setMode(int mode) {
// Release old resource
Log.i(TAG, "<setMode> start mode:" + mode, Log.APP);
ResourceCounter rc = modeToCounter(mMode);
if (rc != null)
releaseResource(rc);
mMode = MODE_NONE;
// Acquire new resource
rc = modeToCounter(mode);
if (rc != null) {
if (!acquireResource(rc)) {
return false;
}
mMode = mode;
}
Log.i(TAG, "<setMode> end", Log.APP);
return true;
}
private ResourceCounter modeToCounter(int mode) {
if (mode == MODE_CPU) {
Log.i(TAG, "<modeToCounter> MODE_CPU", Log.APP);
return mCpuCounter;
} else if (mode == MODE_NETWORK) {
Log.i(TAG, "<modeToCounter> MODE_NETWORK", Log.APP);
return mNetworkCounter;
} else {
return null;
}
}
private boolean acquireResource(ResourceCounter counter) {
Log.i(TAG, "<acquireResource> start", Log.APP);
while (true) {
synchronized (this) {
if (mIsCancelled) {
mWaitOnResource = null;
return false;
}
mWaitOnResource = counter;
}
synchronized (counter) {
if (counter.value > 0) {
counter.value--;
break;
} else {
try {
counter.wait();
} catch (InterruptedException ex) {
// ignore.
}
}
}
}
synchronized (this) {
mWaitOnResource = null;
}
Log.i(TAG, "<acquireResource> end", Log.APP);
return true;
}
private void releaseResource(ResourceCounter counter) {
Log.i(TAG, "<releaseResource> start", Log.APP);
synchronized (counter) {
counter.value++;
counter.notifyAll();
}
Log.i(TAG, "<releaseResource> end", Log.APP);
}
}
}
================================================
FILE: WayHoo/.settings/org.eclipse.jdt.core.prefs
================================================
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6
================================================
FILE: WayHoo/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.way.yahoo"
android:versionCode="20150725"
android:versionName="2.0.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
<!-- 这个权限用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- 这个权限用于访问GPS定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- 获取运营商信息,用于支持提供运营商信息相关的接口 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<!-- 用于读取手机当前的状态 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- 访问网络,网络定位需要上网 -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- SD卡读取权限,用户写入离线定位数据 -->
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<!-- 允许应用读取低级别的系统日志文件 -->
<uses-permission android:name="android.permission.READ_LOGS" />
<!-- 联网权限,更新apk使用 -->
<uses-permission android:name="android.permission.GET_TASKS" />
<application
android:name="com.way.yahoo.App"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.way.yahoo.SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.way.yahoo.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.way.yahoo.ManagerCityActivity"
android:screenOrientation="portrait"
android:theme="@style/SecondAppTheme" />
<activity
android:name="com.way.yahoo.QueryCityActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/SecondAppTheme"
android:windowSoftInputMode="stateHidden|adjustPan" />
<provider
android:name="com.way.db.CityProvider"
android:authorities="com.way.yahoo.provider.Citys" />
<activity
android:name="com.way.yahoo.AboutActivity"
android:screenOrientation="portrait"
android:theme="@style/SecondAppTheme"
android:windowSoftInputMode="stateHidden|adjustPan" />
<activity
android:name="com.way.yahoo.FeedBackActivity"
android:screenOrientation="portrait"
android:theme="@style/SecondAppTheme"
android:windowSoftInputMode="stateHidden|adjustPan" />
android:windowSoftInputMode="stateHidden|adjustResize"
<!-- 接受下载apk成功广播,更新apk使用 -->
<receiver android:name="com.way.upgrade.receiver.DownloadCompleteReveiver" >
<intent-filter>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
<action android:name="android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED" />
</intent-filter>
</receiver>
<meta-data
android:name="BUG_HD_SDK_GENERAL_KEY"
android:value="d9be96d1d636733c2ddc1a1b4381e5b1" />
<meta-data
android:name="bundle_id"
android:value="55b382b8692d655ba7000001" />
<meta-data
android:name="api_token"
android:value="b6bb01fe261cafbabf03e16a9bdf33ad" />
<service
android:name="com.baidu.location.f"
android:enabled="true"
android:process=":remote" >
</service>
<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="W9xG4m71Ek8xz2GyhZvGiuWb" />
</application>
</manifest>
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/MainActivity.java
================================================
package com.way.upgrade;
import android.app.Activity;
import android.os.Bundle;
import com.way.upgrade.core.UpgradeManager;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final UpgradeManager upgradeMangeer = UpgradeManager.newInstance(this);
upgradeMangeer.askForNewVersion();
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/bean/UpgradeInfo.java
================================================
package com.way.upgrade.bean;
import android.os.Parcel;
import android.os.Parcelable;
/**
* 版本更新信息
*
* @author way
* @since 2014/4/28
*/
public class UpgradeInfo implements Parcelable{
private int id;
/**唯一标识apk*/
private String key;
/** 版本信息 */
private String version;
/** 版本名称 */
private String versionName;
/** 是否有更新 */
private String result;
/** 新版本地址 */
private String url;
/** 版本描述 */
private String description;
/** 已下载的大小 */
private long downloadSize;
private String mustUpdate;
private String changeLog;
private String errorCode;
public static final Parcelable.Creator<UpgradeInfo> CREATOR = new Creator<UpgradeInfo>() {
@Override
public UpgradeInfo[] newArray(int size) {
return new UpgradeInfo[size];
}
@Override
public UpgradeInfo createFromParcel(Parcel source) {
return new UpgradeInfo(source);
}
};
public UpgradeInfo() {
}
public UpgradeInfo(Parcel in) {
id = in.readInt();
key = in.readString();
version = in.readString();
versionName = in.readString();
result = in.readString();
url = in.readString();
description = in.readString();
downloadSize = in.readLong();
result = in.readString();
mustUpdate = in.readString();
changeLog = in.readString();
errorCode = in.readString();
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(id);
dest.writeString(key);
dest.writeString(version);
dest.writeString(versionName);
dest.writeString(result);
dest.writeString(url);
dest.writeString(description);
dest.writeLong(downloadSize);
dest.writeString(result);
dest.writeString(mustUpdate);
dest.writeString(changeLog);
dest.writeString(errorCode);
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public long getDownloadSize() {
return downloadSize;
}
public void setDownloadSize(long downloadSize) {
this.downloadSize = downloadSize;
}
public String getVersionName() {
return versionName;
}
public void setVersionName(String versionName) {
this.versionName = versionName;
}
public String isResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getMustUpdate() {
return mustUpdate;
}
public void setMustUpdate(String mustUpdate) {
this.mustUpdate = mustUpdate;
}
public String getChangeLog() {
return changeLog;
}
public void setChangeLog(String changeLog) {
this.changeLog = changeLog;
}
public String getResult() {
return result;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
@Override
public String toString() {
return "UpgradeInfo [id=" + id + ", key=" + key + ", version="
+ version + ", versionName=" + versionName + ", result="
+ result + ", url=" + url + ", description=" + description
+ ", downloadSize=" + downloadSize + ", mustUpdate="
+ mustUpdate + ", changeLog=" + changeLog
+ ", errorCode=" + errorCode + "]";
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/core/CheckNewVersionListener.java
================================================
package com.way.upgrade.core;
/**
*
* @author way
* @sine 2014/10/29
*/
public interface CheckNewVersionListener {
public void checkNewVersion(boolean result);
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/core/UpgradeInterface.java
================================================
package com.way.upgrade.core;
import com.way.upgrade.bean.UpgradeInfo;
/**
*
* @author way
* @since 2014/4/28
*/
public interface UpgradeInterface {
/**
* 请求服务器是否有新版本,并弹出对话框
*
* @return
*/
public void askForNewVersion();
/**
* 请求服务器是否有新版本
*
* @return
*/
public void askForNewVersionFlag(
CheckNewVersionListener checkversionListener);
/**
* 下载新版本
*
* @return
*/
public void downloadNewVersion(UpgradeInfo upgradeInfo);
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/core/UpgradeManager.java
================================================
package com.way.upgrade.core;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.widget.Toast;
import com.way.upgrade.bean.UpgradeInfo;
import com.way.upgrade.job.CheckNewVersionJobWithoutClientUrl;
import com.way.upgrade.job.DownloadNewVersionJob;
import com.way.upgrade.locale.LocaleChina;
import com.way.upgrade.locale.LocaleChinaTW;
import com.way.upgrade.locale.LocaleChinese;
import com.way.upgrade.locale.LocaleEnglish;
import com.way.upgrade.locale.LocaleHandler;
import com.way.upgrade.locale.LocaleUS;
import com.way.upgrade.utils.Constants;
import com.way.upgrade.utils.ContextUtils;
import com.way.upgrade.utils.thread.Future;
import com.way.upgrade.utils.thread.FutureListener;
import com.way.upgrade.utils.thread.ThreadPool;
/**
*
* @author way
* @since 2014/4/28
*/
public class UpgradeManager extends LocaleHandler implements UpgradeInterface {
private Context mContext;
private static ThreadPool mThreadPool;
private Handler mHandler;
private AlertDialog alertDialog;
private AlertDialog alertDialogForMustUpdate;
private ProgressDialog mProgressDialog;
private Map<String, LocaleHandler> handlers;
private static Future<UpgradeInfo> mFuture;
private CheckNewVersionListener mAskForNewVersionFlagListener;
private FutureListener<UpgradeInfo> mAskForNewVersionListener = new FutureListener<UpgradeInfo>() {
public void onFutureDone(Future<UpgradeInfo> future) {
UpgradeInfo upgradeInfo = future.get();
Message msg = mHandler.obtainMessage();
if (upgradeInfo != null) {
if (upgradeInfo.getErrorCode() != null) {
if (upgradeInfo.getErrorCode().equals(
Constants.ERROR_CODE_NET)) {
msg.what = Constants.MSG_NET_ERROR;
}
} else if (Boolean.parseBoolean(upgradeInfo.getResult())) {
mFuture = future;
msg.what = Constants.MSG_HAVA_NEW_VERSION;
msg.obj = upgradeInfo;
} else if (!Boolean.parseBoolean(upgradeInfo.getResult())) {
msg.what = Constants.MSG_NO_NEW_VERSION;
}
} else {
msg.what = Constants.MSG_NO_NEW_VERSION;
}
mHandler.sendMessage(msg);
};
};
public class AskForNewVersionFlag implements FutureListener<UpgradeInfo> {
@Override
public void onFutureDone(Future<UpgradeInfo> future) {
UpgradeInfo upgradeInfo = future.get();
boolean result = false;
if (upgradeInfo != null) {
result = Boolean.parseBoolean(upgradeInfo.getResult());
}
Message msg = mHandler.obtainMessage();
msg.what = Constants.MSG_VERSION_RESULT;
msg.obj = result;
mHandler.sendMessage(msg);
}
}
public UpgradeManager(Context context) {
createHandlers();
mContext = context;
init();
}
private void init() {
if (mThreadPool == null) {
mThreadPool = new ThreadPool();
}
mHandler = new Handler(mContext.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case Constants.MSG_HAVA_NEW_VERSION:
try {
ContextUtils.closeProgressDialog(mProgressDialog);
UpgradeInfo description = (UpgradeInfo) msg.obj;
showDialog(description);
} catch (Exception e1) {
e1.printStackTrace();
}
break;
case Constants.MSG_NO_NEW_VERSION:
try {
ContextUtils.closeProgressDialog(mProgressDialog);
ContextUtils.showToast(mContext, getToastMessage(),
Toast.LENGTH_SHORT);
} catch (Exception e) {
e.printStackTrace();
}
break;
case Constants.MSG_START_DOWNLOAD:
UpgradeInfo description1 = (UpgradeInfo) msg.obj;
downloadNewVersion(description1);
break;
case Constants.MSG_VERSION_RESULT:
Boolean result = (Boolean) msg.obj;
mAskForNewVersionFlagListener.checkNewVersion(result);
break;
case Constants.MSG_NET_ERROR:
try {
ContextUtils.closeProgressDialog(mProgressDialog);
} catch (Exception e) {
e.printStackTrace();
}
ContextUtils.showToast(mContext, getToastNetErrorMessage(),
Toast.LENGTH_SHORT);
default:
break;
}
}
};
alertDialog = ContextUtils.showAlertDialog(mContext, getDialogTitle(),
"", new int[] { android.R.string.ok, android.R.string.cancel },
new DialogInterface.OnClickListener[] {
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
if (mFuture != null) {
Message msg = mHandler.obtainMessage();
msg.what = Constants.MSG_START_DOWNLOAD;
msg.obj = mFuture.get();
mHandler.sendMessage(msg);
}
}
}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
dialog.dismiss();
}
} });
alertDialogForMustUpdate = ContextUtils
.showAlertDialog(
mContext,
getDialogTitle(),
"",
new int[] { android.R.string.ok },
new DialogInterface.OnClickListener[] { new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
if (mFuture != null) {
Message msg = mHandler.obtainMessage();
msg.what = Constants.MSG_START_DOWNLOAD;
msg.obj = mFuture.get();
mHandler.sendMessage(msg);
}
}
} });
alertDialogForMustUpdate.setCancelable(false);
mProgressDialog = ContextUtils.createProgressDialog(mContext);
mProgressDialog.setTitle(getProgressDialogTitle());
mProgressDialog.setMessage(getProgressDialogMessage());
}
public static UpgradeManager newInstance(Context context) {
return new UpgradeManager(context);
}
private void showProgressDialog() {
if (mProgressDialog != null) {
try {
mProgressDialog.show();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public void askForNewVersion() {
showProgressDialog();
mThreadPool.submit(new CheckNewVersionJobWithoutClientUrl(mContext),
mAskForNewVersionListener, ThreadPool.MODE_NETWORK);
}
@Override
public void askForNewVersionFlag(
CheckNewVersionListener checkversionListener) {
if (checkversionListener == null) {
return;
}
mAskForNewVersionFlagListener = checkversionListener;
AskForNewVersionFlag mAskForNewVersionFlagListener = new AskForNewVersionFlag();
mThreadPool.submit(new CheckNewVersionJobWithoutClientUrl(mContext),
mAskForNewVersionFlagListener, ThreadPool.MODE_NETWORK);
}
@Override
public void downloadNewVersion(UpgradeInfo upgradeInfo) {
mThreadPool.submit(new DownloadNewVersionJob(mContext, upgradeInfo),
null, ThreadPool.MODE_CPU);
}
private void createHandlers() {
handlers = new HashMap<String, LocaleHandler>();
handlers.put(LocaleChinese.defaultLocale, new LocaleChinese());
handlers.put(LocaleChinaTW.defaultLocale, new LocaleChinaTW());
handlers.put(LocaleEnglish.defaultLocale, new LocaleEnglish());
handlers.put(Locale.CHINA.toString(), new LocaleChina());
handlers.put(Locale.US.toString(), new LocaleUS());
}
private LocaleHandler lookupHandlerBy(String handlerName) {
LocaleHandler handler = handlers.get(handlerName);
if (handler == null)
return handlers.get(Locale.ENGLISH.getLanguage());
return handlers.get(handlerName);
}
private void showDialog(UpgradeInfo description) {
int mustUpdate = Integer.valueOf(description.getMustUpdate());
boolean result = Boolean.parseBoolean(description.isResult());
String descriptionStr = description.getChangeLog();
Log.i("liweiping", "mustUpdate = " + mustUpdate + ", result = "
+ result + ", alertDialog = " + alertDialog
+ ", alertDialogForMustUpdate = " + alertDialogForMustUpdate);
if (mustUpdate == Constants.NOT_MUST_UPDATE) {
if (alertDialog != null && result) {
alertDialog.setTitle(getDialogTitle());
alertDialog.setMessage(descriptionStr);
alertDialog.show();
}
} else {
if (alertDialogForMustUpdate != null && result) {
alertDialogForMustUpdate.setTitle(getDialogTitle());
alertDialogForMustUpdate.setMessage(descriptionStr);
alertDialogForMustUpdate.show();
}
}
}
private String getLocaleLanguage() {
return Locale.getDefault().toString();
}
@Override
public String getDialogTitle() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getDialogTitle();
}
@Override
public String getProgressDialogTitle() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getProgressDialogTitle();
}
@Override
public String getProgressDialogMessage() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getProgressDialogMessage();
}
@Override
public String getToastMessage() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getToastMessage();
}
@Override
public String getToastNetErrorMessage() {
LocaleHandler handler = lookupHandlerBy(getLocaleLanguage());
return handler.getToastNetErrorMessage();
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/job/AbstractCheckNewVersionJob.java
================================================
package com.way.upgrade.job;
import java.io.IOException;
import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.util.Log;
import com.way.upgrade.bean.UpgradeInfo;
import com.way.upgrade.parser.json.FirVersionJsonParsing;
import com.way.upgrade.utils.Constants;
import com.way.upgrade.utils.NetUtils;
import com.way.upgrade.utils.NetUtils.NETWORK_STATUS;
import com.way.upgrade.utils.thread.ThreadPool;
import com.way.upgrade.utils.thread.ThreadPool.JobContext;
/**
*
* @author way
* @since 2014/4/28
*/
public abstract class AbstractCheckNewVersionJob implements
ThreadPool.Job<UpgradeInfo> {
protected Context mContext;
protected String bundle_id;
protected String api_token;
public AbstractCheckNewVersionJob(Context context) {
this.mContext = context;
try {
ApplicationInfo appInfo = mContext.getPackageManager()
.getApplicationInfo(mContext.getPackageName(),
PackageManager.GET_META_DATA);
bundle_id = appInfo.metaData.getString("bundle_id");
api_token = appInfo.metaData.getString("api_token");
} catch (NameNotFoundException e) {
throw new NullPointerException(
"app_id and token must not null in AndroidManifest.xml "
+ e);
}
Log.i("liweiping", "AbstractCheckNewVersionJob app_id = " + bundle_id
+ ", api_token = " + api_token);
}
@Override
public UpgradeInfo run(JobContext jc) {
UpgradeInfo upgradeInfo = null;
if (NetUtils.getNetworkType(mContext) == NETWORK_STATUS.STATE_NONE_NETWORK) {
Log.i("liweiping", "NETWORK_STATUS.STATE_NONE_NETWORK");
upgradeInfo = new UpgradeInfo();
upgradeInfo.setErrorCode(Constants.ERROR_CODE_NET);
return upgradeInfo;
}
try {
String checkUpdateUrl = String.format(getCheckVersionUrl(), bundle_id,
api_token);
Log.i("liweiping", "checkUpdateUrl = " + checkUpdateUrl);
JSONObject jo = NetUtils.getJSONArrayByGet(checkUpdateUrl);
FirVersionJsonParsing firVersionJsonParsing = new FirVersionJsonParsing(
mContext);
Log.i("liweiping",
"upgradeInfo = " + upgradeInfo + ", checkUpdateUrl = "
+ checkUpdateUrl + ", jo = " + jo.toString());
upgradeInfo = firVersionJsonParsing.readJsonItem(jo);
} catch (Exception e) {
upgradeInfo = new UpgradeInfo();
upgradeInfo.setErrorCode(Constants.ERROR_CODE_NET);
Log.i("liweiping",e.getMessage());
e.printStackTrace();
}
return upgradeInfo;
}
public abstract String getCheckVersionUrl();
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/job/CheckNewVersionJobWithoutClientUrl.java
================================================
package com.way.upgrade.job;
import android.content.Context;
import com.way.upgrade.utils.Constants;
/**
*
* @author way
* @since 2014/4/28
*/
public class CheckNewVersionJobWithoutClientUrl extends
AbstractCheckNewVersionJob {
public CheckNewVersionJobWithoutClientUrl(Context context) {
super(context);
}
@Override
public String getCheckVersionUrl() {
return Constants.BASE_URL;
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/job/DownloadNewVersionJob.java
================================================
package com.way.upgrade.job;
import java.io.File;
import android.app.DownloadManager;
import android.app.DownloadManager.Request;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import com.way.upgrade.bean.UpgradeInfo;
import com.way.upgrade.utils.Constants;
import com.way.upgrade.utils.Preferences;
import com.way.upgrade.utils.thread.ThreadPool;
import com.way.upgrade.utils.thread.ThreadPool.JobContext;
public class DownloadNewVersionJob implements ThreadPool.Job<Void> {
private Context mContext;
private UpgradeInfo mUpgradeInfo;
private boolean allowMobileDownload = false;
private static final long MAX_ALLOWED_DOWNLOAD_BYTES_BY_MOBILE = 3145725;
public DownloadNewVersionJob(Context context, UpgradeInfo upgradeInfo) {
this.mContext = context;
this.mUpgradeInfo = upgradeInfo;
}
@Override
public Void run(JobContext jc) {
try {
if (checkDownloadRunning())
return null;
if (checkApkExist()) {
Intent installApkIntent = new Intent();
installApkIntent.setAction(Intent.ACTION_VIEW);
installApkIntent.setDataAndType(
Uri.parse(Preferences.getDownloadPath(mContext)),
"application/vnd.android.package-archive");
installApkIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
mContext.startActivity(installApkIntent);
} else {
String apkName = mContext.getPackageName()
+ System.currentTimeMillis() + Constants.APK_SUFFIX;
// 系统下载程序
final DownloadManager downloadManager = (DownloadManager) mContext
.getSystemService(mContext.DOWNLOAD_SERVICE);
Long recommendedMaxBytes = DownloadManager
.getRecommendedMaxBytesOverMobile(mContext);
// 可以在移动网络下下载
if (recommendedMaxBytes == null
|| recommendedMaxBytes.longValue() > MAX_ALLOWED_DOWNLOAD_BYTES_BY_MOBILE) {
allowMobileDownload = true;
}
Uri uri = Uri.parse(mUpgradeInfo.getUrl());
final Request request = new Request(uri);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
int NETWORK_TYPE = DownloadManager.Request.NETWORK_WIFI;
if (allowMobileDownload) {
NETWORK_TYPE |= DownloadManager.Request.NETWORK_MOBILE;
}
request.setAllowedNetworkTypes(NETWORK_TYPE);
request.allowScanningByMediaScanner();
request.setShowRunningNotification(true);
request.setVisibleInDownloadsUi(true);
request.setDestinationInExternalPublicDir(
Environment.DIRECTORY_DOWNLOADS, apkName);
PackageManager packageManager = mContext.getPackageManager();
ApplicationInfo applicationInfo = packageManager
.getApplicationInfo(mContext.getPackageName(), 0);
Log.i("liweiping",
"appName = "
+ packageManager
.getApplicationLabel(applicationInfo));
request.setTitle(packageManager
.getApplicationLabel(applicationInfo));
request.setMimeType("application/vnd.android.package-archive");
// id 保存起来跟之后的广播接收器作对比
long id = downloadManager.enqueue(request);
long oldId = Preferences.getDownloadId(mContext);
if (oldId != -1) {
downloadManager.remove(oldId);
}
Preferences.removeAll(mContext);
Preferences.setDownloadId(mContext, id);
Preferences.setUpgradeInfo(mContext, mUpgradeInfo);
Preferences.setDownloadStatus(mContext,
Constants.DOWNLOAD_STATUS_RUNNING);
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private boolean checkApkExist() {
UpgradeInfo prefUpgradeInfo = Preferences.getUpgradeInfo(mContext);
String version = prefUpgradeInfo.getVersion();
String downloadPath = Preferences.getDownloadPath(mContext);
if (version != null && version.trim().length() != 0
&& version.equals(mUpgradeInfo.getVersion())
&& downloadPath != null && downloadPath.trim().length() != 0) {
String path = Uri.parse(downloadPath).getPath();
if (path != null && path.endsWith(Constants.APK_SUFFIX)) {
File file = new File(path);
if (file.exists()) {
return true;
}
}
}
return false;
}
@SuppressWarnings("static-access")
private boolean checkDownloadRunning() {
UpgradeInfo prefUpgradeInfo = Preferences.getUpgradeInfo(mContext);
String version = prefUpgradeInfo.getVersion();
int downloadStatus = Preferences.getDownloadStatus(mContext);
if (version != null && version.trim().length() != 0
&& version.equals(mUpgradeInfo.getVersion())) {
long downloadId = Preferences.getDownloadId(mContext);
if (downloadId != -1) {
final DownloadManager downloadManager = (DownloadManager) mContext
.getSystemService(mContext.DOWNLOAD_SERVICE);
DownloadManager.Query mDownloadQuery = new DownloadManager.Query();
mDownloadQuery.setFilterById(downloadId);
Cursor cursor = downloadManager.query(mDownloadQuery);
if (cursor != null && cursor.moveToFirst()) {
int status = cursor.getInt(cursor
.getColumnIndex(DownloadManager.COLUMN_STATUS));
if (status == DownloadManager.STATUS_RUNNING
|| downloadStatus == Constants.DOWNLOAD_STATUS_RUNNING) {
return true;
}
}
}
}
return false;
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChina.java
================================================
package com.way.upgrade.locale;
/**
*
* @author way
* @since 2014/10/29
*/
public class LocaleChina extends LocaleChinese {
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChinaTW.java
================================================
package com.way.upgrade.locale;
/**
*
* @author way
* @since 2014/10/29
*/
public class LocaleChinaTW extends LocaleChinese {
public static final String defaultLocale = "zh_TW";
@Override
public String getDialogTitle() {
return "發現新版本,是否升級?";
}
@Override
public String getProgressDialogTitle() {
return "檢查更新";
}
@Override
public String getProgressDialogMessage() {
return "正在檢查...";
}
@Override
public String getToastMessage() {
return "已是最新版本";
}
@Override
public String getToastNetErrorMessage() {
return "網路異常";
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChinese.java
================================================
package com.way.upgrade.locale;
/**
*
* @author way
* @since 2014/10/29
*/
public class LocaleChinese extends LocaleHandler {
public static final String defaultLocale = "zh";
@Override
public String getDialogTitle() {
return "发现新版本,是否升级?";
}
@Override
public String getProgressDialogTitle() {
return "检查更新";
}
@Override
public String getProgressDialogMessage() {
return "正在检查...";
}
@Override
public String getToastMessage() {
return "已是最新版本";
}
@Override
public String getToastNetErrorMessage() {
return "网络异常";
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleEnglish.java
================================================
package com.way.upgrade.locale;
public class LocaleEnglish extends LocaleHandler {
public static final String defaultLocale = "en";
@Override
public String getDialogTitle() {
return "Find New Version,Update Now?";
}
@Override
public String getProgressDialogTitle() {
return "Check Update";
}
@Override
public String getProgressDialogMessage() {
return "Checking";
}
@Override
public String getToastMessage() {
return "Is the latest version";
}
@Override
public String getToastNetErrorMessage() {
return "Net Error";
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleHandler.java
================================================
package com.way.upgrade.locale;
/**
*
* @author way
* @since 2014/10/29
*/
public abstract class LocaleHandler {
protected String value;
public abstract String getDialogTitle();
public abstract String getProgressDialogTitle();
public abstract String getProgressDialogMessage();
public abstract String getToastMessage();
public abstract String getToastNetErrorMessage();
public void setUpgradeDescription(String value) {
this.value = value;
}
public String getUpgradeDescription() {
return value;
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleUS.java
================================================
package com.way.upgrade.locale;
public class LocaleUS extends LocaleEnglish {
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/parser/json/AbstractJsonParsing.java
================================================
package com.way.upgrade.parser.json;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public abstract class AbstractJsonParsing<T> {
public abstract T readJsonItem(JSONObject jsonItem) throws JSONException;
/**
* 输入InputStream
*
* @param inStream
* @return
* @throws Exception
*/
public ArrayList<T> readJsonArray(JSONArray jsonArray) {
try {
ArrayList<T> listOperating = new ArrayList<T>();
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject item = jsonArray.getJSONObject(i);
T itemBean = readJsonItem(item);
listOperating.add(itemBean);
}
return listOperating;
} catch (JSONException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/parser/json/FirVersionJsonParsing.java
================================================
package com.way.upgrade.parser.json;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import com.way.upgrade.bean.UpgradeInfo;
import com.way.upgrade.utils.Constants;
import com.way.upgrade.utils.ContextUtils;
public class FirVersionJsonParsing extends AbstractJsonParsing<UpgradeInfo> {
private Context mContext;
public FirVersionJsonParsing(Context context) {
mContext = context;
}
@Override
public UpgradeInfo readJsonItem(JSONObject versionJsonObj)
throws JSONException {
UpgradeInfo upgradeInfo = new UpgradeInfo();
String url = versionJsonObj.getString("installUrl");
String firVersionCode = versionJsonObj.getString("version");
String firVersionName = versionJsonObj.getString("versionShort");
String changeLog = versionJsonObj.getString("changelog");
upgradeInfo.setUrl(url);
upgradeInfo.setVersion(firVersionCode);
boolean result = ContextUtils.getVersionCode(mContext) < Integer
.parseInt(firVersionCode)
|| (ContextUtils.getVersionCode(mContext) == Integer
.parseInt(firVersionCode) && !ContextUtils
.getVersionName(mContext).equals(firVersionName));
upgradeInfo.setResult(String.valueOf(result));
upgradeInfo.setVersionName(firVersionName);
upgradeInfo.setMustUpdate(Constants.NOT_MUST_UPDATE + "");
upgradeInfo.setChangeLog(changeLog);
return upgradeInfo;
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/receiver/DownloadCompleteReveiver.java
================================================
package com.way.upgrade.receiver;
import android.app.DownloadManager;
import android.app.DownloadManager.Query;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import com.way.upgrade.utils.Preferences;
/**
* 下载完成通知接收器
*
* @author way
*
*/
public class DownloadCompleteReveiver extends BroadcastReceiver {
private DownloadManager downloadManager;
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE)) {
long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, 0);
if (id == Preferences.getDownloadId(context)) {
Query query = new Query();
query.setFilterById(id);
downloadManager = (DownloadManager) context
.getSystemService(Context.DOWNLOAD_SERVICE);
Cursor cursor = downloadManager.query(query);
int columnCount = cursor.getColumnCount();
String path = null;
while (cursor.moveToNext()) {
for (int j = 0; j < columnCount; j++) {
String columnName = cursor.getColumnName(j);
String string = cursor.getString(j);
if ("local_uri".equals(columnName)) {
path = string;
}
}
}
cursor.close();
if (path != null) {
Preferences.setDownloadPath(context, path);
Preferences.setDownloadStatus(context, -1);
Intent installApkIntent = new Intent();
installApkIntent.setAction(Intent.ACTION_VIEW);
installApkIntent.setDataAndType(Uri.parse(path),
"application/vnd.android.package-archive");
installApkIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
context.startActivity(installApkIntent);
}
}
} else if (action.equals(DownloadManager.ACTION_NOTIFICATION_CLICKED)) {
long[] ids = intent
.getLongArrayExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS);
if (ids.length > 0 && ids[0] == Preferences.getDownloadId(context)) {
Intent downloadIntent = new Intent();
downloadIntent.setAction(DownloadManager.ACTION_VIEW_DOWNLOADS);
downloadIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
context.startActivity(downloadIntent);
}
}
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/Constants.java
================================================
package com.way.upgrade.utils;
/**
*
* @author way 2014/4/28
*/
public class Constants {
//public static final String BASE_URL = "http://fir.im/api/v2/app/version/%s?token=%s";
public static final String BASE_URL = "http://api.fir.im/apps/latest/%s?api_token=%s";
public static final String DOWNLOAD_FILE_PATH = "/upgrade";
public static final int MSG_HAVA_NEW_VERSION = 1;
public static final int MSG_NO_NEW_VERSION = 2;
public static final int MSG_START_DOWNLOAD = 3;
public static final int MSG_VERSION_RESULT = 4;
public static final int MSG_NET_ERROR = 5;
public static final int MUST_UPDATE = 1;
public static final int NOT_MUST_UPDATE = 0;
public static final String APK_SUFFIX = ".apk";
public static final Integer DOWNLOAD_STATUS_RUNNING = 1;
public static final String ERROR_CODE_NET = "net_error";
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/ContextUtils.java
================================================
package com.way.upgrade.utils;
import java.lang.reflect.Method;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.os.Build;
import android.util.Log;
import android.widget.Toast;
/**
* 上下文操作,如创建对话框,进度条,版本信息...
*
* @author way 2013/12/6
*/
public class ContextUtils {
private static final String TAG = "ContextUtils";
/**
* Show a Toast(Toast.LENGTH_SHORT).
*
* @param text
* the content shown on the Toast.
*/
public static void showToast(Context context, String text, int length) {
Toast.makeText(context, text, length).show();
}
/**
* Show a Toast(Toast.LENGTH_SHORT).
*
* @param text
* the content shown on the Toast.
*/
public static void showToast(Context context, int resId, int length) {
Toast.makeText(context, resId, length).show();
}
public static ProgressDialog createProgressDialog(Context context) {
ProgressDialog dialog = new ProgressDialog(context);
dialog.setIndeterminate(true);
dialog.setCancelable(true);
return dialog;
}
/**
* show progress dialog
*
* @param context
* @param title
* Dialog title
* @param message
* Dialog message
* @return
*/
public static ProgressDialog showProgressDialog(Context context, int title,
int message) {
ProgressDialog dialog = new ProgressDialog(context);
dialog.setTitle(title);
dialog.setMessage(context.getResources().getString(message));
dialog.setIndeterminate(true);
dialog.setCancelable(true);
dialog.show();
return dialog;
}
/**
* close progress dialog
*
* @param progressDialog
*/
public static void closeProgressDialog(Dialog progressDialog) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.cancel();
}
}
/**
*
* @param context
* @param title
* @param message
* @param buttonTexts
* @param listeners
* @return
*/
public static AlertDialog.Builder showDialog(Context context, int title,
int message, int[] buttonTexts, OnClickListener[] listeners) {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
dialog.setTitle(title);
dialog.setMessage(message);
if (buttonTexts.length == 1) {
dialog.setNeutralButton(buttonTexts[0], listeners[0]);
} else if (buttonTexts.length == 2) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNegativeButton(buttonTexts[1], listeners[1]);
} else if (buttonTexts.length == 3) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNeutralButton(buttonTexts[1], listeners[1]);
dialog.setNegativeButton(buttonTexts[2], listeners[2]);
}
dialog.show();
return dialog;
}
/**
*
* @param context
* @param title
* @param message
* @param buttonTexts
* @param listeners
* @return
*/
public static AlertDialog.Builder showDialog(Context context, String title,
String message, int[] buttonTexts, OnClickListener[] listeners) {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
dialog.setTitle(title);
dialog.setMessage(message);
if (buttonTexts.length == 1) {
dialog.setNeutralButton(buttonTexts[0], listeners[0]);
} else if (buttonTexts.length == 2) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNegativeButton(buttonTexts[1], listeners[1]);
} else if (buttonTexts.length == 3) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNeutralButton(buttonTexts[1], listeners[1]);
dialog.setNegativeButton(buttonTexts[2], listeners[2]);
}
dialog.show();
return dialog;
}
/**
*
* @param context
* @param title
* @param message
* @param buttonTexts
* @param listeners
* @return
*/
public static AlertDialog showAlertDialog(Context context, String title,
String message, int[] buttonTexts, OnClickListener[] listeners) {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
dialog.setTitle(title);
dialog.setMessage(message);
if (buttonTexts.length == 1) {
dialog.setNeutralButton(buttonTexts[0], listeners[0]);
} else if (buttonTexts.length == 2) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNegativeButton(buttonTexts[1], listeners[1]);
} else if (buttonTexts.length == 3) {
dialog.setPositiveButton(buttonTexts[0], listeners[0]);
dialog.setNeutralButton(buttonTexts[1], listeners[1]);
dialog.setNegativeButton(buttonTexts[2], listeners[2]);
}
return dialog.create();
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public static String getCustomVersion() {
try {
String className = "android.os.SystemProperties";
String methodName = "get";
String key = "ro.custom.build.version";
Class clazz = Class.forName(className);
// Constructor con = clazz.getEnclosingConstructor();
Method method = clazz.getDeclaredMethod(methodName, String.class);
return (String) method.invoke(clazz, key);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
/**
* 获取版本号
*
* @param context
* @return
*/
public static int getVersionCode(Context context) {
int versionCode = -1;
try {
PackageInfo info = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0);
versionCode = info.versionCode;
} catch (NameNotFoundException e) {
e.printStackTrace();
Log.e(TAG, e.getMessage());
}
return versionCode;
}
/**
* 获取版本信息
*
* @param mContext
* @return
*/
public static String getVersionName(Context context) {
String versionName = null;
try {
PackageInfo info = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0);
versionName = info.versionName;
// int versionCode = info.versionCode;
} catch (NameNotFoundException e) {
e.printStackTrace();
Log.e(TAG, e.getMessage());
}
return versionName;
}
public static String getUserAgent(Context context) {
PackageInfo packageInfo;
try {
packageInfo = context.getPackageManager().getPackageInfo(
context.getPackageName(), 0);
} catch (NameNotFoundException e) {
throw new IllegalStateException("getPackageInfo failed");
}
return String.format("%s/%s; %s/%s/%s/%s; %s/%s/%s",
packageInfo.packageName, packageInfo.versionName, Build.BRAND,
Build.DEVICE, Build.MODEL, Build.ID, Build.VERSION.SDK_INT,
Build.VERSION.RELEASE, Build.VERSION.INCREMENTAL);
}
public static Intent getActivityIntent(Context context, String packageName,
String className) {
PackageManager pm = context.getPackageManager();
Intent intent = new Intent();
ComponentName compoentName = new ComponentName(packageName, className);
intent.setComponent(compoentName);
ResolveInfo ri = pm.resolveActivity(intent,
PackageManager.MATCH_DEFAULT_ONLY);
if (ri != null) {
return intent;
}
return null;
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/FileUtils.java
================================================
package com.way.upgrade.utils;
import java.io.File;
/**
* @author way 2013/12/6
*/
public class FileUtils {
private static final String TAG = "FileUtils";
/**
* @param f
* @throws Exception
*/
public static void createNewFile(File f) throws Exception {
Log.i(TAG, "create file:" + f, Log.APP);
if (!f.getParentFile().exists()) {
f.getParentFile().mkdirs();
}
if (!f.exists()) {
f.createNewFile();
}
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/Log.java
================================================
package com.way.upgrade.utils;
public class Log {
public static final boolean DEBUG = true;
public static final boolean DATA_DEBUG = true;
public static final boolean APP_DEBUG = true;
public static final boolean DISPLAY_DEBUG = false;
public static final int DATA = 0;
public static final int DISPLAY = 1;
public static final int APP = 2;
public static final String TAG = "zhujianwen";
public static void v(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.v(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.v(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.v(tag, msg);
}
}
public static void v(String msg, int mod) {
v(TAG, msg, mod);
}
public static void d(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.d(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.d(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.d(tag, msg);
}
}
public static void d(String msg, int mod) {
d(TAG, msg, mod);
}
public static void i(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.i(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.i(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.i(tag, msg);
}
}
public static void i(String msg, int mod) {
i(TAG, msg, mod);
}
public static void w(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.w(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.w(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.w(tag, msg);
}
}
public static void w(String msg, int mod) {
w(TAG, msg, mod);
}
public static void e(String tag, String msg, int mod) {
if (!DEBUG) {
return;
}
if (mod == DATA && DATA_DEBUG) {
android.util.Log.e(tag, msg);
} else if (mod == DISPLAY && DISPLAY_DEBUG) {
android.util.Log.e(tag, msg);
} else if (mod == APP && APP_DEBUG) {
android.util.Log.e(tag, msg);
}
}
public static void e(String msg, int mod) {
e(TAG, msg, mod);
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/NetUtils.java
================================================
package com.way.upgrade.utils;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
/**
* 网络操作
*
* @author way 2013/12/6
*/
public class NetUtils {
private static final String TAG = "NetUtils";
private static final String NETTYPE_WIFI = "WIFI";
private static String multipart_form_data = "multipart/form-data";
private static String twoHyphens = "--";
private static String boundary = java.util.UUID.randomUUID().toString(); // 数据分隔
private static String lineEnd = "\r\n"; // The value is "\r\n" in Windows.
public enum NETWORK_STATUS {
STATE_WIFI, STATE_GPRS, STATE_NONE_NETWORK
}
private NetUtils() {
}
public static NETWORK_STATUS getNetworkType(Context context) {
NETWORK_STATUS ret = NETWORK_STATUS.STATE_NONE_NETWORK;
ConnectivityManager connetManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connetManager == null) {
Log.e(TAG, "isNetWorkAvailable connetManager = null", Log.APP);
return ret;
}
NetworkInfo[] infos = connetManager.getAllNetworkInfo();
if (infos == null) {
return ret;
}
for (int i = 0; i < infos.length && infos[i] != null; i++) {
if (infos[i].isConnected() && infos[i].isAvailable()) {
if (infos[i].getTypeName().equalsIgnoreCase(NETTYPE_WIFI)) {
ret = NETWORK_STATUS.STATE_WIFI;
} else {
ret = NETWORK_STATUS.STATE_GPRS;
}
break;
}
}
Log.i(TAG, "get network stype is : " + ret, Log.APP);
return ret;
}
/**
*
* @param context
* @param typeName
* ("",WIFI,MOBILE)
* @return
*/
public static boolean isNetWorkAvailable(Context context, String typeName) {
Log.i(TAG, ">>> isNetWorkAvailable context = " + context
+ "typeName = " + typeName, Log.APP);
boolean ret = false;
ConnectivityManager connetManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connetManager == null) {
Log.e(TAG, "isNetWorkAvailable connetManager = null", Log.APP);
return ret;
}
NetworkInfo[] infos = connetManager.getAllNetworkInfo();
if (infos == null) {
return ret;
}
if ((typeName == null) || (typeName.length() <= 0)) {
for (int i = 0; i < infos.length && infos[i] != null; i++) {
if (infos[i].isConnected() && infos[i].isAvailable()) {
ret = true;
break;
}
}
} else {
for (int i = 0; i < infos.length && infos[i] != null; i++) {
if (infos[i].getTypeName().equalsIgnoreCase(typeName)
&& infos[i].isConnected() && infos[i].isAvailable()) {
Log.i(TAG,
"isNetWorkAvailable name is : "
+ infos[i].getTypeName(), Log.APP);
ret = true;
break;
}
}
}
Log.i(TAG, "isNetWorkAvailable >>> result is : " + ret, Log.APP);
return ret;
}
/**
*
* @param url
* @return
* @throws IOException
*/
public static synchronized InputStream getInputStreamByGet(String url)
throws IOException {
Log.i(TAG, "<getInputStreamByGet> url:" + url, Log.APP);
HttpURLConnection httpConnection = null;
int currentSize = 0;
if (url == null) {
return null;
}
URL uri = new URL(url);
httpConnection = (HttpURLConnection) uri.openConnection();
httpConnection.setRequestProperty("User-Agent", "PacificHttpClient");
if (currentSize > 0) {
httpConnection.setRequestProperty("RANGE", "bytes=" + currentSize
+ "-");
}
// 设置超时时间
httpConnection.setConnectTimeout(10000);// 限制连接超时5秒钟
httpConnection.setReadTimeout(2 * 10000);
httpConnection.setRequestProperty("Content-type",
"text/html;charset=UTF-8");
httpConnection.setDoOutput(true);
httpConnection.setRequestMethod("GET");
httpConnection.setUseCaches(false);
int requestCode = httpConnection.getResponseCode();
if (requestCode == 200) {
InputStream in = httpConnection.getInputStream();
return in;
}
return null;
}
/**
* post方式从服务器获取json数组
*
* @return
* @throws IOException
* @throws ClientProtocolException
* @throws JSONException
*/
public static JSONArray getJSONArrayByPost(String uri)
throws ClientProtocolException, IOException, JSONException {
Log.i(TAG, "<getJSONArrayByPost> uri:" + uri, Log.APP);
StringBuilder builder = new StringBuilder();
HttpParams httpParameters = new BasicHttpParams();
// Set the default socket timeout (SO_TIMEOUT) in milliseconds which is
// the timeout for waiting for data.
HttpConnectionParams.setConnectionTimeout(httpParameters, 5000);
HttpConnectionParams.setSoTimeout(httpParameters, 10000);
HttpClient client = new DefaultHttpClient(httpParameters);
HttpPost post = new HttpPost(uri);
HttpResponse response = client.execute(post);
BufferedReader reader = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
for (String s = reader.readLine(); s != null; s = reader.readLine()) {
builder.append(s);
}
String jsonString = new String(builder.toString());
if ("{}".equals(jsonString)) {
return null;
}
Log.i(TAG, "<getJSONArrayByPost> jsonString:" + jsonString, Log.DATA);
return new JSONArray(jsonString);
}
/**
* get方式从服务器获取json数组
*
* @return
* @throws IOException
* @throws ClientProtocolException
* @throws JSONException
*/
public static JSONObject getJSONArrayByGet(String uri)
throws ClientProtocolException, IOException, JSONException {
Log.i(TAG, "<getJSONArrayByGet> uri:" + uri, Log.APP);
StringBuilder builder = new StringBuilder();
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(uri);
HttpResponse response = client.execute(get);
BufferedReader reader = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
for (String s = reader.readLine(); s != null; s = reader.readLine()) {
builder.append(s);
}
String jsonString = new String(builder.toString());
if ("{}".equals(jsonString)) {
return null;
}
Log.i(TAG, "<getJSONArrayByGet> jsonString:" + jsonString, Log.DATA);
return new JSONObject(jsonString);
}
/**
* 使用post的方式,提交表单,不包括文件上传(新服务器)
*
* @param actionUrl
* @param params
* @param files
* @return
* @throws IOException
*/
public static boolean uploadParamsByPost(String actionUrl,
Map<String, String> params) throws IOException {
Log.i(TAG, "<uploadParamsByPost> actionUrl:" + actionUrl + " params:"
+ params, Log.APP);
String BOUNDARY = java.util.UUID.randomUUID().toString();
String PREFIX = "--", LINEND = "\r\n";
String MULTIPART_FROM_DATA = "multipart/form-data";
String CHARSET = "UTF-8";
URL uri = new URL(actionUrl);
HttpURLConnection conn = (HttpURLConnection) uri.openConnection();
conn.setReadTimeout(10 * 1000);
conn.setConnectTimeout(10 * 1000);
conn.setDoInput(true);// 允许输入
conn.setDoOutput(true);// 允许输出
conn.setUseCaches(false);
conn.setRequestMethod("POST"); // Post方式
conn.setRequestProperty("connection", "keep-alive");
conn.setRequestProperty("Charsert", "UTF-8");
conn.setRequestProperty("Content-Type", MULTIPART_FROM_DATA
+ ";boundary=" + BOUNDARY);
// 首先组拼文本类型的参数
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> entry : params.entrySet()) {
sb.append(PREFIX);
sb.append(BOUNDARY);
sb.append(LINEND);
sb.append("Content-Disposition: form-data; name=\""
+ entry.getKey() + "\"" + LINEND);
sb.append("Content-Type: text/plain; charset=" + CHARSET + LINEND);
sb.append("Content-Transfer-Encoding: 8bit" + LINEND);
sb.append(LINEND);
sb.append(entry.getValue());
sb.append(LINEND);
}
DataOutputStream outStream = new DataOutputStream(
conn.getOutputStream());
outStream.write(sb.toString().getBytes());
// 请求结束标志
byte[] end_data = (PREFIX + BOUNDARY + PREFIX + LINEND).getBytes();
outStream.write(end_data);
outStream.flush();
outStream.close();
// 得到响应号
int res = conn.getResponseCode();
if (res == 200) {
return true;
}
conn.disconnect();
return false;
}
/**
* 使用post的方式,提交表单,不包括文件上传(老服务器写的代码使用这种方式)
*
* @param actionUrl
* :http://xxx/xxx.json
* @param query
* :Helpers.combinaStr("login_name=#&password=#&email=#&name=",
* listParams);
* @return
*/
public static JSONObject uploadParamsByPost(String actionUrl, String query) {
Log.i(TAG, "<uploadParamsByPost> actionUrl:" + actionUrl + " query:"
+ query, Log.APP);
try {
URL uri = new URL(actionUrl);
HttpURLConnection conn = (HttpURLConnection) uri.openConnection();
conn.setReadTimeout(10 * 1000);
conn.setDoInput(true);// 允许输入
conn.setDoOutput(true);// 允许输出
conn.setUseCaches(false);
conn.setRequestMethod("POST"); // Post方式
conn.setRequestProperty("connection", "keep-alive");
conn.setRequestProperty("Charsert", "UTF-8");
// query is your body
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");// 请求�?
// 必须设置
conn.setRequestProperty("Content-Length", query.toString()
.getBytes("UTF-8").length + "");// 注意是字节长�?
// 不是字符长度
conn.getOutputStream().write(query.toString().getBytes("UTF-8"));
// 得到响应�?
int res = conn.getResponseCode();
if (res == HttpURLConnection.HTTP_OK) {
StringBuffer stringBuffer = new StringBuffer();
String readLine;
BufferedReader responseReader;
// 处理响应流,必须与服务器响应流输出的编码�?��
responseReader = new BufferedReader(new InputStreamReader(
conn.getInputStream(), "UTF-8"));
while ((readLine = responseReader.readLine()) != null) {
stringBuffer.append(readLine).append("/n");
}
responseReader.close();
return new JSONObject(stringBuffer.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public int uploadFilesByPost(String actionUrl, String fileName, File file) {
Log.i(TAG, "<uploadFilesByPost> actionUrl:" + actionUrl + " fileName:"
+ fileName, Log.APP);
String CHARSET = "UTF-8";
// 得到响应�?
int res = 0;
try {
URL uri = new URL(actionUrl);
HttpURLConnection conn = (HttpURLConnection) uri.openConnection();
conn.setReadTimeout(10 * 1000);
conn.setDoInput(true);// 允许输入
conn.setDoOutput(true);// 允许输出
conn.setUseCaches(false);
conn.setRequestMethod("POST"); // Post方式
conn.setRequestProperty("connection", "keep-alive");
conn.setRequestProperty("Charsert", "UTF-8");
conn.setRequestProperty("Content-Type", multipart_form_data
+ ";boundary=" + boundary);
// 输出�?
DataOutputStream outStream = new DataOutputStream(
conn.getOutputStream());
// 发�?文件数据
if (file != null) {
StringBuilder sb1 = new StringBuilder();
sb1.append(twoHyphens);
sb1.append(boundary);
sb1.append(lineEnd);
// actionData 是自己定义的
sb1.append("Content-Disposition: form-data; name=\"actionData\"; filename=\""
+ fileName + "\"" + lineEnd);
sb1.append("Content-Type: application/octet-stream; charset="
+ CHARSET + lineEnd);
sb1.append(lineEnd);
outStream.write(sb1.toString().getBytes());
InputStream is = new FileInputStream(file);
byte[] buffer = new byte[1024];
int len = 0;
while ((len = is.read(buffer)) != -1) {
outStream.write(buffer, 0, len);
}
is.close();
outStream.write(lineEnd.getBytes());
}
// 请求结束标志
byte[] end_data = (twoHyphens + boundary + twoHyphens + lineEnd)
.getBytes();
outStream.write(end_data);
outStream.flush();
res = conn.getResponseCode();
outStream.close();
conn.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
return res;
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/Preferences.java
================================================
package com.way.upgrade.utils;
import android.content.Context;
import android.content.SharedPreferences;
import com.way.upgrade.bean.UpgradeInfo;
/**
*
* @author way 2014/11/3
*/
public class Preferences {
public static final String PREFERENCES_NAME = "com_upgrade_manager";
public static final String KEY_DOWNLOAD_ID = "downloadId";
protected static final String KEY_APPKEY = "key";
protected static final String KEY_VERSION = "version";
protected static final String KEY_URL = "url";
protected static final String KEY_DESCRIPTION = "description";
protected static final String KEY_DOWNLOAD_SIZE = "downloadSize";
protected static final String KEY_DOWNLOAD_PATH = "download_path";
protected static final String KEY_DOWNLOAD_STATUS = "download_status";
public static void setDownloadId(Context context, long downloadId) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.putLong(KEY_DOWNLOAD_ID, downloadId);
editor.commit();
}
public static long getDownloadId(Context context) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
return pref.getLong(KEY_DOWNLOAD_ID, -1);
}
public static void setUpgradeInfo(Context context, UpgradeInfo upgrade) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.putString(KEY_APPKEY, upgrade.getKey());
editor.putString(KEY_VERSION, upgrade.getVersion());
editor.putString(KEY_URL, upgrade.getUrl());
editor.putString(KEY_DESCRIPTION, upgrade.getDescription());
editor.putLong(KEY_DOWNLOAD_SIZE, upgrade.getDownloadSize());
editor.commit();
}
public static UpgradeInfo getUpgradeInfo(Context context) {
UpgradeInfo upgradeInfo = new UpgradeInfo();
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
upgradeInfo.setKey(pref.getString(KEY_APPKEY, ""));
upgradeInfo.setVersion(pref.getString(KEY_VERSION, ""));
upgradeInfo.setUrl(pref.getString(KEY_URL, ""));
upgradeInfo.setDescription(pref.getString(KEY_DESCRIPTION, ""));
upgradeInfo.setDownloadSize(pref.getLong(KEY_DOWNLOAD_SIZE, -1));
return upgradeInfo;
}
public static void setDownloadPath(Context context, String downloadPath) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.putString(KEY_DOWNLOAD_PATH, downloadPath);
editor.commit();
}
public static String getDownloadPath(Context context) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
return pref.getString(KEY_DOWNLOAD_PATH, "");
}
public static void removeAll(Context context) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.clear();
editor.commit();
}
public static void setDownloadStatus(Context context, int downloadId) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
SharedPreferences.Editor editor = pref.edit();
editor.putInt(KEY_DOWNLOAD_STATUS, downloadId);
editor.commit();
}
public static int getDownloadStatus(Context context) {
SharedPreferences pref = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_APPEND);
return pref.getInt(KEY_DOWNLOAD_STATUS, -1);
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/Utils.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils;
import java.io.Closeable;
import java.io.InterruptedIOException;
import java.util.List;
import android.database.Cursor;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.text.TextUtils;
public class Utils {
private static final String TAG = "Utils";
private static final String DEBUG_TAG = "GalleryDebug";
private static final long POLY64REV = 0x95AC9329AC4BC9B5L;
private static final long INITIALCRC = 0xFFFFFFFFFFFFFFFFL;
private static long[] sCrcTable = new long[256];
private static final boolean IS_DEBUG_BUILD = Build.TYPE.equals("eng")
|| Build.TYPE.equals("userdebug");
private static final String MASK_STRING = "********************************";
// Throws AssertionError if the input is false.
public static void assertTrue(boolean cond) {
if (!cond) {
throw new AssertionError();
}
}
// Throws AssertionError with the message. We had a method having the form
// assertTrue(boolean cond, String message, Object ... args);
// However a call to that method will cause memory allocation even if the
// condition is false (due to autoboxing generated by "Object ... args"),
// so we don't use that anymore.
public static void fail(String message, Object... args) {
throw new AssertionError(args.length == 0 ? message : String.format(
message, args));
}
// Throws NullPointerException if the input is null.
public static <T> T checkNotNull(T object) {
if (object == null)
throw new NullPointerException();
return object;
}
// Returns true if two input Object are both null or equal
// to each other.
public static boolean equals(Object a, Object b) {
return (a == b) || (a == null ? false : a.equals(b));
}
// Returns the next power of two.
// Returns the input if it is already power of 2.
// Throws IllegalArgumentException if the input is <= 0 or
// the answer overflows.
public static int nextPowerOf2(int n) {
if (n <= 0 || n > (1 << 30))
throw new IllegalArgumentException("n is invalid: " + n);
n -= 1;
n |= n >> 16;
n |= n >> 8;
n |= n >> 4;
n |= n >> 2;
n |= n >> 1;
return n + 1;
}
// Returns the previous power of two.
// Returns the input if it is already power of 2.
// Throws IllegalArgumentException if the input is <= 0
public static int prevPowerOf2(int n) {
if (n <= 0)
throw new IllegalArgumentException();
return Integer.highestOneBit(n);
}
// Returns the input value x clamped to the range [min, max].
public static int clamp(int x, int min, int max) {
if (x > max)
return max;
if (x < min)
return min;
return x;
}
// Returns the input value x clamped to the range [min, max].
public static float clamp(float x, float min, float max) {
if (x > max)
return max;
if (x < min)
return min;
return x;
}
// Returns the input value x clamped to the range [min, max].
public static long clamp(long x, long min, long max) {
if (x > max)
return max;
if (x < min)
return min;
return x;
}
public static boolean isOpaque(int color) {
return color >>> 24 == 0xFF;
}
public static void swap(int[] array, int i, int j) {
int temp = array[i];
array[i] = array[j];
array[j] = temp;
}
/**
* A function thats returns a 64-bit crc for string
*
* @param in
* input string
* @return a 64-bit crc value
*/
public static final long crc64Long(String in) {
if (in == null || in.length() == 0) {
return 0;
}
return crc64Long(getBytes(in));
}
static {
// http://bioinf.cs.ucl.ac.uk/downloads/crc64/crc64.c
long part;
for (int i = 0; i < 256; i++) {
part = i;
for (int j = 0; j < 8; j++) {
long x = ((int) part & 1) != 0 ? POLY64REV : 0;
part = (part >> 1) ^ x;
}
sCrcTable[i] = part;
}
}
public static final long crc64Long(byte[] buffer) {
long crc = INITIALCRC;
for (int k = 0, n = buffer.length; k < n; ++k) {
crc = sCrcTable[(((int) crc) ^ buffer[k]) & 0xff] ^ (crc >> 8);
}
return crc;
}
public static byte[] getBytes(String in) {
byte[] result = new byte[in.length() * 2];
int output = 0;
for (char ch : in.toCharArray()) {
result[output++] = (byte) (ch & 0xFF);
result[output++] = (byte) (ch >> 8);
}
return result;
}
public static void closeSilently(Closeable c) {
if (c == null)
return;
try {
c.close();
} catch (Throwable t) {
Log.w(TAG, "close fail", Log.APP);
}
}
public static int compare(long a, long b) {
return a < b ? -1 : a == b ? 0 : 1;
}
public static int ceilLog2(float value) {
int i;
for (i = 0; i < 31; i++) {
if ((1 << i) >= value)
break;
}
return i;
}
public static int floorLog2(float value) {
int i;
for (i = 0; i < 31; i++) {
if ((1 << i) > value)
break;
}
return i - 1;
}
public static void closeSilently(ParcelFileDescriptor fd) {
try {
if (fd != null)
fd.close();
} catch (Throwable t) {
Log.w(TAG, "fail to close", Log.APP);
}
}
public static void closeSilently(Cursor cursor) {
try {
if (cursor != null)
cursor.close();
} catch (Throwable t) {
Log.w(TAG, "fail to close", Log.APP);
}
}
public static float interpolateAngle(float source, float target,
float progress) {
// interpolate the angle from source to target
// We make the difference in the range of [-179, 180], this is the
// shortest path to change source to target.
float diff = target - source;
if (diff < 0)
diff += 360f;
if (diff > 180)
diff -= 360f;
float result = source + diff * progress;
return result < 0 ? result + 360f : result;
}
public static float interpolateScale(float source, float target,
float progress) {
return source + progress * (target - source);
}
public static String ensureNotNull(String value) {
return value == null ? "" : value;
}
public static String ensureNotNull(Object obj) {
return obj == null ? "" : obj.toString();
}
public static float parseFloatSafely(String content, float defaultValue) {
if (content == null)
return defaultValue;
try {
return Float.parseFloat(content);
} catch (NumberFormatException e) {
return defaultValue;
}
}
public static int parseIntSafely(String content, int defaultValue) {
if (content == null)
return defaultValue;
try {
return Integer.parseInt(content);
} catch (NumberFormatException e) {
return defaultValue;
}
}
public static boolean isNullOrEmpty(String exifMake) {
return TextUtils.isEmpty(exifMake);
}
public static void waitWithoutInterrupt(Object object) {
try {
object.wait();
} catch (InterruptedException e) {
Log.w(TAG, "unexpected interrupt: " + object, Log.APP);
}
}
public static boolean handleInterrruptedException(Throwable e) {
// A helper to deal with the interrupt exception
// If an interrupt detected, we will setup the bit again.
if (e instanceof InterruptedIOException
|| e instanceof InterruptedException) {
Thread.currentThread().interrupt();
return true;
}
return false;
}
/**
* @return String with special XML characters escaped.
*/
public static String escapeXml(String s) {
StringBuilder sb = new StringBuilder();
for (int i = 0, len = s.length(); i < len; ++i) {
char c = s.charAt(i);
switch (c) {
case '<':
sb.append("<");
break;
case '>':
sb.append(">");
break;
case '\"':
sb.append(""");
break;
case '\'':
sb.append("'");
break;
case '&':
sb.append("&");
break;
default:
sb.append(c);
}
}
return sb.toString();
}
public static String[] copyOf(String[] source, int newSize) {
String[] result = new String[newSize];
newSize = Math.min(source.length, newSize);
System.arraycopy(source, 0, result, 0, newSize);
return result;
}
// Mask information for debugging only. It returns
// <code>info.toString()</code> directly
// for debugging build (i.e., 'eng' and 'userdebug') and returns a mask
// ("****")
// in release build to protect the information (e.g. for privacy issue).
public static String maskDebugInfo(Object info) {
if (info == null)
return null;
String s = info.toString();
int length = Math.min(s.length(), MASK_STRING.length());
return IS_DEBUG_BUILD ? s : MASK_STRING.substring(0, length);
}
// This method should be ONLY used for debugging.
public static void debug(String message, Object... args) {
Log.v(DEBUG_TAG, String.format(message, args), Log.APP);
}
/**
* combina the url. usr the param list repleace the [#] in the url.
*
* @param str
* @param params
* @return
* @exception RuntimeException
* May throw the runtime exception while the method was done.
* @author MichaelHuang
*/
public static String combinaStr(String str, List<String> params)
throws RuntimeException {
try {
String[] strs = str.split("[#]");
String newStr = "";
for (int i = 0; i < strs.length; i++) {
String itemUrl = strs[i];
newStr += itemUrl;
if (i >= 0 && i < params.size())
newStr += params.get(i);
}
Log.i(TAG, "<combinaStr> newStr:" + newStr, Log.DATA);
return newStr;
} catch (Exception e) {
throw new RuntimeException();
}
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/Future.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils.thread;
// This Future differs from the java.util.concurrent.Future in these aspects:
//
// - Once cancel() is called, isCancelled() always returns true. It is a sticky
// flag used to communicate to the implementation. The implmentation may
// ignore that flag. Regardless whether the Future is cancelled, a return
// value will be provided to get(). The implementation may choose to return
// null if it finds the Future is cancelled.
//
// - get() does not throw exceptions.
//
public interface Future<T> {
public void cancel();
public boolean isCancelled();
public boolean isDone();
public T get();
public void waitDone();
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/FutureListener.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils.thread;
/**
*
* @author way
*
* @param <T>
*/
public interface FutureListener<T> {
public void onFutureDone(Future<T> future);
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/PriorityThreadFactory.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils.thread;
import android.os.Process;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
/**
* A thread factory that creates threads with a given thread priority.
*/
public class PriorityThreadFactory implements ThreadFactory {
private final int mPriority;
private final AtomicInteger mNumber = new AtomicInteger();
private final String mName;
public PriorityThreadFactory(String name, int priority) {
mName = name;
mPriority = priority;
}
@Override
public Thread newThread(Runnable r) {
return new Thread(r, mName + '-' + mNumber.getAndIncrement()) {
@Override
public void run() {
Process.setThreadPriority(mPriority);
super.run();
}
};
}
}
================================================
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/ThreadPool.java
================================================
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.way.upgrade.utils.thread;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import com.way.upgrade.utils.Log;
/**
*
* @author way
*
*/
public class ThreadPool {
private static final String TAG = "ThreadPool";
private static final int CORE_POOL_SIZE = 4;
private static final int MAX_POOL_SIZE = 8;
private static final int KEEP_ALIVE_TIME = 20; // 10 seconds
// Resource type
public static final int MODE_NONE = 0;
public static final int MODE_CPU = 1;
public static final int MODE_NETWORK = 2;
public static final JobContext JOB_CONTEXT_STUB = new JobContextStub();
// M: in order to take full advantage of MT6589 CPU Core, change cpuCounter
// to 4 from 2
ResourceCounter mCpuCounter = new ResourceCounter(4);
ResourceCounter mNetworkCounter = new ResourceCounter(6);
// A Job is like a Callable, but it has an addition JobContext parameter.
public interface Job<T> {
public T run(JobContext jc);
}
public interface JobContext {
boolean isCancelled();
void setCancelListener(CancelListener listener);
boolean setMode(int mode);
}
private static class JobContextStub implements JobContext {
@Override
public boolean isCancelled() {
return false;
}
@Override
public void setCancelListener(CancelListener listener) {
}
@Override
public boolean setMode(int mode) {
return true;
}
}
public interface CancelListener {
public void onCancel();
}
private static class ResourceCounter {
public int value;
public ResourceCounter(int v) {
value = v;
}
}
private final Executor mExecutor;
public ThreadPool() {
this(CORE_POOL_SIZE, MAX_POOL_SIZE);
}
public ThreadPool(int initPoolSize, int maxPoolSize) {
mExecutor = new ThreadPoolExecutor(initPoolSize, maxPoolSize,
KEEP_ALIVE_TIME, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(), new PriorityThreadFactory(
"thread-pool",
android.os.Process.THREAD_PRIORITY_BACKGROUND));
}
// Submit a job to the thread pool. The listener will be called when the
// job is finished (or cancelled).
public <T> Future<T> submit(Job<T> job, FutureListener<T> listener,
int threadMode) {
Log.i(TAG, "<submit> Job:" + job, Log.APP);
Worker<T> w = new Worker<T>(job, listener, threadMode);
mExecutor.execute(w);
return w;
}
public <T> Future<T> submit(Job<T> job) {
return submit(job, null, MODE_CPU);
}
private class Worker<T> implements Runnable, Future<T>, JobContext {
private static final String TAG = "Worker";
private Job<T> mJob;
private FutureListener<T> mListener;
private CancelListener mCancelListener;
private ResourceCounter mWaitOnResource;
private volatile boolean mIsCancelled;
private boolean mIsDone;
private T mResult;
private int mMode;
private int mTargetMode;
public Worker(Job<T> job, FutureListener<T> listener, int threadMode) {
mJob = job;
mListener = listener;
mTargetMode = threadMode;
}
// This is called by a thread in the thread pool.
@Override
public void run() {
Log.i(TAG, "<run> start", Log.APP);
T result = null;
// A job is in CPU mode by default. setMode returns false
// if the job is cancelled.
if (setMode(mTargetMode)) {
try {
result = mJob.run(this);
} catch (Throwable ex) {
}
}
synchronized (this) {
setMode(MODE_NONE);
mResult = result;
mIsDone = true;
notifyAll();
}
if (mListener != null)
mListener.onFutureDone(this);
Log.i(TAG, "<run> end", Log.APP);
}
// Below are the methods for Future.
@Override
public synchronized void cancel() {
if (mIsCancelled)
return;
mIsCancelled = true;
if (mWaitOnResource != null) {
synchronized (mWaitOnResource) {
mWaitOnResource.notifyAll();
}
}
if (mCancelListener != null) {
mCancelListener.onCancel();
}
}
@Override
public boolean isCancelled() {
return mIsCancelled;
}
@Override
public synchronized boolean isDone() {
return mIsDone;
}
@Override
public synchronized T get() {
while (!mIsDone) {
try {
wait();
} catch (Exception ex) {
}
}
return mResult;
}
@Override
public void waitDone() {
get();
}
// Below are the methods for JobContext (only called from the
// thread running the job)
@Override
public synchronized void setCancelListener(CancelListener listener) {
mCancelListener = listener;
if (mIsCancelled && mCancelListener != null) {
mCancelListener.onCancel();
}
}
@Override
public boolean setMode(int mode) {
// Release old resource
Log.i(TAG, "<setMode> start mode:" + mode, Log.APP);
ResourceCounter rc = modeToCounter(mMode);
if (rc != null)
releaseResource(rc);
mMode = MODE_NONE;
// Acquire new resource
rc = modeToCounter(mode);
if (rc != null) {
if (!acquireResource(rc)) {
return false;
}
mMode = mode;
}
Log.i(TAG, "<setMode> end", Log.APP);
return true;
}
private ResourceCounter modeToCounter(int mode) {
if (mode == MODE_CPU) {
Log.i(TAG, "<modeToCounter> MODE_CPU", Log.APP);
return mCpuCounter;
} else if (mode == MODE_NETWORK) {
Log.i(TAG, "<modeToCounter> MODE_NETWORK", Log.APP);
return mNetworkCounter;
} else {
return null;
}
}
private boolean acquireResource(ResourceCounter counter) {
Log.i(TAG, "<acquireResource> start", Log.APP);
while (true) {
synchronized (this) {
if (mIsCancelled) {
mWaitOnResource = null;
return false;
}
mWaitOnResource = counter;
}
synchronized (counter) {
if (counter.value > 0) {
counter.value--;
break;
} else {
try {
counter.wait();
} catch (InterruptedException ex) {
// ignore.
}
}
}
}
synchronized (this) {
mWaitOnResource = null;
}
Log.i(TAG, "<acquireResource> end", Log.APP);
return true;
}
private void releaseResource(ResourceCounter counter) {
Log.i(TAG, "<releaseResource> start", Log.APP);
synchronized (counter) {
counter.value++;
counter.notifyAll();
}
Log.i(TAG, "<releaseResource> end", Log.APP);
}
}
}
================================================
FILE: WayHoo/jni/Android.mk
================================================
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libfrostedGlass
LOCAL_SRC_FILES := frostedGlass.c bitmapPort.c imageProcess.c
LOCAL_LDLIBS := -llog -ljnigraphics
#LOCAL_SHARED_LIBRARIES += \
#liblog libjnigraphics
include $(BUILD_SHARED_LIBRARY)
================================================
FILE: WayHoo/jni/Application.mk
================================================
APP_ABI := armeabi armeabi-v7a
APP_PLATFORM:= android-21
APP_OPTIM := release
================================================
FILE: WayHoo/jni/bitmapPort.c
================================================
#include <string.h>
#include <jni.h>
#include <malloc.h>
#include <android/bitmap.h>
#include "constants.h"
#include "bitmapPort.h"
static AndroidBitmapInfo imageInfo;
static uint8_t* imageData;
//
int allocateMemory() {
int ret = 0;
size_t size = 4*imageInfo.width*imageInfo.height;//color-int
imageData = (uint8_t*)malloc(size);
if (imageData == NULL) {
ret = -1;
}
return ret;
}
void freeMemory(){
if(imageData != NULL){
free(imageData);
imageData = NULL;
}
}
void getUnifiedImageData(jobject bitmap, JNIEnv *env) {
if (imageData == NULL)
return;
switch (imageInfo.format) {
case ANDROID_BITMAP_FORMAT_RGBA_8888:
LOGE("get ARGB 8888");
getARGB8888Data(bitmap, env);
break;
case ANDROID_BITMAP_FORMAT_RGBA_4444:
LOGE("get ARGB 4444");
getARGB4444Data(bitmap, env);
break;
case ANDROID_BITMAP_FORMAT_RGB_565:
LOGE("get rgb 565");
getRGB565Data(bitmap, env);
break;
case ANDROID_BITMAP_FORMAT_A_8:
LOGE("get alpha 8");
getAlpha8Data(bitmap, env);
break;
default:
break;
}
}
void getARGB8888Data(jobject bitmap, JNIEnv *env)
{
int ret, row, col;
void *pixelscolor;
if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixelscolor)) < 0) {
LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret);
}
uint8_t *pData = imageData;
uint32_t colorValue = 0;
for (row = 0; row < imageInfo.height; row++) {
uint32_t * line = (uint32_t *) pixelscolor;
for (col = 0; col < imageInfo.width; col++) {
colorValue = line[col];
*pData++ = colorValue & ARGB8888_MASK_BLUE;
*pData++ = (colorValue & ARGB8888_MASK_GREEN) >> 8;
*pData++ = (colorValue & ARGB8888_MASK_RED) >> 16;
*pData++ = (colorValue & ARGB8888_MASK_ALPHA)>>24;
}
//stride
pixelscolor = (uint8_t*)pixelscolor + imageInfo.stride;
}
AndroidBitmap_unlockPixels(env, bitmap);
}
void getARGB4444Data(jobject bitmap, JNIEnv *env)
{
int ret, row, col;
void *pixelscolor;
if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixelscolor)) < 0) {
LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret);
}
uint8_t *pData = imageData;
for (row = 0; row < imageInfo.height; row++) {
uint16_t *line = (uint16_t *) pixelscolor;
for (col = 0; col < imageInfo.width; col++) {
//*pData++ = (line[col] & ARGB4444_MASK_RED) << 4;
//*pData++ = (line[col] & ARGB4444_MASK_GREEN) << 4;
//*pData++ = (line[col] & ARGB4444_MASK_BLUE) << 4;
}
pixelscolor = (uint8_t*)pixelscolor + imageInfo.stride;
}
AndroidBitmap_unlockPixels(env, bitmap);
}
void getRGB565Data(jobject bitmap, JNIEnv *env)
{
int ret, row, col;
void *pixelscolor;
if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixelscolor)) < 0) {
LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret);
}
uint8_t *pData = imageData;
for (row = 0; row < imageInfo.height; row++) {
uint16_t *line = (uint16_t *) pixelscolor;
for (col = 0; col < imageInfo.width; col++) {
*pData++ = ((line[col] & RGB565_MASK_RED) >> 11) << 3;
*pData++ = ((line[col] & RGB565_MASK_GREEN) >> 5) << 2;
*pData++ = (line[col] & RGB565_MASK_BLUE) << 3;
}
pixelscolor = (uint8_t*)pixelscolor + imageInfo.stride;
}
AndroidBitmap_unlockPixels(env, bitmap);
}
void getAlpha8Data(jobject bitmap, JNIEnv *env)
{
int ret, row, col;
void *pixelscolor;
if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixelscolor)) < 0) {
LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret);
}
uint8_t *pData = imageData;
for (row = 0; row < imageInfo.height; row++) {
uint8_t *line = (uint8_t *) pixelscolor;
for (col = 0; col < imageInfo.width; col++) {
*pData++ = line[col];
*pData++ = line[col];
*pData++ = line[col];
}
pixelscolor = (uint8_t*)pixelscolor + imageInfo.stride;
}
AndroidBitmap_unlockPixels(env, bitmap);
}
void setUnifiedImageData(jobject bitmap, JNIEnv *env)
{
switch (imageInfo.format) {
case ANDROID_BITMAP_FORMAT_RGBA_8888:
LOGE("set ARGB 8888");
setARGB8888Data(bitmap, env);
break;
case ANDROID_BITMAP_FORMAT_RGBA_4444:
LOGE("set ARGB 4444");
setARGB4444Data(bitmap, env);
break;
case ANDROID_BITMAP_FORMAT_RGB_565:
LOGE("set rgb 565");
setRGB565Data(bitmap, env);
break;
case ANDROID_BITMAP_FORMAT_A_8:
LOGE("set alpha 8");
setAlpha8Data(bitmap, env);
break;
default:
break;
}
}
void setARGB8888Data(jobject bitmap, JNIEnv *env)
{
int ret, row, col;
uint32_t red, green, blue, alpha;
void *pixelscolor;
if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixelscolor)) < 0) {
LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret);
}
uint8_t *pData = imageData;
for (row = 0; row < imageInfo.height; row++) {
uint32_t *line = (uint32_t *) pixelscolor;
for (col = 0; col < imageInfo.width; col++) {
blue = *pData++;
green = *pData++;
red = *pData++;
alpha = *pData++;
line[col] = ((alpha<<24) & ARGB8888_MASK_ALPHA)//(line[col] & ARGB8888_MASK_ALPHA)
| ((red << 16) & ARGB8888_MASK_RED)
| ((green << 8) & ARGB8888_MASK_GREEN)
| (blue & ARGB8888_MASK_BLUE);
}
pixelscolor = (uint8_t*)pixelscolor + imageInfo.stride;
}
AndroidBitmap_unlockPixels(env, bitmap);
}
void setARGB4444Data(jobject bitmap, JNIEnv *env)
{}
void setRGB565Data(jobject bitmap, JNIEnv *env)
{
int ret, row, col;
uint16_t red, green, blue;
void *pixelscolor;
if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixelscolor)) < 0) {
LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret);
}
uint8_t *pData = imageData;
for (row = 0; row < imageInfo.height; row++) {
uint16_t *line = (uint16_t *) pixelscolor;
for (col = 0; col < imageInfo.width; col++) {
red = *pData++;
green = *pData++;
blue = *pData++;
line[col] = ((red << 8) & RGB565_MASK_RED)
| ((green << 3) & RGB565_MASK_GREEN)
| (blue >> 3);
}
pixelscolor = (uint8_t*)pixelscolor + imageInfo.stride;
}
AndroidBitmap_unlockPixels(env, bitmap);
LOGE("set RGB 565 Data finished");
}
void setAlpha8Data(jobject bitmap, JNIEnv *env)
{}
//warp
int AndroidBitmap_getInfo_warp(JNIEnv* env, jobject jbitmap)
{
return AndroidBitmap_getInfo(env, jbitmap, &imageInfo);
}
void blur(){
gaussBlurProcess(imageData, imageInfo.width, imageInfo.height);
}
void logBitmapPort(){
LOGI("color image :: width is %d; height is %d; stride is %d; format is %d;flags is%d",
imageInfo.width,imageInfo.height,imageInfo.stride,imageInfo.format,imageInfo.flags);
}
void clearColorPort(int color){
clearColorProcess(imageData, imageInfo.width, imageInfo.height, color);
}
void boxBlurPort(int radius){
boxBlurProcess(imageData, imageInfo.width, imageInfo.height, imageInfo.stride, radius);
}
void stackBlurPort(int radius){
stackBlurProcess(imageData, imageInfo.width, imageInfo.height, imageInfo.stride, radius);
}
void oilPaintPort(int radius){
oilPaintProcess(imageData, imageInfo.width, imageInfo.height, imageInfo.stride, radius);
}
void colorWaterPaintPort(int radius){
colorWaterPaint(imageData, imageInfo.width, imageInfo.height, imageInfo.stride, radius);
}
================================================
FILE: WayHoo/jni/bitmapPort.h
================================================
#include <string.h>
#include <jni.h>
#include <malloc.h>
#include <android/bitmap.h>
#include "constants.h"
#ifndef _BITMAP_PORT_H_
#define _BITMAP_PORT_H_
//declare
int allocateMemory();
void getUnifiedImageData(jobject bitmap, JNIEnv *env);
void getARGB8888Data(jobject bitmap, JNIEnv *env);
void getARGB4444Data(jobject bitmap, JNIEnv *env);
void getRGB565Data(jobject bitmap, JNIEnv *env);
void getAlpha8Data(jobject bitmap, JNIEnv *env);
void setUnifiedImageData(jobject bitmap, JNIEnv *env);
void setARGB8888Data(jobject bitmap, JNIEnv *env);
void setARGB4444Data(jobject bitmap, JNIEnv *env);
void setRGB565Data(jobject bitmap, JNIEnv *env);
void setAlpha8Data(jobject bitmap, JNIEnv *env);
void blurPort();
void logBitmapPort();
void clearColorPort(int color);
void boxBlurPort(int radius);
void stackBlurPort(int radius);
#endif
================================================
FILE: WayHoo/jni/com_way_util_blur_jni_FrostedGlassUtil.h
================================================
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_way_util_blur_jni_FrostedGlassUtil */
#ifndef _Included_com_way_util_blur_jni_FrostedGlassUtil
#define _Included_com_way_util_blur_jni_FrostedGlassUtil
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_way_util_blur_jni_FrostedGlassUtil
* Method: boxBlur
* Signature: (Landroid/graphics/Bitmap;I)V
*/
JNIEXPORT void JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_boxBlur
(JNIEnv *, jobject, jobject, jint);
/*
* Class: com_way_util_blur_jni_FrostedGlassUtil
* Method: stackBlur
* Signature: (Landroid/graphics/Bitmap;I)V
*/
JNIEXPORT void JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_stackBlur
(JNIEnv *, jobject, jobject, jint);
/*
* Class: com_way_util_blur_jni_FrostedGlassUtil
* Method: oilPaint
* Signature: (Landroid/graphics/Bitmap;I)V
*/
JNIEXPORT void JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_oilPaint
(JNIEnv *, jobject, jobject, jint);
/*
* Class: com_way_util_blur_jni_FrostedGlassUtil
* Method: colorWaterPaint
* Signature: (Landroid/graphics/Bitmap;I)V
*/
JNIEXPORT void JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_colorWaterPaint
(JNIEnv *, jobject, jobject, jint);
#ifdef __cplusplus
}
#endif
#endif
================================================
FILE: WayHoo/jni/constants.h
================================================
#ifndef _CONSTANTS_H_
#define _CONSTANTS_H_
#include <jni.h>
#include <android/log.h>
#include <stdlib.h>
#include "com_way_util_blur_jni_FrostedGlassUtil.h"
#define RGB565_MASK_RED 0xF800
#define RGB565_MASK_GREEN 0x07E0
#define RGB565_MASK_BLUE 0x001F
#define ARGB8888_MASK_ALPHA 0xFF000000
#define ARGB8888_MASK_RED 0x00FF0000
#define ARGB8888_MASK_GREEN 0x0000FF00
#define ARGB8888_MASK_BLUE 0x000000FF
#define ARGB4444_MASK_RED 0x0F00;
#define ARGB4444_MASK_GREEN 0x00F0;
#define ARGB4444_MASK_BLUE 0x000F;
#define ARGB8888_2_COLOR(a,r,g,b) (((a)<<24)|((r)<<16)|((g)<<8)|(b))
#define LOG_TAG "FrostedGlass"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
#endif
================================================
FILE: WayHoo/jni/frostedGlass.c
================================================
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <string.h>
#include <jni.h>
#include <malloc.h>
#include <android/bitmap.h>
#include "constants.h"
#include "bitmapPort.h"
//#include "ImageProcessor.h"
//#include "Lomo.h"
/* This is a trivial JNI example where we use a native method
* to return a new VM String. See the corresponding Java source
* file located at:
*
* apps/samples/hello-jni/project/src/com/example/hellojni/HelloJni.java
*/
JNIEXPORT void JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_boxBlur(JNIEnv *env, jclass obj, jobject srcBitmap, jint radius)
{
void* pixelscolor;
int ret, row, col;
if ((ret = AndroidBitmap_getInfo_warp(env, srcBitmap)) < 0) {
LOGE("AndroidBitmap_getInfo() failed ! error=%d", ret);
return;
}
logBitmapPort();
if (-1 == allocateMemory()) {
LOGE("allocate memory failed !");
return;
}
getUnifiedImageData(srcBitmap, env);
LOGE("get unified image data ");
boxBlurPort(radius);
LOGE("conver image data");
setUnifiedImageData(srcBitmap, env);
LOGE("set unified image data");
freeMemory();
}
JNIEXPORT void JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_stackBlur(JNIEnv *env, jclass obj, jobject srcBitmap, jint radius)
{
void* pixelscolor;
int ret, row, col;
if ((ret = AndroidBitmap_getInfo_warp(env, srcBitmap)) < 0) {
LOGE("AndroidBitmap_getInfo() failed ! error=%d", ret);
return;
}
logBitmapPort();
if (-1 == allocateMemory()) {
LOGE("allocate memory failed !");
return;
}
getUnifiedImageData(srcBitmap, env);
LOGE("get unified image data ");
stackBlurPort(radius);
LOGE("conver image data");
setUnifiedImageData(srcBitmap, env);
LOGE("set unified image data");
freeMemory();
}
JNIEXPORT void JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_oilPaint(JNIEnv *env, jclass obj, jobject srcBitmap, jint radius)
{
void* pixelscolor;
int ret, row, col;
if ((ret = AndroidBitmap_getInfo_warp(env, srcBitmap)) < 0) {
LOGE("AndroidBitmap_getInfo() failed ! error=%d", ret);
return;
}
logBitmapPort();
if (-1 == allocateMemory()) {
LOGE("allocate memory failed !");
return;
}
getUnifiedImageData(srcBitmap, env);
LOGE("get unified image data ");
oilPaintPort(radius);
LOGE("conver image data"
gitextract_c4ix2knx/
├── .gitignore
├── LICENSE
├── README.md
├── Upgrade-lib/
│ ├── .settings/
│ │ └── org.eclipse.jdt.core.prefs
│ ├── AndroidManifest.xml
│ ├── proguard-project.txt
│ ├── project.properties
│ └── src/
│ └── com/
│ └── way/
│ └── upgrade/
│ ├── .MainActivity.java.swp
│ ├── MainActivity.java
│ ├── bean/
│ │ └── UpgradeInfo.java
│ ├── core/
│ │ ├── CheckNewVersionListener.java
│ │ ├── UpgradeInterface.java
│ │ └── UpgradeManager.java
│ ├── job/
│ │ ├── AbstractCheckNewVersionJob.java
│ │ ├── CheckNewVersionJobWithoutClientUrl.java
│ │ └── DownloadNewVersionJob.java
│ ├── locale/
│ │ ├── LocaleChina.java
│ │ ├── LocaleChinaTW.java
│ │ ├── LocaleChinese.java
│ │ ├── LocaleEnglish.java
│ │ ├── LocaleHandler.java
│ │ └── LocaleUS.java
│ ├── parser/
│ │ └── json/
│ │ ├── AbstractJsonParsing.java
│ │ └── FirVersionJsonParsing.java
│ ├── receiver/
│ │ └── DownloadCompleteReveiver.java
│ └── utils/
│ ├── Constants.java
│ ├── ContextUtils.java
│ ├── FileUtils.java
│ ├── Log.java
│ ├── NetUtils.java
│ ├── Preferences.java
│ ├── Utils.java
│ └── thread/
│ ├── Future.java
│ ├── FutureListener.java
│ ├── PriorityThreadFactory.java
│ └── ThreadPool.java
└── WayHoo/
├── .settings/
│ └── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── Upgrade-lib/
│ └── com/
│ └── way/
│ └── upgrade/
│ ├── .MainActivity.java.swp
│ ├── MainActivity.java
│ ├── bean/
│ │ └── UpgradeInfo.java
│ ├── core/
│ │ ├── CheckNewVersionListener.java
│ │ ├── UpgradeInterface.java
│ │ └── UpgradeManager.java
│ ├── job/
│ │ ├── AbstractCheckNewVersionJob.java
│ │ ├── CheckNewVersionJobWithoutClientUrl.java
│ │ └── DownloadNewVersionJob.java
│ ├── locale/
│ │ ├── LocaleChina.java
│ │ ├── LocaleChinaTW.java
│ │ ├── LocaleChinese.java
│ │ ├── LocaleEnglish.java
│ │ ├── LocaleHandler.java
│ │ └── LocaleUS.java
│ ├── parser/
│ │ └── json/
│ │ ├── AbstractJsonParsing.java
│ │ └── FirVersionJsonParsing.java
│ ├── receiver/
│ │ └── DownloadCompleteReveiver.java
│ └── utils/
│ ├── Constants.java
│ ├── ContextUtils.java
│ ├── FileUtils.java
│ ├── Log.java
│ ├── NetUtils.java
│ ├── Preferences.java
│ ├── Utils.java
│ └── thread/
│ ├── Future.java
│ ├── FutureListener.java
│ ├── PriorityThreadFactory.java
│ └── ThreadPool.java
├── jni/
│ ├── Android.mk
│ ├── Application.mk
│ ├── bitmapPort.c
│ ├── bitmapPort.h
│ ├── com_way_util_blur_jni_FrostedGlassUtil.h
│ ├── constants.h
│ ├── frostedGlass.c
│ ├── imageProcess.c
│ └── imageProcess.h
├── libs/
│ ├── Bughd_android_sdk_v1.2.6.jar
│ ├── android-support-v13.jar
│ └── locSDK_5.3.jar
├── proguard-project.txt
├── project.properties
├── res/
│ ├── anim/
│ │ ├── count_down_exit.xml
│ │ ├── fade_out.xml
│ │ ├── in_from_bottom.xml
│ │ ├── in_from_top.xml
│ │ ├── out_from_bottom.xml
│ │ ├── out_from_top.xml
│ │ ├── push_right_out.xml
│ │ ├── slide_in_from_bottom.xml
│ │ ├── slide_in_from_top.xml
│ │ ├── slide_out_to_bottom.xml
│ │ └── slide_out_to_top.xml
│ ├── color/
│ │ ├── vpi__dark_theme.xml
│ │ └── vpi__light_theme.xml
│ ├── drawable/
│ │ ├── city_edit_prs.xml
│ │ ├── city_query_delete.xml
│ │ ├── cityselector_locate_btn_bg.xml
│ │ ├── home_setting_selector.xml
│ │ ├── indicator_bg_bottom.xml
│ │ ├── indicator_bg_top.xml
│ │ ├── item_background.xml
│ │ ├── item_prs.xml
│ │ ├── listview_background.xml
│ │ ├── main_city_name_bg.xml
│ │ ├── main_life_complete_selector.xml
│ │ ├── main_life_edit.xml
│ │ ├── module_bg.xml
│ │ ├── refresh_icon_anim.xml
│ │ ├── resource_circle_progressbar_indeterminate.xml
│ │ ├── setting_top_back.xml
│ │ ├── settings_bg_city_item_down.xml
│ │ ├── settings_bg_city_item_up.xml
│ │ ├── shape_bg.xml
│ │ ├── sidebar_item_background_dark_selector.xml
│ │ ├── sidebar_item_background_light_selector.xml
│ │ ├── sidebar_item_selected_layerlist_dark.xml
│ │ ├── slidingmenu_shadow.xml
│ │ ├── topbar_icon_share_selector.xml
│ │ ├── topbar_icon_side_selector.xml
│ │ ├── update_forecast_selector.xml
│ │ ├── vpi__tab_indicator.xml
│ │ ├── weather_detail_activity_btn_bg.xml
│ │ └── white_border.xml
│ ├── layout/
│ │ ├── about.xml
│ │ ├── activity_main.xml
│ │ ├── activity_main_actionbar.xml
│ │ ├── base_fragment.xml
│ │ ├── city_manager_actionbar.xml
│ │ ├── city_manager_layout.xml
│ │ ├── city_manger_grid_item_add.xml
│ │ ├── city_manger_grid_item_normal.xml
│ │ ├── city_query_actionbar.xml
│ │ ├── city_query_hotcity_grid_item.xml
│ │ ├── city_query_layout.xml
│ │ ├── city_query_list_item.xml
│ │ ├── comm_lay_emptyview.xml
│ │ ├── comm_lay_loadfailed.xml
│ │ ├── comm_lay_loading.xml
│ │ ├── count_down_to_location.xml
│ │ ├── custom_progress_dialog.xml
│ │ ├── feed_back_view.xml
│ │ ├── loading_empty_container.xml
│ │ ├── no_results_message.xml
│ │ ├── notification_weather_multi.xml
│ │ ├── sidemenu_list_item_category.xml
│ │ ├── sidemenu_list_item_item.xml
│ │ ├── sidemenu_listview.xml
│ │ ├── splash_activity_layout.xml
│ │ ├── swipeback_layout.xml
│ │ ├── weather_aqi.xml
│ │ ├── weather_current_condition.xml
│ │ ├── weather_details.xml
│ │ ├── weather_forecast.xml
│ │ ├── weather_forecast_item.xml
│ │ ├── weather_fragment.xml
│ │ ├── weather_index.xml
│ │ ├── weather_index_item.xml
│ │ ├── weather_info_error.xml
│ │ ├── weather_provider_layout_rigo_2x2.xml
│ │ ├── weather_provider_layout_rigo_4x1.xml
│ │ └── weather_provider_layout_rigo_4x2.xml
│ ├── values/
│ │ ├── arrays.xml
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── drawables.xml
│ │ ├── ids.xml
│ │ ├── integers.xml
│ │ ├── menudrawer_attrs.xml
│ │ ├── menudrawer_colors.xml
│ │ ├── menudrawer_ids.xml
│ │ ├── menudrawer_strings.xml
│ │ ├── menudrawer_styles.xml
│ │ ├── strings.xml
│ │ ├── styles.xml
│ │ ├── swipeback_attrs.xml
│ │ ├── swipeback_styles.xml
│ │ ├── vpi__attrs.xml
│ │ ├── vpi__colors.xml
│ │ ├── vpi__defaults.xml
│ │ └── vpi__styles.xml
│ ├── values-hdpi/
│ │ └── dimens.xml
│ ├── values-xhdpi/
│ │ └── dimens.xml
│ ├── values-zh-rCN/
│ │ └── strings.xml
│ └── xml/
│ ├── weather_appwidget_info_rigo_2x2.xml
│ ├── weather_appwidget_info_rigo_4x1.xml
│ └── weather_appwidget_info_rigo_4x2.xml
└── src/
├── com/
│ ├── android/
│ │ └── volley/
│ │ ├── AuthFailureError.java
│ │ ├── Cache.java
│ │ ├── CacheDispatcher.java
│ │ ├── DefaultRetryPolicy.java
│ │ ├── ExecutorDelivery.java
│ │ ├── Network.java
│ │ ├── NetworkDispatcher.java
│ │ ├── NetworkError.java
│ │ ├── NetworkResponse.java
│ │ ├── NoConnectionError.java
│ │ ├── ParseError.java
│ │ ├── Request.java
│ │ ├── RequestQueue.java
│ │ ├── Response.java
│ │ ├── ResponseDelivery.java
│ │ ├── RetryPolicy.java
│ │ ├── ServerError.java
│ │ ├── TimeoutError.java
│ │ ├── VolleyError.java
│ │ ├── VolleyLog.java
│ │ └── toolbox/
│ │ ├── AndroidAuthenticator.java
│ │ ├── Authenticator.java
│ │ ├── BasicNetwork.java
│ │ ├── ByteArrayPool.java
│ │ ├── ClearCacheRequest.java
│ │ ├── DiskBasedCache.java
│ │ ├── HttpClientStack.java
│ │ ├── HttpHeaderParser.java
│ │ ├── HttpStack.java
│ │ ├── HurlStack.java
│ │ ├── ImageLoader.java
│ │ ├── ImageRequest.java
│ │ ├── JsonArrayRequest.java
│ │ ├── JsonObjectRequest.java
│ │ ├── JsonRequest.java
│ │ ├── NetworkImageView.java
│ │ ├── NoCache.java
│ │ ├── PoolingByteArrayOutputStream.java
│ │ ├── RequestFuture.java
│ │ ├── StringRequest.java
│ │ └── Volley.java
│ ├── viewpagerindicator/
│ │ ├── CirclePageIndicator.java
│ │ ├── IconPageIndicator.java
│ │ ├── IconPagerAdapter.java
│ │ ├── IcsLinearLayout.java
│ │ ├── LinePageIndicator.java
│ │ ├── PageIndicator.java
│ │ ├── TabPageIndicator.java
│ │ ├── TitlePageIndicator.java
│ │ └── UnderlinePageIndicator.java
│ └── way/
│ ├── adapter/
│ │ ├── FragmentPagerAdapter.java
│ │ ├── ParallaxPagerTransformer.java
│ │ ├── QueryCityAdapter.java
│ │ ├── SideMenuAdapter.java
│ │ ├── WeatherListAdapter.java
│ │ └── WeatherPagerAdapter.java
│ ├── beans/
│ │ ├── Category.java
│ │ ├── City.java
│ │ ├── Item.java
│ │ └── MainItem.java
│ ├── common/
│ │ └── util/
│ │ ├── L.java
│ │ ├── LocationUtils.java
│ │ ├── LunarCalendar.java
│ │ ├── LunarCalendarConvertUtil.java
│ │ ├── NetUtil.java
│ │ ├── PreferenceUtils.java
│ │ ├── SystemUtils.java
│ │ ├── T.java
│ │ ├── TimeUtils.java
│ │ └── WeatherIconUtils.java
│ ├── db/
│ │ └── CityProvider.java
│ ├── fragment/
│ │ ├── BaseFragment.java
│ │ ├── IExceptionDeclare.java
│ │ ├── ITaskManager.java
│ │ ├── TaskException.java
│ │ ├── TaskManager.java
│ │ ├── WeatherFragment.java
│ │ └── WorkTask.java
│ ├── observablescrollview/
│ │ ├── CacheFragmentStatePagerAdapter.java
│ │ ├── ObservableGridView.java
│ │ ├── ObservableListView.java
│ │ ├── ObservableScrollView.java
│ │ ├── ObservableScrollViewCallbacks.java
│ │ ├── ObservableWebView.java
│ │ ├── ScrollState.java
│ │ ├── ScrollUtils.java
│ │ ├── Scrollable.java
│ │ └── TouchInterceptionFrameLayout.java
│ ├── ui/
│ │ ├── swipeback/
│ │ │ ├── SwipeBackActivity.java
│ │ │ ├── SwipeBackActivityBase.java
│ │ │ ├── SwipeBackActivityHelper.java
│ │ │ ├── SwipeBackLayout.java
│ │ │ └── ViewDragHelper.java
│ │ └── view/
│ │ ├── CountDownView.java
│ │ ├── DragSortGridView.java
│ │ ├── LoadingEmptyContainer.java
│ │ ├── NoResultsContainer.java
│ │ ├── TouchDispatchView.java
│ │ ├── WeatherAqiView.java
│ │ ├── WeatherBaseView.java
│ │ ├── WeatherDetailsView.java
│ │ ├── WeatherForecastView.java
│ │ ├── WeatherIndexView.java
│ │ └── WeatherTypefacedTextView.java
│ ├── util/
│ │ └── blur/
│ │ └── jni/
│ │ ├── BitmapUtils.java
│ │ └── FrostedGlassUtil.java
│ ├── weather/
│ │ └── plugin/
│ │ ├── bean/
│ │ │ ├── AQI.java
│ │ │ ├── Alerts.java
│ │ │ ├── Forecast.java
│ │ │ ├── Index.java
│ │ │ ├── IndexDetail.java
│ │ │ ├── RealTime.java
│ │ │ └── WeatherInfo.java
│ │ ├── spider/
│ │ │ ├── WeatherConstants.java
│ │ │ ├── WeatherController.java
│ │ │ ├── WeatherSpider.java
│ │ │ └── WeatherUtilities.java
│ │ └── util/
│ │ ├── Constants.java
│ │ └── NetUtil.java
│ └── yahoo/
│ ├── AboutActivity.java
│ ├── App.java
│ ├── BaseActivity.java
│ ├── FeedBackActivity.java
│ ├── MainActivity.java
│ ├── ManagerCityActivity.java
│ ├── QueryCityActivity.java
│ └── SplashActivity.java
└── net/
└── simonvt/
└── menudrawer/
├── BuildLayerFrameLayout.java
├── ColorDrawable.java
├── DraggableDrawer.java
├── FloatScroller.java
├── MenuDrawer.java
├── NoClickThroughFrameLayout.java
├── OverlayDrawer.java
├── PeekInterpolator.java
├── Position.java
├── Scroller.java
├── SinusoidalInterpolator.java
├── SlideDrawable.java
├── SlidingDrawer.java
├── SmoothInterpolator.java
├── StaticDrawer.java
├── ViewHelper.java
└── compat/
├── ActionBarHelper.java
├── ActionBarHelperCompat.java
└── ActionBarHelperNative.java
Showing preview only (205K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2524 symbols across 205 files)
FILE: Upgrade-lib/src/com/way/upgrade/MainActivity.java
class MainActivity (line 8) | public class MainActivity extends Activity {
method onCreate (line 10) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/bean/UpgradeInfo.java
class UpgradeInfo (line 12) | public class UpgradeInfo implements Parcelable{
method newArray (line 44) | @Override
method createFromParcel (line 49) | @Override
method UpgradeInfo (line 55) | public UpgradeInfo() {
method UpgradeInfo (line 59) | public UpgradeInfo(Parcel in) {
method describeContents (line 74) | @Override
method writeToParcel (line 79) | @Override
method getId (line 95) | public int getId() {
method setId (line 99) | public void setId(int id) {
method getKey (line 103) | public String getKey() {
method setKey (line 107) | public void setKey(String key) {
method getVersion (line 111) | public String getVersion() {
method setVersion (line 115) | public void setVersion(String version) {
method getUrl (line 119) | public String getUrl() {
method setUrl (line 123) | public void setUrl(String url) {
method getDescription (line 127) | public String getDescription() {
method setDescription (line 131) | public void setDescription(String description) {
method getDownloadSize (line 135) | public long getDownloadSize() {
method setDownloadSize (line 139) | public void setDownloadSize(long downloadSize) {
method getVersionName (line 143) | public String getVersionName() {
method setVersionName (line 147) | public void setVersionName(String versionName) {
method isResult (line 151) | public String isResult() {
method setResult (line 155) | public void setResult(String result) {
method getMustUpdate (line 159) | public String getMustUpdate() {
method setMustUpdate (line 163) | public void setMustUpdate(String mustUpdate) {
method getChangeLog (line 167) | public String getChangeLog() {
method setChangeLog (line 171) | public void setChangeLog(String changeLog) {
method getResult (line 175) | public String getResult() {
method getErrorCode (line 180) | public String getErrorCode() {
method setErrorCode (line 184) | public void setErrorCode(String errorCode) {
method toString (line 188) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/core/CheckNewVersionListener.java
type CheckNewVersionListener (line 8) | public interface CheckNewVersionListener {
method checkNewVersion (line 9) | public void checkNewVersion(boolean result);
FILE: Upgrade-lib/src/com/way/upgrade/core/UpgradeInterface.java
type UpgradeInterface (line 10) | public interface UpgradeInterface {
method askForNewVersion (line 16) | public void askForNewVersion();
method askForNewVersionFlag (line 23) | public void askForNewVersionFlag(
method downloadNewVersion (line 31) | public void downloadNewVersion(UpgradeInfo upgradeInfo);
FILE: Upgrade-lib/src/com/way/upgrade/core/UpgradeManager.java
class UpgradeManager (line 36) | public class UpgradeManager extends LocaleHandler implements UpgradeInte...
method onFutureDone (line 51) | public void onFutureDone(Future<UpgradeInfo> future) {
class AskForNewVersionFlag (line 74) | public class AskForNewVersionFlag implements FutureListener<UpgradeInf...
method onFutureDone (line 75) | @Override
method UpgradeManager (line 90) | public UpgradeManager(Context context) {
method init (line 96) | private void init() {
method newInstance (line 196) | public static UpgradeManager newInstance(Context context) {
method showProgressDialog (line 200) | private void showProgressDialog() {
method askForNewVersion (line 210) | @Override
method askForNewVersionFlag (line 217) | @Override
method downloadNewVersion (line 229) | @Override
method createHandlers (line 235) | private void createHandlers() {
method lookupHandlerBy (line 244) | private LocaleHandler lookupHandlerBy(String handlerName) {
method showDialog (line 251) | private void showDialog(UpgradeInfo description) {
method getLocaleLanguage (line 273) | private String getLocaleLanguage() {
method getDialogTitle (line 277) | @Override
method getProgressDialogTitle (line 283) | @Override
method getProgressDialogMessage (line 289) | @Override
method getToastMessage (line 295) | @Override
method getToastNetErrorMessage (line 301) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/job/AbstractCheckNewVersionJob.java
class AbstractCheckNewVersionJob (line 28) | public abstract class AbstractCheckNewVersionJob implements
method AbstractCheckNewVersionJob (line 34) | public AbstractCheckNewVersionJob(Context context) {
method run (line 51) | @Override
method getCheckVersionUrl (line 82) | public abstract String getCheckVersionUrl();
FILE: Upgrade-lib/src/com/way/upgrade/job/CheckNewVersionJobWithoutClientUrl.java
class CheckNewVersionJobWithoutClientUrl (line 12) | public class CheckNewVersionJobWithoutClientUrl extends
method CheckNewVersionJobWithoutClientUrl (line 14) | public CheckNewVersionJobWithoutClientUrl(Context context) {
method getCheckVersionUrl (line 18) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/job/DownloadNewVersionJob.java
class DownloadNewVersionJob (line 22) | public class DownloadNewVersionJob implements ThreadPool.Job<Void> {
method DownloadNewVersionJob (line 29) | public DownloadNewVersionJob(Context context, UpgradeInfo upgradeInfo) {
method run (line 34) | @Override
method checkApkExist (line 112) | private boolean checkApkExist() {
method checkDownloadRunning (line 132) | @SuppressWarnings("static-access")
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleChina.java
class LocaleChina (line 8) | public class LocaleChina extends LocaleChinese {
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleChinaTW.java
class LocaleChinaTW (line 8) | public class LocaleChinaTW extends LocaleChinese {
method getDialogTitle (line 11) | @Override
method getProgressDialogTitle (line 16) | @Override
method getProgressDialogMessage (line 21) | @Override
method getToastMessage (line 26) | @Override
method getToastNetErrorMessage (line 31) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleChinese.java
class LocaleChinese (line 8) | public class LocaleChinese extends LocaleHandler {
method getDialogTitle (line 11) | @Override
method getProgressDialogTitle (line 16) | @Override
method getProgressDialogMessage (line 21) | @Override
method getToastMessage (line 26) | @Override
method getToastNetErrorMessage (line 31) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleEnglish.java
class LocaleEnglish (line 3) | public class LocaleEnglish extends LocaleHandler {
method getDialogTitle (line 6) | @Override
method getProgressDialogTitle (line 11) | @Override
method getProgressDialogMessage (line 16) | @Override
method getToastMessage (line 21) | @Override
method getToastNetErrorMessage (line 26) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleHandler.java
class LocaleHandler (line 8) | public abstract class LocaleHandler {
method getDialogTitle (line 11) | public abstract String getDialogTitle();
method getProgressDialogTitle (line 13) | public abstract String getProgressDialogTitle();
method getProgressDialogMessage (line 15) | public abstract String getProgressDialogMessage();
method getToastMessage (line 17) | public abstract String getToastMessage();
method getToastNetErrorMessage (line 19) | public abstract String getToastNetErrorMessage();
method setUpgradeDescription (line 21) | public void setUpgradeDescription(String value) {
method getUpgradeDescription (line 25) | public String getUpgradeDescription() {
FILE: Upgrade-lib/src/com/way/upgrade/locale/LocaleUS.java
class LocaleUS (line 3) | public class LocaleUS extends LocaleEnglish {
FILE: Upgrade-lib/src/com/way/upgrade/parser/json/AbstractJsonParsing.java
class AbstractJsonParsing (line 9) | public abstract class AbstractJsonParsing<T> {
method readJsonItem (line 11) | public abstract T readJsonItem(JSONObject jsonItem) throws JSONException;
method readJsonArray (line 20) | public ArrayList<T> readJsonArray(JSONArray jsonArray) {
FILE: Upgrade-lib/src/com/way/upgrade/parser/json/FirVersionJsonParsing.java
class FirVersionJsonParsing (line 12) | public class FirVersionJsonParsing extends AbstractJsonParsing<UpgradeIn...
method FirVersionJsonParsing (line 15) | public FirVersionJsonParsing(Context context) {
method readJsonItem (line 19) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/receiver/DownloadCompleteReveiver.java
class DownloadCompleteReveiver (line 19) | public class DownloadCompleteReveiver extends BroadcastReceiver {
method onReceive (line 22) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/utils/Constants.java
class Constants (line 7) | public class Constants {
FILE: Upgrade-lib/src/com/way/upgrade/utils/ContextUtils.java
class ContextUtils (line 25) | public class ContextUtils {
method showToast (line 34) | public static void showToast(Context context, String text, int length) {
method showToast (line 44) | public static void showToast(Context context, int resId, int length) {
method createProgressDialog (line 48) | public static ProgressDialog createProgressDialog(Context context) {
method showProgressDialog (line 65) | public static ProgressDialog showProgressDialog(Context context, int t...
method closeProgressDialog (line 81) | public static void closeProgressDialog(Dialog progressDialog) {
method showDialog (line 96) | public static AlertDialog.Builder showDialog(Context context, int title,
method showDialog (line 124) | public static AlertDialog.Builder showDialog(Context context, String t...
method showAlertDialog (line 152) | public static AlertDialog showAlertDialog(Context context, String title,
method getCustomVersion (line 170) | @SuppressWarnings({ "unchecked", "rawtypes" })
method getVersionCode (line 193) | public static int getVersionCode(Context context) {
method getVersionName (line 212) | public static String getVersionName(Context context) {
method getUserAgent (line 226) | public static String getUserAgent(Context context) {
method getActivityIntent (line 240) | public static Intent getActivityIntent(Context context, String package...
FILE: Upgrade-lib/src/com/way/upgrade/utils/FileUtils.java
class FileUtils (line 8) | public class FileUtils {
method createNewFile (line 15) | public static void createNewFile(File f) throws Exception {
FILE: Upgrade-lib/src/com/way/upgrade/utils/Log.java
class Log (line 3) | public class Log {
method v (line 14) | public static void v(String tag, String msg, int mod) {
method v (line 27) | public static void v(String msg, int mod) {
method d (line 31) | public static void d(String tag, String msg, int mod) {
method d (line 44) | public static void d(String msg, int mod) {
method i (line 48) | public static void i(String tag, String msg, int mod) {
method i (line 61) | public static void i(String msg, int mod) {
method w (line 65) | public static void w(String tag, String msg, int mod) {
method w (line 78) | public static void w(String msg, int mod) {
method e (line 82) | public static void e(String tag, String msg, int mod) {
method e (line 95) | public static void e(String msg, int mod) {
FILE: Upgrade-lib/src/com/way/upgrade/utils/NetUtils.java
class NetUtils (line 36) | public class NetUtils {
type NETWORK_STATUS (line 46) | public enum NETWORK_STATUS {
method NetUtils (line 50) | private NetUtils() {
method getNetworkType (line 53) | public static NETWORK_STATUS getNetworkType(Context context) {
method isNetWorkAvailable (line 91) | public static boolean isNetWorkAvailable(Context context, String typeN...
method getInputStreamByGet (line 138) | public static synchronized InputStream getInputStreamByGet(String url)
method getJSONArrayByPost (line 179) | public static JSONArray getJSONArrayByPost(String uri)
method getJSONArrayByGet (line 216) | public static JSONObject getJSONArrayByGet(String uri)
method uploadParamsByPost (line 249) | public static boolean uploadParamsByPost(String actionUrl,
method uploadParamsByPost (line 318) | public static JSONObject uploadParamsByPost(String actionUrl, String q...
method uploadFilesByPost (line 366) | public int uploadFilesByPost(String actionUrl, String fileName, File f...
FILE: Upgrade-lib/src/com/way/upgrade/utils/Preferences.java
class Preferences (line 12) | public class Preferences {
method setDownloadId (line 23) | public static void setDownloadId(Context context, long downloadId) {
method getDownloadId (line 31) | public static long getDownloadId(Context context) {
method setUpgradeInfo (line 37) | public static void setUpgradeInfo(Context context, UpgradeInfo upgrade) {
method getUpgradeInfo (line 49) | public static UpgradeInfo getUpgradeInfo(Context context) {
method setDownloadPath (line 61) | public static void setDownloadPath(Context context, String downloadPat...
method getDownloadPath (line 69) | public static String getDownloadPath(Context context) {
method removeAll (line 75) | public static void removeAll(Context context) {
method setDownloadStatus (line 83) | public static void setDownloadStatus(Context context, int downloadId) {
method getDownloadStatus (line 91) | public static int getDownloadStatus(Context context) {
FILE: Upgrade-lib/src/com/way/upgrade/utils/Utils.java
class Utils (line 28) | public class Utils {
method assertTrue (line 43) | public static void assertTrue(boolean cond) {
method fail (line 54) | public static void fail(String message, Object... args) {
method checkNotNull (line 60) | public static <T> T checkNotNull(T object) {
method equals (line 68) | public static boolean equals(Object a, Object b) {
method nextPowerOf2 (line 76) | public static int nextPowerOf2(int n) {
method prevPowerOf2 (line 91) | public static int prevPowerOf2(int n) {
method clamp (line 98) | public static int clamp(int x, int min, int max) {
method clamp (line 107) | public static float clamp(float x, float min, float max) {
method clamp (line 116) | public static long clamp(long x, long min, long max) {
method isOpaque (line 124) | public static boolean isOpaque(int color) {
method swap (line 128) | public static void swap(int[] array, int i, int j) {
method crc64Long (line 141) | public static final long crc64Long(String in) {
method crc64Long (line 161) | public static final long crc64Long(byte[] buffer) {
method getBytes (line 169) | public static byte[] getBytes(String in) {
method closeSilently (line 179) | public static void closeSilently(Closeable c) {
method compare (line 189) | public static int compare(long a, long b) {
method ceilLog2 (line 193) | public static int ceilLog2(float value) {
method floorLog2 (line 202) | public static int floorLog2(float value) {
method closeSilently (line 211) | public static void closeSilently(ParcelFileDescriptor fd) {
method closeSilently (line 220) | public static void closeSilently(Cursor cursor) {
method interpolateAngle (line 229) | public static float interpolateAngle(float source, float target,
method interpolateScale (line 244) | public static float interpolateScale(float source, float target,
method ensureNotNull (line 249) | public static String ensureNotNull(String value) {
method ensureNotNull (line 253) | public static String ensureNotNull(Object obj) {
method parseFloatSafely (line 257) | public static float parseFloatSafely(String content, float defaultValu...
method parseIntSafely (line 267) | public static int parseIntSafely(String content, int defaultValue) {
method isNullOrEmpty (line 277) | public static boolean isNullOrEmpty(String exifMake) {
method waitWithoutInterrupt (line 281) | public static void waitWithoutInterrupt(Object object) {
method handleInterrruptedException (line 289) | public static boolean handleInterrruptedException(Throwable e) {
method escapeXml (line 303) | public static String escapeXml(String s) {
method copyOf (line 330) | public static String[] copyOf(String[] source, int newSize) {
method maskDebugInfo (line 342) | public static String maskDebugInfo(Object info) {
method debug (line 351) | public static void debug(String message, Object... args) {
method combinaStr (line 365) | public static String combinaStr(String str, List<String> params)
FILE: Upgrade-lib/src/com/way/upgrade/utils/thread/Future.java
type Future (line 29) | public interface Future<T> {
method cancel (line 30) | public void cancel();
method isCancelled (line 32) | public boolean isCancelled();
method isDone (line 34) | public boolean isDone();
method get (line 36) | public T get();
method waitDone (line 38) | public void waitDone();
FILE: Upgrade-lib/src/com/way/upgrade/utils/thread/FutureListener.java
type FutureListener (line 24) | public interface FutureListener<T> {
method onFutureDone (line 25) | public void onFutureDone(Future<T> future);
FILE: Upgrade-lib/src/com/way/upgrade/utils/thread/PriorityThreadFactory.java
class PriorityThreadFactory (line 26) | public class PriorityThreadFactory implements ThreadFactory {
method PriorityThreadFactory (line 32) | public PriorityThreadFactory(String name, int priority) {
method newThread (line 37) | @Override
FILE: Upgrade-lib/src/com/way/upgrade/utils/thread/ThreadPool.java
class ThreadPool (line 30) | public class ThreadPool {
type Job (line 49) | public interface Job<T> {
method run (line 50) | public T run(JobContext jc);
type JobContext (line 53) | public interface JobContext {
method isCancelled (line 54) | boolean isCancelled();
method setCancelListener (line 56) | void setCancelListener(CancelListener listener);
method setMode (line 58) | boolean setMode(int mode);
class JobContextStub (line 61) | private static class JobContextStub implements JobContext {
method isCancelled (line 62) | @Override
method setCancelListener (line 67) | @Override
method setMode (line 71) | @Override
type CancelListener (line 77) | public interface CancelListener {
method onCancel (line 78) | public void onCancel();
class ResourceCounter (line 81) | private static class ResourceCounter {
method ResourceCounter (line 84) | public ResourceCounter(int v) {
method ThreadPool (line 91) | public ThreadPool() {
method ThreadPool (line 95) | public ThreadPool(int initPoolSize, int maxPoolSize) {
method submit (line 105) | public <T> Future<T> submit(Job<T> job, FutureListener<T> listener,
method submit (line 113) | public <T> Future<T> submit(Job<T> job) {
class Worker (line 117) | private class Worker<T> implements Runnable, Future<T>, JobContext {
method Worker (line 129) | public Worker(Job<T> job, FutureListener<T> listener, int threadMode) {
method run (line 136) | @Override
method cancel (line 162) | @Override
method isCancelled (line 177) | @Override
method isDone (line 182) | @Override
method get (line 187) | @Override
method waitDone (line 198) | @Override
method setCancelListener (line 205) | @Override
method setMode (line 213) | @Override
method modeToCounter (line 234) | private ResourceCounter modeToCounter(int mode) {
method acquireResource (line 246) | private boolean acquireResource(ResourceCounter counter) {
method releaseResource (line 278) | private void releaseResource(ResourceCounter counter) {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/MainActivity.java
class MainActivity (line 8) | public class MainActivity extends Activity {
method onCreate (line 10) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/bean/UpgradeInfo.java
class UpgradeInfo (line 12) | public class UpgradeInfo implements Parcelable{
method newArray (line 44) | @Override
method createFromParcel (line 49) | @Override
method UpgradeInfo (line 55) | public UpgradeInfo() {
method UpgradeInfo (line 59) | public UpgradeInfo(Parcel in) {
method describeContents (line 74) | @Override
method writeToParcel (line 79) | @Override
method getId (line 95) | public int getId() {
method setId (line 99) | public void setId(int id) {
method getKey (line 103) | public String getKey() {
method setKey (line 107) | public void setKey(String key) {
method getVersion (line 111) | public String getVersion() {
method setVersion (line 115) | public void setVersion(String version) {
method getUrl (line 119) | public String getUrl() {
method setUrl (line 123) | public void setUrl(String url) {
method getDescription (line 127) | public String getDescription() {
method setDescription (line 131) | public void setDescription(String description) {
method getDownloadSize (line 135) | public long getDownloadSize() {
method setDownloadSize (line 139) | public void setDownloadSize(long downloadSize) {
method getVersionName (line 143) | public String getVersionName() {
method setVersionName (line 147) | public void setVersionName(String versionName) {
method isResult (line 151) | public String isResult() {
method setResult (line 155) | public void setResult(String result) {
method getMustUpdate (line 159) | public String getMustUpdate() {
method setMustUpdate (line 163) | public void setMustUpdate(String mustUpdate) {
method getChangeLog (line 167) | public String getChangeLog() {
method setChangeLog (line 171) | public void setChangeLog(String changeLog) {
method getResult (line 175) | public String getResult() {
method getErrorCode (line 180) | public String getErrorCode() {
method setErrorCode (line 184) | public void setErrorCode(String errorCode) {
method toString (line 188) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/core/CheckNewVersionListener.java
type CheckNewVersionListener (line 8) | public interface CheckNewVersionListener {
method checkNewVersion (line 9) | public void checkNewVersion(boolean result);
FILE: WayHoo/Upgrade-lib/com/way/upgrade/core/UpgradeInterface.java
type UpgradeInterface (line 10) | public interface UpgradeInterface {
method askForNewVersion (line 16) | public void askForNewVersion();
method askForNewVersionFlag (line 23) | public void askForNewVersionFlag(
method downloadNewVersion (line 31) | public void downloadNewVersion(UpgradeInfo upgradeInfo);
FILE: WayHoo/Upgrade-lib/com/way/upgrade/core/UpgradeManager.java
class UpgradeManager (line 36) | public class UpgradeManager extends LocaleHandler implements UpgradeInte...
method onFutureDone (line 51) | public void onFutureDone(Future<UpgradeInfo> future) {
class AskForNewVersionFlag (line 74) | public class AskForNewVersionFlag implements FutureListener<UpgradeInf...
method onFutureDone (line 75) | @Override
method UpgradeManager (line 90) | public UpgradeManager(Context context) {
method init (line 96) | private void init() {
method newInstance (line 196) | public static UpgradeManager newInstance(Context context) {
method showProgressDialog (line 200) | private void showProgressDialog() {
method askForNewVersion (line 210) | @Override
method askForNewVersionFlag (line 217) | @Override
method downloadNewVersion (line 229) | @Override
method createHandlers (line 235) | private void createHandlers() {
method lookupHandlerBy (line 244) | private LocaleHandler lookupHandlerBy(String handlerName) {
method showDialog (line 251) | private void showDialog(UpgradeInfo description) {
method getLocaleLanguage (line 273) | private String getLocaleLanguage() {
method getDialogTitle (line 277) | @Override
method getProgressDialogTitle (line 283) | @Override
method getProgressDialogMessage (line 289) | @Override
method getToastMessage (line 295) | @Override
method getToastNetErrorMessage (line 301) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/job/AbstractCheckNewVersionJob.java
class AbstractCheckNewVersionJob (line 28) | public abstract class AbstractCheckNewVersionJob implements
method AbstractCheckNewVersionJob (line 34) | public AbstractCheckNewVersionJob(Context context) {
method run (line 51) | @Override
method getCheckVersionUrl (line 82) | public abstract String getCheckVersionUrl();
FILE: WayHoo/Upgrade-lib/com/way/upgrade/job/CheckNewVersionJobWithoutClientUrl.java
class CheckNewVersionJobWithoutClientUrl (line 12) | public class CheckNewVersionJobWithoutClientUrl extends
method CheckNewVersionJobWithoutClientUrl (line 14) | public CheckNewVersionJobWithoutClientUrl(Context context) {
method getCheckVersionUrl (line 18) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/job/DownloadNewVersionJob.java
class DownloadNewVersionJob (line 22) | public class DownloadNewVersionJob implements ThreadPool.Job<Void> {
method DownloadNewVersionJob (line 29) | public DownloadNewVersionJob(Context context, UpgradeInfo upgradeInfo) {
method run (line 34) | @Override
method checkApkExist (line 112) | private boolean checkApkExist() {
method checkDownloadRunning (line 132) | @SuppressWarnings("static-access")
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChina.java
class LocaleChina (line 8) | public class LocaleChina extends LocaleChinese {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChinaTW.java
class LocaleChinaTW (line 8) | public class LocaleChinaTW extends LocaleChinese {
method getDialogTitle (line 11) | @Override
method getProgressDialogTitle (line 16) | @Override
method getProgressDialogMessage (line 21) | @Override
method getToastMessage (line 26) | @Override
method getToastNetErrorMessage (line 31) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChinese.java
class LocaleChinese (line 8) | public class LocaleChinese extends LocaleHandler {
method getDialogTitle (line 11) | @Override
method getProgressDialogTitle (line 16) | @Override
method getProgressDialogMessage (line 21) | @Override
method getToastMessage (line 26) | @Override
method getToastNetErrorMessage (line 31) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleEnglish.java
class LocaleEnglish (line 3) | public class LocaleEnglish extends LocaleHandler {
method getDialogTitle (line 6) | @Override
method getProgressDialogTitle (line 11) | @Override
method getProgressDialogMessage (line 16) | @Override
method getToastMessage (line 21) | @Override
method getToastNetErrorMessage (line 26) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleHandler.java
class LocaleHandler (line 8) | public abstract class LocaleHandler {
method getDialogTitle (line 11) | public abstract String getDialogTitle();
method getProgressDialogTitle (line 13) | public abstract String getProgressDialogTitle();
method getProgressDialogMessage (line 15) | public abstract String getProgressDialogMessage();
method getToastMessage (line 17) | public abstract String getToastMessage();
method getToastNetErrorMessage (line 19) | public abstract String getToastNetErrorMessage();
method setUpgradeDescription (line 21) | public void setUpgradeDescription(String value) {
method getUpgradeDescription (line 25) | public String getUpgradeDescription() {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleUS.java
class LocaleUS (line 3) | public class LocaleUS extends LocaleEnglish {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/parser/json/AbstractJsonParsing.java
class AbstractJsonParsing (line 9) | public abstract class AbstractJsonParsing<T> {
method readJsonItem (line 11) | public abstract T readJsonItem(JSONObject jsonItem) throws JSONException;
method readJsonArray (line 20) | public ArrayList<T> readJsonArray(JSONArray jsonArray) {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/parser/json/FirVersionJsonParsing.java
class FirVersionJsonParsing (line 12) | public class FirVersionJsonParsing extends AbstractJsonParsing<UpgradeIn...
method FirVersionJsonParsing (line 15) | public FirVersionJsonParsing(Context context) {
method readJsonItem (line 19) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/receiver/DownloadCompleteReveiver.java
class DownloadCompleteReveiver (line 19) | public class DownloadCompleteReveiver extends BroadcastReceiver {
method onReceive (line 22) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/Constants.java
class Constants (line 7) | public class Constants {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/ContextUtils.java
class ContextUtils (line 25) | public class ContextUtils {
method showToast (line 34) | public static void showToast(Context context, String text, int length) {
method showToast (line 44) | public static void showToast(Context context, int resId, int length) {
method createProgressDialog (line 48) | public static ProgressDialog createProgressDialog(Context context) {
method showProgressDialog (line 65) | public static ProgressDialog showProgressDialog(Context context, int t...
method closeProgressDialog (line 81) | public static void closeProgressDialog(Dialog progressDialog) {
method showDialog (line 96) | public static AlertDialog.Builder showDialog(Context context, int title,
method showDialog (line 124) | public static AlertDialog.Builder showDialog(Context context, String t...
method showAlertDialog (line 152) | public static AlertDialog showAlertDialog(Context context, String title,
method getCustomVersion (line 170) | @SuppressWarnings({ "unchecked", "rawtypes" })
method getVersionCode (line 193) | public static int getVersionCode(Context context) {
method getVersionName (line 212) | public static String getVersionName(Context context) {
method getUserAgent (line 226) | public static String getUserAgent(Context context) {
method getActivityIntent (line 240) | public static Intent getActivityIntent(Context context, String package...
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/FileUtils.java
class FileUtils (line 8) | public class FileUtils {
method createNewFile (line 15) | public static void createNewFile(File f) throws Exception {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/Log.java
class Log (line 3) | public class Log {
method v (line 14) | public static void v(String tag, String msg, int mod) {
method v (line 27) | public static void v(String msg, int mod) {
method d (line 31) | public static void d(String tag, String msg, int mod) {
method d (line 44) | public static void d(String msg, int mod) {
method i (line 48) | public static void i(String tag, String msg, int mod) {
method i (line 61) | public static void i(String msg, int mod) {
method w (line 65) | public static void w(String tag, String msg, int mod) {
method w (line 78) | public static void w(String msg, int mod) {
method e (line 82) | public static void e(String tag, String msg, int mod) {
method e (line 95) | public static void e(String msg, int mod) {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/NetUtils.java
class NetUtils (line 36) | public class NetUtils {
type NETWORK_STATUS (line 46) | public enum NETWORK_STATUS {
method NetUtils (line 50) | private NetUtils() {
method getNetworkType (line 53) | public static NETWORK_STATUS getNetworkType(Context context) {
method isNetWorkAvailable (line 91) | public static boolean isNetWorkAvailable(Context context, String typeN...
method getInputStreamByGet (line 138) | public static synchronized InputStream getInputStreamByGet(String url)
method getJSONArrayByPost (line 179) | public static JSONArray getJSONArrayByPost(String uri)
method getJSONArrayByGet (line 216) | public static JSONObject getJSONArrayByGet(String uri)
method uploadParamsByPost (line 249) | public static boolean uploadParamsByPost(String actionUrl,
method uploadParamsByPost (line 318) | public static JSONObject uploadParamsByPost(String actionUrl, String q...
method uploadFilesByPost (line 366) | public int uploadFilesByPost(String actionUrl, String fileName, File f...
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/Preferences.java
class Preferences (line 12) | public class Preferences {
method setDownloadId (line 23) | public static void setDownloadId(Context context, long downloadId) {
method getDownloadId (line 31) | public static long getDownloadId(Context context) {
method setUpgradeInfo (line 37) | public static void setUpgradeInfo(Context context, UpgradeInfo upgrade) {
method getUpgradeInfo (line 49) | public static UpgradeInfo getUpgradeInfo(Context context) {
method setDownloadPath (line 61) | public static void setDownloadPath(Context context, String downloadPat...
method getDownloadPath (line 69) | public static String getDownloadPath(Context context) {
method removeAll (line 75) | public static void removeAll(Context context) {
method setDownloadStatus (line 83) | public static void setDownloadStatus(Context context, int downloadId) {
method getDownloadStatus (line 91) | public static int getDownloadStatus(Context context) {
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/Utils.java
class Utils (line 28) | public class Utils {
method assertTrue (line 43) | public static void assertTrue(boolean cond) {
method fail (line 54) | public static void fail(String message, Object... args) {
method checkNotNull (line 60) | public static <T> T checkNotNull(T object) {
method equals (line 68) | public static boolean equals(Object a, Object b) {
method nextPowerOf2 (line 76) | public static int nextPowerOf2(int n) {
method prevPowerOf2 (line 91) | public static int prevPowerOf2(int n) {
method clamp (line 98) | public static int clamp(int x, int min, int max) {
method clamp (line 107) | public static float clamp(float x, float min, float max) {
method clamp (line 116) | public static long clamp(long x, long min, long max) {
method isOpaque (line 124) | public static boolean isOpaque(int color) {
method swap (line 128) | public static void swap(int[] array, int i, int j) {
method crc64Long (line 141) | public static final long crc64Long(String in) {
method crc64Long (line 161) | public static final long crc64Long(byte[] buffer) {
method getBytes (line 169) | public static byte[] getBytes(String in) {
method closeSilently (line 179) | public static void closeSilently(Closeable c) {
method compare (line 189) | public static int compare(long a, long b) {
method ceilLog2 (line 193) | public static int ceilLog2(float value) {
method floorLog2 (line 202) | public static int floorLog2(float value) {
method closeSilently (line 211) | public static void closeSilently(ParcelFileDescriptor fd) {
method closeSilently (line 220) | public static void closeSilently(Cursor cursor) {
method interpolateAngle (line 229) | public static float interpolateAngle(float source, float target,
method interpolateScale (line 244) | public static float interpolateScale(float source, float target,
method ensureNotNull (line 249) | public static String ensureNotNull(String value) {
method ensureNotNull (line 253) | public static String ensureNotNull(Object obj) {
method parseFloatSafely (line 257) | public static float parseFloatSafely(String content, float defaultValu...
method parseIntSafely (line 267) | public static int parseIntSafely(String content, int defaultValue) {
method isNullOrEmpty (line 277) | public static boolean isNullOrEmpty(String exifMake) {
method waitWithoutInterrupt (line 281) | public static void waitWithoutInterrupt(Object object) {
method handleInterrruptedException (line 289) | public static boolean handleInterrruptedException(Throwable e) {
method escapeXml (line 303) | public static String escapeXml(String s) {
method copyOf (line 330) | public static String[] copyOf(String[] source, int newSize) {
method maskDebugInfo (line 342) | public static String maskDebugInfo(Object info) {
method debug (line 351) | public static void debug(String message, Object... args) {
method combinaStr (line 365) | public static String combinaStr(String str, List<String> params)
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/Future.java
type Future (line 29) | public interface Future<T> {
method cancel (line 30) | public void cancel();
method isCancelled (line 32) | public boolean isCancelled();
method isDone (line 34) | public boolean isDone();
method get (line 36) | public T get();
method waitDone (line 38) | public void waitDone();
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/FutureListener.java
type FutureListener (line 24) | public interface FutureListener<T> {
method onFutureDone (line 25) | public void onFutureDone(Future<T> future);
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/PriorityThreadFactory.java
class PriorityThreadFactory (line 26) | public class PriorityThreadFactory implements ThreadFactory {
method PriorityThreadFactory (line 32) | public PriorityThreadFactory(String name, int priority) {
method newThread (line 37) | @Override
FILE: WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/ThreadPool.java
class ThreadPool (line 30) | public class ThreadPool {
type Job (line 49) | public interface Job<T> {
method run (line 50) | public T run(JobContext jc);
type JobContext (line 53) | public interface JobContext {
method isCancelled (line 54) | boolean isCancelled();
method setCancelListener (line 56) | void setCancelListener(CancelListener listener);
method setMode (line 58) | boolean setMode(int mode);
class JobContextStub (line 61) | private static class JobContextStub implements JobContext {
method isCancelled (line 62) | @Override
method setCancelListener (line 67) | @Override
method setMode (line 71) | @Override
type CancelListener (line 77) | public interface CancelListener {
method onCancel (line 78) | public void onCancel();
class ResourceCounter (line 81) | private static class ResourceCounter {
method ResourceCounter (line 84) | public ResourceCounter(int v) {
method ThreadPool (line 91) | public ThreadPool() {
method ThreadPool (line 95) | public ThreadPool(int initPoolSize, int maxPoolSize) {
method submit (line 105) | public <T> Future<T> submit(Job<T> job, FutureListener<T> listener,
method submit (line 113) | public <T> Future<T> submit(Job<T> job) {
class Worker (line 117) | private class Worker<T> implements Runnable, Future<T>, JobContext {
method Worker (line 129) | public Worker(Job<T> job, FutureListener<T> listener, int threadMode) {
method run (line 136) | @Override
method cancel (line 162) | @Override
method isCancelled (line 177) | @Override
method isDone (line 182) | @Override
method get (line 187) | @Override
method waitDone (line 198) | @Override
method setCancelListener (line 205) | @Override
method setMode (line 213) | @Override
method modeToCounter (line 234) | private ResourceCounter modeToCounter(int mode) {
method acquireResource (line 246) | private boolean acquireResource(ResourceCounter counter) {
method releaseResource (line 278) | private void releaseResource(ResourceCounter counter) {
FILE: WayHoo/jni/bitmapPort.c
function allocateMemory (line 15) | int allocateMemory() {
function freeMemory (line 25) | void freeMemory(){
function getUnifiedImageData (line 32) | void getUnifiedImageData(jobject bitmap, JNIEnv *env) {
function getARGB8888Data (line 58) | void getARGB8888Data(jobject bitmap, JNIEnv *env)
function getARGB4444Data (line 83) | void getARGB4444Data(jobject bitmap, JNIEnv *env)
function getRGB565Data (line 103) | void getRGB565Data(jobject bitmap, JNIEnv *env)
function getAlpha8Data (line 123) | void getAlpha8Data(jobject bitmap, JNIEnv *env)
function setUnifiedImageData (line 143) | void setUnifiedImageData(jobject bitmap, JNIEnv *env)
function setARGB8888Data (line 167) | void setARGB8888Data(jobject bitmap, JNIEnv *env)
function setARGB4444Data (line 196) | void setARGB4444Data(jobject bitmap, JNIEnv *env)
function setRGB565Data (line 199) | void setRGB565Data(jobject bitmap, JNIEnv *env)
function setAlpha8Data (line 224) | void setAlpha8Data(jobject bitmap, JNIEnv *env)
function AndroidBitmap_getInfo_warp (line 229) | int AndroidBitmap_getInfo_warp(JNIEnv* env, jobject jbitmap)
function blur (line 235) | void blur(){
function logBitmapPort (line 239) | void logBitmapPort(){
function clearColorPort (line 244) | void clearColorPort(int color){
function boxBlurPort (line 248) | void boxBlurPort(int radius){
function stackBlurPort (line 253) | void stackBlurPort(int radius){
function oilPaintPort (line 258) | void oilPaintPort(int radius){
function colorWaterPaintPort (line 263) | void colorWaterPaintPort(int radius){
FILE: WayHoo/jni/frostedGlass.c
function JNICALL (line 37) | JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_boxBlur(JNIEnv *env,...
function JNICALL (line 68) | JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_stackBlur(JNIEnv *en...
function JNICALL (line 99) | JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_oilPaint(JNIEnv *env...
function JNICALL (line 129) | JNICALL Java_com_way_util_blur_jni_FrostedGlassUtil_colorWaterPaint(JNIE...
FILE: WayHoo/jni/imageProcess.c
function gaussBlurProcess (line 15) | void gaussBlurProcess(uint8_t *image, int width, int height)
function clearColorProcess (line 106) | void clearColorProcess(uint8_t *image, int width, int height, int color)
function blurH (line 126) | void blurH(uint8_t * image, int width, int height, int radius)
function boxBlurProcess (line 263) | void boxBlurProcess(uint8_t *image, int width, int height, int stride, i...
function iblurH (line 354) | static void iblurH(int *pDataSave, int * pData, int *divTable, int width...
function iblurV (line 468) | static void iblurV(int *pDataSave, int * pData, int *divTable, int width...
function stackBlurProcess (line 593) | void stackBlurProcess(uint8_t *image, int width, int height, int stride,...
function Math_max (line 606) | int Math_max(int x, int y){
function Math_min (line 610) | int Math_min(int x, int y){
function Math_abs (line 614) | int Math_abs(int x){
function iStackBlur (line 618) | static void iStackBlur(int *pData, int width, int height, int radius){
function iOilPaint (line 888) | static int iOilPaint( int * pDstData, int * pSrcData, int width, int hei...
function oilPaintProcess (line 991) | void oilPaintProcess(uint8_t *image, int width, int height, int stride, ...
function iPartions (line 1018) | static int iPartions(uint8_t a[],int low,int high)
function iQSort (line 1035) | static void iQSort(uint8_t a[],int low,int high)
function iQuickSort (line 1046) | static void iQuickSort(uint8_t a[],int n)
function imMedian (line 1052) | static void imMedian( int * pDstImage, int * pSrcImage, int width, int h...
function iColorWaterFilter (line 1153) | static void iColorWaterFilter( int * pDstImage, int * pSrcImage, int wid...
function colorWaterPaint (line 1291) | void colorWaterPaint( int * pSrcImage, int width, int height, int stride...
FILE: WayHoo/src/com/android/volley/AuthFailureError.java
class AuthFailureError (line 27) | @SuppressWarnings("serial")
method AuthFailureError (line 32) | public AuthFailureError() { }
method AuthFailureError (line 34) | public AuthFailureError(Intent intent) {
method AuthFailureError (line 38) | public AuthFailureError(NetworkResponse response) {
method AuthFailureError (line 42) | public AuthFailureError(String message) {
method AuthFailureError (line 46) | public AuthFailureError(String message, Exception reason) {
method getResolutionIntent (line 50) | public Intent getResolutionIntent() {
method getMessage (line 54) | @Override
FILE: WayHoo/src/com/android/volley/Cache.java
type Cache (line 25) | public interface Cache {
method get (line 31) | public Entry get(String key);
method put (line 38) | public void put(String key, Entry entry);
method initialize (line 44) | public void initialize();
method invalidate (line 51) | public void invalidate(String key, boolean fullExpire);
method remove (line 57) | public void remove(String key);
method clear (line 62) | public void clear();
class Entry (line 67) | public static class Entry {
method isExpired (line 87) | public boolean isExpired() {
method refreshNeeded (line 92) | public boolean refreshNeeded() {
FILE: WayHoo/src/com/android/volley/CacheDispatcher.java
class CacheDispatcher (line 32) | public class CacheDispatcher extends Thread {
method CacheDispatcher (line 60) | public CacheDispatcher(
method quit (line 73) | public void quit() {
method run (line 78) | @Override
FILE: WayHoo/src/com/android/volley/DefaultRetryPolicy.java
class DefaultRetryPolicy (line 22) | public class DefaultRetryPolicy implements RetryPolicy {
method DefaultRetryPolicy (line 47) | public DefaultRetryPolicy() {
method DefaultRetryPolicy (line 57) | public DefaultRetryPolicy(int initialTimeoutMs, int maxNumRetries, flo...
method getCurrentTimeout (line 66) | @Override
method getCurrentRetryCount (line 74) | @Override
method retry (line 83) | @Override
method hasAttemptRemaining (line 95) | protected boolean hasAttemptRemaining() {
FILE: WayHoo/src/com/android/volley/ExecutorDelivery.java
class ExecutorDelivery (line 26) | public class ExecutorDelivery implements ResponseDelivery {
method ExecutorDelivery (line 34) | public ExecutorDelivery(final Handler handler) {
method ExecutorDelivery (line 49) | public ExecutorDelivery(Executor executor) {
method postResponse (line 53) | @Override
method postResponse (line 58) | @Override
method postError (line 65) | @Override
class ResponseDeliveryRunnable (line 76) | @SuppressWarnings("rawtypes")
method ResponseDeliveryRunnable (line 82) | public ResponseDeliveryRunnable(Request request, Response response, ...
method run (line 88) | @SuppressWarnings("unchecked")
FILE: WayHoo/src/com/android/volley/Network.java
type Network (line 22) | public interface Network {
method performRequest (line 29) | public NetworkResponse performRequest(Request<?> request) throws Volle...
FILE: WayHoo/src/com/android/volley/NetworkDispatcher.java
class NetworkDispatcher (line 34) | public class NetworkDispatcher extends Thread {
method NetworkDispatcher (line 55) | public NetworkDispatcher(BlockingQueue<Request<?>> queue,
method quit (line 68) | public void quit() {
method addTrafficStatsTag (line 73) | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
method run (line 81) | @Override
method parseAndDeliverNetworkError (line 143) | private void parseAndDeliverNetworkError(Request<?> request, VolleyErr...
FILE: WayHoo/src/com/android/volley/NetworkError.java
class NetworkError (line 25) | @SuppressWarnings("serial")
method NetworkError (line 27) | public NetworkError() {
method NetworkError (line 31) | public NetworkError(Throwable cause) {
method NetworkError (line 35) | public NetworkError(NetworkResponse networkResponse) {
FILE: WayHoo/src/com/android/volley/NetworkResponse.java
class NetworkResponse (line 27) | public class NetworkResponse {
method NetworkResponse (line 35) | public NetworkResponse(int statusCode, byte[] data, Map<String, String...
method NetworkResponse (line 43) | public NetworkResponse(byte[] data) {
method NetworkResponse (line 47) | public NetworkResponse(byte[] data, Map<String, String> headers) {
FILE: WayHoo/src/com/android/volley/NoConnectionError.java
class NoConnectionError (line 22) | @SuppressWarnings("serial")
method NoConnectionError (line 24) | public NoConnectionError() {
method NoConnectionError (line 28) | public NoConnectionError(Throwable reason) {
FILE: WayHoo/src/com/android/volley/ParseError.java
class ParseError (line 25) | @SuppressWarnings("serial")
method ParseError (line 27) | public ParseError() { }
method ParseError (line 29) | public ParseError(NetworkResponse networkResponse) {
method ParseError (line 33) | public ParseError(Throwable cause) {
FILE: WayHoo/src/com/android/volley/Request.java
class Request (line 38) | public abstract class Request<T> implements Comparable<Request<T>> {
type Method (line 48) | public interface Method {
method Request (line 120) | @Deprecated
method Request (line 131) | public Request(int method, String url, Response.ErrorListener listener) {
method getMethod (line 143) | public int getMethod() {
method setTag (line 153) | public Request<?> setTag(Object tag) {
method getTag (line 162) | public Object getTag() {
method getTrafficStatsTag (line 169) | public int getTrafficStatsTag() {
method findDefaultTrafficStatsTag (line 176) | private static int findDefaultTrafficStatsTag(String url) {
method setRetryPolicy (line 194) | public Request<?> setRetryPolicy(RetryPolicy retryPolicy) {
method addMarker (line 202) | public void addMarker(String tag) {
method finish (line 215) | void finish(final String tag) {
method setRequestQueue (line 251) | public Request<?> setRequestQueue(RequestQueue requestQueue) {
method setSequence (line 261) | public final Request<?> setSequence(int sequence) {
method getSequence (line 269) | public final int getSequence() {
method getUrl (line 279) | public String getUrl() {
method getCacheKey (line 286) | public String getCacheKey() {
method setCacheEntry (line 296) | public Request<?> setCacheEntry(Cache.Entry entry) {
method getCacheEntry (line 304) | public Cache.Entry getCacheEntry() {
method cancel (line 311) | public void cancel() {
method isCanceled (line 318) | public boolean isCanceled() {
method getHeaders (line 328) | public Map<String, String> getHeaders() throws AuthFailureError {
method getPostParams (line 343) | @Deprecated
method getPostParamsEncoding (line 362) | @Deprecated
method getPostBodyContentType (line 370) | @Deprecated
method getPostBody (line 382) | @Deprecated
method getParams (line 403) | protected Map<String, String> getParams() throws AuthFailureError {
method getParamsEncoding (line 419) | protected String getParamsEncoding() {
method getBodyContentType (line 423) | public String getBodyContentType() {
method getBody (line 432) | public byte[] getBody() throws AuthFailureError {
method encodeParameters (line 443) | private byte[] encodeParameters(Map<String, String> params, String par...
method setShouldCache (line 463) | public final Request<?> setShouldCache(boolean shouldCache) {
method shouldCache (line 471) | public final boolean shouldCache() {
type Priority (line 479) | public enum Priority {
method getPriority (line 489) | public Priority getPriority() {
method getTimeoutMs (line 498) | public final int getTimeoutMs() {
method getRetryPolicy (line 505) | public RetryPolicy getRetryPolicy() {
method markDelivered (line 513) | public void markDelivered() {
method hasHadResponseDelivered (line 520) | public boolean hasHadResponseDelivered() {
method parseNetworkResponse (line 532) | abstract protected Response<T> parseNetworkResponse(NetworkResponse re...
method parseNetworkError (line 542) | protected VolleyError parseNetworkError(VolleyError volleyError) {
method deliverResponse (line 553) | abstract protected void deliverResponse(T response);
method deliverError (line 561) | public void deliverError(VolleyError error) {
method compareTo (line 571) | @Override
method toString (line 583) | @Override
FILE: WayHoo/src/com/android/volley/RequestQueue.java
class RequestQueue (line 38) | public class RequestQueue {
method RequestQueue (line 97) | public RequestQueue(Cache cache, Network network, int threadPoolSize,
method RequestQueue (line 112) | public RequestQueue(Cache cache, Network network, int threadPoolSize) {
method RequestQueue (line 123) | public RequestQueue(Cache cache, Network network) {
method start (line 130) | public void start() {
method stop (line 148) | public void stop() {
method getSequenceNumber (line 162) | public int getSequenceNumber() {
method getCache (line 169) | public Cache getCache() {
type RequestFilter (line 177) | public interface RequestFilter {
method apply (line 178) | public boolean apply(Request<?> request);
method cancelAll (line 185) | public void cancelAll(RequestFilter filter) {
method cancelAll (line 199) | public void cancelAll(final Object tag) {
method add (line 216) | public <T> Request<T> add(Request<T> request) {
method finish (line 264) | void finish(Request<?> request) {
FILE: WayHoo/src/com/android/volley/Response.java
class Response (line 24) | public class Response<T> {
type Listener (line 27) | public interface Listener<T> {
method onResponse (line 29) | public void onResponse(T response);
type ErrorListener (line 33) | public interface ErrorListener {
method onErrorResponse (line 38) | public void onErrorResponse(VolleyError error);
method success (line 42) | public static <T> Response<T> success(T result, Cache.Entry cacheEntry) {
method error (line 50) | public static <T> Response<T> error(VolleyError error) {
method isSuccess (line 69) | public boolean isSuccess() {
method Response (line 74) | private Response(T result, Cache.Entry cacheEntry) {
method Response (line 80) | private Response(VolleyError error) {
FILE: WayHoo/src/com/android/volley/ResponseDelivery.java
type ResponseDelivery (line 19) | public interface ResponseDelivery {
method postResponse (line 23) | public void postResponse(Request<?> request, Response<?> response);
method postResponse (line 29) | public void postResponse(Request<?> request, Response<?> response, Run...
method postError (line 34) | public void postError(Request<?> request, VolleyError error);
FILE: WayHoo/src/com/android/volley/RetryPolicy.java
type RetryPolicy (line 22) | public interface RetryPolicy {
method getCurrentTimeout (line 27) | public int getCurrentTimeout();
method getCurrentRetryCount (line 32) | public int getCurrentRetryCount();
method retry (line 40) | public void retry(VolleyError error) throws VolleyError;
FILE: WayHoo/src/com/android/volley/ServerError.java
class ServerError (line 25) | @SuppressWarnings("serial")
method ServerError (line 27) | public ServerError(NetworkResponse networkResponse) {
method ServerError (line 31) | public ServerError() {
FILE: WayHoo/src/com/android/volley/TimeoutError.java
class TimeoutError (line 22) | @SuppressWarnings("serial")
FILE: WayHoo/src/com/android/volley/VolleyError.java
class VolleyError (line 22) | @SuppressWarnings("serial")
method VolleyError (line 26) | public VolleyError() {
method VolleyError (line 30) | public VolleyError(NetworkResponse response) {
method VolleyError (line 34) | public VolleyError(String exceptionMessage) {
method VolleyError (line 39) | public VolleyError(String exceptionMessage, Throwable reason) {
method VolleyError (line 44) | public VolleyError(Throwable cause) {
FILE: WayHoo/src/com/android/volley/VolleyLog.java
class VolleyLog (line 27) | public class VolleyLog {
method setTag (line 40) | public static void setTag(String tag) {
method v (line 48) | public static void v(String format, Object... args) {
method d (line 54) | public static void d(String format, Object... args) {
method e (line 58) | public static void e(String format, Object... args) {
method e (line 62) | public static void e(Throwable tr, String format, Object... args) {
method wtf (line 66) | public static void wtf(String format, Object... args) {
method wtf (line 70) | public static void wtf(Throwable tr, String format, Object... args) {
method buildMessage (line 78) | private static String buildMessage(String format, Object... args) {
class MarkerLog (line 103) | static class MarkerLog {
class Marker (line 109) | private static class Marker {
method Marker (line 114) | public Marker(String name, long thread, long time) {
method add (line 125) | public synchronized void add(String name, long threadId) {
method finish (line 138) | public synchronized void finish(String header) {
method finalize (line 155) | @Override
method getTotalDuration (line 166) | private long getTotalDuration() {
FILE: WayHoo/src/com/android/volley/toolbox/AndroidAuthenticator.java
class AndroidAuthenticator (line 32) | public class AndroidAuthenticator implements Authenticator {
method AndroidAuthenticator (line 44) | public AndroidAuthenticator(Context context, Account account, String a...
method AndroidAuthenticator (line 55) | public AndroidAuthenticator(Context context, Account account, String a...
method getAccount (line 66) | public Account getAccount() {
method getAuthToken (line 71) | @SuppressWarnings("deprecation")
method invalidateAuthToken (line 98) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/Authenticator.java
type Authenticator (line 24) | public interface Authenticator {
method getAuthToken (line 30) | public String getAuthToken() throws AuthFailureError;
method invalidateAuthToken (line 35) | public void invalidateAuthToken(String authToken);
FILE: WayHoo/src/com/android/volley/toolbox/BasicNetwork.java
class BasicNetwork (line 53) | public class BasicNetwork implements Network {
method BasicNetwork (line 67) | public BasicNetwork(HttpStack httpStack) {
method BasicNetwork (line 77) | public BasicNetwork(HttpStack httpStack, ByteArrayPool pool) {
method performRequest (line 82) | @Override
method logSlowRequests (line 158) | private void logSlowRequests(long requestLifetime, Request<?> request,
method attemptRetryOnException (line 173) | private static void attemptRetryOnException(String logPrefix, Request<...
method addCacheHeaders (line 188) | private void addCacheHeaders(Map<String, String> headers, Cache.Entry ...
method logError (line 204) | protected void logError(String what, String url, long start) {
method entityToBytes (line 210) | private byte[] entityToBytes(HttpEntity entity) throws IOException, Se...
method convertHeaders (line 242) | private static Map<String, String> convertHeaders(Header[] headers) {
FILE: WayHoo/src/com/android/volley/toolbox/ByteArrayPool.java
class ByteArrayPool (line 54) | public class ByteArrayPool {
method compare (line 70) | @Override
method ByteArrayPool (line 79) | public ByteArrayPool(int sizeLimit) {
method getBuf (line 91) | public synchronized byte[] getBuf(int len) {
method returnBuf (line 110) | public synchronized void returnBuf(byte[] buf) {
method trim (line 127) | private synchronized void trim() {
FILE: WayHoo/src/com/android/volley/toolbox/ClearCacheRequest.java
class ClearCacheRequest (line 30) | public class ClearCacheRequest extends Request<Object> {
method ClearCacheRequest (line 40) | public ClearCacheRequest(Cache cache, Runnable callback) {
method isCanceled (line 46) | @Override
method getPriority (line 57) | @Override
method parseNetworkResponse (line 62) | @Override
method deliverResponse (line 67) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/DiskBasedCache.java
class DiskBasedCache (line 42) | public class DiskBasedCache implements Cache {
method DiskBasedCache (line 71) | public DiskBasedCache(File rootDirectory, int maxCacheSizeInBytes) {
method DiskBasedCache (line 81) | public DiskBasedCache(File rootDirectory) {
method clear (line 88) | @Override
method get (line 104) | @Override
method initialize (line 138) | @Override
method invalidate (line 177) | @Override
method put (line 193) | @Override
method remove (line 221) | @Override
method getFilenameForKey (line 236) | private String getFilenameForKey(String key) {
method getFileForKey (line 246) | public File getFileForKey(String key) {
method pruneIfNeeded (line 254) | private void pruneIfNeeded(int neededSpace) {
method putEntry (line 296) | private void putEntry(String key, CacheHeader entry) {
method removeEntry (line 309) | private void removeEntry(String key) {
method streamToBytes (line 320) | private static byte[] streamToBytes(InputStream in, int length) throws...
class CacheHeader (line 337) | static class CacheHeader {
method CacheHeader (line 360) | private CacheHeader() { }
method CacheHeader (line 367) | public CacheHeader(String key, Entry entry) {
method readHeader (line 382) | public static CacheHeader readHeader(InputStream is) throws IOExcept...
method toCacheEntry (line 404) | public Entry toCacheEntry(byte[] data) {
method writeHeader (line 419) | public boolean writeHeader(OutputStream os) {
class CountingInputStream (line 438) | private static class CountingInputStream extends FilterInputStream {
method CountingInputStream (line 441) | private CountingInputStream(InputStream in) {
method read (line 445) | @Override
method read (line 454) | @Override
method read (line 475) | private static int read(InputStream is) throws IOException {
method writeInt (line 483) | static void writeInt(OutputStream os, int n) throws IOException {
method readInt (line 490) | static int readInt(InputStream is) throws IOException {
method writeLong (line 499) | static void writeLong(OutputStream os, long n) throws IOException {
method readLong (line 510) | static long readLong(InputStream is) throws IOException {
method writeString (line 523) | static void writeString(OutputStream os, String s) throws IOException {
method readString (line 529) | static String readString(InputStream is) throws IOException {
method writeStringStringMap (line 535) | static void writeStringStringMap(Map<String, String> map, OutputStream...
method readStringStringMap (line 547) | static Map<String, String> readStringStringMap(InputStream is) throws ...
FILE: WayHoo/src/com/android/volley/toolbox/HttpClientStack.java
class HttpClientStack (line 50) | public class HttpClientStack implements HttpStack {
method HttpClientStack (line 55) | public HttpClientStack(HttpClient client) {
method addHeaders (line 59) | private static void addHeaders(HttpUriRequest httpRequest, Map<String,...
method getPostParameterPairs (line 65) | @SuppressWarnings("unused")
method performRequest (line 74) | @Override
method createHttpRequest (line 93) | @SuppressWarnings("deprecation")
method setEntityIfNonEmptyBody (line 146) | private static void setEntityIfNonEmptyBody(HttpEntityEnclosingRequest...
method onPrepareRequest (line 160) | protected void onPrepareRequest(HttpUriRequest request) throws IOExcep...
class HttpPatch (line 167) | public static final class HttpPatch extends HttpEntityEnclosingRequest...
method HttpPatch (line 171) | public HttpPatch() {
method HttpPatch (line 175) | public HttpPatch(final URI uri) {
method HttpPatch (line 183) | public HttpPatch(final String uri) {
method getMethod (line 188) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/HttpHeaderParser.java
class HttpHeaderParser (line 31) | public class HttpHeaderParser {
method parseCacheHeaders (line 39) | public static Cache.Entry parseCacheHeaders(NetworkResponse response) {
method parseDateAsEpoch (line 107) | public static long parseDateAsEpoch(String dateStr) {
method parseCharset (line 121) | public static String parseCharset(Map<String, String> headers) {
FILE: WayHoo/src/com/android/volley/toolbox/HttpStack.java
type HttpStack (line 30) | public interface HttpStack {
method performRequest (line 42) | public HttpResponse performRequest(Request<?> request, Map<String, Str...
FILE: WayHoo/src/com/android/volley/toolbox/HurlStack.java
class HurlStack (line 49) | public class HurlStack implements HttpStack {
type UrlRewriter (line 56) | public interface UrlRewriter {
method rewriteUrl (line 61) | public String rewriteUrl(String originalUrl);
method HurlStack (line 67) | public HurlStack() {
method HurlStack (line 74) | public HurlStack(UrlRewriter urlRewriter) {
method HurlStack (line 82) | public HurlStack(UrlRewriter urlRewriter, SSLSocketFactory sslSocketFa...
method performRequest (line 87) | @Override
method entityFromConnection (line 133) | private static HttpEntity entityFromConnection(HttpURLConnection conne...
method createConnection (line 151) | protected HttpURLConnection createConnection(URL url) throws IOExcepti...
method openConnection (line 161) | private HttpURLConnection openConnection(URL url, Request<?> request) ...
method setConnectionParametersForRequest (line 178) | @SuppressWarnings("deprecation")
method addBodyIfExists (line 234) | private static void addBodyIfExists(HttpURLConnection connection, Requ...
FILE: WayHoo/src/com/android/volley/toolbox/ImageLoader.java
class ImageLoader (line 43) | public class ImageLoader {
type ImageCache (line 75) | public interface ImageCache {
method getBitmap (line 76) | public Bitmap getBitmap(String url);
method putBitmap (line 77) | public void putBitmap(String url, Bitmap bitmap);
method ImageLoader (line 85) | public ImageLoader(RequestQueue queue, ImageCache imageCache) {
method getImageListener (line 98) | public static ImageListener getImageListener(final ImageView view,
type ImageListener (line 132) | public interface ImageListener extends ErrorListener {
method onResponse (line 143) | public void onResponse(ImageContainer response, boolean isImmediate);
method isCached (line 153) | public boolean isCached(String requestUrl, int maxWidth, int maxHeight) {
method get (line 170) | public ImageContainer get(String requestUrl, final ImageListener liste...
method get (line 186) | public ImageContainer get(String requestUrl, ImageListener imageListener,
method setBatchedResponseDelay (line 244) | public void setBatchedResponseDelay(int newBatchedResponseDelayMs) {
method onGetImageSuccess (line 253) | private void onGetImageSuccess(String cacheKey, Bitmap response) {
method onGetImageError (line 273) | private void onGetImageError(String cacheKey, VolleyError error) {
class ImageContainer (line 290) | public class ImageContainer {
method ImageContainer (line 311) | public ImageContainer(Bitmap bitmap, String requestUrl,
method cancelRequest (line 322) | public void cancelRequest() {
method getBitmap (line 348) | public Bitmap getBitmap() {
method getRequestUrl (line 355) | public String getRequestUrl() {
class BatchedImageRequest (line 364) | private class BatchedImageRequest {
method BatchedImageRequest (line 382) | public BatchedImageRequest(Request<?> request, ImageContainer contai...
method setError (line 390) | public void setError(VolleyError error) {
method getError (line 397) | public VolleyError getError() {
method addContainer (line 405) | public void addContainer(ImageContainer container) {
method removeContainerAndCancelIfNecessary (line 415) | public boolean removeContainerAndCancelIfNecessary(ImageContainer co...
method batchResponse (line 431) | private void batchResponse(String cacheKey, BatchedImageRequest reques...
method throwIfNotOnMainThread (line 465) | private void throwIfNotOnMainThread() {
method getCacheKey (line 476) | private static String getCacheKey(String url, int maxWidth, int maxHei...
FILE: WayHoo/src/com/android/volley/toolbox/ImageRequest.java
class ImageRequest (line 34) | public class ImageRequest extends Request<Bitmap> {
method ImageRequest (line 69) | public ImageRequest(String url, Response.Listener<Bitmap> listener, in...
method getPriority (line 80) | @Override
method getResizedDimension (line 96) | private static int getResizedDimension(int maxPrimary, int maxSecondar...
method parseNetworkResponse (line 121) | @Override
method doParse (line 137) | private Response<Bitmap> doParse(NetworkResponse response) {
method deliverResponse (line 184) | @Override
method findBestSampleSize (line 199) | static int findBestSampleSize(
FILE: WayHoo/src/com/android/volley/toolbox/JsonArrayRequest.java
class JsonArrayRequest (line 33) | public class JsonArrayRequest extends JsonRequest<JSONArray> {
method JsonArrayRequest (line 41) | public JsonArrayRequest(String url, Listener<JSONArray> listener, Erro...
method parseNetworkResponse (line 45) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/JsonObjectRequest.java
class JsonObjectRequest (line 34) | public class JsonObjectRequest extends JsonRequest<JSONObject> {
method JsonObjectRequest (line 45) | public JsonObjectRequest(int method, String url, JSONObject jsonRequest,
method JsonObjectRequest (line 57) | public JsonObjectRequest(String url, JSONObject jsonRequest, Listener<...
method parseNetworkResponse (line 63) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/JsonRequest.java
class JsonRequest (line 34) | public abstract class JsonRequest<T> extends Request<T> {
method JsonRequest (line 51) | public JsonRequest(String url, String requestBody, Listener<T> listener,
method JsonRequest (line 56) | public JsonRequest(int method, String url, String requestBody, Listene...
method deliverResponse (line 63) | @Override
method parseNetworkResponse (line 68) | @Override
method getPostBodyContentType (line 74) | @Override
method getPostBody (line 82) | @Override
method getBodyContentType (line 87) | @Override
method getBody (line 92) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/NetworkImageView.java
class NetworkImageView (line 32) | public class NetworkImageView extends ImageView {
method NetworkImageView (line 52) | public NetworkImageView(Context context) {
method NetworkImageView (line 56) | public NetworkImageView(Context context, AttributeSet attrs) {
method NetworkImageView (line 60) | public NetworkImageView(Context context, AttributeSet attrs, int defSt...
method setImageUrl (line 76) | public void setImageUrl(String url, ImageLoader imageLoader) {
method setDefaultImageResId (line 87) | public void setDefaultImageResId(int defaultImage) {
method setErrorImageResId (line 95) | public void setErrorImageResId(int errorImage) {
method loadImageIfNecessary (line 103) | void loadImageIfNecessary(final boolean isInLayoutPass) {
method setDefaultImageOrNull (line 186) | private void setDefaultImageOrNull() {
method onLayout (line 195) | @Override
method onDetachedFromWindow (line 201) | @Override
method drawableStateChanged (line 214) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/NoCache.java
class NoCache (line 24) | public class NoCache implements Cache {
method clear (line 25) | @Override
method get (line 29) | @Override
method put (line 34) | @Override
method invalidate (line 38) | @Override
method remove (line 42) | @Override
method initialize (line 46) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/PoolingByteArrayOutputStream.java
class PoolingByteArrayOutputStream (line 26) | public class PoolingByteArrayOutputStream extends ByteArrayOutputStream {
method PoolingByteArrayOutputStream (line 39) | public PoolingByteArrayOutputStream(ByteArrayPool pool) {
method PoolingByteArrayOutputStream (line 51) | public PoolingByteArrayOutputStream(ByteArrayPool pool, int size) {
method close (line 56) | @Override
method finalize (line 63) | @Override
method expand (line 71) | private void expand(int i) {
method write (line 82) | @Override
method write (line 88) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/RequestFuture.java
class RequestFuture (line 54) | public class RequestFuture<T> implements Future<T>, Response.Listener<T>,
method newFuture (line 61) | public static <E> RequestFuture<E> newFuture() {
method RequestFuture (line 65) | private RequestFuture() {}
method setRequest (line 67) | public void setRequest(Request<?> request) {
method cancel (line 71) | @Override
method get (line 85) | @Override
method get (line 94) | @Override
method doGet (line 100) | private synchronized T doGet(Long timeoutMs)
method isCancelled (line 127) | @Override
method isDone (line 135) | @Override
method onResponse (line 140) | @Override
method onErrorResponse (line 147) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/StringRequest.java
class StringRequest (line 30) | public class StringRequest extends Request<String> {
method StringRequest (line 41) | public StringRequest(int method, String url, Listener<String> listener,
method StringRequest (line 54) | public StringRequest(String url, Listener<String> listener, ErrorListe...
method deliverResponse (line 58) | @Override
method parseNetworkResponse (line 63) | @Override
FILE: WayHoo/src/com/android/volley/toolbox/Volley.java
class Volley (line 30) | public class Volley {
method newRequestQueue (line 42) | public static RequestQueue newRequestQueue(Context context, HttpStack ...
method newRequestQueue (line 77) | public static RequestQueue newRequestQueue(Context context) {
FILE: WayHoo/src/com/viewpagerindicator/CirclePageIndicator.java
class CirclePageIndicator (line 45) | public class CirclePageIndicator extends View implements PageIndicator {
method CirclePageIndicator (line 68) | public CirclePageIndicator(Context context) {
method CirclePageIndicator (line 72) | public CirclePageIndicator(Context context, AttributeSet attrs) {
method CirclePageIndicator (line 76) | public CirclePageIndicator(Context context, AttributeSet attrs, int de...
method setCentered (line 118) | public void setCentered(boolean centered) {
method isCentered (line 123) | public boolean isCentered() {
method setPageColor (line 127) | public void setPageColor(int pageColor) {
method getPageColor (line 132) | public int getPageColor() {
method setFillColor (line 136) | public void setFillColor(int fillColor) {
method getFillColor (line 141) | public int getFillColor() {
method setOrientation (line 145) | public void setOrientation(int orientation) {
method getOrientation (line 158) | public int getOrientation() {
method setStrokeColor (line 162) | public void setStrokeColor(int strokeColor) {
method getStrokeColor (line 167) | public int getStrokeColor() {
method setStrokeWidth (line 171) | public void setStrokeWidth(float strokeWidth) {
method getStrokeWidth (line 176) | public float getStrokeWidth() {
method setRadius (line 180) | public void setRadius(float radius) {
method getRadius (line 185) | public float getRadius() {
method setSnap (line 189) | public void setSnap(boolean snap) {
method isSnap (line 194) | public boolean isSnap() {
method onDraw (line 198) | @Override
method onTouchEvent (line 282) | public boolean onTouchEvent(android.view.MotionEvent ev) {
method setViewPager (line 365) | @Override
method setViewPager (line 381) | @Override
method setCurrentItem (line 387) | @Override
method notifyDataSetChanged (line 397) | @Override
method onPageScrollStateChanged (line 402) | @Override
method onPageScrolled (line 411) | @Override
method onPageSelected (line 422) | @Override
method setOnPageChangeListener (line 435) | @Override
method onMeasure (line 445) | @Override
method measureLong (line 461) | private int measureLong(int measureSpec) {
method measureShort (line 489) | private int measureShort(int measureSpec) {
method onRestoreInstanceState (line 508) | @Override
method onSaveInstanceState (line 517) | @Override
class SavedState (line 525) | static class SavedState extends BaseSavedState {
method SavedState (line 528) | public SavedState(Parcelable superState) {
method SavedState (line 532) | private SavedState(Parcel in) {
method writeToParcel (line 537) | @Override
method createFromParcel (line 545) | @Override
method newArray (line 550) | @Override
FILE: WayHoo/src/com/viewpagerindicator/IconPageIndicator.java
class IconPageIndicator (line 37) | public class IconPageIndicator extends HorizontalScrollView implements P...
method IconPageIndicator (line 45) | public IconPageIndicator(Context context) {
method IconPageIndicator (line 49) | public IconPageIndicator(Context context, AttributeSet attrs) {
method animateToIcon (line 57) | private void animateToIcon(final int position) {
method onAttachedToWindow (line 72) | @Override
method onDetachedFromWindow (line 81) | @Override
method onPageScrollStateChanged (line 89) | @Override
method onPageScrolled (line 96) | @Override
method onPageSelected (line 103) | @Override
method setViewPager (line 111) | @Override
method notifyDataSetChanged (line 128) | public void notifyDataSetChanged() {
method setViewPager (line 144) | @Override
method setCurrentItem (line 150) | @Override
method setOnPageChangeListener (line 169) | @Override
FILE: WayHoo/src/com/viewpagerindicator/IconPagerAdapter.java
type IconPagerAdapter (line 3) | public interface IconPagerAdapter {
method getIconResId (line 7) | int getIconResId(int index);
method getCount (line 10) | int getCount();
FILE: WayHoo/src/com/viewpagerindicator/IcsLinearLayout.java
class IcsLinearLayout (line 17) | class IcsLinearLayout extends LinearLayout {
method IcsLinearLayout (line 34) | public IcsLinearLayout(Context context, int themeAttr) {
method setDividerDrawable (line 44) | public void setDividerDrawable(Drawable divider) {
method measureChildWithMargins (line 60) | @Override
method onDraw (line 88) | @Override
method drawDividersVertical (line 100) | private void drawDividersVertical(Canvas canvas) {
method drawDividersHorizontal (line 127) | private void drawDividersHorizontal(Canvas canvas) {
method drawHorizontalDivider (line 154) | private void drawHorizontalDivider(Canvas canvas, int top) {
method drawVerticalDivider (line 160) | private void drawVerticalDivider(Canvas canvas, int left) {
method hasDividerBeforeChildAt (line 166) | private boolean hasDividerBeforeChildAt(int childIndex) {
FILE: WayHoo/src/com/viewpagerindicator/LinePageIndicator.java
class LinePageIndicator (line 41) | public class LinePageIndicator extends View implements PageIndicator {
method LinePageIndicator (line 59) | public LinePageIndicator(Context context) {
method LinePageIndicator (line 63) | public LinePageIndicator(Context context, AttributeSet attrs) {
method LinePageIndicator (line 67) | public LinePageIndicator(Context context, AttributeSet attrs, int defS...
method setCentered (line 103) | public void setCentered(boolean centered) {
method isCentered (line 108) | public boolean isCentered() {
method setUnselectedColor (line 112) | public void setUnselectedColor(int unselectedColor) {
method getUnselectedColor (line 117) | public int getUnselectedColor() {
method setSelectedColor (line 121) | public void setSelectedColor(int selectedColor) {
method getSelectedColor (line 126) | public int getSelectedColor() {
method setLineWidth (line 130) | public void setLineWidth(float lineWidth) {
method getLineWidth (line 135) | public float getLineWidth() {
method setStrokeWidth (line 139) | public void setStrokeWidth(float lineHeight) {
method getStrokeWidth (line 145) | public float getStrokeWidth() {
method setGapWidth (line 149) | public void setGapWidth(float gapWidth) {
method getGapWidth (line 154) | public float getGapWidth() {
method onDraw (line 158) | @Override
method onTouchEvent (line 195) | public boolean onTouchEvent(android.view.MotionEvent ev) {
method setViewPager (line 278) | @Override
method setViewPager (line 295) | @Override
method setCurrentItem (line 301) | @Override
method notifyDataSetChanged (line 311) | @Override
method onPageScrollStateChanged (line 316) | @Override
method onPageScrolled (line 323) | @Override
method onPageSelected (line 330) | @Override
method setOnPageChangeListener (line 340) | @Override
method onMeasure (line 345) | @Override
method measureWidth (line 357) | private int measureWidth(int measureSpec) {
method measureHeight (line 384) | private int measureHeight(int measureSpec) {
method onRestoreInstanceState (line 403) | @Override
method onSaveInstanceState (line 411) | @Override
class SavedState (line 419) | static class SavedState extends BaseSavedState {
method SavedState (line 422) | public SavedState(Parcelable superState) {
method SavedState (line 426) | private SavedState(Parcel in) {
method writeToParcel (line 431) | @Override
method createFromParcel (line 439) | @Override
method newArray (line 444) | @Override
FILE: WayHoo/src/com/viewpagerindicator/PageIndicator.java
type PageIndicator (line 26) | public interface PageIndicator extends ViewPager.OnPageChangeListener {
method setViewPager (line 32) | void setViewPager(ViewPager view);
method setViewPager (line 40) | void setViewPager(ViewPager view, int initialPosition);
method setCurrentItem (line 50) | void setCurrentItem(int item);
method setOnPageChangeListener (line 57) | void setOnPageChangeListener(ViewPager.OnPageChangeListener listener);
method notifyDataSetChanged (line 62) | void notifyDataSetChanged();
FILE: WayHoo/src/com/viewpagerindicator/TabPageIndicator.java
class TabPageIndicator (line 38) | public class TabPageIndicator extends HorizontalScrollView implements Pa...
type OnTabReselectedListener (line 45) | public interface OnTabReselectedListener {
method onTabReselected (line 51) | void onTabReselected(int position);
method onClick (line 57) | public void onClick(View view) {
method TabPageIndicator (line 78) | public TabPageIndicator(Context context) {
method TabPageIndicator (line 82) | public TabPageIndicator(Context context, AttributeSet attrs) {
method setOnTabReselectedListener (line 90) | public void setOnTabReselectedListener(OnTabReselectedListener listene...
method onMeasure (line 94) | @Override
method animateToTab (line 121) | private void animateToTab(final int position) {
method onAttachedToWindow (line 136) | @Override
method onDetachedFromWindow (line 145) | @Override
method addTab (line 153) | private void addTab(int index, CharSequence text, int iconResId) {
method onPageScrollStateChanged (line 167) | @Override
method onPageScrolled (line 174) | @Override
method onPageSelected (line 181) | @Override
method setViewPager (line 189) | @Override
method notifyDataSetChanged (line 206) | public void notifyDataSetChanged() {
method setViewPager (line 232) | @Override
method setCurrentItem (line 238) | @Override
method setOnPageChangeListener (line 257) | @Override
class TabView (line 262) | private class TabView extends TextView {
method TabView (line 265) | public TabView(Context context) {
method onMeasure (line 269) | @Override
method getIndex (line 280) | public int getIndex() {
FILE: WayHoo/src/com/viewpagerindicator/TitlePageIndicator.java
class TitlePageIndicator (line 49) | public class TitlePageIndicator extends View implements PageIndicator {
type OnCenterItemClickListener (line 72) | public interface OnCenterItemClickListener {
method onCenterItemClick (line 78) | void onCenterItemClick(int position);
type IndicatorStyle (line 81) | public enum IndicatorStyle {
method IndicatorStyle (line 86) | private IndicatorStyle(int value) {
method fromValue (line 90) | public static IndicatorStyle fromValue(int value) {
type LinePosition (line 100) | public enum LinePosition {
method LinePosition (line 105) | private LinePosition(int value) {
method fromValue (line 109) | public static LinePosition fromValue(int value) {
method TitlePageIndicator (line 153) | public TitlePageIndicator(Context context) {
method TitlePageIndicator (line 157) | public TitlePageIndicator(Context context, AttributeSet attrs) {
method TitlePageIndicator (line 161) | public TitlePageIndicator(Context context, AttributeSet attrs, int def...
method getFooterColor (line 221) | public int getFooterColor() {
method setFooterColor (line 225) | public void setFooterColor(int footerColor) {
method getFooterLineHeight (line 231) | public float getFooterLineHeight() {
method setFooterLineHeight (line 235) | public void setFooterLineHeight(float footerLineHeight) {
method getFooterIndicatorHeight (line 241) | public float getFooterIndicatorHeight() {
method setFooterIndicatorHeight (line 245) | public void setFooterIndicatorHeight(float footerTriangleHeight) {
method getFooterIndicatorPadding (line 250) | public float getFooterIndicatorPadding() {
method setFooterIndicatorPadding (line 254) | public void setFooterIndicatorPadding(float footerIndicatorPadding) {
method getFooterIndicatorStyle (line 259) | public IndicatorStyle getFooterIndicatorStyle() {
method setFooterIndicatorStyle (line 263) | public void setFooterIndicatorStyle(IndicatorStyle indicatorStyle) {
method getLinePosition (line 268) | public LinePosition getLinePosition() {
method setLinePosition (line 272) | public void setLinePosition(LinePosition linePosition) {
method getSelectedColor (line 277) | public int getSelectedColor() {
method setSelectedColor (line 281) | public void setSelectedColor(int selectedColor) {
method isSelectedBold (line 286) | public boolean isSelectedBold() {
method setSelectedBold (line 290) | public void setSelectedBold(boolean selectedBold) {
method getTextColor (line 295) | public int getTextColor() {
method setTextColor (line 299) | public void setTextColor(int textColor) {
method getTextSize (line 305) | public float getTextSize() {
method setTextSize (line 309) | public void setTextSize(float textSize) {
method getTitlePadding (line 314) | public float getTitlePadding() {
method setTitlePadding (line 318) | public void setTitlePadding(float titlePadding) {
method getTopPadding (line 323) | public float getTopPadding() {
method setTopPadding (line 327) | public void setTopPadding(float topPadding) {
method getClipPadding (line 332) | public float getClipPadding() {
method setClipPadding (line 336) | public void setClipPadding(float clipPadding) {
method setTypeface (line 341) | public void setTypeface(Typeface typeface) {
method getTypeface (line 346) | public Typeface getTypeface() {
method onDraw (line 355) | @Override
method onTouchEvent (line 546) | public boolean onTouchEvent(android.view.MotionEvent ev) {
method clipViewOnTheRight (line 649) | private void clipViewOnTheRight(Rect curViewBound, float curViewWidth,...
method clipViewOnTheLeft (line 662) | private void clipViewOnTheLeft(Rect curViewBound, float curViewWidth, ...
method calculateAllBounds (line 673) | private ArrayList<Rect> calculateAllBounds(Paint paint) {
method calcBounds (line 700) | private Rect calcBounds(int index, Paint paint) {
method setViewPager (line 709) | @Override
method setViewPager (line 725) | @Override
method notifyDataSetChanged (line 731) | @Override
method setOnCenterItemClickListener (line 741) | public void setOnCenterItemClickListener(OnCenterItemClickListener lis...
method setCurrentItem (line 745) | @Override
method onPageScrollStateChanged (line 755) | @Override
method onPageScrolled (line 764) | @Override
method onPageSelected (line 775) | @Override
method setOnPageChangeListener (line 787) | @Override
method onMeasure (line 792) | @Override
method onRestoreInstanceState (line 817) | @Override
method onSaveInstanceState (line 825) | @Override
class SavedState (line 833) | static class SavedState extends BaseSavedState {
method SavedState (line 836) | public SavedState(Parcelable superState) {
method SavedState (line 840) | private SavedState(Parcel in) {
method writeToParcel (line 845) | @Override
method createFromParcel (line 853) | @Override
method newArray (line 858) | @Override
method getTitle (line 865) | private CharSequence getTitle(int i) {
FILE: WayHoo/src/com/viewpagerindicator/UnderlinePageIndicator.java
class UnderlinePageIndicator (line 40) | public class UnderlinePageIndicator extends View implements PageIndicator {
method run (line 63) | @Override public void run() {
method UnderlinePageIndicator (line 75) | public UnderlinePageIndicator(Context context) {
method UnderlinePageIndicator (line 79) | public UnderlinePageIndicator(Context context, AttributeSet attrs) {
method UnderlinePageIndicator (line 83) | public UnderlinePageIndicator(Context context, AttributeSet attrs, int...
method getFades (line 114) | public boolean getFades() {
method setFades (line 118) | public void setFades(boolean fades) {
method getFadeDelay (line 131) | public int getFadeDelay() {
method setFadeDelay (line 135) | public void setFadeDelay(int fadeDelay) {
method getFadeLength (line 139) | public int getFadeLength() {
method setFadeLength (line 143) | public void setFadeLength(int fadeLength) {
method getSelectedColor (line 148) | public int getSelectedColor() {
method setSelectedColor (line 152) | public void setSelectedColor(int selectedColor) {
method onDraw (line 157) | @Override
method onTouchEvent (line 183) | public boolean onTouchEvent(MotionEvent ev) {
method setViewPager (line 266) | @Override
method setViewPager (line 290) | @Override
method setCurrentItem (line 296) | @Override
method notifyDataSetChanged (line 306) | @Override
method onPageScrollStateChanged (line 311) | @Override
method onPageScrolled (line 320) | @Override
method onPageSelected (line 339) | @Override
method setOnPageChangeListener (line 352) | @Override
method onRestoreInstanceState (line 357) | @Override
method onSaveInstanceState (line 365) | @Override
class SavedState (line 373) | static class SavedState extends BaseSavedState {
method SavedState (line 376) | public SavedState(Parcelable superState) {
method SavedState (line 380) | private SavedState(Parcel in) {
method writeToParcel (line 385) | @Override
method createFromParcel (line 393) | @Override
method newArray (line 398) | @Override
FILE: WayHoo/src/com/way/adapter/FragmentPagerAdapter.java
class FragmentPagerAdapter (line 67) | public abstract class FragmentPagerAdapter extends PagerAdapter {
method FragmentPagerAdapter (line 75) | public FragmentPagerAdapter(FragmentManager fm) {
method getItem (line 82) | public abstract Fragment getItem(int position);
method startUpdate (line 84) | @Override
method instantiateItem (line 88) | @Override
method freshUI (line 115) | protected void freshUI(Fragment fragment) {
method destroyItem (line 120) | @Override
method setPrimaryItem (line 132) | @Override
method finishUpdate (line 148) | @Override
method isViewFromObject (line 157) | @Override
method saveState (line 162) | @Override
method restoreState (line 167) | @Override
method getItemId (line 180) | public long getItemId(int position) {
method makeFragmentName (line 184) | protected abstract String makeFragmentName(int position);
FILE: WayHoo/src/com/way/adapter/ParallaxPagerTransformer.java
class ParallaxPagerTransformer (line 7) | public class ParallaxPagerTransformer implements ViewPager.PageTransform...
method ParallaxPagerTransformer (line 13) | public ParallaxPagerTransformer(int id) {
method transformPage (line 17) | @Override
method setBorder (line 39) | public void setBorder(int px) {
method setSpeed (line 43) | public void setSpeed(float speed) {
FILE: WayHoo/src/com/way/adapter/QueryCityAdapter.java
class QueryCityAdapter (line 19) | public class QueryCityAdapter extends BaseAdapter implements Filterable {
method QueryCityAdapter (line 26) | public QueryCityAdapter(Context context, List<City> allCities) {
method getCount (line 33) | @Override
method getItem (line 38) | @Override
method getItemId (line 43) | @Override
method getView (line 48) | @Override
class ViewHolder (line 73) | static class ViewHolder {
method getFilter (line 79) | @Override
FILE: WayHoo/src/com/way/adapter/SideMenuAdapter.java
class SideMenuAdapter (line 18) | public class SideMenuAdapter extends BaseAdapter {
method SideMenuAdapter (line 24) | public SideMenuAdapter(Context context) {
method addContent (line 29) | public void addContent(List<City> tmpCities) {
method getCount (line 47) | @Override
method getItem (line 52) | @Override
method getItemId (line 57) | @Override
method getItemViewType (line 62) | @Override
method getViewTypeCount (line 67) | @Override
method isEnabled (line 72) | @Override
method areAllItemsEnabled (line 77) | @Override
method getView (line 82) | @Override
method buildHolder (line 111) | private ViewHolder buildHolder(View convertView) {
method bindViewData (line 117) | private void bindViewData(ViewHolder holder, final int position) {
class ViewHolder (line 134) | private static final class ViewHolder {
FILE: WayHoo/src/com/way/adapter/WeatherListAdapter.java
class WeatherListAdapter (line 20) | public class WeatherListAdapter extends BaseAdapter {
method WeatherListAdapter (line 31) | public WeatherListAdapter(Context context) {
method initViews (line 36) | public void initViews() {
method setWeather (line 53) | public void setWeather(WeatherInfo weatherInfo) {
method getCount (line 68) | @Override
method getItem (line 73) | @Override
method getItemId (line 78) | @Override
method getViewTypeCount (line 83) | @Override
method getItemViewType (line 90) | @Override
method getView (line 97) | @Override
FILE: WayHoo/src/com/way/adapter/WeatherPagerAdapter.java
class WeatherPagerAdapter (line 16) | public class WeatherPagerAdapter extends FragmentPagerAdapter {
method WeatherPagerAdapter (line 25) | public WeatherPagerAdapter(Activity activity) {
method setData (line 30) | public void setData(List<City> mainItems) {
method getFragment (line 38) | public Fragment getFragment(final int position) {
method instantiateItem (line 48) | @Override
method destroyItem (line 63) | @Override
method getItem (line 75) | @Override
method getCount (line 83) | @Override
method getPageTitle (line 88) | @Override
method getCurrentPage (line 98) | public int getCurrentPage() {
method setCurrentPage (line 108) | public void setCurrentPage(final int currentPage) {
method getItemPosition (line 123) | @Override
method makeFragmentName (line 132) | @Override
FILE: WayHoo/src/com/way/beans/Category.java
class Category (line 3) | public class Category {
method Category (line 8) | public Category(String title) {
method Category (line 12) | public Category(int title) {
FILE: WayHoo/src/com/way/beans/City.java
class City (line 6) | public class City implements Parcelable {
method City (line 20) | public City() {
method City (line 23) | public City(String name, String postID, long refreshTime, int isLocati...
method City (line 33) | public City(String name, String postID) {
method City (line 39) | public City(String province, String city, String name, String pinyin,
method getProvince (line 52) | public String getProvince() {
method setProvince (line 56) | public void setProvince(String province) {
method getCity (line 60) | public String getCity() {
method setCity (line 64) | public void setCity(String city) {
method getName (line 68) | public String getName() {
method setName (line 72) | public void setName(String name) {
method getPinyin (line 76) | public String getPinyin() {
method setPinyin (line 80) | public void setPinyin(String pinyin) {
method getPy (line 84) | public String getPy() {
method setPy (line 88) | public void setPy(String py) {
method getPhoneCode (line 92) | public String getPhoneCode() {
method setPhoneCode (line 96) | public void setPhoneCode(String phoneCode) {
method getAreaCode (line 100) | public String getAreaCode() {
method setAreaCode (line 104) | public void setAreaCode(String areaCode) {
method getPostID (line 108) | public String getPostID() {
method setPostID (line 112) | public void setPostID(String postID) {
method getIsLocation (line 116) | public boolean getIsLocation() {
method setIsLocation (line 120) | public void setIsLocation(int isLocation) {
method getRefreshTime (line 124) | public long getRefreshTime() {
method setRefreshTime (line 128) | public void setRefreshTime(long refreshTime) {
method getPubTime (line 132) | public long getPubTime() {
method setPubTime (line 136) | public void setPubTime(long pubTime) {
method getWeatherInfoStr (line 140) | public String getWeatherInfoStr() {
method setWeatherInfoStr (line 144) | public void setWeatherInfoStr(String weatherInfoStr) {
method hashCode (line 148) | @Override
method equals (line 155) | @Override
method toString (line 169) | @Override
method describeContents (line 178) | @Override
method writeToParcel (line 183) | @Override
method createFromParcel (line 199) | @Override
method newArray (line 215) | @Override
FILE: WayHoo/src/com/way/beans/Item.java
class Item (line 3) | public class Item {
method Item (line 15) | public Item(int id, String title, int iconRes) {
method Item (line 21) | public Item(int id, int title, int iconRes) {
FILE: WayHoo/src/com/way/beans/MainItem.java
class MainItem (line 5) | public class MainItem {
method MainItem (line 9) | public MainItem() {
method MainItem (line 13) | public MainItem(City city, WeatherInfo weatherInfo) {
method getCity (line 19) | public City getCity() {
method setCity (line 23) | public void setCity(City city) {
method getWeatherInfo (line 27) | public WeatherInfo getWeatherInfo() {
method setWeatherInfo (line 31) | public void setWeatherInfo(WeatherInfo weatherInfo) {
FILE: WayHoo/src/com/way/common/util/L.java
class L (line 13) | public class L {
method i (line 18) | public static void i(String msg) {
method d (line 23) | public static void d(String msg) {
method e (line 28) | public static void e(String msg) {
method v (line 33) | public static void v(String msg) {
method i (line 38) | public static void i(Class<?> _class,String msg){
method d (line 42) | public static void d(Class<?> _class,String msg){
method e (line 46) | public static void e(Class<?> _class,String msg){
method v (line 50) | public static void v(Class<?> _class,String msg){
method i (line 55) | public static void i(String tag, String msg) {
method d (line 60) | public static void d(String tag, String msg) {
method e (line 65) | public static void e(String tag, String msg) {
method v (line 70) | public static void v(String tag, String msg) {
FILE: WayHoo/src/com/way/common/util/LocationUtils.java
class LocationUtils (line 12) | public class LocationUtils {
type LocationListener (line 18) | public static abstract interface LocationListener {
method detecting (line 19) | public abstract void detecting();
method succeed (line 21) | public abstract void succeed(String city);
method failed (line 23) | public abstract void failed();
method LocationUtils (line 26) | public LocationUtils(Context context, LocationListener listener) {
method startLocation (line 36) | public void startLocation() {
method stopLocation (line 43) | public void stopLocation() {
method isStarted (line 48) | public boolean isStarted() {
method getLocationClientOption (line 52) | private LocationClientOption getLocationClientOption(Context context) {
method onReceiveLocation (line 68) | @Override
FILE: WayHoo/src/com/way/common/util/LunarCalendar.java
class LunarCalendar (line 8) | public class LunarCalendar {
method LunarCalendar (line 57) | public LunarCalendar(Context context) {
method reloadLanguageResources (line 65) | public static void reloadLanguageResources(Context ctx) {
method clearLanguageResourcesRefs (line 206) | public static void clearLanguageResourcesRefs() {
method getString (line 222) | private static String getString(Context ctx, int resId) {
method getTraditionalFestival (line 226) | public String getTraditionalFestival() {
method getTraditionalFestival (line 230) | public String getTraditionalFestival(int lunarYear, int lunarMonth,
method getFestival (line 264) | public String getFestival() {
method getFestival (line 268) | private String getFestival(int lunarMonth, int lunarDay) {
method getSolarTerm (line 301) | private String getSolarTerm(int year, int month, int date) {
method getChinaMonthString (line 322) | private String getChinaMonthString() {
method getChinaMonthString (line 326) | private String getChinaMonthString(int lunarMonth, boolean isLeapMonth) {
method getChinaDayString (line 333) | private String getChinaDayString(boolean notDisplayLunarMonthForFirstD...
method getChinaDayString (line 338) | public String getChinaDayString(int lunarMonth, int lunarDay,
method getChinaYearString (line 353) | private String getChinaYearString() {
method getChinaYearString (line 357) | private String getChinaYearString(int lunarYear) {
method getLunarYearString (line 361) | private String getLunarYearString(int num) {
method getLunarYear (line 366) | public String getLunarYear(int year) {
method animalsYear (line 371) | public String animalsYear(int year) {
method getLunarCalendarInfo (line 375) | public String[] getLunarCalendarInfo(boolean notDisplayLunarMonthForFi...
method getLunarDayInfo (line 391) | public String getLunarDayInfo() {
class SpecialSolarTermInfo (line 455) | final static class SpecialSolarTermInfo {
method SpecialSolarTermInfo (line 460) | SpecialSolarTermInfo(String specialStr, String termStr,
method getSpecialSolarTermInfo (line 468) | private static SpecialSolarTermInfo getSpecialSolarTermInfo(int year,
FILE: WayHoo/src/com/way/common/util/LunarCalendarConvertUtil.java
class LunarCalendarConvertUtil (line 8) | public class LunarCalendarConvertUtil {
method getSolarTermDayOfMonth (line 79) | public static int getSolarTermDayOfMonth(int year, int n) {
method getLunarMonthDays (line 88) | public static int getLunarMonthDays(int lunarYear, int lunarMonth) {
method isLunarBigMonth (line 95) | public static boolean isLunarBigMonth(int lunarYear, int lunarMonth) {
method getYearDays (line 103) | final public static int getYearDays(int lunarYear) {
method getLeapMonth (line 111) | final public static int getLeapMonth(int lunarYear) {
method getLeapMonthDays (line 115) | final public static int getLeapMonthDays(int lunarYear) {
method parseLunarCalendar (line 124) | public static void parseLunarCalendar(int year, int month, int day,
method isLunarSetting (line 193) | public static boolean isLunarSetting() {
method getLanguageEnv (line 204) | private static String getLanguageEnv() {
FILE: WayHoo/src/com/way/common/util/NetUtil.java
class NetUtil (line 7) | public class NetUtil {
method getNetworkState (line 12) | public static int getNetworkState(Context context) {
FILE: WayHoo/src/com/way/common/util/PreferenceUtils.java
class PreferenceUtils (line 8) | public class PreferenceUtils {
method getPrefString (line 9) | public static String getPrefString(Context context, String key,
method setPrefString (line 16) | public static void setPrefString(Context context, final String key,
method getPrefBoolean (line 23) | public static boolean getPrefBoolean(Context context, final String key,
method hasKey (line 30) | public static boolean hasKey(Context context, final String key) {
method setPrefBoolean (line 35) | public static void setPrefBoolean(Context context, final String key,
method setPrefInt (line 42) | public static void setPrefInt(Context context, final String key,
method getPrefInt (line 49) | public static int getPrefInt(Context context, final String key,
method setPrefFloat (line 56) | public static void setPrefFloat(Context context, final String key,
method getPrefFloat (line 63) | public static float getPrefFloat(Context context, final String key,
method setSettingLong (line 70) | public static void setSettingLong(Context context, final String key,
method getPrefLong (line 77) | public static long getPrefLong(Context context, final String key,
method clearPreference (line 84) | public static void clearPreference(Context context,
FILE: WayHoo/src/com/way/common/util/SystemUtils.java
class SystemUtils (line 27) | public class SystemUtils {
method getTmpCities (line 35) | public static List<City> getTmpCities(Cursor c) {
method getHotCities (line 64) | public static List<City> getHotCities(Cursor c) {
method getAllCities (line 85) | public static List<City> getAllCities(Cursor c) {
method getDBFilePath (line 110) | public static String getDBFilePath(Context context) {
method getDBDirPath (line 116) | public static String getDBDirPath(Context context) {
method copyDB (line 122) | public static void copyDB(Context context) {
method getCustomeDialog (line 163) | public static Dialog getCustomeDialog(Activity activity, int style,
method getCustomeDialog (line 179) | public static Dialog getCustomeDialog(Activity activity, int style,
method getDisplayHeight (line 201) | public static int getDisplayHeight(Context context) {
method getDisplayWidth (line 216) | public static int getDisplayWidth(Context context) {
method getStatusBarHeight (line 230) | public static int getStatusBarHeight(Context context) {
method readBitMap (line 254) | public static Bitmap readBitMap(Context context, int resId) {
FILE: WayHoo/src/com/way/common/util/T.java
class T (line 12) | public class T {
method showShort (line 22) | public static void showShort(Context context, CharSequence message) {
method showShort (line 38) | public static void showShort(Context context, int message) {
method showLong (line 54) | public static void showLong(Context context, CharSequence message) {
method showLong (line 70) | public static void showLong(Context context, int message) {
method show (line 87) | public static void show(Context context, CharSequence message, int dur...
method show (line 104) | public static void show(Context context, int message, int duration) {
method hideToast (line 115) | public static void hideToast() {
FILE: WayHoo/src/com/way/common/util/TimeUtils.java
class TimeUtils (line 15) | public class TimeUtils {
method TimeUtils (line 30) | private TimeUtils() {
method getWeek (line 34) | public static String getWeek(int num, String format) {
method getZhouWeek (line 43) | public static String getZhouWeek() {
method getDay (line 49) | public static String getDay(long timesamp) {
method getLongTime (line 78) | public static long getLongTime(String time) {
method getTime (line 89) | public static String getTime(long time) {
method getDateTime (line 92) | public static String getDateTime(long time) {
method getListTime (line 96) | public static String getListTime(Resources res, long time) {
method isSameHalfDay (line 172) | private static boolean isSameHalfDay(Calendar now, Calendar msg) {
method isSameDay (line 185) | private static boolean isSameDay(Calendar now, Calendar msg) {
method isYesterDay (line 192) | private static boolean isYesterDay(Calendar now, Calendar msg) {
method isTheDayBeforeYesterDay (line 199) | private static boolean isTheDayBeforeYesterDay(Calendar now, Calendar ...
FILE: WayHoo/src/com/way/common/util/WeatherIconUtils.java
class WeatherIconUtils (line 9) | public class WeatherIconUtils {
method WeatherIconUtils (line 11) | private WeatherIconUtils() {
method getWeatherIcon (line 19) | public static int getWeatherIcon(int type) {
method getWeatherNromalBg (line 104) | public static int getWeatherNromalBg(int type) {
method getWeatherBlurBg (line 175) | public static int getWeatherBlurBg(int type) {
method isNight (line 242) | public static boolean isNight(long time) {
method getRawNromalBg (line 261) | public static int getRawNromalBg(int type) {
method getRawBlurBg (line 336) | public static int getRawBlurBg(int type) {
FILE: WayHoo/src/com/way/db/CityProvider.java
class CityProvider (line 21) | public class CityProvider extends ContentProvider {
method createTmpCityTable (line 62) | public static void createTmpCityTable(Context context) {
method onCreate (line 72) | @Override
method infoLog (line 81) | private static void infoLog(String data) {
method query (line 85) | @Override
method getType (line 138) | @Override
method insert (line 151) | @Override
method delete (line 179) | @Override
method update (line 205) | @Override
class CityConstants (line 240) | public static final class CityConstants implements BaseColumns {
method CityConstants (line 264) | private CityConstants() {
method getRequiredColumns (line 267) | public static ArrayList<String> getRequiredColumns() {
method getCityDefaultProjection (line 284) | public static String[] getCityDefaultProjection() {
FILE: WayHoo/src/com/way/fragment/BaseFragment.java
class BaseFragment (line 22) | public abstract class BaseFragment extends Fragment implements ITaskMana...
type ABaseTaskState (line 25) | protected enum ABaseTaskState {
method onAttach (line 40) | @Override
method onCreate (line 45) | @Override
method onCreateView (line 53) | @Override
method getRootView (line 74) | ViewGroup getRootView() {
method onActivityCreated (line 78) | @Override
method onHomeClick (line 91) | public boolean onHomeClick() {
method onBackClick (line 100) | public boolean onBackClick() {
method requestData (line 107) | public void requestData() {
method _layoutInit (line 117) | void _layoutInit(LayoutInflater inflater, Bundle savedInstanceSate) {
method layoutInit (line 157) | protected void layoutInit(LayoutInflater inflater, Bundle savedInstanc...
method findViewById (line 161) | protected View findViewById(int viewId) {
method inflateContentView (line 168) | abstract protected int inflateContentView();
method setContentEmpty (line 170) | public void setContentEmpty(boolean empty) {
method isContentEmpty (line 174) | public boolean isContentEmpty() {
method onViewClicked (line 183) | public void onViewClicked(View view) {
method setViewVisiable (line 190) | void setViewVisiable(View v, int visibility) {
method taskStateChanged (line 202) | protected void taskStateChanged(ABaseTaskState state, Serializable tag) {
method setTextViewValue (line 252) | public void setTextViewValue(View container, int txtId, String content) {
method showMessage (line 260) | protected void showMessage(CharSequence msg) {
method showMessage (line 270) | protected void showMessage(int msgId) {
class ABaseTask (line 285) | protected abstract class ABaseTask<Params, Progress, Result> extends W...
method ABaseTask (line 287) | public ABaseTask(String taskId) {
method onPrepare (line 291) | @Override
method onSuccess (line 298) | @Override
method onFailure (line 308) | @Override
method onFinished (line 315) | @Override
method resultIsEmpty (line 328) | protected boolean resultIsEmpty(Result result) {
method onDestroy (line 334) | @Override
method onDetach (line 346) | @Override
method addTask (line 352) | @Override
method removeTask (line 357) | @Override
method removeAllTask (line 362) | @Override
method getTaskCount (line 367) | @Override
method cleatTaskCount (line 372) | protected void cleatTaskCount(String taskId) {
method setViewOnClick (line 376) | protected void setViewOnClick(View v) {
method onClick (line 385) | @Override
method onSaveInstanceState (line 392) | @Override
method getTaskManager (line 400) | protected ITaskManager getTaskManager() {
FILE: WayHoo/src/com/way/fragment/IExceptionDeclare.java
type IExceptionDeclare (line 3) | public interface IExceptionDeclare {
method declareMessage (line 5) | public String declareMessage(String code);
FILE: WayHoo/src/com/way/fragment/ITaskManager.java
type ITaskManager (line 3) | public interface ITaskManager {
method addTask (line 5) | public void addTask(WorkTask task);
method removeTask (line 7) | public void removeTask(String taskId, boolean cancelIfRunning);
method removeAllTask (line 9) | public void removeAllTask(boolean cancelIfRunning);
method getTaskCount (line 11) | public int getTaskCount(String taskId);
FILE: WayHoo/src/com/way/fragment/TaskException.java
class TaskException (line 16) | public class TaskException extends Exception {
type TaskError (line 20) | public enum TaskError {
method TaskException (line 37) | public TaskException(String code) {
method TaskException (line 41) | public TaskException(String code, String msg) {
method getCode (line 46) | public String getCode() {
method getMessage (line 50) | @Override
method config (line 80) | public static void config(IExceptionDeclare declare) {
FILE: WayHoo/src/com/way/fragment/TaskManager.java
class TaskManager (line 13) | public class TaskManager implements ITaskManager {
method TaskManager (line 20) | public TaskManager() {
method addTask (line 25) | @Override
method removeTask (line 38) | @Override
method removeAllTask (line 43) | @Override
method cancelExistTask (line 54) | private void cancelExistTask(String taskId, boolean mayInterruptIfRunn...
method getTaskById (line 66) | private WorkTask getTaskById(String taskId) {
method getTaskCount (line 73) | @Override
method cleatTaskCount (line 81) | public void cleatTaskCount(String taskId) {
method save (line 86) | public void save(Bundle outState) {
method restore (line 90) | public void restore(Bundle savedInstanceState) {
FILE: WayHoo/src/com/way/fragment/WeatherFragment.java
class WeatherFragment (line 50) | public class WeatherFragment extends Fragment implements ITaskManager,
method WeatherFragment (line 76) | public WeatherFragment() {
method newInstance (line 79) | public static WeatherFragment newInstance(City city) {
method onCreate (line 87) | @Override
method setUserVisibleHint (line 110) | @Override
method onLoadedData (line 126) | private void onLoadedData() {
method isNeedRequestNet (line 136) | private boolean isNeedRequestNet() {
method onCreateView (line 154) | @Override
method run (line 182) | @Override
method run (line 190) | @Override
method run (line 198) | @Override
method onDestroyView (line 205) | @Override
method isNeedDestroy (line 223) | protected boolean isNeedDestroy() {
method initViews (line 232) | private void initViews(View view, Bundle savedInstanceState) {
method initCurWeatherViews (line 280) | private void initCurWeatherViews(View view) {
method onResume (line 289) | @Override
method onScroll (line 296) | @Override
method onScrollStateChanged (line 309) | @Override
method onNewScroll (line 320) | private void onNewScroll(int scrollPosition) {
method loadWeatherInfoFromLocal (line 336) | private WeatherInfo loadWeatherInfoFromLocal() throws TaskException {
method loadWeatherInfoFromNetwork (line 352) | private WeatherInfo loadWeatherInfoFromNetwork() throws TaskException {
method save2Database (line 363) | protected void save2Database(WeatherInfo weatherInfo, String postID,
method getPubTime (line 379) | private long getPubTime(String postID) {
method getRefreshTime (line 390) | private long getRefreshTime() {
method updateWeatherView (line 407) | private void updateWeatherView(WeatherInfo weatherInfo) {
method onRefresh (line 436) | @Override
method requestData (line 441) | public void requestData(boolean force) {
class WeatherTask (line 447) | class WeatherTask extends WorkTask<Boolean, Void, WeatherInfo> {
method WeatherTask (line 448) | public WeatherTask(String postID) {
method onPrepare (line 452) | @Override
method workInBackground (line 458) | @Override
method onSuccess (line 483) | @Override
method onFailure (line 490) | @Override
method onFinished (line 496) | @Override
method taskStateChanged (line 510) | protected void taskStateChanged(ABaseTaskState state, Serializable tag) {
method onSaveInstanceState (line 543) | @Override
method getTaskManager (line 553) | protected ITaskManager getTaskManager() {
method addTask (line 557) | @Override
method removeTask (line 562) | @Override
method removeAllTask (line 567) | @Override
method getTaskCount (line 572) | @Override
type ABaseTaskState (line 577) | protected enum ABaseTaskState {
method refreshUI (line 581) | public void refreshUI() {
method releaseImageViewByIds (line 587) | public void releaseImageViewByIds() {
FILE: WayHoo/src/com/way/fragment/WorkTask.java
class WorkTask (line 25) | public abstract class WorkTask<Params, Progress, Result> {
method newThread (line 48) | public Thread newThread(Runnable r) {
class SerialExecutor (line 89) | private static class SerialExecutor implements Executor {
method execute (line 93) | public synchronized void execute(final Runnable r) {
method scheduleNext (line 108) | protected synchronized void scheduleNext() {
type Status (line 115) | public enum Status {
method init (line 131) | public static void init() {
method setDefaultExecutor (line 135) | private static void setDefaultExecutor(Executor exec) {
method getTaskId (line 141) | public String getTaskId() {
method setTaskId (line 145) | public void setTaskId(String taskId) {
method WorkTask (line 149) | public WorkTask(String taskId, ITaskManager taskManager) {
method WorkTask (line 155) | public WorkTask() {
method postResultIfNotInvoked (line 185) | private void postResultIfNotInvoked(Result result) {
method postResult (line 192) | private Result postResult(Result result) {
method getStatus (line 198) | public final Status getStatus() {
method onPrepare (line 205) | protected void onPrepare() {
method onFailure (line 212) | protected void onFailure(TaskException exception) {
method onSuccess (line 219) | protected void onSuccess(Result result) {
method getParams (line 223) | protected Params[] getParams() {
method onFinished (line 230) | protected void onFinished() {
method workInBackground (line 241) | abstract public Result workInBackground(Params... params) throws TaskE...
method doInBackground (line 243) | private Result doInBackground(Params... params) {
method onPreExecute (line 256) | final protected void onPreExecute() {
method onPostExecute (line 261) | final protected void onPostExecute(Result result) {
method onProgressUpdate (line 283) | protected void onProgressUpdate(Progress... values) {
method onCancelled (line 286) | protected void onCancelled(Result result) {
method onCancelled (line 290) | protected void onCancelled() {
method isCancelled (line 295) | public final boolean isCancelled() {
method cancel (line 299) | public final boolean cancel(boolean mayInterruptIfRunning) {
method get (line 303) | public final Result get() throws InterruptedException, ExecutionExcept...
method get (line 307) | public final Result get(long timeout, TimeUnit unit) throws Interrupte...
method executeOnSerialExecutor (line 317) | public final WorkTask<Params, Progress, Result> executeOnSerialExecuto...
method executrOnImageExecutor (line 327) | public final WorkTask<Params, Progress, Result> executrOnImageExecutor...
method execute (line 337) | public final WorkTask<Params, Progress, Result> execute(Params... para...
method executeOnExecutor (line 341) | public final WorkTask<Params, Progress, Result> executeOnExecutor(Exec...
method execute (line 362) | public static void execute(Runnable runnable) {
method publishProgress (line 366) | protected final void publishProgress(Progress... values) {
method finish (line 372) | private void finish(Result result) {
class InternalHandler (line 381) | private static class InternalHandler extends Handler {
method handleMessage (line 382) | @SuppressWarnings({ "unchecked" })
class WorkerRunnable (line 398) | private static abstract class WorkerRunnable<Params, Result> implement...
class AsyncTaskResult (line 402) | private static class AsyncTaskResult<Data> {
method AsyncTaskResult (line 406) | AsyncTaskResult(WorkTask task, Data... data) {
FILE: WayHoo/src/com/way/observablescrollview/CacheFragmentStatePagerAdapter.java
class CacheFragmentStatePagerAdapter (line 34) | public abstract class CacheFragmentStatePagerAdapter extends FragmentSta...
method CacheFragmentStatePagerAdapter (line 44) | public CacheFragmentStatePagerAdapter(FragmentManager fm) {
method saveState (line 50) | @Override
method restoreState (line 68) | @Override
method getItem (line 96) | @Override
method destroyItem (line 104) | @Override
method getItemAt (line 118) | public Fragment getItemAt(int position) {
method createItem (line 129) | protected abstract Fragment createItem(int position);
method createCacheIndex (line 137) | protected String createCacheIndex(int index) {
method createCacheKey (line 147) | protected String createCacheKey(int position) {
FILE: WayHoo/src/com/way/observablescrollview/ObservableGridView.java
class ObservableGridView (line 34) | public class ObservableGridView extends GridView implements Scrollable {
method onScrollStateChanged (line 55) | @Override
method onScroll (line 62) | @Override
method ObservableGridView (line 74) | public ObservableGridView(Context context) {
method ObservableGridView (line 79) | public ObservableGridView(Context context, AttributeSet attrs) {
method ObservableGridView (line 84) | public ObservableGridView(Context context, AttributeSet attrs, int def...
method onRestoreInstanceState (line 89) | @Override
method onSaveInstanceState (line 101) | @Override
method onInterceptTouchEvent (line 114) | @Override
method onTouchEvent (line 133) | @Override
method setOnScrollListener (line 205) | @Override
method setScrollViewCallbacks (line 212) | @Override
method setTouchInterceptionViewGroup (line 217) | @Override
method scrollVerticallyTo (line 222) | @Override
method getCurrentScrollY (line 227) | @Override
method init (line 232) | private void init() {
method getNumColumnsCompat (line 237) | private int getNumColumnsCompat() {
method onScrollChanged (line 252) | private void onScrollChanged() {
class SavedState (line 317) | static class SavedState extends BaseSavedState {
method SavedState (line 328) | SavedState(Parcelable superState) {
method SavedState (line 335) | private SavedState(Parcel in) {
method writeToParcel (line 353) | @Override
method createFromParcel (line 373) | @Override
method newArray (line 378) | @Override
FILE: WayHoo/src/com/way/observablescrollview/ObservableListView.java
class ObservableListView (line 33) | public class ObservableListView extends ListView implements Scrollable {
method onScrollStateChanged (line 54) | @Override
method onScroll (line 61) | @Override
method ObservableListView (line 73) | public ObservableListView(Context context) {
method ObservableListView (line 78) | public ObservableListView(Context context, AttributeSet attrs) {
method ObservableListView (line 83) | public ObservableListView(Context context, AttributeSet attrs, int def...
method onRestoreInstanceState (line 88) | @Override
method onSaveInstanceState (line 100) | @Override
method onInterceptTouchEvent (line 113) | @Override
method onTouchEvent (line 132) | @Override
method setOnScrollListener (line 204) | @Override
method setScrollViewCallbacks (line 211) | @Override
method setTouchInterceptionViewGroup (line 216) | @Override
method scrollVerticallyTo (line 221) | @Override
method getCurrentScrollY (line 231) | @Override
method init (line 236) | private void init() {
method onScrollChanged (line 241) | private void onScrollChanged() {
class SavedState (line 314) | static class SavedState extends BaseSavedState {
method SavedState (line 325) | SavedState(Parcelable superState) {
method SavedState (line 332) | private SavedState(Parcel in) {
method writeToParcel (line 350) | @Override
method createFromParcel (line 370) | @Override
method newArray (line 375) | @Override
FILE: WayHoo/src/com/way/observablescrollview/ObservableScrollView.java
class ObservableScrollView (line 31) | public class ObservableScrollView extends ScrollView implements Scrollab...
method ObservableScrollView (line 46) | public ObservableScrollView(Context context) {
method ObservableScrollView (line 50) | public ObservableScrollView(Context context, AttributeSet attrs) {
method ObservableScrollView (line 54) | public ObservableScrollView(Context context, AttributeSet attrs, int d...
method onRestoreInstanceState (line 58) | @Override
method onSaveInstanceState (line 66) | @Override
method onScrollChanged (line 75) | @Override
method onInterceptTouchEvent (line 101) | @Override
method onTouchEvent (line 120) | @Override
method setScrollViewCallbacks (line 192) | @Override
method setTouchInterceptionViewGroup (line 197) | @Override
method scrollVerticallyTo (line 202) | @Override
method getCurrentScrollY (line 207) | @Override
class SavedState (line 212) | static class SavedState extends BaseSavedState {
method SavedState (line 219) | SavedState(Parcelable superState) {
method SavedState (line 226) | private SavedState(Parcel in) {
method writeToParcel (line 232) | @Override
method createFromParcel (line 241) | @Override
method newArray (line 246) | @Override
FILE: WayHoo/src/com/way/observablescrollview/ObservableScrollViewCallbacks.java
type ObservableScrollViewCallbacks (line 22) | public interface ObservableScrollViewCallbacks {
method onScrollChanged (line 33) | void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging);
method onDownMotionEvent (line 38) | void onDownMotionEvent();
method onUpOrCancelMotionEvent (line 45) | void onUpOrCancelMotionEvent(ScrollState scrollState);
FILE: WayHoo/src/com/way/observablescrollview/ObservableWebView.java
class ObservableWebView (line 31) | public class ObservableWebView extends WebView implements Scrollable {
method ObservableWebView (line 46) | public ObservableWebView(Context context) {
method ObservableWebView (line 50) | public ObservableWebView(Context context, AttributeSet attrs) {
method ObservableWebView (line 54) | public ObservableWebView(Context context, AttributeSet attrs, int defS...
method onRestoreInstanceState (line 58) | @Override
method onSaveInstanceState (line 66) | @Override
method onScrollChanged (line 75) | @Override
method onInterceptTouchEvent (line 97) | @Override
method onTouchEvent (line 116) | @Override
method setScrollViewCallbacks (line 190) | @Override
method setTouchInterceptionViewGroup (line 195) | @Override
method scrollVerticallyTo (line 200) | @Override
method getCurrentScrollY (line 205) | @Override
class SavedState (line 210) | static class SavedState extends BaseSavedState {
method SavedState (line 217) | SavedState(Parcelable superState) {
method SavedState (line 224) | private SavedState(Parcel in) {
method writeToParcel (line 230) | @Override
method createFromParcel (line 239) | @Override
method newArray (line 244) | @Override
FILE: WayHoo/src/com/way/observablescrollview/ScrollState.java
type ScrollState (line 22) | public enum ScrollState {
FILE: WayHoo/src/com/way/observablescrollview/ScrollUtils.java
class ScrollUtils (line 26) | public final class ScrollUtils {
method ScrollUtils (line 28) | private ScrollUtils() {
method getFloat (line 41) | public static float getFloat(final float value, final float minValue, ...
method getColorWithAlpha (line 53) | public static int getColorWithAlpha(float alpha, int baseColor) {
method addOnGlobalLayoutListener (line 67) | public static void addOnGlobalLayoutListener(final View view, final Ru...
method mixColors (line 92) | public static int mixColors(int fromColor, int toColor, float toAlpha) {
method cmykFromRgb (line 108) | public static float[] cmykFromRgb(int rgbColor) {
method rgbFromCmyk (line 133) | public static int rgbFromCmyk(float[] cmyk) {
FILE: WayHoo/src/com/way/observablescrollview/Scrollable.java
type Scrollable (line 24) | public interface Scrollable {
method setScrollViewCallbacks (line 30) | void setScrollViewCallbacks(ObservableScrollViewCallbacks listener);
method scrollVerticallyTo (line 39) | void scrollVerticallyTo(int y);
method getCurrentScrollY (line 46) | int getCurrentScrollY();
method setTouchInterceptionViewGroup (line 55) | void setTouchInterceptionViewGroup(ViewGroup viewGroup);
FILE: WayHoo/src/com/way/observablescrollview/TouchInterceptionFrameLayout.java
class TouchInterceptionFrameLayout (line 36) | public class TouchInterceptionFrameLayout extends FrameLayout {
type TouchInterceptionListener (line 41) | public interface TouchInterceptionListener {
method shouldInterceptTouchEvent (line 51) | boolean shouldInterceptTouchEvent(MotionEvent ev, boolean moving, fl...
method onDownMotionEvent (line 58) | void onDownMotionEvent(MotionEvent ev);
method onMoveMotionEvent (line 67) | void onMoveMotionEvent(MotionEvent ev, float diffX, float diffY);
method onUpOrCancelMotionEvent (line 74) | void onUpOrCancelMotionEvent(MotionEvent ev);
method TouchInterceptionFrameLayout (line 85) | public TouchInterceptionFrameLayout(Context context) {
method TouchInterceptionFrameLayout (line 89) | public TouchInterceptionFrameLayout(Context context, AttributeSet attr...
method TouchInterceptionFrameLayout (line 93) | public TouchInterceptionFrameLayout(Context context, AttributeSet attr...
method TouchInterceptionFrameLayout (line 97) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
method setScrollInterceptionListener (line 102) | public void setScrollInterceptionListener(TouchInterceptionListener li...
method onInterceptTouchEvent (line 106) | @Override
method onTouchEvent (line 140) | @Override
method obtainMotionEvent (line 238) | private MotionEvent obtainMotionEvent(MotionEvent base, int action) {
method duplicateTouchEventForChildren (line 253) | private void duplicateTouchEventForChildren(MotionEvent ev, MotionEven...
FILE: WayHoo/src/com/way/ui/swipeback/SwipeBackActivity.java
class SwipeBackActivity (line 7) | public class SwipeBackActivity extends Activity implements
method onCreate (line 11) | @Override
method onPostCreate (line 18) | @Override
method findViewById (line 24) | @Override
method getSwipeBackLayout (line 32) | @Override
method setSwipeBackEnable (line 37) | @Override
method scrollToFinishActivity (line 42) | @Override
FILE: WayHoo/src/com/way/ui/swipeback/SwipeBackActivityBase.java
type SwipeBackActivityBase (line 6) | public interface SwipeBackActivityBase {
method getSwipeBackLayout (line 10) | public abstract SwipeBackLayout getSwipeBackLayout();
method setSwipeBackEnable (line 12) | public abstract void setSwipeBackEnable(boolean enable);
method scrollToFinishActivity (line 17) | public abstract void scrollToFinishActivity();
FILE: WayHoo/src/com/way/ui/swipeback/SwipeBackActivityHelper.java
class SwipeBackActivityHelper (line 20) | public class SwipeBackActivityHelper {
method SwipeBackActivityHelper (line 25) | public SwipeBackActivityHelper(Activity activity) {
method onActivityCreate (line 29) | @SuppressWarnings("deprecation")
method onPostCreate (line 60) | public void onPostCreate() {
method findViewById (line 65) | public View findViewById(int id) {
method getSwipeBackLayout (line 72) | public SwipeBackLayout getSwipeBackLayout() {
method convertActivityFromTranslucent (line 88) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
method convertActivityToTranslucent (line 121) | public void convertActivityToTranslucent() {
FILE: WayHoo/src/com/way/ui/swipeback/SwipeBackLayout.java
class SwipeBackLayout (line 21) | public class SwipeBackLayout extends FrameLayout {
method SwipeBackLayout (line 123) | public SwipeBackLayout(Context context) {
method SwipeBackLayout (line 127) | public SwipeBackLayout(Context context, AttributeSet attrs) {
method SwipeBackLayout (line 131) | public SwipeBackLayout(Context context, AttributeSet attrs, int defSty...
method setContentView (line 170) | private void setContentView(View view) {
method setEnableGesture (line 174) | public void setEnableGesture(boolean enable) {
method setEdgeTrackingEnabled (line 193) | public void setEdgeTrackingEnabled(int edgeFlags) {
method setScrimColor (line 205) | public void setScrimColor(int color) {
method setEdgeSize (line 218) | public void setEdgeSize(int size) {
method setSwipeListener (line 230) | @Deprecated
method addSwipeListener (line 241) | public void addSwipeListener(SwipeListener listener) {
method removeSwipeListener (line 253) | public void removeSwipeListener(SwipeListener listener) {
type SwipeListener (line 260) | public static interface SwipeListener {
method onScrollStateChange (line 272) | public void onScrollStateChange(int state, float scrollPercent);
method onScrollLeftChange (line 274) | public void onScrollLeftChange(int left);
method onEdgeTouch (line 285) | public void onEdgeTouch(int edgeFlag);
method onScrollOverThreshold (line 290) | public void onScrollOverThreshold();
method setScrollThresHold (line 299) | public void setScrollThresHold(float threshold) {
method setShadow (line 318) | public void setShadow(Drawable shadow, int edgeFlag) {
method setShadow (line 340) | public void setShadow(int resId, int edgeFlag) {
method scrollToFinishActivity (line 347) | public void scrollToFinishActivity() {
method onInterceptTouchEvent (line 370) | @Override
method onTouchEvent (line 384) | @Override
method onLayout (line 393) | @Override
method requestLayout (line 404) | @Override
method drawChild (line 411) | @Override
method drawScrim (line 424) | private void drawScrim(Canvas canvas, View child) {
method drawShadow (line 440) | private void drawShadow(Canvas canvas, View child) {
method attachToActivity (line 466) | public void attachToActivity(Activity activity) {
method computeScroll (line 482) | @Override
class ViewDragCallback (line 490) | private class ViewDragCallback extends ViewDragHelper.Callback {
method tryCaptureView (line 493) | @Override
method getViewHorizontalDragRange (line 524) | @Override
method getViewVerticalDragRange (line 529) | @Override
method onViewPositionChanged (line 534) | @Override
method onViewReleased (line 577) | @Override
method clampViewPositionHorizontal (line 604) | @Override
method clampViewPositionVertical (line 615) | @Override
method onViewDragStateChanged (line 624) | @Override
FILE: WayHoo/src/com/way/ui/swipeback/ViewDragHelper.java
class ViewDragHelper (line 39) | @SuppressLint("NewApi")
class Callback (line 167) | public static abstract class Callback {
method onViewDragStateChanged (line 178) | public void onViewDragStateChanged(int state) {
method onViewPositionChanged (line 196) | public void onViewPositionChanged(View changedView, int left, int top,
method onViewCaptured (line 211) | public void onViewCaptured(View capturedChild, int activePointerId) {
method onViewReleased (line 239) | public void onViewReleased(View releasedChild, float xvel, float yve...
method onEdgeTouched (line 256) | public void onEdgeTouched(int edgeFlags, int pointerId) {
method onEdgeLock (line 270) | public boolean onEdgeLock(int edgeFlags) {
method onEdgeDragStarted (line 288) | public void onEdgeDragStarted(int edgeFlags, int pointerId) {
method getOrderedChildIndex (line 299) | public int getOrderedChildIndex(int index) {
method getViewHorizontalDragRange (line 312) | public int getViewHorizontalDragRange(View child) {
method getViewVerticalDragRange (line 325) | public int getViewVerticalDragRange(View child) {
method tryCaptureView (line 351) | public abstract boolean tryCaptureView(View child, int pointerId);
method clampViewPositionHorizontal (line 367) | public int clampViewPositionHorizontal(View child, int left, int dx) {
method clampViewPositionVertical (line 385) | public int clampViewPositionVertical(View child, int top, int dy) {
method getInterpolation (line 394) | public float getInterpolation(float t) {
method run (line 401) | public void run() {
method create (line 415) | public static ViewDragHelper create(ViewGroup forParent, Callback cb) {
method create (line 432) | public static ViewDragHelper create(ViewGroup forParent, float sensiti...
method ViewDragHelper (line 449) | private ViewDragHelper(Context context, ViewGroup forParent, Callback ...
method setMinVelocity (line 478) | public void setMinVelocity(float minVel) {
method getMinVelocity (line 490) | public float getMinVelocity() {
method getViewDragState (line 500) | public int getViewDragState() {
method setEdgeTrackingEnabled (line 520) | public void setEdgeTrackingEnabled(int edgeFlags) {
method getEdgeSize (line 532) | public int getEdgeSize() {
method setEdgeSize (line 544) | public void setEdgeSize(int size) {
method captureChildView (line 559) | public void captureChildView(View childView, int activePointerId) {
method getCapturedView (line 577) | public View getCapturedView() {
method getActivePointerId (line 585) | public int getActivePointerId() {
method getTouchSlop (line 593) | public int getTouchSlop() {
method cancel (line 602) | public void cancel() {
method abort (line 616) | public void abort() {
method smoothSlideViewTo (line 651) | public boolean smoothSlideViewTo(View child, int finalLeft, int finalT...
method settleCapturedViewAt (line 673) | public boolean settleCapturedViewAt(int finalLeft, int finalTop) {
method forceSettleCapturedViewAt (line 701) | private boolean forceSettleCapturedViewAt(int finalLeft, int finalTop,
method computeSettleDuration (line 723) | private int computeSettleDuration(View child, int dx, int dy, int xvel,
method computeAxisDuration (line 747) | private int computeAxisDuration(int delta, int velocity, int motionRan...
method clampMag (line 783) | private int clampMag(int value, int absMin, int absMax) {
method clampMag (line 805) | private float clampMag(float value, float absMin, float absMax) {
method distanceInfluenceForSnapDuration (line 814) | private float distanceInfluenceForSnapDuration(float f) {
method flingCapturedView (line 834) | public void flingCapturedView(int minLeft, int minTop, int maxLeft,
method continueSettling (line 863) | public boolean continueSettling(boolean deferCallbacks) {
method dispatchViewReleased (line 909) | private void dispatchViewReleased(float xvel, float yvel) {
method clearMotionHistory (line 921) | private void clearMotionHistory() {
method clearMotionHistory (line 935) | private void clearMotionHistory(int pointerId) {
method ensureMotionHistorySizeForId (line 949) | private void ensureMotionHistorySizeForId(int pointerId) {
method saveInitialMotion (line 984) | private void saveInitialMotion(float x, float y, int pointerId) {
method saveLastMotion (line 992) | private void saveLastMotion(MotionEvent ev) {
method isPointerDown (line 1019) | public boolean isPointerDown(int pointerId) {
method setDragState (line 1023) | void setDragState(int state) {
method tryCaptureViewForDrag (line 1045) | boolean tryCaptureViewForDrag(View toCapture, int pointerId) {
method canScroll (line 1076) | protected boolean canScroll(View v, boolean checkV, int dx, int dy, in...
method shouldInterceptTouchEvent (line 1116) | public boolean shouldInterceptTouchEvent(MotionEvent ev) {
method processTouchEvent (line 1230) | public void processTouchEvent(MotionEvent ev) {
method reportNewEdgeDrags (line 1394) | private void reportNewEdgeDrags(float dx, float dy, int pointerId) {
method checkNewEdgeDrag (line 1415) | private boolean checkNewEdgeDrag(float delta, float odelta, int pointe...
method checkTouchSlop (line 1448) | private boolean checkTouchSlop(View child, float dx, float dy) {
method checkTouchSlop (line 1483) | public boolean checkTouchSlop(int directions) {
method checkTouchSlop (line 1512) | public boolean checkTouchSlop(int directions, int pointerId) {
method isEdgeTouched (line 1545) | public boolean isEdgeTouched(int edges) {
method isEdgeTouched (line 1568) | public boolean isEdgeTouched(int edges, int pointerId) {
method releaseViewForPointerUp (line 1573) | private void releaseViewForPointerUp() {
method dragTo (line 1582) | private void dragTo(int left, int top, int dx, int dy) {
method isCapturedViewUnder (line 1618) | public boolean isCapturedViewUnder(int x, int y) {
method isViewUnder (line 1635) | public boolean isViewUnder(View view, int x, int y) {
method findTopChildUnder (line 1655) | public View findTopChildUnder(int x, int y) {
method getEdgesTouched (line 1668) | private int getEdgesTouched(int x, int y) {
FILE: WayHoo/src/com/way/ui/view/CountDownView.java
class CountDownView (line 18) | public class CountDownView extends FrameLayout {
method CountDownView (line 32) | public CountDownView(Context context, AttributeSet attrs) {
method isCountingDown (line 42) | public boolean isCountingDown() {
type OnCountDownFinishedListener (line 46) | public interface OnCountDownFinishedListener {
method onCountDownFinished (line 47) | public void onCountDownFinished();
method remainingSecondsChanged (line 50) | private void remainingSecondsChanged(int newVal) {
method onFinishInflate (line 79) | @Override
method setCountDownFinishedListener (line 85) | public void setCountDownFinishedListener(
method startCountDown (line 90) | public void startCountDown(int sec, boolean playSound) {
method startCountDown (line 99) | public void startCountDown(int sec) {
method cancelCountDown (line 108) | public void cancelCountDown() {
class MainHandler (line 116) | private class MainHandler extends Handler {
method handleMessage (line 117) | @Override
FILE: WayHoo/src/com/way/ui/view/DragSortGridView.java
class DragSortGridView (line 19) | @SuppressLint("NewApi")
method DragSortGridView (line 25) | public DragSortGridView(Context context) {
method DragSortGridView (line 29) | public DragSortGridView(Context context, AttributeSet attrs) {
method DragSortGridView (line 33) | public DragSortGridView(Context context, AttributeSet attrs, int defSt...
type OnReorderingListener (line 44) | public interface OnReorderingListener {
method beginRecordering (line 45) | public void beginRecordering(AdapterView<?> parent, View view,
method onReordering (line 48) | public void onReordering(int fromPosition, int toPosition);
method setOnReorderingListener (line 51) | public void setOnReorderingListener(OnReorderingListener listener) {
method onItemLongClick (line 59) | @Override
class IntegerArray (line 77) | private class IntegerArray {
method IntegerArray (line 80) | public IntegerArray(int size) {
method get (line 88) | public int get(int position) {
method reorder (line 99) | public void reorder(int from, int to) {
method getValueIndex (line 121) | public int getValueIndex(int value) {
method toString (line 133) | @Override
method onDrag (line 156) | @Override
method reorderViews (line 250) | protected void reorderViews(int fromPosition, int toPosition) {
method moveView (line 290) | private void moveView(int fromPosition, int toPosition) {
class MoveViewAnimationListener (line 315) | private class MoveViewAnimationListener implements
method MoveViewAnimationListener (line 321) | public MoveViewAnimationListener(View target, int newX, int newY) {
method onAnimationEnd (line 327) | @Override
method onAnimationRepeat (line 335) | @Override
method onAnimationStart (line 339) | @Override
method getLayout (line 345) | private void getLayout(View view, Rect rect) {
method getView (line 350) | private View getView(int reorderingPosition) {
FILE: WayHoo/src/com/way/ui/view/LoadingEmptyContainer.java
class LoadingEmptyContainer (line 17) | public class LoadingEmptyContainer extends FrameLayout {
method LoadingEmptyContainer (line 23) | public LoadingEmptyContainer(Context context, AttributeSet attrs) {
method onFinishInflate (line 36) | @Override
method hideAll (line 43) | public void hideAll() {
method showLoading (line 48) | public void showLoading() {
method showNoResults (line 57) | public void showNoResults() {
method getNoResultsContainer (line 64) | public NoResultsContainer getNoResultsContainer() {
FILE: WayHoo/src/com/way/ui/view/NoResultsContainer.java
class NoResultsContainer (line 16) | public class NoResultsContainer extends LinearLayout {
method NoResultsContainer (line 17) | public NoResultsContainer(Context context, AttributeSet attrs) {
method setMainText (line 27) | public void setMainText(final int resId) {
method setTextColor (line 31) | public void setTextColor(int color) {
FILE: WayHoo/src/com/way/ui/view/TouchDispatchView.java
class TouchDispatchView (line 9) | public class TouchDispatchView extends RelativeLayout {
method TouchDispatchView (line 12) | public TouchDispatchView(Context context) {
method TouchDispatchView (line 16) | public TouchDispatchView(Context context, AttributeSet attrs) {
method TouchDispatchView (line 20) | public TouchDispatchView(Context context, AttributeSet attrs, int defS...
method onInterceptTouchEvent (line 24) | public boolean onInterceptTouchEvent(MotionEvent event) {
method onTouchEvent (line 28) | public boolean onTouchEvent(MotionEvent event) {
method setInterceptTouches (line 54) | public void setInterceptTouches(boolean isInterceptTouches) {
FILE: WayHoo/src/com/way/ui/view/WeatherAqiView.java
class WeatherAqiView (line 13) | public class WeatherAqiView extends WeatherBaseView {
method WeatherAqiView (line 22) | public WeatherAqiView(Context c) {
method WeatherAqiView (line 26) | public WeatherAqiView(Context context, AttributeSet attrs) {
method WeatherAqiView (line 30) | public WeatherAqiView(Context context, AttributeSet attrs, int defStyl...
method onFinishInflate (line 34) | @Override
method setWeatherInfo (line 46) | public void setWeatherInfo(AQI aqi) {
method getAqiIcon (line 57) | private int getAqiIcon(int aqi) {
method setWeatherInfo (line 75) | @Override
FILE: WayHoo/src/com/way/ui/view/WeatherBaseView.java
class WeatherBaseView (line 9) | public abstract class WeatherBaseView extends RelativeLayout {
method WeatherBaseView (line 10) | public WeatherBaseView(Context c) {
method WeatherBaseView (line 14) | public WeatherBaseView(Context context, AttributeSet attrs) {
method WeatherBaseView (line 18) | public WeatherBaseView(Context context, AttributeSet attrs, int defSty...
method setWeatherInfo (line 21) | public abstract void setWeatherInfo(WeatherInfo weatherInfo);
FILE: WayHoo/src/com/way/ui/view/WeatherDetailsView.java
class WeatherDetailsView (line 17) | public class WeatherDetailsView extends WeatherBaseView {
method WeatherDetailsView (line 28) | public WeatherDetailsView(Context c) {
method WeatherDetailsView (line 32) | public WeatherDetailsView(Context context, AttributeSet attrs) {
method WeatherDetailsView (line 36) | public WeatherDetailsView(Context context, AttributeSet attrs,
method onFinishInflate (line 41) | @Override
method setWeatherInfo (line 54) | public void setWeatherInfo(RealTime realTime) {
method setWeatherInfo (line 87) | @Override
FILE: WayHoo/src/com/way/ui/view/WeatherForecastView.java
class WeatherForecastView (line 15) | public class WeatherForecastView extends WeatherBaseView {
method WeatherForecastView (line 48) | public WeatherForecastView(Context c) {
method WeatherForecastView (line 52) | public WeatherForecastView(Context context, AttributeSet attrs) {
method WeatherForecastView (line 56) | public WeatherForecastView(Context context, AttributeSet attrs,
method onFinishInflate (line 61) | @Override
method setWeatherInfo (line 117) | public void setWeatherInfo(Forecast forecast) {
method setWeatherInfo (line 154) | @Override
FILE: WayHoo/src/com/way/ui/view/WeatherIndexView.java
class WeatherIndexView (line 18) | public class WeatherIndexView extends WeatherBaseView {
method WeatherIndexView (line 65) | public WeatherIndexView(Context c) {
method WeatherIndexView (line 69) | public WeatherIndexView(Context context, AttributeSet attrs) {
method WeatherIndexView (line 73) | public WeatherIndexView(Context context, AttributeSet attrs,
method onFinishInflate (line 78) | @Override
method setWeatherInfo (line 158) | public void setWeatherInfo(Index index) {
method setWeatherInfo (line 209) | @Override
FILE: WayHoo/src/com/way/ui/view/WeatherTypefacedTextView.java
class WeatherTypefacedTextView (line 12) | public class WeatherTypefacedTextView extends TextView {
method WeatherTypefacedTextView (line 13) | public WeatherTypefacedTextView(Context context) {
method WeatherTypefacedTextView (line 17) | public WeatherTypefacedTextView(Context context, AttributeSet attrs) {
method WeatherTypefacedTextView (line 21) | public WeatherTypefacedTextView(Context context, AttributeSet attrs,
FILE: WayHoo/src/com/way/util/blur/jni/BitmapUtils.java
class BitmapUtils (line 10) | public class BitmapUtils {
method drawViewToBitmap (line 11) | public static Bitmap drawViewToBitmap(View view, int width, int height,
method drawViewToBitmap (line 16) | public static Bitmap drawViewToBitmap(View view, int width, int height,
FILE: WayHoo/src/com/way/util/blur/jni/FrostedGlassUtil.java
class FrostedGlassUtil (line 5) | public class FrostedGlassUtil {
method getInstance (line 9) | public static FrostedGlassUtil getInstance() {
method boxBlur (line 20) | public native void boxBlur(Bitmap srcBitmap, int radius);
method stackBlur (line 22) | public native void stackBlur(Bitmap srcBitmap, int radius);
method oilPaint (line 24) | public native void oilPaint(Bitmap srcBitmap, int radius);
method colorWaterPaint (line 26) | public native void colorWaterPaint(Bitmap srcBitmap, int radius);
method convertToBlur (line 28) | public synchronized Bitmap convertToBlur(Bitmap bmp, int radius) {
FILE: WayHoo/src/com/way/weather/plugin/bean/AQI.java
class AQI (line 4) | public class AQI {
method getAqi (line 19) | public int getAqi() {
method getAqi_desc (line 23) | public String getAqi_desc() {
method getAqi_level (line 27) | public String getAqi_level() {
method getCity_code (line 31) | public String getCity_code() {
method getCo (line 35) | public int getCo() {
method getNo2 (line 39) | public int getNo2() {
method getO3 (line 43) | public int getO3() {
method getPm10 (line 47) | public int getPm10() {
method getPm25 (line 51) | public int getPm25() {
method getPub_time (line 55) | public long getPub_time() {
method getSo2 (line 59) | public int getSo2() {
method getSource (line 63) | public String getSource() {
method getSpot (line 67) | public String getSpot() {
method setAqi (line 71) | public void setAqi(int paramInt) {
method setAqi_desc (line 75) | public void setAqi_desc(String paramString) {
method setAqi_level (line 79) | public void setAqi_level(String paramString) {
method setCity_code (line 83) | public void setCity_code(String paramString) {
method setCo (line 87) | public void setCo(int paramInt) {
method setNo2 (line 91) | public void setNo2(int paramInt) {
method setO3 (line 95) | public void setO3(int paramInt) {
method setPm10 (line 99) | public void setPm10(int paramInt) {
method setPm25 (line 103) | public void setPm25(int paramInt) {
method setPub_time (line 107) | public void setPub_time(long paramLong) {
method setSo2 (line 111) | public void setSo2(int paramInt) {
method setSource (line 115) | public void setSource(String paramString) {
method setSpot (line 119) | public void setSpot(String paramString) {
method toString (line 123) | @Override
FILE: WayHoo/src/com/way/weather/plugin/bean/Alerts.java
class Alerts (line 5) | public class Alerts {
method getArryAlert (line 9) | public ArrayList<Alert> getArryAlert() {
method getPid (line 13) | public String getPid() {
method setArryAlert (line 17) | public void setArryAlert(ArrayList<Alert> paramArrayList) {
method setPid (line 21) | public void setPid(String paramString) {
method toString (line 25) | @Override
class Alert (line 30) | public static class Alert {
method getAbnormal (line 38) | public String getAbnormal() {
method getDetail (line 42) | public String getDetail() {
method getHoliday (line 46) | public String getHoliday() {
method getLevel (line 50) | public String getLevel() {
method getPubTime (line 54) | public Long getPubTime() {
method getTitle (line 58) | public String getTitle() {
method setAbnormal (line 62) | public void setAbnormal(String paramString) {
method setDetail (line 66) | public void setDetail(String paramString) {
method setHoliday (line 70) | public void setHoliday(String paramString) {
method setLevel (line 74) | public void setLevel(String paramString) {
method setPubTime (line 78) | public void setPubTime(long paramLong) {
method setTitle (line 82) | public void setTitle(String paramString) {
method toString (line 86) | @Override
FILE: WayHoo/src/com/way/weather/plugin/bean/Forecast.java
class Forecast (line 7) | public class Forecast {
method getHumidity (line 24) | public int getHumidity(int position) {
method getPid (line 31) | public String getPid() {
method getPressure (line 35) | public int getPressure(int position) {
method getPubtime (line 41) | public long getPubtime() {
method getSunrise (line 45) | public long getSunrise(int position) {
method getSunset (line 51) | public long getSunset(int position) {
method getTmpHigh (line 57) | public int getTmpHigh(int position) {
method getTmpLow (line 63) | public int getTmpLow(int position) {
method getWeatherNames (line 69) | public String getWeatherNames(int position) {
method getWeatherNamesFrom (line 75) | public String getWeatherNamesFrom(int position) {
method getWeatherNamesTo (line 81) | public String getWeatherNamesTo(int position) {
method getWinds (line 87) | public String getWinds(int position) {
method setHumiditys (line 93) | public void setHumiditys(int position, int humidity) {
method setPid (line 99) | public void setPid(String pid) {
method setPressures (line 103) | public void setPressures(int position, int pressure) {
method setPubtime (line 109) | public void setPubtime(Long pubtime) {
method setSunrise (line 113) | public void setSunrise(int position, long sunrise) {
method setSunset (line 119) | public void setSunset(int position, long sunset) {
method setTmpHighs (line 125) | public void setTmpHighs(int position, int tmpHigh) {
method setTmpLows (line 131) | public void setTmpLows(int position, int tmpLow) {
method setWeatherNames (line 137) | public void setWeatherNames(int position, String weatherName) {
method setWeatherNamesFrom (line 143) | public void setWeatherNamesFrom(int position, String weatherNameFrom) {
method setWeatherNamesTo (line 149) | public void setWeatherNamesTo(int position, String weatherNameTo) {
method setWinds (line 155) | public void setWinds(int position, String wind) {
method getType (line 161) | public int getType(int position) {
method setType (line 167) | public void setType(int position, int type) {
method toString (line 173) | @Override
FILE: WayHoo/src/com/way/weather/plugin/bean/Index.java
class Index (line 5) | public class Index {
method getCity_code (line 9) | public String getCity_code() {
method getIndex (line 13) | public List<IndexDetail> getIndex() {
method setCity_code (line 17) | public void setCity_code(String paramString) {
method setIndex (line 21) | public void setIndex(List<IndexDetail> paramList) {
method toString (line 25) | @Override
FILE: WayHoo/src/com/way/weather/plugin/bean/IndexDetail.java
class IndexDetail (line 4) | public class IndexDetail {
method getDesc (line 10) | public String getDesc() {
method getDetail (line 14) | public String getDetail() {
method getTitle (line 18) | public String getTitle() {
method getType (line 22) | public int getType() {
method setDesc (line 26) | public void setDesc(String desc) {
method setDetail (line 30) | public void setDetail(String detail) {
method setTitle (line 34) | public void setTitle(String title) {
method setType (line 38) | public void setType(int type) {
method toString (line 42) | @Override
FILE: WayHoo/src/com/way/weather/plugin/bean/RealTime.java
class RealTime (line 4) | public class RealTime {
method getAnimation_type (line 17) | public int getAnimation_type() {
method getCity_code (line 21) | public String getCity_code() {
method getFalling_tide (line 25) | public long getFalling_tide() {
method getHumidity (line 29) | public int getHumidity() {
method getPressure (line 33) | public double getPressure() {
method getPub_time (line 37) | public long getPub_time() {
method getRising_tide (line 41) | public long getRising_tide() {
method getTemp (line 45) | public int getTemp() {
method getWater (line 49) | public int getWater() {
method getWeather_name (line 53) | public String getWeather_name() {
method getWind (line 57) | public String getWind() {
method setAnimation_type (line 61) | public void setAnimation_type(int type) {
method setCity_code (line 65) | public void setCity_code(String cityCode) {
method setFalling_tide (line 69) | public void setFalling_tide(long fallingTide) {
method setHumidity (line 73) | public void setHumidity(int humidity) {
method setPressure (line 77) | public void setPressure(double pressure) {
method setPub_time (line 81) | public void setPub_time(long pubTime) {
method setRising_tide (line 85) | public void setRising_tide(long risingTide) {
method setTemp (line 89) | public void setTemp(int temp) {
method setWater (line 93) | public void setWater(int water) {
method setWeather_name (line 97) | public void setWeather_name(String weatherName) {
method setWind (line 101) | public void setWind(String wind) {
method toString (line 105) | @Override
FILE: WayHoo/src/com/way/weather/plugin/bean/WeatherInfo.java
class WeatherInfo (line 3) | public class WeatherInfo {
method WeatherInfo (line 11) | public WeatherInfo() {
method WeatherInfo (line 15) | public WeatherInfo(RealTime realTime, Forecast forecast, AQI aqi,
method isNewData (line 25) | public boolean isNewData() {
method setNewData (line 29) | public void setNewData(boolean isNewData) {
method getRealTime (line 33) | public RealTime getRealTime() {
method setRealTime (line 37) | public void setRealTime(RealTime realTime) {
method getForecast (line 41) | public Forecast getForecast() {
method setForecast (line 45) | public void setForecast(Forecast forecast) {
method getAqi (line 49) | public AQI getAqi() {
method setAqi (line 53) | public void setAqi(AQI aqi) {
method getIndex (line 57) | public Index getIndex() {
method setIndex (line 61) | public void setIndex(Index index) {
method getAlerts (line 65) | public Alerts getAlerts() {
method setAlerts (line 69) | public void setAlerts(Alerts alerts) {
method toString (line 73) | @Override
FILE: WayHoo/src/com/way/weather/plugin/spider/WeatherConstants.java
class WeatherConstants (line 10) | public class WeatherConstants {
FILE: WayHoo/src/com/way/weather/plugin/spider/WeatherController.java
class WeatherController (line 24) | public class WeatherController {
method convertToNewAQI (line 25) | public static AQI convertToNewAQI(JSONObject aqiJSONObject,
method convertToNewAlert (line 51) | public static Alerts convertToNewAlert(JSONArray alertJSONArray,
method convertToNewForecast (line 75) | public static Forecast convertToNewForecast(JSONObject forecastJSONObj...
method convertToNewIndex (line 171) | public static Index convertToNewIndex(JSONObject indexInfo,
method convertToNewRealTime (line 210) | public static RealTime convertToNewRealTime(JSONObject realTimeJSONObj...
method getAQITime (line 233) | private static long getAQITime(String timeStr) {
method getForcastTime (line 243) | private static long getForcastTime(String timeStr) {
method parseTime (line 254) | private static long parseTime(String timeStr) {
FILE: WayHoo/src/com/way/weather/plugin/spider/WeatherSpider.java
class WeatherSpider (line 30) | public class WeatherSpider {
method getWeatherInfo (line 34) | public static WeatherInfo getWeatherInfo(String postID) throws TaskExc...
method save2Database (line 66) | public static void save2Database(WeatherInfo weatherInfo, String postID,
method getPubTime (line 84) | public static long getPubTime(String postID) {
method getWeatherInfo (line 99) | public static WeatherInfo getWeatherInfo(Context context, String postID,
method isEmpty (line 126) | public static boolean isEmpty(WeatherInfo info) {
method isEmpty (line 141) | public static boolean isEmpty(RealTime info) {
method isEmpty (line 147) | public static boolean isEmpty(Forecast info) {
method isEmpty (line 153) | public static boolean isEmpty(AQI info) {
method isEmpty (line 159) | public static boolean isEmpty(Index info) {
method isEmpty (line 166) | public static boolean isEmpty(Alerts info) {
FILE: WayHoo/src/com/way/weather/plugin/spider/WeatherUtilities.java
class WeatherUtilities (line 10) | public class WeatherUtilities {
method checkLanguageSuport (line 11) | private static String checkLanguageSuport(String language) {
method getAQISource (line 18) | public static String getAQISource(String paramString) {
method getAnimationType (line 23) | public static int getAnimationType(String weatherStr) {
method getAqi (line 47) | public static int getAqi(String aqiStr) {
method getAqiDesc (line 56) | public static String getAqiDesc(int aqiLevel, String language) {
method getAqiLevel (line 83) | public static String getAqiLevel(int aqiLevel, String language) {
method getChina (line 110) | public static String getChina(String paramString) {
method getHumidity (line 115) | public static int getHumidity(String humidity) {
method getIndexDesc (line 119) | public static String getIndexDesc(String indexTitle, String indexType,
method getIndexDetail (line 126) | public static String getIndexDetail(String paramString1,
method getIndexTitle (line 133) | public static String getIndexTitle(String indexTitleKey, String langua...
method getIndexType (line 139) | public static Integer getIndexType(String indexTypeKey) {
method getIntFromJSON (line 143) | public static int getIntFromJSON(JSONObject jsonObject, String paramSt...
method getWeather (line 152) | public static String getWeather(String weatherStr) {
method getWeatherName (line 164) | public static WeatherName getWeatherName(String weatherStr, String lan...
method getWind (line 191) | public static String getWind(String windStr, String language) {
method getWind (line 212) | public static String getWind(String fx, String fl, String language) {
method getWindIndexDetail (line 247) | public static String getWindIndexDetail(String windIndex, String langu...
class WeatherName (line 257) | public static class WeatherName {
method getFrom (line 262) | public String getFrom() {
method getName (line 266) | public String getName() {
method getTo (line 270) | public String getTo() {
method setFrom (line 274) | public void setFrom(String paramString) {
method setName (line 278) | public void setName(String paramString) {
method setTo (line 282) | public void setTo(String paramString) {
FILE: WayHoo/src/com/way/weather/plugin/util/Constants.java
class Constants (line 3) | public class Constants {
FILE: WayHoo/src/com/way/weather/plugin/util/NetUtil.java
class NetUtil (line 7) | public class NetUtil {
method getNetworkState (line 12) | public static int getNetworkState(Context context) {
FILE: WayHoo/src/com/way/yahoo/AboutActivity.java
class AboutActivity (line 15) | public class AboutActivity extends SwipeBackActivity {
method onCreate (line 17) | @Override
FILE: WayHoo/src/com/way/yahoo/App.java
class App (line 10) | public class App extends Application {
method getVolleyRequestQueue (line 14) | public static synchronized RequestQueue getVolleyRequestQueue() {
method getApplication (line 20) | public static synchronized App getApplication() {
method onCreate (line 24) | @Override
FILE: WayHoo/src/com/way/yahoo/BaseActivity.java
class BaseActivity (line 23) | public class BaseActivity extends SwipeBackActivity {
method onCreate (line 29) | @Override
method initDatas (line 35) | private void initDatas() {
method onResume (line 40) | @Override
method getTmpCities (line 45) | protected List<City> getTmpCities() {
method startLocation (line 51) | protected void startLocation(LocationListener cityNameStatus) {
method stopLocation (line 63) | protected void stopLocation() {
method getLocationCityFromDB (line 68) | protected City getLocationCityFromDB(String name) {
method addOrUpdateLocationCity (line 79) | protected void addOrUpdateLocationCity(City city) {
FILE: WayHoo/src/com/way/yahoo/FeedBackActivity.java
class FeedBackActivity (line 16) | public class FeedBackActivity extends SwipeBackActivity {
method onCreate (line 20) | @Override
FILE: WayHoo/src/com/way/yahoo/MainActivity.java
class MainActivity (line 49) | public class MainActivity extends BaseActivity implements OnClickListener,
method onCreate (line 73) | @Override
method onBackPressed (line 86) | @Override
method initViews (line 100) | private void initViews() {
method onResume (line 125) | @Override
method onPause (line 140) | @Override
method visibleAddCityBtn (line 148) | private void visibleAddCityBtn() {
method updateUI (line 156) | private void updateUI() {
method onClick (line 191) | @Override
method shareTo (line 210) | private void shareTo() {
method onPageScrollStateChanged (line 301) | @Override
method onPageScrolled (line 306) | @Override
method onPageSelected (line 313) | @Override
method initMenuDrawer (line 331) | private void initMenuDrawer() {
method changeBlurImageViewAlpha (line 375) | private void changeBlurImageViewAlpha(float slideOffset) {
method setBlurImage (line 387) | private void setBlurImage() {
method onItemClick (line 405) | @Override
method onMenuItemClicked (line 416) | protected void onMenuItemClicked(int position, Item item) {
FILE: WayHoo/src/com/way/yahoo/ManagerCityActivity.java
class ManagerCityActivity (line 36) | public class ManagerCityActivity extends BaseActivity implements
method onCreate (line 48) | @Override
method onPause (line 56) | @Override
method onStop (line 64) | @Override
method initViews (line 70) | private void initViews() {
method onClick (line 92) | @Override
method updateRefreshMode (line 113) | private void updateRefreshMode(boolean isRefresh) {
method onReordering (line 139) | @Override
method beginRecordering (line 147) | @Override
method changeEditMode (line 157) | private void changeEditMode() {
method changeSortIndex (line 174) | private void changeSortIndex() {
method deleteCityFromTable (line 185) | private void deleteCityFromTable(int position) {
method onActivityResult (line 198) | @Override
method updateUI (line 219) | private void updateUI(boolean isAdd) {
method updateBtnStates (line 231) | private void updateBtnStates() {
class CityGridAdapter (line 237) | private class CityGridAdapter extends BaseAdapter {
method CityGridAdapter (line 243) | public CityGridAdapter() {
method setRefreshingIndex (line 248) | public void setRefreshingIndex(int position) {
method isEditMode (line 254) | public boolean isEditMode() {
method notifyDataSetChanged (line 258) | @Override
method changeEditMode (line 272) | public void changeEditMode() {
method reorder (line 278) | public void reorder(int from, int to) {
method getCount (line 288) | @Override
method getItem (line 293) | @Override
method getItemId (line 298) | @Override
method getItemViewType (line 303) | @Override
method getViewTypeCount (line 311) | @Override
method getView (line 316) | @Override
method bindViewData (line 349) | private void bindViewData(ViewHolder holder, final int position) {
method buildHolder (line 437) | private ViewHolder buildHolder(View convertView) {
class ViewHolder (line 455) | private static class ViewHolder {
method getWeather (line 465) | private void getWeather(City city) {
method save2Database (line 505) | protected void save2Database(String postID, String response,
method getPubTime (line 521) | private long getPubTime(String postID) {
method getAllWeather (line 534) | private void getAllWeather() {
FILE: WayHoo/src/com/way/yahoo/QueryCityActivity.java
class QueryCityActivity (line 43) | public class QueryCityActivity extends BaseActivity implements OnClickLi...
method onCreate (line 61) | @Override
method onResume (line 70) | @Override
method initViews (line 76) | private void initViews() {
method formatBigMessage (line 112) | public CharSequence formatBigMessage(String city) {
method getCityName (line 130) | private String getCityName() {
method initDatas (line 141) | private void initDatas() {
method onItemClick (line 154) | @Override
method addToTmpCityTable (line 173) | private void addToTmpCityTable(City city) {
method onClick (line 196) | @Override
method onStop (line 217) | @Override
method stopLocation (line 223) | @Override
method onBackPressed (line 229) | @Override
method enoughToFilter (line 239) | public boolean enoughToFilter() {
method doBeforeTextChanged (line 243) | private void doBeforeTextChanged() {
method doAfterTextChanged (line 249) | private void doAfterTextChanged() {
method beforeTextChanged (line 267) | @Override
method onTextChanged (line 273) | @Override
method afterTextChanged (line 283) | @Override
method onCountDownFinished (line 290) | @Override
method detecting (line 300) | @Override
method succeed (line 306) | @Override
method failed (line 327) | @Override
method showCountDownView (line 335) | private void showCountDownView() {
method dismissCountDownView (line 346) | private void dismissCountDownView() {
class HotCityAdapter (line 351) | private class HotCityAdapter extends BaseAdapter {
method getCount (line 353) | @Override
method getItem (line 358) | @Override
method getItemId (line 363) | @Override
method getView (line 368) | @Override
class ViewHoler (line 396) | static class ViewHoler {
FILE: WayHoo/src/com/way/yahoo/SplashActivity.java
class SplashActivity (line 11) | public class SplashActivity extends Activity {
method onCreate (line 16) | @Override
method onBackPressed (line 32) | @Override
method onDestroy (line 36) | @Override
method handleMessage (line 44) | public void handleMessage(android.os.Message msg) {
FILE: WayHoo/src/net/simonvt/menudrawer/BuildLayerFrameLayout.java
class BuildLayerFrameLayout (line 13) | class BuildLayerFrameLayout extends FrameLayout {
method BuildLayerFrameLayout (line 23) | public BuildLayerFrameLayout(Context context) {
method BuildLayerFrameLayout (line 30) | public BuildLayerFrameLayout(Context context, AttributeSet attrs) {
method BuildLayerFrameLayout (line 37) | public BuildLayerFrameLayout(Context context, AttributeSet attrs, int ...
method setHardwareLayersEnabled (line 44) | void setHardwareLayersEnabled(boolean enabled) {
method onAttachedToWindow (line 48) | @Override
method onDetachedFromWindow (line 54) | @Override
method onSizeChanged (line 60) | @Override
method dispatchDraw (line 75) | @Override
FILE: WayHoo/src/net/simonvt/menudrawer/ColorDrawable.java
class ColorDrawable (line 34) | class ColorDrawable extends Drawable {
method ColorDrawable (line 40) | public ColorDrawable() {
method ColorDrawable (line 49) | public ColorDrawable(int color) {
method ColorDrawable (line 54) | private ColorDrawable(ColorState state) {
method getChangingConfigurations (line 58) | @Override
method draw (line 63) | @Override
method getColor (line 76) | public int getColor() {
method setColor (line 86) | public void setColor(int color) {
method getAlpha (line 98) | public int getAlpha() {
method setAlpha (line 107) | public void setAlpha(int alpha) {
method setColorFilter (line 123) | public void setColorFilter(ColorFilter colorFilter) {
method getOpacity (line 126) | public int getOpacity() {
method getConstantState (line 136) | @Override
class ColorState (line 142) | static final class ColorState extends ConstantState {
method ColorState (line 148) | ColorState(ColorState state) {
method newDrawable (line 155) | @Override
method newDrawable (line 160) | @Override
method getChangingConfigurations (line 165) | @Override
FILE: WayHoo/src/net/simonvt/menudrawer/DraggableDrawer.java
class DraggableDrawer (line 17) | public abstract class DraggableDrawer extends MenuDrawer {
method run (line 65) | @Override
method run (line 75) | @Override
method DraggableDrawer (line 158) | DraggableDrawer(Activity activity, int dragMode) {
method DraggableDrawer (line 162) | public DraggableDrawer(Context context) {
method DraggableDrawer (line 166) | public DraggableDrawer(Context context, AttributeSet attrs) {
method DraggableDrawer (line 170) | public DraggableDrawer(Context context, AttributeSet attrs, int defSty...
method initDrawer (line 174) | @Override
method toggleMenu (line 188) | public void toggleMenu(boolean animate) {
method isMenuVisible (line 196) | public boolean isMenuVisible() {
method setMenuSize (line 200) | public void setMenuSize(final int size) {
method setOffsetMenuEnabled (line 209) | public void setOffsetMenuEnabled(boolean offsetMenu) {
method getOffsetMenuEnabled (line 217) | public boolean getOffsetMenuEnabled() {
method peekDrawer (line 221) | public void peekDrawer() {
method peekDrawer (line 225) | public void peekDrawer(long delay) {
method peekDrawer (line 229) | public void peekDrawer(final long startDelay, final long delay) {
method setHardwareLayerEnabled (line 250) | public void setHardwareLayerEnabled(boolean enabled) {
method getTouchMode (line 259) | public int getTouchMode() {
method setTouchMode (line 263) | public void setTouchMode(int mode) {
method setTouchBezelSize (line 270) | public void setTouchBezelSize(int size) {
method getTouchBezelSize (line 274) | public int getTouchBezelSize() {
method startLayerTranslation (line 281) | protected void startLayerTranslation() {
method stopLayerTranslation (line 293) | protected void stopLayerTranslation() {
method endDrag (line 304) | protected void endDrag() {
method stopAnimation (line 316) | protected void stopAnimation() {
method completeAnimation (line 325) | private void completeAnimation() {
method cancelContentTouch (line 333) | protected void cancelContentTouch() {
method animateOffsetTo (line 351) | protected void animateOffsetTo(int position, int velocity, boolean ani...
method animateOffsetTo (line 377) | protected void animateOffsetTo(int position, int duration) {
method postAnimationInvalidate (line 397) | private void postAnimationInvalidate() {
method startPeek (line 415) | protected void startPeek() {
method initPeekScroller (line 423) | protected abstract void initPeekScroller();
method peekDrawerInvalidate (line 428) | private void peekDrawerInvalidate() {
method completePeek (line 455) | private void completePeek() {
method endPeek (line 468) | protected void endPeek() {
method isCloseEnough (line 475) | protected boolean isCloseEnough() {
method canChildrenScroll (line 479) | protected boolean canChildrenScroll(int dx, int dy, int x, int y) {
method canChildScrollHorizontally (line 518) | protected boolean canChildScrollHorizontally(View v, boolean checkV, i...
method canChildScrollVertically (line 552) | protected boolean canChildScrollVertically(View v, boolean checkV, int...
method getXVelocity (line 576) | protected float getXVelocity(VelocityTracker velocityTracker) {
method getYVelocity (line 584) | protected float getYVelocity(VelocityTracker velocityTracker) {
method supportGetTranslationY (line 592) | private int supportGetTranslationY(View v) {
method supportGetTranslationX (line 600) | private int supportGetTranslationX(View v) {
method saveState (line 608) | void saveState(Bundle state) {
method restoreState (line 613) | public void restoreState(Parcelable in) {
FILE: WayHoo/src/net/simonvt/menudrawer/FloatScroller.java
class FloatScroller (line 29) | class FloatScroller {
method FloatScroller (line 47) | public FloatScroller(Interpolator interpolator) {
method isFinished (line 57) | public final boolean isFinished() {
method forceFinished (line 66) | public final void forceFinished(boolean finished) {
method getDuration (line 75) | public final int getDuration() {
method getCurr (line 84) | public final float getCurr() {
method getStart (line 93) | public final float getStart() {
method getFinal (line 102) | public final float getFinal() {
method computeScrollOffset (line 106) | public boolean computeScrollOffset() {
method startScroll (line 125) | public void startScroll(float start, float delta, int duration) {
method abortAnimation (line 142) | public void abortAnimation() {
method extendDuration (line 154) | public void extendDuration(int extend) {
method timePassed (line 166) | public int timePassed() {
method setFinal (line 170) | public void setFinal(float newVal) {
FILE: WayHoo/src/net/simonvt/menudrawer/MenuDrawer.java
class MenuDrawer (line 30) | @SuppressLint("NewApi")
type OnDrawerStateChangeListener (line 36) | public interface OnDrawerStateChangeListener {
method onDrawerStateChange (line 44) | void onDrawerStateChange(int oldState, int newState);
method onDrawerSlide (line 52) | void onDrawerSlide(float openRatio, int offsetPixels);
type OnInterceptMoveEventListener (line 60) | public interface OnInterceptMoveEventListener {
method isViewDraggable (line 71) | boolean isViewDraggable(View v, int delta, int x, int y);
type Type (line 74) | public enum Type {
method run (line 331) | @Override
method attach (line 410) | public static MenuDrawer attach(Activity activity) {
method attach (line 421) | public static MenuDrawer attach(Activity activity, Type type) {
method attach (line 432) | public static MenuDrawer attach(Activity activity, Position position) {
method attach (line 444) | public static MenuDrawer attach(Activity activity, Type type, Position...
method attach (line 458) | public static MenuDrawer attach(Activity activity, Type type, Position...
method createMenuDrawer (line 481) | private static MenuDrawer createMenuDrawer(Activity activity, int drag...
method attachToContent (line 509) | private static void attachToContent(Activity activity, MenuDrawer menu...
method attachToDecor (line 523) | private static void attachToDecor(Activity activity, MenuDrawer menuDr...
method MenuDrawer (line 533) | MenuDrawer(Activity activity, int dragMode) {
method MenuDrawer (line 540) | public MenuDrawer(Context context) {
method MenuDrawer (line 544) | public MenuDrawer(Context context, AttributeSet attrs) {
method MenuDrawer (line 548) | public MenuDrawer(Context context, AttributeSet attrs, int defStyle) {
method initDrawer (line 553) | protected void initDrawer(Context context, AttributeSet attrs, int def...
method onFinishInflate (line 618) | @Override
method dpToPx (line 639) | protected int dpToPx(int dp) {
method isViewDescendant (line 643) | protected boolean isViewDescendant(View v) {
method onAttachedToWindow (line 656) | @Override
method onDetachedFromWindow (line 662) | @Override
method shouldDrawIndicator (line 668) | private boolean shouldDrawIndicator() {
method dispatchDraw (line 672) | @Override
method drawOverlay (line 688) | protected abstract void drawOverlay(Canvas canvas);
method drawDropShadow (line 690) | private void drawDropShadow(Canvas canvas) {
method updateDropShadowRect (line 702) | protected void updateDropShadowRect() {
method drawIndicator (line 735) | private void drawIndicator(Canvas canvas) {
method updateIndicatorClipRect (line 770) | protected void updateIndicatorClipRect() {
method setPosition (line 847) | private void setPosition(Position position) {
method getPosition (line 852) | protected Position getPosition() {
method onRtlPropertiesChanged (line 874) | @Override
method setOffsetPixels (line 896) | protected void setOffsetPixels(float offsetPixels) {
method onOffsetPixelsChanged (line 923) | protected abstract void onOffsetPixelsChanged(int offsetPixels);
method toggleMenu (line 928) | public void toggleMenu() {
method toggleMenu (line 937) | public abstract void toggleMenu(boolean animate);
method openMenu (line 942) | public void openMenu() {
method openMenu (line 951) | public abstract void openMenu(boolean animate);
method closeMenu (line 956) | public void closeMenu() {
method closeMenu (line 965) | public abstract void closeMenu(boolean animate);
method isMenuVisible (line 972) | public abstract boolean isMenuVisible();
method setMenuSize (line 979) | public abstract void setMenuSize(int size);
method getMenuSize (line 986) | public int getMenuSize() {
method setActiveView (line 996) | public void setActiveView(View v) {
method setActiveView (line 1008) | public void setActiveView(View v, int position) {
method setAllowIndicatorAnimation (line 1025) | public void setAllowIndicatorAnimation(boolean animate) {
method getAllowIndicatorAnimation (line 1037) | public boolean getAllowIndicatorAnimation() {
method onScrollChanged (line 1045) | @Override
method startAnimatingIndicator (line 1061) | private void startAnimatingIndicator() {
method getIndicatorStartPos (line 1074) | private int getIndicatorStartPos() {
method updateTouchAreaSize (line 1090) | protected void updateTouchAreaSize() {
method animateIndicatorInvalidate (line 1103) | private void animateIndicatorInvalidate() {
method completeAnimatingIndicator (line 1120) | private void completeAnimatingIndicator() {
method setOffsetMenuEnabled (line 1131) | public abstract void setOffsetMenuEnabled(boolean offsetMenu);
method getOffsetMenuEnabled (line 1138) | public abstract boolean getOffsetMenuEnabled();
method getDrawerState (line 1145) | public int getDrawerState() {
method setOnDrawerStateChangeListener (line 1154) | public void setOnDrawerStateChangeListener(OnDrawerStateChangeListener...
method setOnInterceptMoveEventListener (line 1163) | public void setOnInterceptMoveEventListener(OnInterceptMoveEventListen...
method setDropShadowEnabled (line 1172) | public void setDropShadowEnabled(boolean enabled) {
method getDropShadowOrientation (line 1177) | protected GradientDrawable.Orientation getDropShadowOrientation() {
method setDropShadowColor (line 1199) | public void setDropShadowColor(int color) {
method setDropShadow (line 1216) | public void setDropShadow(Drawable drawable) {
method setDropShadow (line 1227) | public void setDropShadow(int resId) {
method getDropShadow (line 1234) | public Drawable getDropShadow() {
method setDropShadowSize (line 1243) | public void setDropShadowSize(int size) {
method peekDrawer (line 1251) | public abstract void peekDrawer();
method peekDrawer (line 1259) | public abstract void peekDrawer(long delay);
method peekDrawer (line 1268) | public abstract void peekDrawer(long startDelay, long delay);
method setHardwareLayerEnabled (line 1275) | public abstract void setHardwareLayerEnabled(boolean enabled);
method setMaxAnimationDuration (line 1282) | public void setMaxAnimationDuration(int duration) {
method setDrawOverlay (line 1291) | public void setDrawOverlay(boolean drawOverlay) {
method getDrawOverlay (line 1300) | public boolean getDrawOverlay() {
method updateUpContentDescription (line 1304) | protected void updateUpContentDescription() {
method setSlideDrawable (line 1317) | public void setSlideDrawable(int drawableRes) {
method setSlideDrawable (line 1326) | public void setSlideDrawable(Drawable drawable) {
method setupUpIndicator (line 1345) | public void setupUpIndicator(Activity activity) {
method setDrawerIndicatorEnabled (line 1363) | public void setDrawerIndicatorEnabled(boolean enabled) {
method isDrawerIndicatorEnabled (line 1382) | public boolean isDrawerIndicatorEnabled() {
method getMenuContainer (line 1391) | public ViewGroup getMenuContainer() {
method getContentContainer (line 1400) | public ViewGroup getContentContainer() {
method setMenuView (line 1413) | public void setMenuView(int layoutResId) {
method setMenuView (line 1424) | public void setMenuView(View view) {
method setMenuView (line 1434) | public void setMenuView(View view, LayoutParams params) {
method getMenuView (line 1445) | public View getMenuView() {
method setContentView (line 1454) | public void setContentView(int layoutResId) {
method setContentView (line 1472) | public void setContentView(View view) {
method setContentView (line 1482) | public void setContentView(View view, LayoutParams params) {
method setDrawerState (line 1495) | protected void setDrawerState(int state) {
method logDrawerState (line 1504) | protected void logDrawerState(int state) {
method getTouchMode (line 1534) | public abstract int getTouchMode();
method setTouchMode (line 1542) | public abstract void setTouchMode(int mode);
method setTouchBezelSize (line 1549) | public abstract void setTouchBezelSize(int size);
method getTouchBezelSize (line 1554) | public abstract int getTouchBezelSize();
method postOnAnimation (line 1556) | @Override
method fitSystemWindows (line 1565) | @Override
method dispatchOnDrawerSlide (line 1573) | protected void dispatchOnDrawerSlide(float openRatio, int offsetPixels) {
method saveState (line 1584) | public final Parcelable saveState() {
method saveState (line 1590) | void saveState(Bundle state) {
method restoreState (line 1599) | public void restoreState(Parcelable in) {
method onSaveInstanceState (line 1603) | @Override
method onRestoreInstanceState (line 1615) | @Override
class SavedState (line 1623) | static class SavedState extends BaseSavedState {
method SavedState (line 1627) | public SavedState(Parcelable superState) {
method SavedState (line 1631) | public SavedState(Parcel in) {
method writeToParcel (line 1636) | @Override
method createFromParcel (line 1644) | @Override
method newArray (line 1649) | @Override
FILE: WayHoo/src/net/simonvt/menudrawer/NoClickThroughFrameLayout.java
class NoClickThroughFrameLayout (line 10) | class NoClickThroughFrameLayout extends BuildLayerFrameLayout {
method NoClickThroughFrameLayout (line 12) | public NoClickThroughFrameLayout(Context context) {
method NoClickThroughFrameLayout (line 16) | public NoClickThroughFrameLayout(Context context, AttributeSet attrs) {
method NoClickThroughFrameLayout (line 20) | public NoClickThroughFrameLayout(Context context, AttributeSet attrs, ...
method onTouchEvent (line 24) | @Override
FILE: WayHoo/src/net/simonvt/menudrawer/OverlayDrawer.java
class OverlayDrawer (line 12) | public class OverlayDrawer extends DraggableDrawer {
method run (line 19) | @Override
method OverlayDrawer (line 37) | OverlayDrawer(Activity activity, int dragMode) {
method OverlayDrawer (line 41) | public OverlayDrawer(Context context) {
method OverlayDrawer (line 45) | public OverlayDrawer(Context context, AttributeSet attrs) {
method OverlayDrawer (line 49) | public OverlayDrawer(Context context, AttributeSet attrs, int defStyle) {
method initDrawer (line 53) | @Override
method drawOverlay (line 65) | @Override
method openMenu (line 94) | @Override
method closeMenu (line 112) | @Override
method onOffsetPixelsChanged (line 117) | @Override
method initPeekScroller (line 160) | @Override
method onSizeChanged (line 178) | @Override
method getDropShadowOrientation (line 184) | @Override
method updateDropShadowRect (line 201) | @Override
method startLayerTranslation (line 237) | @Override
method stopLayerTranslation (line 245) | @Override
method onLayout (line 253) | @Override
method onMeasure (line 303) | @Override
method isContentTouch (line 342) | private boolean isContentTouch(int x, int y) {
method onDownAllowDrag (line 366) | protected boolean onDownAllowDrag(int x, int y) {
method onMoveAllowDrag (line 392) | protected boolean onMoveAllowDrag(int x, int y, float dx, float dy) {
method onMoveEvent (line 424) | protected void onMoveEvent(float dx, float dy) {
method onUpEvent (line 444) | protected void onUpEvent(int x, int y) {
method checkTouchSlop (line 508) | protected boolean checkTouchSlop(float dx, float dy) {
method stopAnimation (line 519) | @Override
method requestDisallowInterceptTouchEvent (line 525) | @Override
method onInterceptTouchEvent (line 535) | public boolean onInterceptTouchEvent(MotionEvent ev) {
method onTouchEvent (line 669) | @Override
method onPointerUp (line 779) | private void onPointerUp(MotionEvent ev) {
FILE: WayHoo/src/net/simonvt/menudrawer/PeekInterpolator.java
class PeekInterpolator (line 5) | class PeekInterpolator implements Interpolator {
method getInterpolation (line 11) | @Override
FILE: WayHoo/src/net/simonvt/menudrawer/Position.java
type Position (line 8) | public enum Position {
method Position (line 35) | Position(int value) {
method fromValue (line 47) | public static Position fromValue(int value) {
FILE: WayHoo/src/net/simonvt/menudrawer/Scroller.java
class Scroller (line 35) | class Scroller {
method Scroller (line 107) | public Scroller(Context context) {
method Scroller (line 116) | public Scroller(Context context, Interpolator interpolator) {
method Scroller (line 126) | public Scroller(Context context, Interpolator interpolator, boolean fl...
method setFriction (line 141) | public final void setFriction(float friction) {
method computeDeceleration (line 145) | private float computeDeceleration(float friction) {
method isFinished (line 158) | public final boolean isFinished() {
method forceFinished (line 167) | public final void forceFinished(boolean finished) {
method getDuration (line 176) | public final int getDuration() {
method getCurrX (line 185) | public final int getCurrX() {
method getCurrY (line 194) | public final int getCurrY() {
method getCurrVelocity (line 204) | public float getCurrVelocity() {
method getStartX (line 213) | public final int getStartX() {
method getStartY (line 222) | public final int getStartY() {
method getFinalX (line 231) | public final int getFinalX() {
method getFinalY (line 240) | public final int getFinalY() {
method computeScrollOffset (line 249) | public boolean computeScrollOffset() {
method startScroll (line 316) | public void startScroll(int startX, int startY, int dx, int dy) {
method startScroll (line 333) | public void startScroll(int startX, int startY, int dx, int dy, int du...
method fling (line 366) | public void fling(int startX, int startY, int velocityX, int velocityY,
method viscousFluid (line 422) | static float viscousFluid(float x) {
method abortAnimation (line 442) | public void abortAnimation() {
method extendDuration (line 456) | public void extendDuration(int extend) {
method timePassed (line 468) | public int timePassed() {
method setFinalX (line 479) | public void setFinalX(int newX) {
method setFinalY (line 492) | public void setFinalY(int newY) {
method isScrollingInDirection (line 501) | public boolean isScrollingInDirection(float xvel, float yvel) {
FILE: WayHoo/src/net/simonvt/menudrawer/SinusoidalInterpolator.java
class SinusoidalInterpolator (line 9) | class SinusoidalInterpolator implements Interpolator {
method getInterpolation (line 11) | @Override
FILE: WayHoo/src/net/simonvt/menudrawer/SlideDrawable.java
class SlideDrawable (line 10) | public class SlideDrawable extends Drawable implements Drawable.Callback {
method SlideDrawable (line 19) | public SlideDrawable(Drawable wrapped) {
method setOffset (line 23) | public void setOffset(float offset) {
method getOffset (line 28) | public float getOffset() {
method setIsRtl (line 32) | void setIsRtl(boolean isRtl) {
method draw (line 37) | @Override
method setChangingConfigurations (line 50) | @Override
method getChangingConfigurations (line 55) | @Override
method setDither (line 60) | @Override
method setFilterBitmap (line 65) | @Override
method setAlpha (line 70) | @Override
method setColorFilter (line 75) | @Override
method setColorFilter (line 80) | @Override
method clearColorFilter (line 85) | @Override
method isStateful (line 90) | @Override
method setState (line 95) | @Override
method getState (line 100) | @Override
method getCurrent (line 105) | @Override
method setVisible (line 110) | @Override
method getOpacity (line 115) | @Override
method getTransparentRegion (line 120) | @Override
method onStateChange (line 125) | @Override
method onBoundsChange (line 131) | @Override
method getIntrinsicWidth (line 137) | @Override
method getIntrinsicHeight (line 142) | @Override
method getMinimumWidth (line 147) | @Override
method getMinimumHeight (line 152) | @Override
method getPadding (line 157) | @Override
method getConstantState (line 162) | @Override
method invalidateDrawable (line 167) | @Override
method scheduleDrawable (line 174) | @Override
method unscheduleDrawable (line 181) | @Override
FILE: WayHoo/src/net/simonvt/menudrawer/SlidingDrawer.java
class SlidingDrawer (line 10) | public class SlidingDrawer extends DraggableDrawer {
method SlidingDrawer (line 14) | SlidingDrawer(Activity activity, int dragMode) {
method SlidingDrawer (line 18) | public SlidingDrawer(Context context) {
method SlidingDrawer (line 22) | public SlidingDrawer(Context context, AttributeSet attrs) {
method SlidingDrawer (line 26) | public SlidingDrawer(Context context, AttributeSet attrs, int defStyle) {
method initDrawer (line 30) | @Override
method openMenu (line 37) | @Override
method closeMenu (line 55) | @Override
method onOffsetPixelsChanged (line 60) | @Override
method initPeekScroller (line 90) | @Override
method onSizeChanged (line 108) | @Override
method drawOverlay (line 114) | @Override
method onLayout (line 143) | @Override
method offsetMenu (line 183) | private void offsetMenu(int offsetPixels) {
method onMeasure (line 264) | @Override
method isContentTouch (line 303) | private boolean isContentTouch(int x, int y) {
method onDownAllowDrag (line 327) | protected boolean onDownAllowDrag(int x, int y) {
method onMoveAllowDrag (line 353) | protected boolean onMoveAllowDrag(int x, int y, float dx, float dy) {
method onMoveEvent (line 377) | protected void onMoveEvent(float dx, float dy) {
method onUpEvent (line 397) | protected void onUpEvent(int x, int y) {
method checkTouchSlop (line 461) | protected boolean checkTouchSlop(float dx, float dy) {
method onInterceptTouchEvent (line 472) | publi
Condensed preview — 333 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,571K chars).
[
{
"path": ".gitignore",
"chars": 485,
"preview": "# Built application files\n*.apk\n*.ap_\n.DS_Store\n\n# files for the dex VM\n*.dex\n\n# Java class files\n*.class\n\n# generated f"
},
{
"path": "LICENSE",
"chars": 10248,
"preview": "Apache License\nVersion 2.0, January 2004\nhttp://www.apache.org/licenses/\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AN"
},
{
"path": "README.md",
"chars": 1429,
"preview": "威震天气\n======\n\n本应用是以变形金刚作为主题元素的实用型Android天气软件,界面高仿雅虎天气,数据来自中国天气网!\n\n##下载apk\n\n[腾讯应用市场](http://sj.qq.com/myapp/detail.htm?apk"
},
{
"path": "Upgrade-lib/.settings/org.eclipse.jdt.core.prefs",
"chars": 173,
"preview": "eclipse.preferences.version=1\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\norg.eclipse.jdt.core.compiler.com"
},
{
"path": "Upgrade-lib/AndroidManifest.xml",
"chars": 309,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n package"
},
{
"path": "Upgrade-lib/proguard-project.txt",
"chars": 781,
"preview": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in t"
},
{
"path": "Upgrade-lib/project.properties",
"chars": 584,
"preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/MainActivity.java",
"chars": 412,
"preview": "package com.way.upgrade;\r\n\r\nimport android.app.Activity;\r\nimport android.os.Bundle;\r\n\r\nimport com.way.upgrade.core.Upgra"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/bean/UpgradeInfo.java",
"chars": 3594,
"preview": "package com.way.upgrade.bean;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\n\n/**\n * 版本更新信息\n * \n * @author way"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/core/CheckNewVersionListener.java",
"chars": 179,
"preview": "package com.way.upgrade.core;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @sine 2014/10/29\r\n */\r\npublic interface CheckNewVersionLis"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/core/UpgradeInterface.java",
"chars": 498,
"preview": "package com.way.upgrade.core;\r\n\r\nimport com.way.upgrade.bean.UpgradeInfo;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/4/"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/core/UpgradeManager.java",
"chars": 9499,
"preview": "package com.way.upgrade.core;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Locale;\r\nimport java.util.Map;\r\n\r\nimport an"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/job/AbstractCheckNewVersionJob.java",
"chars": 2759,
"preview": "package com.way.upgrade.job;\r\n\r\nimport java.io.IOException;\r\n\r\nimport org.apache.http.client.ClientProtocolException;\r\ni"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/job/CheckNewVersionJobWithoutClientUrl.java",
"chars": 429,
"preview": "package com.way.upgrade.job;\r\n\r\nimport android.content.Context;\r\n\r\nimport com.way.upgrade.utils.Constants;\r\n\r\n/**\r\n * \r\n"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/job/DownloadNewVersionJob.java",
"chars": 5598,
"preview": "package com.way.upgrade.job;\r\n\r\nimport java.io.File;\r\n\r\nimport android.app.DownloadManager;\r\nimport android.app.Download"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/locale/LocaleChina.java",
"chars": 143,
"preview": "package com.way.upgrade.locale;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/10/29\r\n */\r\npublic class LocaleChina extends"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/locale/LocaleChinaTW.java",
"chars": 594,
"preview": "package com.way.upgrade.locale;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/10/29\r\n */\r\npublic class LocaleChinaTW exten"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/locale/LocaleChinese.java",
"chars": 589,
"preview": "package com.way.upgrade.locale;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/10/29\r\n */\r\npublic class LocaleChinese exten"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/locale/LocaleEnglish.java",
"chars": 584,
"preview": "package com.way.upgrade.locale;\r\n\r\npublic class LocaleEnglish extends LocaleHandler {\r\n\tpublic static final String defau"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/locale/LocaleHandler.java",
"chars": 557,
"preview": "package com.way.upgrade.locale;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/10/29\r\n */\r\npublic abstract class LocaleHand"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/locale/LocaleUS.java",
"chars": 85,
"preview": "package com.way.upgrade.locale;\r\n\r\npublic class LocaleUS extends LocaleEnglish {\r\n}\r\n"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/parser/json/AbstractJsonParsing.java",
"chars": 813,
"preview": "package com.way.upgrade.parser.json;\n\nimport java.util.ArrayList;\n\nimport org.json.JSONArray;\nimport org.json.JSONExcept"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/parser/json/FirVersionJsonParsing.java",
"chars": 1379,
"preview": "package com.way.upgrade.parser.json;\n\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport android.content"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/receiver/DownloadCompleteReveiver.java",
"chars": 2428,
"preview": "package com.way.upgrade.receiver;\r\n\r\nimport android.app.DownloadManager;\r\nimport android.app.DownloadManager.Query;\r\nimp"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/Constants.java",
"chars": 862,
"preview": "package com.way.upgrade.utils;\r\n\r\n/**\r\n * \r\n * @author way 2014/4/28\r\n */\r\npublic class Constants {\r\n\t//public static fi"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/ContextUtils.java",
"chars": 7469,
"preview": "package com.way.upgrade.utils;\r\n\r\nimport java.lang.reflect.Method;\r\n\r\nimport android.app.AlertDialog;\r\nimport android.ap"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/FileUtils.java",
"chars": 458,
"preview": "package com.way.upgrade.utils;\r\n\r\nimport java.io.File;\r\n\r\n/**\r\n * @author way 2013/12/6\r\n */\r\npublic class FileUtils {\r\n"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/Log.java",
"chars": 2432,
"preview": "package com.way.upgrade.utils;\r\n\r\npublic class Log {\r\n\tpublic static final boolean DEBUG = true;\r\n\tpublic static final b"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/NetUtils.java",
"chars": 12841,
"preview": "package com.way.upgrade.utils;\r\n\r\nimport java.io.BufferedReader;\r\nimport java.io.DataOutputStream;\r\nimport java.io.File;"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/Preferences.java",
"chars": 3667,
"preview": "package com.way.upgrade.utils;\r\n\r\nimport android.content.Context;\r\nimport android.content.SharedPreferences;\r\n\r\nimport c"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/Utils.java",
"chars": 9824,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/thread/Future.java",
"chars": 1298,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/thread/FutureListener.java",
"chars": 787,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/thread/PriorityThreadFactory.java",
"chars": 1373,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "Upgrade-lib/src/com/way/upgrade/utils/thread/ThreadPool.java",
"chars": 6900,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/.settings/org.eclipse.jdt.core.prefs",
"chars": 173,
"preview": "eclipse.preferences.version=1\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\norg.eclipse.jdt.core.compiler.com"
},
{
"path": "WayHoo/AndroidManifest.xml",
"chars": 4520,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package="
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/MainActivity.java",
"chars": 412,
"preview": "package com.way.upgrade;\r\n\r\nimport android.app.Activity;\r\nimport android.os.Bundle;\r\n\r\nimport com.way.upgrade.core.Upgra"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/bean/UpgradeInfo.java",
"chars": 3594,
"preview": "package com.way.upgrade.bean;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\n\n/**\n * 版本更新信息\n * \n * @author way"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/core/CheckNewVersionListener.java",
"chars": 179,
"preview": "package com.way.upgrade.core;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @sine 2014/10/29\r\n */\r\npublic interface CheckNewVersionLis"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/core/UpgradeInterface.java",
"chars": 498,
"preview": "package com.way.upgrade.core;\r\n\r\nimport com.way.upgrade.bean.UpgradeInfo;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/4/"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/core/UpgradeManager.java",
"chars": 9499,
"preview": "package com.way.upgrade.core;\r\n\r\nimport java.util.HashMap;\r\nimport java.util.Locale;\r\nimport java.util.Map;\r\n\r\nimport an"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/job/AbstractCheckNewVersionJob.java",
"chars": 2759,
"preview": "package com.way.upgrade.job;\r\n\r\nimport java.io.IOException;\r\n\r\nimport org.apache.http.client.ClientProtocolException;\r\ni"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/job/CheckNewVersionJobWithoutClientUrl.java",
"chars": 429,
"preview": "package com.way.upgrade.job;\r\n\r\nimport android.content.Context;\r\n\r\nimport com.way.upgrade.utils.Constants;\r\n\r\n/**\r\n * \r\n"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/job/DownloadNewVersionJob.java",
"chars": 5598,
"preview": "package com.way.upgrade.job;\r\n\r\nimport java.io.File;\r\n\r\nimport android.app.DownloadManager;\r\nimport android.app.Download"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChina.java",
"chars": 143,
"preview": "package com.way.upgrade.locale;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/10/29\r\n */\r\npublic class LocaleChina extends"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChinaTW.java",
"chars": 594,
"preview": "package com.way.upgrade.locale;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/10/29\r\n */\r\npublic class LocaleChinaTW exten"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleChinese.java",
"chars": 589,
"preview": "package com.way.upgrade.locale;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/10/29\r\n */\r\npublic class LocaleChinese exten"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleEnglish.java",
"chars": 584,
"preview": "package com.way.upgrade.locale;\r\n\r\npublic class LocaleEnglish extends LocaleHandler {\r\n\tpublic static final String defau"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleHandler.java",
"chars": 557,
"preview": "package com.way.upgrade.locale;\r\n\r\n/**\r\n * \r\n * @author way\r\n * @since 2014/10/29\r\n */\r\npublic abstract class LocaleHand"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/locale/LocaleUS.java",
"chars": 85,
"preview": "package com.way.upgrade.locale;\r\n\r\npublic class LocaleUS extends LocaleEnglish {\r\n}\r\n"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/parser/json/AbstractJsonParsing.java",
"chars": 813,
"preview": "package com.way.upgrade.parser.json;\n\nimport java.util.ArrayList;\n\nimport org.json.JSONArray;\nimport org.json.JSONExcept"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/parser/json/FirVersionJsonParsing.java",
"chars": 1379,
"preview": "package com.way.upgrade.parser.json;\n\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport android.content"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/receiver/DownloadCompleteReveiver.java",
"chars": 2428,
"preview": "package com.way.upgrade.receiver;\r\n\r\nimport android.app.DownloadManager;\r\nimport android.app.DownloadManager.Query;\r\nimp"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/Constants.java",
"chars": 862,
"preview": "package com.way.upgrade.utils;\r\n\r\n/**\r\n * \r\n * @author way 2014/4/28\r\n */\r\npublic class Constants {\r\n\t//public static fi"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/ContextUtils.java",
"chars": 7469,
"preview": "package com.way.upgrade.utils;\r\n\r\nimport java.lang.reflect.Method;\r\n\r\nimport android.app.AlertDialog;\r\nimport android.ap"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/FileUtils.java",
"chars": 458,
"preview": "package com.way.upgrade.utils;\r\n\r\nimport java.io.File;\r\n\r\n/**\r\n * @author way 2013/12/6\r\n */\r\npublic class FileUtils {\r\n"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/Log.java",
"chars": 2432,
"preview": "package com.way.upgrade.utils;\r\n\r\npublic class Log {\r\n\tpublic static final boolean DEBUG = true;\r\n\tpublic static final b"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/NetUtils.java",
"chars": 12841,
"preview": "package com.way.upgrade.utils;\r\n\r\nimport java.io.BufferedReader;\r\nimport java.io.DataOutputStream;\r\nimport java.io.File;"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/Preferences.java",
"chars": 3667,
"preview": "package com.way.upgrade.utils;\r\n\r\nimport android.content.Context;\r\nimport android.content.SharedPreferences;\r\n\r\nimport c"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/Utils.java",
"chars": 9824,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/Future.java",
"chars": 1298,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/FutureListener.java",
"chars": 787,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/PriorityThreadFactory.java",
"chars": 1373,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/Upgrade-lib/com/way/upgrade/utils/thread/ThreadPool.java",
"chars": 6900,
"preview": "/*\n * Copyright (C) 2010 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/jni/Android.mk",
"chars": 876,
"preview": "# Copyright (C) 2009 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");"
},
{
"path": "WayHoo/jni/Application.mk",
"chars": 78,
"preview": "APP_ABI\t\t:= armeabi armeabi-v7a\nAPP_PLATFORM:= android-21\nAPP_OPTIM\t:= release"
},
{
"path": "WayHoo/jni/bitmapPort.c",
"chars": 6966,
"preview": "\n#include <string.h>\n#include <jni.h>\n#include <malloc.h>\n#include <android/bitmap.h>\n#include \"constants.h\"\n#include \"b"
},
{
"path": "WayHoo/jni/bitmapPort.h",
"chars": 858,
"preview": "\n#include <string.h>\n#include <jni.h>\n#include <malloc.h>\n#include <android/bitmap.h>\n#include \"constants.h\"\n\n\n#ifndef _"
},
{
"path": "WayHoo/jni/com_way_util_blur_jni_FrostedGlassUtil.h",
"chars": 1304,
"preview": "/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n/* Header for class com_way_util_blur_jni_Frosted"
},
{
"path": "WayHoo/jni/constants.h",
"chars": 795,
"preview": "#ifndef _CONSTANTS_H_\n#define _CONSTANTS_H_\n\n#include <jni.h>\n#include <android/log.h>\n#include <stdlib.h>\n#include \"com"
},
{
"path": "WayHoo/jni/frostedGlass.c",
"chars": 3570,
"preview": "/*\n * Copyright (C) 2009 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/jni/imageProcess.c",
"chars": 26713,
"preview": "#include \"stdlib.h\"\r\n#include \"stdio.h\"\r\n#include \"math.h\"\r\n#include \"imageProcess.h\"\r\n#include \"constants.h\"\r\n\r\n\r\nstati"
},
{
"path": "WayHoo/jni/imageProcess.h",
"chars": 546,
"preview": "#ifndef _IMAGE_PROCESS_H_\n#define _IMAGE_PROCESS_H_\n\nvoid gaussBlurProcess( uint8_t *colorImg, int width, int height );\n"
},
{
"path": "WayHoo/proguard-project.txt",
"chars": 781,
"preview": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in t"
},
{
"path": "WayHoo/project.properties",
"chars": 563,
"preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
},
{
"path": "WayHoo/res/anim/count_down_exit.xml",
"chars": 1090,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Copyright (c) 2013, The Android Open Source Project\n\n Licensed unde"
},
{
"path": "WayHoo/res/anim/fade_out.xml",
"chars": 354,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<alpha xmlns:android=\"http://schemas.android.com/apk/res/android\" \n android:i"
},
{
"path": "WayHoo/res/anim/in_from_bottom.xml",
"chars": 428,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\r\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\r\n <transla"
},
{
"path": "WayHoo/res/anim/in_from_top.xml",
"chars": 429,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\r\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\r\n <transla"
},
{
"path": "WayHoo/res/anim/out_from_bottom.xml",
"chars": 427,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\r\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\r\n <translat"
},
{
"path": "WayHoo/res/anim/out_from_top.xml",
"chars": 428,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\r\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\">\r\n <translat"
},
{
"path": "WayHoo/res/anim/push_right_out.xml",
"chars": 361,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\" >\r\n\r\n <transl"
},
{
"path": "WayHoo/res/anim/slide_in_from_bottom.xml",
"chars": 865,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Copyright (C) 2009 The Android Open Source Project\n\n Licensed under"
},
{
"path": "WayHoo/res/anim/slide_in_from_top.xml",
"chars": 866,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Copyright (C) 2009 The Android Open Source Project\n\n Licensed under"
},
{
"path": "WayHoo/res/anim/slide_out_to_bottom.xml",
"chars": 865,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Copyright (C) 2009 The Android Open Source Project\n\n Licensed under"
},
{
"path": "WayHoo/res/anim/slide_out_to_top.xml",
"chars": 866,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Copyright (C) 2009 The Android Open Source Project\n\n Licensed under"
},
{
"path": "WayHoo/res/color/vpi__dark_theme.xml",
"chars": 1358,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2010 The Android Open Source Project\n\n Licensed under the "
},
{
"path": "WayHoo/res/color/vpi__light_theme.xml",
"chars": 1370,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2010 The Android Open Source Project\n\n Licensed under the "
},
{
"path": "WayHoo/res/drawable/city_edit_prs.xml",
"chars": 306,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector\n xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item"
},
{
"path": "WayHoo/res/drawable/city_query_delete.xml",
"chars": 287,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector\n xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item"
},
{
"path": "WayHoo/res/drawable/cityselector_locate_btn_bg.xml",
"chars": 302,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/home_setting_selector.xml",
"chars": 216,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/indicator_bg_bottom.xml",
"chars": 595,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "WayHoo/res/drawable/indicator_bg_top.xml",
"chars": 595,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "WayHoo/res/drawable/item_background.xml",
"chars": 223,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/item_prs.xml",
"chars": 284,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/listview_background.xml",
"chars": 275,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/main_city_name_bg.xml",
"chars": 269,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/main_life_complete_selector.xml",
"chars": 339,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/main_life_edit.xml",
"chars": 458,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/module_bg.xml",
"chars": 410,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n android:p"
},
{
"path": "WayHoo/res/drawable/refresh_icon_anim.xml",
"chars": 1973,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<animation-list xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n "
},
{
"path": "WayHoo/res/drawable/resource_circle_progressbar_indeterminate.xml",
"chars": 282,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rotate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:dr"
},
{
"path": "WayHoo/res/drawable/setting_top_back.xml",
"chars": 347,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector\n xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item"
},
{
"path": "WayHoo/res/drawable/settings_bg_city_item_down.xml",
"chars": 309,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "WayHoo/res/drawable/settings_bg_city_item_up.xml",
"chars": 309,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "WayHoo/res/drawable/shape_bg.xml",
"chars": 309,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:sha"
},
{
"path": "WayHoo/res/drawable/sidebar_item_background_dark_selector.xml",
"chars": 498,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/sidebar_item_background_light_selector.xml",
"chars": 396,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/sidebar_item_selected_layerlist_dark.xml",
"chars": 272,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list\n xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <it"
},
{
"path": "WayHoo/res/drawable/slidingmenu_shadow.xml",
"chars": 250,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\n <gradien"
},
{
"path": "WayHoo/res/drawable/topbar_icon_share_selector.xml",
"chars": 706,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <!--\n "
},
{
"path": "WayHoo/res/drawable/topbar_icon_side_selector.xml",
"chars": 275,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/update_forecast_selector.xml",
"chars": 460,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/vpi__tab_indicator.xml",
"chars": 2203,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2008 The Android Open Source Project\n\n Licensed under the "
},
{
"path": "WayHoo/res/drawable/weather_detail_activity_btn_bg.xml",
"chars": 220,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n <item "
},
{
"path": "WayHoo/res/drawable/white_border.xml",
"chars": 451,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\r\n\r\n <soli"
},
{
"path": "WayHoo/res/layout/about.xml",
"chars": 6693,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "WayHoo/res/layout/activity_main.xml",
"chars": 1001,
"preview": "<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:weather=\"http://schemas.android.com/ap"
},
{
"path": "WayHoo/res/layout/activity_main_actionbar.xml",
"chars": 3754,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<merge xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:weath"
},
{
"path": "WayHoo/res/layout/base_fragment.xml",
"chars": 1176,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andro"
},
{
"path": "WayHoo/res/layout/city_manager_actionbar.xml",
"chars": 4082,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<merge xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:weath"
},
{
"path": "WayHoo/res/layout/city_manager_layout.xml",
"chars": 1923,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/layout/city_manger_grid_item_add.xml",
"chars": 1055,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "WayHoo/res/layout/city_manger_grid_item_normal.xml",
"chars": 2796,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "WayHoo/res/layout/city_query_actionbar.xml",
"chars": 1264,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<merge xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:weath"
},
{
"path": "WayHoo/res/layout/city_query_hotcity_grid_item.xml",
"chars": 805,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/layout/city_query_layout.xml",
"chars": 7644,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/layout/city_query_list_item.xml",
"chars": 2596,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "WayHoo/res/layout/comm_lay_emptyview.xml",
"chars": 948,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "WayHoo/res/layout/comm_lay_loadfailed.xml",
"chars": 921,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "WayHoo/res/layout/comm_lay_loading.xml",
"chars": 385,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "WayHoo/res/layout/count_down_to_location.xml",
"chars": 1461,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.way.ui.view.CountDownView xmlns:android=\"http://schemas.android.com/apk/res/"
},
{
"path": "WayHoo/res/layout/custom_progress_dialog.xml",
"chars": 1292,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andro"
},
{
"path": "WayHoo/res/layout/feed_back_view.xml",
"chars": 1924,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n xm"
},
{
"path": "WayHoo/res/layout/loading_empty_container.xml",
"chars": 654,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.way.ui.view.LoadingEmptyContainer xmlns:android=\"http://schemas.android.com/"
},
{
"path": "WayHoo/res/layout/no_results_message.xml",
"chars": 925,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.way.ui.view.NoResultsContainer xmlns:android=\"http://schemas.android.com/apk"
},
{
"path": "WayHoo/res/layout/notification_weather_multi.xml",
"chars": 16054,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/layout/sidemenu_list_item_category.xml",
"chars": 300,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n style=\"@"
},
{
"path": "WayHoo/res/layout/sidemenu_list_item_item.xml",
"chars": 317,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n style=\"@"
},
{
"path": "WayHoo/res/layout/sidemenu_listview.xml",
"chars": 638,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ListView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:"
},
{
"path": "WayHoo/res/layout/splash_activity_layout.xml",
"chars": 1784,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/layout/swipeback_layout.xml",
"chars": 253,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.way.ui.swipeback.SwipeBackLayout xmlns:android=\"http://schemas.android.com/a"
},
{
"path": "WayHoo/res/layout/weather_aqi.xml",
"chars": 5474,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.way.ui.view.WeatherAqiView xmlns:android=\"http://schemas.android.com/apk/res"
},
{
"path": "WayHoo/res/layout/weather_current_condition.xml",
"chars": 5755,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n "
},
{
"path": "WayHoo/res/layout/weather_details.xml",
"chars": 7070,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.way.ui.view.WeatherDetailsView xmlns:android=\"http://schemas.android.com/apk"
},
{
"path": "WayHoo/res/layout/weather_forecast.xml",
"chars": 3895,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.way.ui.view.WeatherForecastView xmlns:android=\"http://schemas.android.com/ap"
},
{
"path": "WayHoo/res/layout/weather_forecast_item.xml",
"chars": 1797,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n xm"
},
{
"path": "WayHoo/res/layout/weather_fragment.xml",
"chars": 2065,
"preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\"\n a"
},
{
"path": "WayHoo/res/layout/weather_index.xml",
"chars": 5617,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.way.ui.view.WeatherIndexView xmlns:android=\"http://schemas.android.com/apk/r"
},
{
"path": "WayHoo/res/layout/weather_index_item.xml",
"chars": 2892,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "WayHoo/res/layout/weather_info_error.xml",
"chars": 1424,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/layout/weather_provider_layout_rigo_2x2.xml",
"chars": 10461,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/layout/weather_provider_layout_rigo_4x1.xml",
"chars": 14470,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/layout/weather_provider_layout_rigo_4x2.xml",
"chars": 17418,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n an"
},
{
"path": "WayHoo/res/values/arrays.xml",
"chars": 1137,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <string-array name=\"special_solar_term_dates\">\n <item>198"
},
{
"path": "WayHoo/res/values/attrs.xml",
"chars": 195,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <declare-styleable name=\"WeatherTypefacedTextView\">\n <att"
},
{
"path": "WayHoo/res/values/colors.xml",
"chars": 12320,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<resources>\r\n <color name=\"yapps_purple_accent\">#ff6e329d</color>\r\n <color"
},
{
"path": "WayHoo/res/values/dimens.xml",
"chars": 13251,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<resources>\r\n\r\n <dimen name=\"uv_listPreferredItemHeightSmall\">64.0dip</dimen>"
},
{
"path": "WayHoo/res/values/drawables.xml",
"chars": 1619,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <item name=\"main_info_background_normal\" type=\"drawable\">#ffd9e5"
},
{
"path": "WayHoo/res/values/ids.xml",
"chars": 107,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <item name=\"details_icon\" type=\"id\"/>\n\n</resources>"
},
{
"path": "WayHoo/res/values/integers.xml",
"chars": 128,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <integer name=\"dragged_item_fade_out_duration\">150</integer>\n</re"
},
{
"path": "WayHoo/res/values/menudrawer_attrs.xml",
"chars": 2595,
"preview": "<resources>\n\n <!-- Reference to a style for the menu drawer. -->\n <attr name=\"menuDrawerStyle\" format=\"reference\" "
},
{
"path": "WayHoo/res/values/menudrawer_colors.xml",
"chars": 134,
"preview": "<resources>\n\n <!-- The default background of the menu. -->\n <color name=\"md__defaultBackground\">#00000000</color>\n"
},
{
"path": "WayHoo/res/values/menudrawer_ids.xml",
"chars": 705,
"preview": "<resources>\n\n <!-- ID used when defining the content layout in XML. -->\n <item name=\"mdContent\" type=\"id\" />\n\n "
},
{
"path": "WayHoo/res/values/menudrawer_strings.xml",
"chars": 206,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <string name=\"md__drawerOpenIndicatorDesc\">Close drawer</string>"
},
{
"path": "WayHoo/res/values/menudrawer_styles.xml",
"chars": 502,
"preview": "<resources>\n\n <style name=\"Widget\" />\n\n <!-- Base theme for the menu drawer. -->\n <style name=\"Widget.MenuDrawe"
},
{
"path": "WayHoo/res/values/strings.xml",
"chars": 6392,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <string name=\"app_name\">简洁天气</string>\n <string name=\"press_ag"
},
{
"path": "WayHoo/res/values/styles.xml",
"chars": 9684,
"preview": "<resources>\n\n <style name=\"AppTheme\" parent=\"@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen\"></style>\n\n "
},
{
"path": "WayHoo/res/values/swipeback_attrs.xml",
"chars": 628,
"preview": "<resources>\n\n <!-- 滑动返回style声明 -->\n <declare-styleable name=\"SwipeBackLayout\">\n <attr name=\"edge_size\" form"
},
{
"path": "WayHoo/res/values/swipeback_styles.xml",
"chars": 330,
"preview": "<resources>\n\n <!-- 滑动返回主题 -->\n <style name=\"SwipeBackLayout\">\n <item name=\"edge_size\">50dip</item>\n "
},
{
"path": "WayHoo/res/values/vpi__attrs.xml",
"chars": 6039,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2012 Jake Wharton\n Copyright (C) 2011 Patrik Åkerfeldt\n\n "
},
{
"path": "WayHoo/res/values/vpi__colors.xml",
"chars": 1361,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2012 Jake Wharton\n\n Licensed under the Apache License, Ver"
},
{
"path": "WayHoo/res/values/vpi__defaults.xml",
"chars": 2924,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2012 Jake Wharton\n\n Licensed under the Apache License, Ver"
},
{
"path": "WayHoo/res/values/vpi__styles.xml",
"chars": 1965,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2011 Jake Wharton\n\n Licensed under the Apache License, Ver"
},
{
"path": "WayHoo/res/values-hdpi/dimens.xml",
"chars": 1803,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<resources>\r\n <dimen name=\"weather_topbar_padding\">48.0dip</dimen>\r\n <dime"
},
{
"path": "WayHoo/res/values-xhdpi/dimens.xml",
"chars": 5834,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<resources>\r\n <dimen name=\"city_manager_tiny_height\">160.0dip</dimen>\r\n \r\n"
},
{
"path": "WayHoo/res/values-zh-rCN/strings.xml",
"chars": 6217,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n <string name=\"app_name\">简洁天气</string>\n <string name=\"press_ag"
},
{
"path": "WayHoo/res/xml/weather_appwidget_info_rigo_2x2.xml",
"chars": 337,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<appwidget-provider xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "WayHoo/res/xml/weather_appwidget_info_rigo_4x1.xml",
"chars": 336,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<appwidget-provider xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "WayHoo/res/xml/weather_appwidget_info_rigo_4x2.xml",
"chars": 337,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<appwidget-provider xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "WayHoo/src/com/android/volley/AuthFailureError.java",
"chars": 1752,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/Cache.java",
"chars": 2798,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/CacheDispatcher.java",
"chars": 6004,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/DefaultRetryPolicy.java",
"chars": 2978,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/ExecutorDelivery.java",
"chars": 3881,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/Network.java",
"chars": 1035,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/NetworkDispatcher.java",
"chars": 5596,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/NetworkError.java",
"chars": 1118,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/NetworkResponse.java",
"chars": 2000,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/NoConnectionError.java",
"chars": 971,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/ParseError.java",
"chars": 1072,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/Request.java",
"chars": 19270,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/RequestQueue.java",
"chars": 10470,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/Response.java",
"chars": 2649,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/ResponseDelivery.java",
"chars": 1210,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/RetryPolicy.java",
"chars": 1309,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/ServerError.java",
"chars": 1027,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "WayHoo/src/com/android/volley/TimeoutError.java",
"chars": 794,
"preview": "/*\n * Copyright (C) 2011 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
}
]
// ... and 133 more files (download for full content)
About this extraction
This page contains the full source code of the way1989/WayHoo GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 333 files (1.4 MB), approximately 356.8k tokens, and a symbol index with 2524 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.