[
  {
    "path": ".classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.DEPENDENCIES\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"libs/gson-2.1.jar\"/>\n\t<classpathentry exported=\"true\" kind=\"lib\" path=\"libs/BaiduLBS_Android.jar\"/>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": ".project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>CoolWeather</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": ".settings/org.eclipse.jdt.core.prefs",
    "content": "eclipse.preferences.version=1\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\norg.eclipse.jdt.core.compiler.compliance=1.6\norg.eclipse.jdt.core.compiler.source=1.6\n"
  },
  {
    "path": "AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.htq.coolweather\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\" >\n\n    <uses-sdk\n        android:minSdkVersion=\"14\"\n        android:targetSdkVersion=\"19\" />\n    <!-- 访问网络 -->\n    <uses-permission android:name=\"android.permission.INTERNET\"/>\n    <!-- 写入扩展存储，向扩展卡写入数据，用于写入离线定位数据 -->\n    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n    <!-- 这个权限用于网络定位 -->\n    <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>\n    <!-- 这个权限用于访问GPS定位 -->\n    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>\n    <!-- 用于访问WIFI网络信息，WIFI信息会用于进行网络定位 -->\n    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>\n    <!-- 获取运营商信息，用于支持提供运营商信息相关的接口 -->\n    <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n    <!-- 用于读取手机当前的状态 -->\n    <uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>\n    <!-- 这个权限用于获取WIFI的获取权限，WIFI信息会用来进行网络定位 -->\n    <uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>\n    <!-- SD卡读取权限，用户写入离线定位数据 -->\n    <uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>\n    <!-- 允许应用读取低级别的系统日志文件 -->\n    <uses-permission android:name=\"android.permission.READ_LOGS\"/>\n\n    <application\n\t\tandroid:name=\"com.htq.coolweather.base.Appliction\"    \n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/cool_weather_icon\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@android:style/Theme.Black.NoTitleBar\" >\n        <activity\n            android:name=\"com.htq.coolweather.WelcomeActivity\"\n            android:label=\"@string/app_name\" \n            android:screenOrientation=\"portrait\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n        <!-- windowSoftInputMode属性是为了不默认弹出软键盘 -->\n        <activity android:name=\"com.htq.coolweather.MainActivity\"\n            android:windowSoftInputMode=\"adjustPan\"  \n             android:screenOrientation=\"portrait\" >\n        </activity>\n        <activity android:name=\"com.htq.coolweather.HomePageFragment\" \n             android:screenOrientation=\"portrait\" >\n        </activity>\n        <activity android:name=\"com.htq.coolweather.LifeIndexFragment\"\n             android:screenOrientation=\"portrait\"  >\n        </activity>\n    \n       \n        <activity android:name=\"com.htq.coolweather.AddCityActivity\" \n             android:screenOrientation=\"portrait\" >\n        </activity>\n        <!-- 声明service组件,每个app拥有自己单独的定位service -->\n        <service android:name=\"com.baidu.location.f\"\n            android:enabled=\"true\"\n            android:process=\":remote\">\n        </service>\n        <meta-data android:name=\"com.baidu.lbsapi.API_KEY\"\n            android:value=\"iGs8rFvzh1e8c7C9DjXT5toK\"\n            \n            />\n    </application>\n<!-- android:value=\"N7NSNI7NGaWLmpBy2S6RdmBbBWYaSkjD\" -->\n</manifest>\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# CoolWeather\n本人完全自主设计与开发的一款轻量级简约好用的天气App，无广告，无烦人的通知栏，定位精准，天气信息数据准确，还支持更换背景皮肤哦，颜值爆表，如要引用，请注明出处：https://github.com/HuTianQi/CoolWeather\n\n<br>实现的功能：\n<br>1自动定位：自动获取用户所在的城市位置然后显示该位置的天气情况\n<br>2手动查询：如果定位失败，用户可以手动输入城市名查询天气\n<br>3城市管理：用户可以添加/删除多个城市，方便用户在不同城市直接查看该城市的天气\n<br>4生活指数：提醒用户生活方面的一些指数信息，如穿衣，是否适合外出\n<br>5自动换肤：能够根据用户所在城市的当天天气自动更换背景皮肤，如雨天则显示下雨的背景皮肤。晴天则显示蓝天白云的背景皮肤\n<br>6更换皮肤：用户可以在更换皮肤模块选择自己喜欢的图片作为该App主界面的皮肤，悄悄地告诉颖火虫们，内置了一张我们的颖宝宝的美图哦\n<br>7分享功能：如果用户觉得该App不错，可以将其分享到QQ好友或微博，微信朋友圈等社交场合\n\n<br>如果大家觉得不错，欢迎大家访问关注我的博客账号：http://blog.csdn.net/htq__\n\n该App已在各大app Market上线：评分均为7.5分及以上<br>\n<a href=\"http://shouji.baidu.com/software/9706112.html\">百度手机助手</a> \n<br><a href=\"http://zhushou.360.cn/detail/index/soft_id/3355443?recrefer=SE_D_%E9%85%B7%E6%88%91%E5%A4%A9%E6%B0%94\">360手机助手</a> \n\n\n应用截图：界面是不是很美呢？<br>\n\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161720.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161732.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161738.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161802.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161808.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161813.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161819.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161825.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161834.jpg)\n![image](https://github.com/HuTianQi/CoolWeather/blob/master/CoolWeather_ScreenShot/S60718-161910.jpg)\n\n#相关链接\n【QQ：一款高仿腾讯QQ的IM App，已经实现了纯文本，表情，图片，位置，语音等信息的发送以及增，删，查好友等功能,代码质量非常高】[https://github.com/HuTianQi/QQ](https://github.com/HuTianQi/QQ)  \n【HQ_QQ：一款高仿腾讯QQ的IM通讯App，界面几乎与腾讯QQ一模一样】 https://github.com/HuTianQi/HTQ_QQ  \n【美女笔记:一款类似印象笔记的App】https://github.com/HuTianQi/YingBeautyNote  \n\n\n#LICENSE\nThe MIT License (MIT)\n\nCopyright (c) 2016 HuTianQi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "lint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lint>\n    <issue id=\"HandlerLeak\" severity=\"ignore\" />\n</lint>"
  },
  {
    "path": "proguard-project.txt",
    "content": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in that file.\n#\n# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in ${sdk.dir}/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the ProGuard\n# include property in project.properties.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "project.properties",
    "content": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# This file must be checked in Version Control Systems.\n#\n# To customize properties used by the Ant build system edit\n# \"ant.properties\", and override values to adapt the script to your\n# project structure.\n#\n# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):\n#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt\n\n# Project target.\ntarget=android-19\n\n"
  },
  {
    "path": "res/drawable/citym_normal_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item android:state_pressed=\"true\" \n        android:drawable=\"@android:color/black\"></item>\n    <item android:drawable=\"@drawable/citym_normal_color\"></item>\n\n</selector>\n"
  },
  {
    "path": "res/drawable/citym_normal_color.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <solid android:color=\"#789abc\"/>\n</shape>\n"
  },
  {
    "path": "res/drawable/drawerlayout_bt_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item android:state_pressed=\"true\" \n        android:drawable=\"@android:color/white\"></item>\n    <item android:drawable=\"@drawable/drawerlayout_button_bg\"></item>\n\n</selector>\n"
  },
  {
    "path": "res/drawable/drawerlayout_button_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\" >\n    <stroke android:width=\"1px\"\n        android:color=\"#DDD\"/>\n</shape>\n"
  },
  {
    "path": "res/drawable/exitapp_text_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\" >\n    <solid android:color=\"#499BF7\"/>\n    <stroke android:width=\"1px\"\n        android:color=\"#000\"/>\n</shape>\n"
  },
  {
    "path": "res/drawable/homep_search_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item android:state_pressed=\"true\" \n        android:drawable=\"@android:color/transparent\"></item>\n    <item android:drawable=\"@drawable/bg_dialog_snowman_left_normal\"></item>\n\n</selector>\n"
  },
  {
    "path": "res/drawable/homep_titlebt_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item android:state_pressed=\"true\" \n        android:drawable=\"@android:color/transparent\"></item>\n    <item android:drawable=\"@drawable/homep_title_refresh\"></item>\n\n</selector>\n"
  },
  {
    "path": "res/drawable/homep_titlemenu_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item android:state_pressed=\"true\" \n        android:drawable=\"@android:color/transparent\"></item>\n    <item android:drawable=\"@drawable/homep_titlemenu_normal\"></item>\n\n</selector>\n"
  },
  {
    "path": "res/drawable/inputcity_edit.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <corners android:radius=\"5dp\"/>\n    <solid android:color=\"#fff\"/>\n    <stroke android:width=\"1dp\" android:color=\"#499BF7\"/>\n</shape>"
  },
  {
    "path": "res/drawable/item_citym_normal_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item android:state_pressed=\"true\" \n        android:drawable=\"@android:color/transparent\"></item>\n    <item android:drawable=\"@drawable/item_citym_normal_color\"></item>\n\n</selector>\n"
  },
  {
    "path": "res/drawable/item_citym_normal_color.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <solid android:color=\"#90FFFFFF\"/>\n    <corners android:radius=\"8dip\"/>\n</shape>\n"
  },
  {
    "path": "res/drawable/item_todayc_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item android:state_pressed=\"true\" \n        android:drawable=\"@drawable/item_citym_normal_color\"></item>\n    <item android:drawable=\"@android:color/transparent\"></item>\n\n</selector>\n"
  },
  {
    "path": "res/drawable/launch_otext_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" \n    android:shape=\"ring\"\n    android:innerRadius=\"20dp\"\n    android:thickness=\"0dp\"\n    android:useLevel=\"false\" >\n    \n     <stroke android:width=\"1dp\"\n         android:color=\"@android:color/white\"/>\n    \n</shape>\n"
  },
  {
    "path": "res/drawable/search_btn.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <corners android:radius=\"5dp\"/>\n    <solid android:color=\"#499BF7\"/>\n    <stroke android:width=\"1dp\" android:color=\"#499BF7\"/>\n</shape>\n"
  },
  {
    "path": "res/drawable/skin_img_item_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector\n  xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_pressed=\"true\" android:drawable=\"@drawable/skin_img_item_background_selected\" />\n    <item android:drawable=\"@drawable/skin_img_item_background_normal\" />\n</selector>"
  },
  {
    "path": "res/layout/about_me_fragment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n     >\n\n    <TextView\n        android:id=\"@+id/textView1\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@+id/imageView1\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"10dp\"\n        android:textColor=\"#000\"\n        android:textSize=\"20sp\"\n        android:text=\"酷我天气\" />\n\n    <ImageView\n        android:id=\"@+id/imageView1\"\n        android:layout_width=\"70dp\"\n        android:layout_height=\"70dp\"\n        android:layout_alignParentTop=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"20dp\"\n        android:src=\"@drawable/cool_weather_icon\" />\n\n    <TextView\n        android:id=\"@+id/textView3\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:textColor=\"#000\"\n        android:textSize=\"20sp\"\n        android:text=\"@string/author\" />\n\n    <TextView\n        android:id=\"@+id/textView2\"\n        android:layout_marginTop=\"30dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@+id/textView1\"\n        android:layout_centerHorizontal=\"true\"\n        android:textColor=\"#000\"\n        android:textSize=\"20sp\"\n        android:text=\"关于作者：\" />\n<RelativeLayout \n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:layout_below=\"@+id/textView2\" \n    android:layout_marginTop=\"10dp\">\n\n   <com.htq.coolweather.utils.CircleImageView\n        android:id=\"@+id/imageView2\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentLeft=\"true\"\n        android:layout_alignParentTop=\"true\"\n        android:src=\"@drawable/mine_avatar\" />\n\n    <TextView\n        android:id=\"@+id/about_me_tv\"\n        android:textColor=\"#000\"\n        android:textSize=\"20sp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerVertical=\"true\"\n        android:layout_marginLeft=\"10dp\"\n        android:layout_toRightOf=\"@+id/imageView2\"\n        android:text=\"@string/about_me\" />\n\n</RelativeLayout>\n</RelativeLayout>"
  },
  {
    "path": "res/layout/addcity_activity.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingLeft=\"10dp\"\n    android:paddingRight=\"10dp\"\n    android:paddingTop=\"10dp\"\n    android:background=\"@drawable/add_city_bg\">\n\n    <TextView\n        android:id=\"@+id/addcity_title\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:textColor=\"#fff\"\n        android:textSize=\"24sp\"\n        android:text=\"@string/add_city_text\"\n        android:gravity=\"center\" />\n    <GridView\n        android:id=\"@+id/addcity_gridview\" \n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/addcity_title\"\n        android:layout_marginTop=\"10dp\"\n        android:numColumns=\"3\"\n        android:verticalSpacing=\"10dp\"\n        android:listSelector=\"@android:color/transparent\" />\n        \n</RelativeLayout>\n"
  },
  {
    "path": "res/layout/bg_pic_grid_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" >\n     <!--此处必须用相对布局，线性布局不能做到让第二个iv显示在第一个iv控件上  -->\n    <RelativeLayout\n        android:layout_width=\"95.0dip\"\n        android:layout_height=\"150dip\"\n        android:orientation=\"vertical\"\n        android:background=\"@drawable/skin_img_item_background\" >\n\n        <ImageView\n            android:id=\"@+id/gridview_item_iv\"\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"fill_parent\" />\n         <ImageView\n        android:id=\"@+id/gridview_item_checked_iv\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignBottom=\"@id/gridview_item_iv\"\n        android:layout_alignRight=\"@id/gridview_item_iv\"\n        android:background=\"@drawable/skin_ico_checked\"/>\n    </RelativeLayout>\n\n</LinearLayout>\n"
  },
  {
    "path": "res/layout/change_background_fragment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\" >\n    <GridView\n        android:id=\"@+id/change_background_grid\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"fill_parent\"\n        android:layout_marginLeft=\"10.0dip\"\n        android:layout_marginRight=\"10.0dip\"\n        android:columnWidth=\"96.0dip\"\n        android:horizontalSpacing=\"2.0dip\"\n        android:listSelector=\"#00000000\"\n        android:numColumns=\"auto_fit\"\n        android:scrollbars=\"none\"\n        android:stretchMode=\"columnWidth\"\n        android:verticalSpacing=\"2.0dip\" />\n    \n\n</LinearLayout>\n"
  },
  {
    "path": "res/layout/citymanager_activity.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingLeft=\"10dp\"\n    android:paddingRight=\"10dp\"\n    android:paddingTop=\"10dp\"\n    android:background=\"@drawable/bg_homepager_blur\" >\n\n    <include \n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        layout=\"@layout/include_title_activity\"/>\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"城市管理\"\n        android:textColor=\"#fff\"\n        android:textSize=\"32sp\"\n        android:layout_centerInParent=\"true\" />\n    \n\n</RelativeLayout>\n"
  },
  {
    "path": "res/layout/exitapp_dialog.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@drawable/exitapp_text_bg\" >\n\n    <TextView\n        android:id=\"@+id/exitapp_text\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentTop=\"true\"\n        android:textColor=\"#fff\"\n        android:textSize=\"18sp\"\n        android:padding=\"10dp\"\n        android:background=\"@drawable/exitapp_text_bg\" />\n\n    <LinearLayout\n        android:id=\"@+id/linearLayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentLeft=\"true\"\n        android:layout_below=\"@+id/exitapp_text\"\n        android:layout_marginTop=\"30dp\"\n        android:padding=\"5dp\"\n        android:background=\"#499BF7\" >\n\n        <Button\n            android:id=\"@+id/leftbutton\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:layout_weight=\"1\"\n            android:textColor=\"#000\" />\n\n        <Button\n            android:id=\"@+id/rightbutton\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:layout_weight=\"1\"\n            android:textColor=\"#000\" />\n    </LinearLayout>\n\n</RelativeLayout>"
  },
  {
    "path": "res/layout/gridview_activity.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@android:color/transparent\" >\n\n    <GridView \n        android:id=\"@+id/gridview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:horizontalSpacing=\"10dp\"\n        android:verticalSpacing=\"5dp\"\n        android:gravity=\"center\"\n        android:scrollbars=\"none\" />\n\n</RelativeLayout>\n"
  },
  {
    "path": "res/layout/gridview_citymanager.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@android:color/transparent\" >\n\n    <GridView \n        android:id=\"@+id/gridview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:horizontalSpacing=\"10dp\"\n        android:verticalSpacing=\"5dp\"\n        android:numColumns=\"3\"\n        android:listSelector=\"@android:color/transparent\"\n        android:focusable=\"true\"\n        android:gravity=\"center\"\n        android:scrollbars=\"none\" />\n\n</RelativeLayout>\n"
  },
  {
    "path": "res/layout/gridview_todaycan.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@android:color/transparent\" >\n\n    <LinearLayout \n        android:id=\"@+id/data_linear\"\n      \n        android:layout_marginTop=\"20dp\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"horizontal\" >\n        \n         <TextView\n        \n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginLeft=\"20dp\"\n        android:textColor=\"#fff\"\n        android:textSize=\"20sp\"\n        android:text=\"当前日期为：\" />\n\n    <TextView\n        android:id=\"@+id/date_tv\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textColor=\"#fff\"\n        android:textSize=\"20sp\"\n        android:text=\"TextView\" />\n    </LinearLayout>\n    \n    <GridView \n        android:id=\"@+id/gridview\"\n        android:layout_below=\"@id/data_linear\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:horizontalSpacing=\"10dp\"\n        android:verticalSpacing=\"10dp\"\n        android:layout_marginTop=\"40dp\"\n        android:gravity=\"center\"\n\t\tandroid:numColumns=\"2\"\n        android:listSelector=\"@android:color/transparent\"\n        android:scrollbars=\"none\" />\n    <TextView \n        android:id=\"@+id/todaycan_dec\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/gridview\"\n        android:layout_alignParentBottom=\"true\"\n        android:gravity=\"center\"\n        android:textSize=\"18sp\"\n        android:textColor=\"@android:color/white\"/>\n\n   \n\n</RelativeLayout>\n"
  },
  {
    "path": "res/layout/homepager_activity.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    \n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n  \n    android:paddingLeft=\"10dp\"\n    android:paddingRight=\"10dp\"\n    android:paddingTop=\"10dp\" >\n\n    <include\n        android:id=\"@+id/homep_title\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        layout=\"@layout/include_title_activity\" />\n\n    <FrameLayout\n        android:id=\"@+id/fragmentlayout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_above=\"@+id/homep_bottom\"\n        android:layout_below=\"@id/homep_title\" >\n    </FrameLayout>\n\n   \n</RelativeLayout>"
  },
  {
    "path": "res/layout/include_content_activity.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"vertical\" >\n\n    <TextView\n        android:id=\"@+id/temp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/homep_title\"\n        android:layout_centerHorizontal=\"true\"\n        android:gravity=\"center\"\n        android:text=\"0.0\"\n        android:textColor=\"#fff\"\n        android:textSize=\"64sp\" />\n\n    <LinearLayout\n        android:id=\"@+id/homep_nowinfo\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_below=\"@id/temp\"\n        android:gravity=\"center\"\n        android:layout_marginTop=\"10dp\"\n        android:orientation=\"horizontal\" >\n\n        <TextView\n            android:id=\"@+id/currentcity\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:layout_weight=\"2\"\n            android:focusable=\"true\"\n            android:gravity=\"center\"\n            android:textColor=\"#fff\"\n            android:textSize=\"32sp\" />\n\n        <LinearLayout\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:layout_weight=\"2\"\n            android:orientation=\"vertical\" >\n\n            <TextView\n                android:id=\"@+id/pm25\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:gravity=\"center|top\"\n                android:textColor=\"#fff\"\n                android:textSize=\"18sp\" />\n\n            <TextView\n                android:id=\"@+id/pollution_level\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_gravity=\"center\"\n                android:textColor=\"#fff\"\n                android:textSize=\"18sp\" />\n        </LinearLayout>\n    </LinearLayout>\n    \n    \n\n    <LinearLayout\n        android:id=\"@+id/search_hint\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n\t\tandroid:layout_below=\"@id/homep_nowinfo\"\n        android:orientation=\"horizontal\"\n        android:layout_marginTop=\"10dp\" >\n\n        <EditText\n            android:id=\"@+id/inputcity\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"40dp\"\n            android:layout_weight=\"1\"\n            android:maxLength=\"10\"\n            android:singleLine=\"true\"\n            android:background=\"@drawable/inputcity_edit\"\n            android:hint=\"@string/pleaseinput\" />\n\n        <Button\n            android:id=\"@+id/btn_search\"\n            android:layout_width=\"50dp\"\n            android:layout_height=\"40dp\"\n            android:background=\"@drawable/search_btn\"\n            android:layout_marginLeft=\"4dp\"\n            android:gravity=\"center\"\n            android:text=\"@string/search\" />\n    </LinearLayout>\n\n    <ListView\n        android:id=\"@+id/weather_infor_list\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"10dp\"\n        android:layout_marginBottom=\"10dp\"\n        android:layout_below=\"@id/search_hint\"\n        android:cacheColorHint=\"@android:color/transparent\" />\n    \n\n</RelativeLayout>"
  },
  {
    "path": "res/layout/include_title_activity.xml",
    "content": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"horizontal\" >\n\n    <Button\n        android:id=\"@+id/homep_menu\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/homep_titlemenu_bg\"\n        android:onClick=\"onClick\" />\n\n    <TextView\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_weight=\"1\"\n        android:gravity=\"center\"\n        android:text=\"@string/app_name\"\n        android:textSize=\"18sp\"\n        android:textColor=\"#fff\" />\n\n    <Button\n        android:id=\"@+id/homep_refresh\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/homep_titlebt_bg\"\n        android:onClick=\"onClick\" />\n\n</LinearLayout>"
  },
  {
    "path": "res/layout/item_gridview_addcity.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center\"\n    android:padding=\"5dp\"\n    android:background=\"@drawable/item_todayc_bg\" >\n\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:id=\"@+id/citytext\"\n        android:textSize=\"16sp\"\n        android:textColor=\"@android:color/white\" />\n\t\n</RelativeLayout>\n"
  },
  {
    "path": "res/layout/item_gridview_citymanager.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"160dp\"\n    android:background=\"@drawable/item_citym_normal_bg\"\n    android:orientation=\"vertical\" >\n\n    <TextView\n        android:id=\"@+id/grid_city\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:textColor=\"#fff\"\n        android:maxLines=\"1\"\n        android:textSize=\"22sp\" />\n\n    <TextView\n        android:id=\"@+id/city_item_layout\"\n        android:layout_width=\"50dp\"\n        android:layout_height=\"50dp\"\n        android:layout_centerInParent=\"true\" />\n\n    <com.htq.coolweather.base.CHImageView\n        android:id=\"@+id/grid_weatherimage\"\n        android:layout_width=\"40dp\"\n        android:layout_height=\"40dp\"\n        android:layout_marginTop=\"10dp\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_below=\"@id/grid_city\" />\n\n    <TextView\n        android:id=\"@+id/grid_weather\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:textColor=\"#fff\"\n        android:textSize=\"16sp\"\n        android:layout_below=\"@id/grid_weatherimage\" />\n\n    <TextView\n        android:id=\"@+id/grid_temp\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:textColor=\"#fff\"\n        android:textSize=\"20sp\"\n        android:layout_below=\"@id/grid_weather\" />\n\n    <Button\n        android:id=\"@+id/grid_set_normal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"@drawable/citym_normal_bg\"\n        android:text=\"@string/set_normal\"\n        android:textColor=\"#fff\"\n        android:textSize=\"16sp\"\n        android:focusable=\"false\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_below=\"@id/grid_temp\"\n        android:layout_marginTop=\"10dp\" />\n    \n    <TextView\n        android:id=\"@+id/grid_item_delete\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentRight=\"true\"\n        android:layout_alignParentTop=\"true\"\n        android:paddingRight=\"5dp\"\n        android:paddingLeft=\"10dp\"\n        android:paddingBottom=\"5dp\"\n        android:clickable=\"true\"\n        android:textColor=\"@android:color/white\"\n        android:textSize=\"18sp\" />\n\n</RelativeLayout>"
  },
  {
    "path": "res/layout/item_gridview_todaycan.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:gravity=\"center\"\n    android:paddingTop=\"10dp\"\n    android:paddingBottom=\"10dp\"\n    android:background=\"@drawable/item_todayc_bg\" >\n\n    <ImageView\n        android:id=\"@+id/image_index\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n\t\tandroid:layout_centerVertical=\"true\"\n        android:contentDescription=\"@string/app_name\" />\n\n    <TextView\n        android:id=\"@+id/dothing\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textSize=\"18sp\"\n        android:gravity=\"center\"\n        android:layout_toRightOf=\"@id/image_index\"\n        android:layout_marginLeft=\"5dp\"\n        android:textColor=\"#fff\" />\n    \n    <TextView\n        android:id=\"@+id/index\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:textColor=\"#fff\"\n        android:layout_toRightOf=\"@id/image_index\"\n        android:layout_marginLeft=\"5dp\"\n\t\tandroid:layout_below=\"@id/dothing\"\n        android:textSize=\"16sp\" />\n    \n    <ImageView \n        android:id=\"@+id/image_click\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"match_parent\"\n\t\tandroid:layout_alignParentRight=\"true\"\n        android:layout_marginRight=\"5dp\"\n\t\tandroid:layout_centerVertical=\"true\"\n        android:contentDescription=\"@string/app_name\"/>\n\t\n</RelativeLayout>\n"
  },
  {
    "path": "res/layout/item_listview_tomorrow.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center\"\n    android:orientation=\"horizontal\"\n    android:paddingTop=\"10dp\" >\n\n    <TextView\n        android:id=\"@+id/list_date_nextday\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_weight=\"2\"\n        android:gravity=\"center\"\n        android:textColor=\"#fff\"\n        android:textSize=\"24sp\" />\n\n    <RelativeLayout\n        android:layout_width=\"0dp\"\n        android:layout_height=\"match_parent\"\n        android:layout_weight=\"3\"\n        android:gravity=\"center_horizontal\" >\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center\" >\n\n            <com.htq.coolweather.base.CHImageView\n                android:id=\"@+id/list_day_picture\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\" />\n\n            <com.htq.coolweather.base.CHImageView\n                android:id=\"@+id/list_night_picture\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"10dp\" />\n        </LinearLayout>\n\n        <TextView\n            android:id=\"@+id/list_weather\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentBottom=\"true\"\n            android:gravity=\"center\"\n            android:textColor=\"#fff\"\n            android:textSize=\"18sp\" />\n    </RelativeLayout>\n\n    <LinearLayout\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_weight=\"3\"\n        android:gravity=\"center\"\n        android:orientation=\"vertical\" >\n\n        <TextView\n            android:id=\"@+id/list_temperature\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center\"\n            android:textColor=\"#fff\"\n            android:textSize=\"20sp\" />\n\n        <TextView\n            android:id=\"@+id/list_wind\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:textColor=\"#fff\"\n            android:textSize=\"18sp\" />\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "res/layout/main_activity.xml",
    "content": "<android.support.v4.widget.DrawerLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/drawerlayout_main\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\" \n    android:background=\"@drawable/left_layout_bg\">\n\n    <FrameLayout\n        android:id=\"@+id/frame_content\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" >\n\n        <include\n            android:id=\"@+id/include_content\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            layout=\"@layout/homepager_activity\" />\n    </FrameLayout>\n\n    <RelativeLayout\n        android:id=\"@+id/left_drawer\"\n        android:layout_width=\"300dp\"\n        android:layout_height=\"match_parent\"\n        android:layout_gravity=\"start\"\n        android:background=\"#EEffffff\" >\n \n<LinearLayout\n     android:id=\"@+id/linearLayout1\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"200dp\"\n    android:orientation=\"vertical\"\n    android:background=\"@drawable/left_layout_bg\">\n        <ImageView\n            android:id=\"@+id/text1\"\n            android:layout_width=\"70dp\"\n            android:layout_height=\"70dp\"\n            android:layout_marginTop=\"20dp\"\n            android:background=\"@drawable/cool_weather_icon\"\n            android:layout_gravity=\"center_horizontal\"\n             />\n        <TextView \n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n             android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"7dp\"\n            android:textSize=\"18sp\"\n            android:textColor=\"#000\"\n            android:text=\"@string/app_name\"/>\n        <TextView \n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n             android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"7dp\"\n            android:textSize=\"18sp\"\n            android:textColor=\"#000\"\n            android:text=\"@string/slogan\"/>\n        \n</LinearLayout>\n        <Button\n             android:id=\"@+id/btn_city_manager\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_below=\"@id/linearLayout1\"\n            android:layout_marginTop=\"20dp\"\n            android:background=\"@drawable/drawerlayout_bt_bg\"\n            android:drawableLeft=\"@drawable/ic_dl_green_m\"\n            android:gravity=\"center\"\n            android:padding=\"10dp\"\n            android:text=\"城市管理\"\n            android:onClick=\"onClick\"\n            android:textSize=\"18sp\" />\n\n        <Button\n            android:id=\"@+id/btn_life\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_below=\"@id/btn_city_manager\"\n            android:background=\"@drawable/drawerlayout_bt_bg\"\n            android:drawableLeft=\"@drawable/ic_dl_green_m\"\n            android:gravity=\"center\"\n            android:padding=\"10dp\"\n            android:text=\"生活指数\"\n            android:onClick=\"onClick\"\n            android:textSize=\"18sp\" />\n\n        <Button\n            android:id=\"@+id/btn_change_bag\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_below=\"@id/btn_life\"\n            android:background=\"@drawable/drawerlayout_bt_bg\"\n             android:drawableLeft=\"@drawable/ic_dl_green_m\"\n            android:gravity=\"center\"\n            android:padding=\"10dp\"\n            android:text=\"更换皮肤\"\n            android:onClick=\"onClick\"\n            android:textSize=\"18sp\" />\n <Button\n            android:id=\"@+id/btn_share_app\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_below=\"@id/btn_change_bag\"\n            android:background=\"@drawable/drawerlayout_bt_bg\"\n             android:drawableLeft=\"@drawable/ic_dl_green_m\"\n            android:gravity=\"center\"\n            android:padding=\"10dp\"\n            android:text=\"分享应用\"\n            android:onClick=\"onClick\"\n            android:textSize=\"18sp\" />\n     \n        <Button\n            android:id=\"@+id/btn_about\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_below=\"@id/btn_share_app\"\n            android:background=\"@drawable/drawerlayout_bt_bg\"\n            android:drawableLeft=\"@drawable/ic_dl_red\"\n            android:gravity=\"center\"\n            android:padding=\"10dp\"\n            android:text=\"关于作者\"\n            android:onClick=\"onClick\"\n            android:textSize=\"18sp\" />\n\n        <Button\n            android:id=\"@+id/exitapp\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentBottom=\"true\"\n            android:layout_marginBottom=\"2dp\"\n            android:background=\"@drawable/drawerlayout_bt_bg\"\n            android:gravity=\"center\"\n            android:padding=\"10dp\"\n            android:text=\"退出程序\"\n            android:onClick=\"onClick\"\n            android:textSize=\"18sp\" />\n        \n    </RelativeLayout>\n\n</android.support.v4.widget.DrawerLayout>"
  },
  {
    "path": "res/layout/main_activity_net_error.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    >\n    \n     <TextView\n        \n         android:layout_width=\"wrap_content\"\n         android:layout_height=\"wrap_content\"\n         android:gravity=\"center_vertical\"\n         android:textColor=\"#fff\"\n         android:layout_centerInParent=\"true\"\n         android:textSize=\"15sp\"\n         android:text=\"请检查网络设置后点击刷新按钮重试\" />\n\n</RelativeLayout>\n"
  },
  {
    "path": "res/layout/tomorrow_weather_activity.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center\"\n    android:orientation=\"horizontal\"\n    android:paddingTop=\"10dp\" >\n\n    <TextView\n        android:id=\"@+id/list_date_nextday\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_weight=\"2\"\n        android:gravity=\"center\"\n        android:text=\"周一\"\n        android:textColor=\"#fff\"\n        android:textSize=\"24sp\" />\n\n    <RelativeLayout\n        android:layout_width=\"0dp\"\n        android:layout_height=\"match_parent\"\n        android:layout_weight=\"3\"\n        android:gravity=\"center_horizontal\" >\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center\" >\n\n            <com.htq.coolweather.base.CHImageView\n                android:id=\"@+id/list_day_picture\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:contentDescription=\"@string/app_name\" />\n\n            <com.htq.coolweather.base.CHImageView\n                android:id=\"@+id/list_night_picture\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"10dp\"\n                android:contentDescription=\"@string/app_name\"\n                android:src=\"@drawable/duoyun_night\" />\n        </LinearLayout>\n\n        <TextView\n            android:id=\"@+id/list_weather\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentBottom=\"true\"\n            android:text=\"多云\"\n            android:gravity=\"center\"\n            android:textColor=\"#fff\"\n            android:textSize=\"18sp\" />\n    </RelativeLayout>\n\n    <LinearLayout\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_weight=\"3\"\n        android:gravity=\"center\"\n        android:orientation=\"vertical\" >\n\n        <TextView\n            android:id=\"@+id/list_temperature\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center\"\n            android:text=\"14~5°C\"\n            android:textColor=\"#fff\"\n            android:textSize=\"20sp\" />\n\n        <TextView\n            android:id=\"@+id/list_wind\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"南风微风\"\n            android:textColor=\"#fff\"\n            android:textSize=\"18sp\" />\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "res/layout/welcome_activity.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@drawable/left_layout_bg\" >\n<ImageView \n        android:id=\"@+id/cool_weather_icon\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"80dp\"\n        android:layout_marginTop=\"60dp\"\n        android:layout_centerHorizontal=\"true\"\n        android:src=\"@drawable/cool_weather_icon\"\n        android:contentDescription=\"@string/app_name\"/>\n    \n    <TextView \n        android:id=\"@+id/cool\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textSize=\"20sp\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_below=\"@id/cool_weather_icon\"\n        android:layout_marginTop=\"20dp\"\n        android:textColor=\"#fff\"\n        android:text=\"@string/app_name\"/>\n    <TextView\n        android:id=\"@+id/simple\"\n       android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"50dp\"\n        android:textSize=\"20sp\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_below=\"@id/cool\"\n        android:textColor=\"#fff\"\n        android:text=\"@string/slogan\"\n        android:gravity=\"center\"\n        />\n   \n    \n    \n    <TextView \n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:textSize=\"14sp\"\n        android:textColor=\"#000\"\n        android:text=\"@string/author\"/>\n</RelativeLayout>\n"
  },
  {
    "path": "res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <declare-styleable name=\"CircleImageView\">\n        <attr name=\"civ_border_width\" format=\"dimension\" />\n        <attr name=\"civ_border_color\" format=\"color\" />\n        <attr name=\"civ_border_overlay\" format=\"boolean\" />\n        <attr name=\"civ_fill_color\" format=\"color\" />\n    </declare-styleable>\n</resources>\n"
  },
  {
    "path": "res/values/dimens.xml",
    "content": "<resources>\n\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n\n</resources>\n"
  },
  {
    "path": "res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <string name=\"app_name\">酷我天气</string>\n    <string name=\"author\">酷我天气   @：htq All rights reserved </string>\n    <string name=\"about_me\">          \n           作者：@：htq 爱丽颖的颖火虫\n    blog:http://blog.csdn.net/htq__欢迎大家访问我的博客  </string>\n   \n    <string name=\"today_can\">生活指数</string>\n    <string name=\"weather\">天气预报</string>\n    <string name=\"pleaseinput\">请输入城市名:</string>\n    <string name=\"search\">查询</string>\n    <string name=\"citymanager\">城市管理</string>\n    <string name=\"pollution_no\">空气清新</string>\n    <string name=\"pollution_little\">空气良好</string>\n    <string name=\"pollution_mild\">轻度污染</string>\n    <string name=\"polltion_moderate\">中度污染</string>\n    <string name=\"polltion_severe\">重度污染</string>\n    <string name=\"edittext_hint\">请输入城市名</string>\n    <string name=\"net_fail\">网络请求失败</string>\n    <string name=\"click_exit\">再次按下程序退出</string>\n    <string name=\"no_data\">暂无数据</string>\n    <string name=\"color_green\">#00FF00</string>\n    <string name=\"color_gandb\">#00FFFF</string>\n    <string name=\"color_orange\">#FF9F00</string>\n    <string name=\"color_red\">#FF0000</string>\n    <string name=\"color_balck\">#000000</string>\n    <string name=\"color_bottombg\">#B3D7F3</string>\n    <string name=\"color_bottombgn\">#888888</string>\n    <string name=\"getdata_fail\">获取数据失败</string>\n    <string name=\"input_truename\">请输入正确的城市名</string>\n    <string name=\"city_default\">武汉</string>\n    <string name=\"set_normal\">设为默认</string>\n    <string name=\"slogan\">简约 好用的天气APP</string>\n    <string name=\"add_city_text\">热门城市</string>\n    <string name=\"loading\">加载中</string>\n\n</resources>\n"
  },
  {
    "path": "res/values/styles.xml",
    "content": "<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "res/values-sw600dp/dimens.xml",
    "content": "<resources>\n\n    <!--\n         Customize dimensions originally defined in res/values/dimens.xml (such as\n         screen margins) for sw600dp devices (e.g. 7\" tablets) here.\n    -->\n\n</resources>\n"
  },
  {
    "path": "res/values-sw720dp-land/dimens.xml",
    "content": "<resources>\n\n    <!--\n         Customize dimensions originally defined in res/values/dimens.xml (such as\n         screen margins) for sw720dp devices (e.g. 10\" tablets) in landscape here.\n    -->\n    <dimen name=\"activity_horizontal_margin\">128dp</dimen>\n\n</resources>\n"
  },
  {
    "path": "res/values-v11/styles.xml",
    "content": "<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "res/values-v14/styles.xml",
    "content": "<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"android:Theme.Holo.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "src/com/htq/coolweather/AboutMeFragment.java",
    "content": "package com.htq.coolweather;\n\n\nimport com.htq.coolweather.R;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android.text.util.Linkify;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.TextView;\n\npublic class AboutMeFragment extends Fragment {\n\n\tprivate View baseView;\n\t@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\t// TODO Auto-generated method stub\n\t\tbaseView=inflater.inflate(R.layout.about_me_fragment, null);\n\t\tinitView();\n\t\treturn baseView;\n\t}\n\n\tprivate void initView()\n\t{\n       TextView aboutMeTv=(TextView) baseView.findViewById(R.id.about_me_tv);\n       Linkify.addLinks(aboutMeTv, Linkify.ALL);\n\t}\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/AddCityActivity.java",
    "content": "package com.htq.coolweather;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.adapter.GridAddCityAdapter;\nimport com.htq.coolweather.entity.SQLiteCityManager;\n\nimport android.app.Activity;\nimport android.content.ContentValues;\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.AdapterView;\nimport android.widget.AdapterView.OnItemClickListener;\nimport android.widget.GridView;\nimport android.widget.TextView;\nimport android.widget.Toast;\n/**\n * \n * @author htq 爱丽颖的颖火虫\n * blog:blog.csdn.net/htq__\n */\npublic class AddCityActivity extends Activity {\n\n\tprivate GridView addCityGrid;\n\tprivate static TextView cityTv;\n\tprivate boolean ishas;\n\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.addcity_activity);\n\t\tinitView();\n\t\t\n\t}\n\n\tprivate void initView()\n\t{\naddCityGrid = (GridView) findViewById(R.id.addcity_gridview);\n\t\t\n\t\tGridAddCityAdapter ad = new GridAddCityAdapter(this);\n\t\t\n\t\taddCityGrid.setAdapter(ad);\n\t\t\n\t\taddCityGrid.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tcityTv = (TextView) view.findViewById(R.id.citytext);\n\t\t\t\tcityTv.setCompoundDrawablesWithIntrinsicBounds(0, 0,\n\t\t\t\t\t\tR.drawable.city_checkbox_selected, 0);\n\t\t\t\tquerydata(cityTv.getText().toString());\n\t\t\t\t// 如果数据库中没有该城市，则添加到数据库。反之则提示。\n\t\t\t\tif(!ishas){\n\t\t\t\t\tinsertdata();\n\t\t\t\t\tfinish();\n\t\t\t\t}else{\n\t\t\t\t\tToast.makeText(AddCityActivity.this, \"不可重复添加\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t}\n\tprivate SQLiteCityManager sqlite = new SQLiteCityManager(\n\t\t\tAddCityActivity.this, \"weatherdb\", null, 1);\n\n\t\n\tprivate void insertdata() {\n\t\t\n\t\tSQLiteDatabase db = sqlite.getReadableDatabase();\n\t\t\n\t\tContentValues cv = new ContentValues();\n\t\t\n\t\tcv.put(\"cityname\", cityTv.getText().toString());\n\t\tcv.put(\"imageurl\", \"\");\n\t\tcv.put(\"weather\", \"点击更新\");\n\t\tcv.put(\"temp\", \"0℃\");\n\t\t//\n\t\tdb.insert(\"coolWeather\", \"cityname\", cv);\n\t}\n\n\tpublic void querydata(String str) {\n\t\t// 读写数据库\n\t\tSQLiteDatabase db = sqlite.getReadableDatabase();\n\t\tCursor cursor = db.query(\"coolWeather\", null, null, null, null, null,\n\t\t\t\tnull);\n\t\twhile (cursor.moveToNext()) {\n\t\t\tString cityname = cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(\"cityname\"));\n\t\t\tcityname = cityname.substring(0, 2);\n\t\t\tstr = str.substring(0, 2);\n\t\t\t// 与当前按下的城市名做比较\n\t\t\tif (ishas = cityname.equals(str)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/ChangeBackgroundFragment.java",
    "content": "package com.htq.coolweather;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.adapter.BgPicGridAdapter;\nimport com.htq.coolweather.entity.BgPicEntity;\nimport com.htq.coolweather.utils.SharePrefrenceUtil;\n\nimport android.support.v4.app.Fragment;\nimport android.util.Log;\nimport android.content.Intent;\nimport android.content.res.AssetManager;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.drawable.BitmapDrawable;\nimport android.graphics.drawable.Drawable;\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.AdapterView;\nimport android.widget.AdapterView.OnItemClickListener;\nimport android.widget.GridView;\nimport android.widget.RelativeLayout;\n\npublic class ChangeBackgroundFragment extends Fragment {\n\n\tprivate List<BgPicEntity> mBgPicList;\n\tprivate View baseView;\n\tprivate GridView mGridView;\n\tprivate BgPicGridAdapter mBgPicAdapter;\n\tprivate SharePrefrenceUtil shareUtil;\n\t\n\t@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\t\t\tsuper.onCreateView(inflater, container, savedInstanceState);\n\t\t\t\tbaseView=inflater.inflate(R.layout.change_background_fragment, null);\n\t\t\t\tinitBackgroundPic();\n\t\t\t\tinitView();\n\t\t\t\treturn baseView;\n\t}\n\n\t\n\tprivate void initView()\n\t{\n\t\t\n\t\tmGridView = (GridView) baseView.findViewById(R.id.change_background_grid);\n\t\tmBgPicAdapter = new BgPicGridAdapter(getActivity(),mBgPicList);\n\n\t\tmGridView.setOnItemClickListener(gridItemClickListener);\n\t\tmGridView.setAdapter(mBgPicAdapter);\n\t\t\n\t}\n\tprivate void initBackgroundPic()\n\t{\n\t\tAssetManager am = getActivity().getAssets();\n\t\ttry {\n\t\t\tString[] drawableList = am.list(\"bkgs\");\n\t\t\tmBgPicList = new ArrayList<BgPicEntity>();\n\t\t\tfor (String path : drawableList) {\n\t\t\t\tBgPicEntity bg = new BgPicEntity();\n\t\t\t\tInputStream is = am.open(\"bkgs/\" + path);\n\t\t\t\tBitmap bitmap = BitmapFactory.decodeStream(is);\n\t\t\t\tbg.path = path;\n\t\t\t\tbg.bitmap = bitmap;\n\t\t\t\tmBgPicList.add(bg);\n\t\t\t\tis.close();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}\n\t\n\t OnItemClickListener gridItemClickListener=new OnItemClickListener() {\n\n\t\t@Override\n\t\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tString path = ((BgPicEntity)mBgPicAdapter.getItem(position)).path;\n\t\t\t\n\t\t\tshareUtil=new SharePrefrenceUtil(getActivity());\n\t\t\tshareUtil.saveBgPicPath(path);\n\t\t\tLog.i(\"weatherIndex\",path);\n//\t\t\tDrawable drawable=Drawable.createFromPath(path);\n//\t\t\tmMainLayout.setBackgroundDrawable(drawable);\n//\t\t\tBitmap bitmap =getBitmapByPath(path);\n//\t\t\tif(bitmap != null) {\n//\t\t\t\tmMainLayout.setBackgroundDrawable(new BitmapDrawable(getActivity().getResources(), bitmap));\n//\t\t\t}\n\t\t\tIntent intent=new Intent(\"change_background\");\n\t\t\tintent.putExtra(\"path\", path);\n\t\t\tgetActivity().sendBroadcast(intent);\n\t\t\tmBgPicAdapter.notifyDataSetChanged();\n\t\t\t\n\t\t}\n\t};\n\t\n\t\n \n}\n"
  },
  {
    "path": "src/com/htq/coolweather/CityManagerActivity.java",
    "content": "package com.htq.coolweather;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.http.util.VersionInfo;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.adapter.GridCityMAdapter;\nimport com.htq.coolweather.entity.CityManagerEntity;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.widget.GridView;\n\npublic class CityManagerActivity extends Activity {\n\n\tprivate GridView mGrid;\n\tprivate List<CityManagerEntity> mCityManagerEntity;\n\t\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.gridview_activity);\n\t\tinitView();\n\t}\n\tprivate void initView()\n\t{\n\t\tmCityManagerEntity = new ArrayList<CityManagerEntity>();\n\t\tmGrid = (GridView) findViewById(R.id.gridview);\n\t\tmGrid.setNumColumns(3);\n\t\tmGrid.setBackgroundResource(R.drawable.bg_homepager_blur);\n\t\tmGrid.setAdapter(new GridCityMAdapter(this, mCityManagerEntity));\n\t\t\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/CityManagerFragment.java",
    "content": "package com.htq.coolweather;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.adapter.GridCityMAdapter;\nimport com.htq.coolweather.entity.CityManagerEntity;\nimport com.htq.coolweather.entity.SQLiteCityManager;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.AdapterView;\nimport android.widget.AdapterView.OnItemClickListener;\nimport android.widget.GridView;\n\npublic class CityManagerFragment extends Fragment {\n\n\tpublic static final String TAG = \"CityManager\";\n\tprivate GridView mGridview;\n\tprivate String cityname;\n\tprivate String imageurl;\n\tprivate String weather;\n\tprivate String temp;\n\tpublic CityManagerEntity cmb;\n\tpublic GridCityMAdapter cmAdapter;\n\tprivate FragmentAndActivity mActivity;\n\tpublic Intent intent;\n\tprivate SQLiteCityManager sqlite;\n\tprivate SQLiteDatabase db;\n\tprivate View baseView;\n\n\t@Override\n\tpublic void onResume() {\n\t\tgetdatabase();\n\t\tfor (int i = 0; i < HomePageFragment.mcmb.size(); i++) {\n\t\t\tif (HomePageFragment.mcmb.get(i).getCity()\n\t\t\t\t\t.equals(MainActivity.cmb2.getCity())) {\n\t\t\t\tHomePageFragment.mcmb.remove(MainActivity.cmb2);\n\t\t\t}\n\t\t}\n\t\t// 标记，为每次打开城市管理页都会加载一个item问题的解决方案\n\t\tMainActivity.cmb2.setCity(\"添加\");\n\t\tHomePageFragment.mcmb.add(HomePageFragment.mcmb.size(),\n\t\t\t\tMainActivity.cmb2);\n\t\tcmAdapter.setCitymanager(HomePageFragment.mcmb);\n\t\tfor(int i = 0; i < HomePageFragment.mcmb.size(); i++ ){\n\t\t\tLog.i(\"TAG\", HomePageFragment.mcmb.get(i).getCity());\n\t\t}\n\t\tLog.i(\"TAG\", HomePageFragment.mcmb.size()+\"<<<<==>>>>HomePageFragment.mcmb\");\n\t\tcmAdapter.notifyDataSetChanged();\n\n\t\tsuper.onResume();\n\t}\n\n\t@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tmActivity = (FragmentAndActivity) activity;\n\t}\n\n\t@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tMainActivity.TAG_H = TAG;\n\t\tbaseView=inflater.inflate(R.layout.gridview_citymanager,\n\t\t\t\tnull);\n\t\t init();\n\t\treturn baseView;\n\t}\n\n\tprivate void init()\n\t{\n\t\t\n\t\tmGridview = (GridView) baseView.findViewById(R.id.gridview);\n\t\tintent = new Intent(getActivity(), AddCityActivity.class);\n\t\tmGridview.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tif (position == HomePageFragment.mcmb.size() - 1) {\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t} else {\n\t\t\t\t\t//showDialog\n\t\t\t\t\tmActivity.showDialog();\n\t\t\t\t\t\n\t\t\t\t\tMainActivity ff = (MainActivity) getActivity();\n\t\t\t\t\tff.switchFragment(MainActivity.homecontent,\n\t\t\t\t\t\t\tHomePageFragment.TAG);\n\t\t\t\t\t// 得到城市，发起网络请求。\n\t\t\t\t\tmActivity.sendcitytext(HomePageFragment.mcmb.get(\n\t\t\t\t\t\t\tposition).getCity());\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tcmAdapter = new GridCityMAdapter(getActivity(),\n\t\t\t\tHomePageFragment.mcmb);\n\t\tmGridview.setAdapter(cmAdapter);\n\t}\n\t\n\tpublic void getdatabase() {\n\t\t\n\t\tsqlite = new SQLiteCityManager(getActivity(),\n\t\t\t\t\"weatherdb\", null, 1);\n\t\t\n\t\tdb = sqlite.getWritableDatabase();\n\t\t\n\t\tCursor cursor = db.query(\"coolWeather\", null, null, null, null, null,\n\t\t\t\tnull);\n\t\tHomePageFragment.mcmb.clear();\n\t\t\n\t\twhile (cursor.moveToNext()) {\n\t\t\tint _id = cursor.getInt(cursor.getColumnIndex(\"_id\"));\n\t\t\tcityname = cursor.getString(cursor.getColumnIndex(\"cityname\"));\n\t\t\timageurl = cursor.getString(cursor.getColumnIndex(\"imageurl\"));\n\t\t\tweather = cursor.getString(cursor.getColumnIndex(\"weather\"));\n\t\t\ttemp = cursor.getString(cursor.getColumnIndex(\"temp\"));\n\t\t\tLog.i(\"TAG\", _id + \"  @@@@@@@@_id-\" + \" cityname-\" + cityname + \" imageurl-\"\n\t\t\t\t\t+ imageurl + \" weather-\" + weather + \" temp-\" + temp);\n\t\t\tsetCityManagerEntity();\n\t\t}\n\t}\n\n\t\n\tpublic void setCityManagerEntity() {\n\t\tcmb = new CityManagerEntity();\n\t\tcmb.setCity(cityname);\n\t\tcmb.setWeather(weather);\n\t\tcmb.setTemp(temp);\n\t\tcmb.setWeatherimage(imageurl);\n\t\tfor (int i = 0; i < HomePageFragment.mcmb.size(); i++) {\n\t\t\tLog.i(\"TAG\", HomePageFragment.mcmb.size()+\"==>HomePageFragment.mcmb.size()\");\n\t\t\tLog.i(\"TAG\", HomePageFragment.mcmb.get(i).getCity()+\"==>\" +\n\t\t\t\t\t\t\"HomePageFragment.mcmb.get(i).getCity()\");\n\t\t\tif (HomePageFragment.mcmb.get(i).getCity().equals(cmb.getCity())) {\n\t\t\t\tHomePageFragment.mcmb.set(i, cmb);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tHomePageFragment.mcmb.add(cmb);\n\t}\n\t\n\t/**\n\t * 删除数据库\n\t */\n\tpublic void deletedata(){\n\t\tsqlite = new SQLiteCityManager(getActivity(),\n\t\t\t\t\"weatherdb\", null, 1);\n\t\tdb = sqlite.getWritableDatabase();\n\t\tdb.delete(\"coolWeather\", \"_id = \"+ 2, null);\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/FragmentAndActivity.java",
    "content": "package com.htq.coolweather;\n\nimport android.widget.EditText;\n\n\npublic interface FragmentAndActivity {\n\n\tpublic void senddata(EditText inputcity);\n\tpublic void sendcitytext(String inputcitytext);\n\tpublic void showDialog();\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/HomePageFragment.java",
    "content": "package com.htq.coolweather;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.adapter.ListWeatherAdapter;\nimport com.htq.coolweather.entity.CityManagerEntity;\nimport com.htq.coolweather.entity.SQLiteCityManager;\n\nimport android.app.Activity;\nimport android.app.ProgressDialog;\nimport android.content.ContentValues;\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.ListView;\nimport android.widget.TextView;\n\npublic class HomePageFragment extends Fragment {\n\n\tpublic static final String TAG = \"HomeContent\";\n\tpublic static List<CityManagerEntity> mcmb = new ArrayList<CityManagerEntity>();\n\tpublic static TextView currentcity;// 当前城市\n\tprivate TextView pm25;// PM值\n\tprivate TextView temp;// 温度\n\tprivate TextView pollution;// 污染程度\n\tprivate ListView weatherInfolist;//\n\tprivate EditText inputcity;\n\tprivate Button searchWeatherBtn;\n\tprivate View homeContent;\n\tpublic MainActivity mainActivity;\n\tpublic FragmentAndActivity mActivity;\n\tstatic ProgressDialog pDialog;\n\n\t@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\n\t\tMainActivity.TAG_H = TAG;\n\t\tif(!mainActivity.netErrorFlag)\n\t\t{\n\t\t\thomeContent = inflater.inflate(R.layout.include_content_activity,\n\t\t\t\tnull);\n\t\t   initview();\n\t\t   if(MainActivity.response.getResults()!=null)\n\t\t\t{\n\t\t       setpagedata();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\thomeContent = inflater.inflate(R.layout.main_activity_net_error,\n\t\t\t\t\tnull);\n\t\t}\n\t\treturn homeContent;\n\t}\n\n\t@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tmainActivity = (MainActivity) getActivity();\n\t\tmActivity = (FragmentAndActivity) activity;\n\n\t}\n\n\tprivate void initview() {\n\t\tcurrentcity = (TextView) homeContent.findViewById(R.id.currentcity);\n\t\tpm25 = (TextView) homeContent.findViewById(R.id.pm25);\n\t\ttemp = (TextView) homeContent.findViewById(R.id.temp);\n\t\tsearchWeatherBtn= (Button) homeContent.findViewById(R.id.btn_search);\n\t\t\n\t\tpollution = (TextView) homeContent.findViewById(R.id.pollution_level);\n\t\tinputcity = (EditText) homeContent.findViewById(R.id.inputcity);\n\t\tweatherInfolist = (ListView) homeContent\n\t\t\t\t.findViewById(R.id.weather_infor_list);\n\t\t\n\t}\n/**\n * @author htq\n * 根据天气情况自动更换app的皮肤，如晴天则显示晴天的背景，多云则显示多云的背景...\n * 如果当前天气为一种转另外一种天气，则显示前面的那种天气背景，如多云转晴则显示多云的背景\n * 注自动设置背景不会在配置文件中记录设置的是哪张图片背景，仅仅当用户在更换皮肤模块手动更改才\n * 在配置文件中记录\n * bolg:blog.csdn.net/htq__\n */\n\tprivate void autoSetBgPic()\n\t{\n\t\tString path=null;\n\t\t\n\t\tString weather=MainActivity.response.getResults().get(0)\n\t\t\t\t\n\t\t.getWeather_data().get(0).getWeather();\n\t\tif(weather.contains(\"多云\")&&!weather.contains(\"转多云\"))\n\t\t{\n\t\t\tpath=\"cloudy.jpg\";\n\t\t\t\n\t\t}else if(weather.contains(\"晴\")&&!weather.contains(\"转晴\"))\n\t\t{\n\t\t\tpath=\"fine.jpg\";\n\t\t}else if(weather.contains(\"雨\")){\n\t\t\tpath=\"rain.jpg\";\n\t\t\t\n\t\t}\n\t\tif(path!=null)\n\t\t{\n\t\t    Intent intent=new Intent(\"change_background\");\n\t     \tintent.putExtra(\"path\", path);\n\t     \tintent.putExtra(\"auto\", true);\n\t\t    getActivity().sendBroadcast(intent);\n\t\t}\n\t}\n\tpublic void setpagedata() {\n\t\tif(pDialog != null){\n\t\t\tpDialog.dismiss();\n\t\t}\n\t\t\n\t\t  autoSetBgPic();\n//\t\t Log.i(\"weather\",\"autoSet is called\");\n\t\tweatherInfolist.setAdapter(new ListWeatherAdapter(getActivity(),\n\t\t\t\tMainActivity.response.getResults().get(0)\n\t\t\t\t\t\t.getWeather_data()));\n\t\tsearchWeatherBtn.setOnClickListener(searchWeatherOnClickListener);\n\t\tcurrentcity.setText(MainActivity.response.getResults().get(0)\n\t\t\t\t.getCurrentCity());\n\n\t\tif (\"\".equals(MainActivity.response.getResults().get(0).getPm25())) {\n\t\t\tpm25.setText(\"PM2.5：\");\n\t\t\tpollution.setText(R.string.no_data);\n\t\t\tpollution.setBackgroundColor(Color.TRANSPARENT);\n\t\t} else {\n\t\t\tpm25.setText(\"PM2.5：\"\n\t\t\t\t\t+ MainActivity.response.getResults().get(0).getPm25());\n\t\t\tint pm = Integer.parseInt(MainActivity.response.getResults()\n\t\t\t\t\t.get(0).getPm25());\n\t\t\tLog.i(\"TAG\", pm + \" <-- pm\");\n\t\t\tif (pm < 75) {\n\t\t\t\tpollution.setText(R.string.pollution_no);\n\t\t\t\tpollution.setBackgroundResource(R.drawable.ic_dl_b);\n\t\t\t} else if (pm > 75 && pm < 100) {\n\t\t\t\tpollution.setText(R.string.pollution_little);\n\t\t\t\tpollution.setBackgroundResource(R.drawable.ic_dl_c);\n\t\t\t} else if (pm > 100 && pm < 150) {\n\t\t\t\tpollution.setText(R.string.pollution_mild);\n\t\t\t\tpollution.setBackgroundResource(R.drawable.ic_dl_d);\n\t\t\t} else if (pm > 150 && pm < 200) {\n\t\t\t\tpollution.setText(R.string.polltion_moderate);\n\t\t\t\tpollution.setBackgroundResource(R.drawable.ic_dl_e);\n\t\t\t} else if (pm > 200) {\n\t\t\t\tpollution.setText(R.string.polltion_severe);\n\t\t\t\tpollution.setBackgroundResource(R.drawable.ic_dl_f);\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tString todaydata = MainActivity.response.getResults().get(0)\n\t\t\t\t.getWeather_data().get(0).getDate();\n\t\tString temperature = MainActivity.response.getResults().get(0)\n\t\t\t\t.getWeather_data().get(0).getTemperature();\n\t\tString subs = null;\n\t\tif (todaydata.length() > 14) {\n\t\t\tsubs = todaydata.substring(14, todaydata.length() - 1);\n\t\t\ttemp.setText(subs);\n\t\t} else if (temperature.length() > 5) {\n\t\t\tString[] str = temperature.split(\"~ \", 2);\n\t\t\tsubs = str[1];\n\t\t\ttemp.setText(subs);\n\t\t} else {\n\t\t\ttemp.setText(temperature);\n\t\t}\n\n\t\t// 创建SQLite对象并不会创建数据库\n\t\tSQLiteCityManager sqlite = new SQLiteCityManager(getActivity(),\n\t\t\t\t\"weatherdb\", null, 1);\n\t\t// 读写数据库\n\t\tSQLiteDatabase db = sqlite.getWritableDatabase();\n\t\t// ContentValues键值对，类似HashMap\n\t\tContentValues cv = new ContentValues();\n\t\t// key为字段名，value为所存数据\n\t\tcv.put(\"cityname\", MainActivity.response.getResults().get(0)\n\t\t\t\t.getCurrentCity());\n\t\tcv.put(\"imageurl\", MainActivity.response.getResults().get(0)\n\t\t\t\t.getWeather_data().get(0).getDayPictureUrl());\n\t\tcv.put(\"weather\", MainActivity.response.getResults().get(0)\n\t\t\t\t.getWeather_data().get(0).getWeather());\n\t\tcv.put(\"temp\", subs);\n\t\tCursor cursor = db.query(\"coolWeather\", null, null, null, null, null,\n\t\t\t\tnull);\n\t\tint i = 0;\n\t\twhile (cursor.moveToNext()) {\n\t\t\ti++;\n\t\t\tLog.i(\"TAG\", i + \"==>>i\");\n\t\t\tString cityname = cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(\"cityname\"));\n\t\t\tString weathertext = cursor.getString(cursor\n\t\t\t\t\t.getColumnIndex(\"weather\"));\n\t\t\tcityname = cityname.substring(0, 2);\n\t\t\tString citytext = currentcity.getText().toString().substring(0, 2);\n\t\t\tif (citytext.equals(cityname)) {\n\t\t\t\tif (\"点击更新\".equals(weathertext)) {\n\t\t\t\t\tdb.update(\"coolWeather\", cv, \"weather = ?\",\n\t\t\t\t\t\t\tnew String[] { \"点击更新\" });\n\t\t\t\t\tdb.close();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// 插入，第二个参数:不能为null的字段\n\t\tdb.insert(\"coolWeather\", \"cityname\", cv);\n\t\tdb.close();\n\t}\n\n\tprivate View.OnClickListener searchWeatherOnClickListener = new View.OnClickListener() {\n\n\t\t@Override\n\t\tpublic void onClick(View v) {\n\t\t\tpDialog = new ProgressDialog(getActivity());\n\t\t\tpDialog.setCancelable(true);// 点击可以取消Dialog的展现\n\t\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t\t\tpDialog.setMessage(\"正在查询，请稍后...\");\n\t\t\tpDialog.show();\n\t\t\tmActivity.senddata(inputcity);\n\t\t\tmActivity.sendcitytext(inputcity.getText().toString());\n\t\t}\n\t};\n}\n\n"
  },
  {
    "path": "src/com/htq/coolweather/LifeIndexFragment.java",
    "content": "package com.htq.coolweather;\n\nimport java.util.Calendar;\nimport java.util.List;\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.adapter.GridTodayCAdapter;\nimport com.htq.coolweather.entity.LivingIndexEntity;\n\nimport android.os.Bundle;\nimport android.support.v4.app.Fragment;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.AdapterView;\nimport android.widget.AdapterView.OnItemClickListener;\nimport android.widget.GridView;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\n/**\n * \n * @author htq 爱丽颖的颖火虫\n * 博客地址:blog.csdn.net/htq__\n *\n */\npublic class LifeIndexFragment extends Fragment {\n\n\tpublic static final String TAG = \"TodayCan\";\n\tpublic TextView descTv;\n\tpublic List<LivingIndexEntity> listsib;\n    private TextView dateTv;\n\tprivate View baseView;\n\tprivate GridView todayInfoGrid;\n\t@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tMainActivity.TAG_H = TAG;\n\t\tbaseView = inflater.inflate(R.layout.gridview_todaycan, null);\n\n\t\tinitView();\n\t\tinitData();\n\t\treturn baseView;\n\t}\n\t\n\tprivate void initView()\n\t{\n\t\ttodayInfoGrid = (GridView) baseView\n\t\t\t\t.findViewById(R.id.gridview);\n\t\tdateTv=(TextView) baseView.findViewById(R.id.date_tv);\n\t\t\n\t\tdescTv = (TextView)baseView.findViewById(R.id.todaycan_dec);\n\n\t\t\n\t\t\n\t}\n\tprivate  void initData()\n\t{\n\t\tinitDate();\n\t\t\n\t\t\n\t\tif(MainActivity.response.getResults()==null)\n\t\t{\n\t\t\tToast.makeText(getActivity(), \"获取指数信息失败，请检查网络连接\",0).show();\n\t\t}else\n\t\t{\n\t\t\tsetData();\n\t\t}\n\n\t}\n\tprivate void setData()\n\t{\n\t\tlistsib = MainActivity.response.getResults().get(0).getIndex();\n\t//\tLog.i(\"weatherIndex\", listsib.toString()+\"==>>listsib.toString()\");\n\t\tif (MainActivity.response.getResults().get(0).getIndex()\n\t\t\t\t.toString() == \"[]\") {\n\t\t}else {\n\t\t\t\n\t\t\ttodayInfoGrid.setAdapter(new GridTodayCAdapter(getActivity(),\n\t\t\t\t\tlistsib));\n\t\n\t\t}\n\t\ttodayInfoGrid.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\t\n\t\t\t\t\tdescTv.setText(listsib.get(position).getDes());\n\t\t\t\t\t\n\t\t\t}\n\t\t});\n\t\t\n\t}\n\tprivate void initDate()\n\t{\n\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tint year=calendar.get(Calendar.YEAR);\n\t\tint mon=calendar.get(Calendar.MONTH )+1;\n\t\tint day=calendar.get(Calendar.DAY_OF_MONTH);\n\t\tdateTv.setText(year+\"年\"+mon+\"月\"+day+\"日\");\n\t}\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/MainActivity.java",
    "content": "package com.htq.coolweather;\n\nimport java.io.IOException;\nimport java.io.InputStream;\n\nimport org.apache.http.ParseException;\nimport org.apache.http.util.EntityUtils;\n\nimport android.app.AlertDialog;\nimport android.app.Dialog;\nimport android.app.ProgressDialog;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.content.res.AssetManager;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.drawable.BitmapDrawable;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Message;\nimport android.support.v4.app.Fragment;\nimport android.support.v4.app.FragmentActivity;\nimport android.support.v4.app.FragmentManager;\nimport android.support.v4.app.FragmentTransaction;\nimport android.support.v4.widget.DrawerLayout;\nimport android.util.Log;\nimport android.view.KeyEvent;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.inputmethod.InputMethodManager;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.RelativeLayout;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.htq.coolweather.R;\nimport com.google.gson.GsonBuilder;\nimport com.htq.coolweather.base.Appliction;\nimport com.htq.coolweather.entity.CityManagerEntity;\nimport com.htq.coolweather.entity.MHttpEntity;\nimport com.htq.coolweather.entity.ResponseWrapper;\nimport com.htq.coolweather.entity.SendDataEntity;\nimport com.htq.coolweather.utils.SharePrefrenceUtil;\nimport com.htq.coolweather.utils.SystemUtils;\n\n/**\n * \n * @author htq 爱丽颖的颖火虫\n * 博客地址：blog.csdn.net/htq__\n *\n */\npublic class MainActivity extends FragmentActivity implements\n\t\tOnClickListener, FragmentAndActivity {\n\n\tprivate long nowtime;\n\t\n\tpublic static ResponseWrapper response = new ResponseWrapper();// 数据结构的对象\n\tpublic static ResponseWrapper response2;\n\tprivate DrawerLayout mainDrawerLayout;\n\tprivate View leftDrawer;\n\tprivate EditText inputcity;\n\tpublic boolean netErrorFlag=false;\n\tpublic static final int succeed = 1;\n\tpublic static final int fail = 2;\n\tpublic static final int nonet = 3;\n\tprivate static int tag = 0;\n\tpublic static String TAG_H = null;\n\tprivate ProgressDialog pDialog;\n\tpublic static HomePageFragment homecontent = new HomePageFragment();\n\tpublic CityManagerFragment citymanager = new CityManagerFragment();\n\tpublic static CityManagerEntity cmb2 = new CityManagerEntity();\n    private ChangeBgReceiver mReceiver;\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.main_activity);\n\t\t\n\t\tgetIntentData();\n\t\tregisterBroadCast();\n\t\tinitview();\n\n\t}\n\n\t\n\tprivate void getIntentData()\n\t{\n\t\tIntent intent = getIntent();\n\t\tString wetherdata = intent.getStringExtra(\"weather_data\");// 得到启动页传递过来的数据\n\t\tGsonBuilder gson = new GsonBuilder();//\n\t\tresponse2 = gson.create().fromJson(wetherdata, ResponseWrapper.class);\n\t\tif(response2!=null)\n\t\t{\n\t\t\tif(response2.getError() == 0){\n\t\t\tresponse = response2;\n\t\t\t\n\t\t}\n\t\t}else\n\t\t{\n\t\t\tnetErrorFlag=true;\n\t\t}\n\t\t\n\t}\n\t\n\tprivate void initview() {\n\t\tmainDrawerLayout = (DrawerLayout) findViewById(R.id.drawerlayout_main);\n\t\tinitBgPic();\n\t\tleftDrawer = findViewById(R.id.left_drawer);\n\t\tmainDrawerLayout.setScrimColor(0x00000000);// 设置底部页面背景透明度\n\t\tFragmentManager fm = getSupportFragmentManager();\n\t\tFragmentTransaction ft = fm.beginTransaction();\n\t\t  ft.replace(R.id.fragmentlayout, homecontent, HomePageFragment.TAG);\n\t\t  ft.commit();\n\t\n\t}\n\n\t\n\t\n\t@Override\n\tpublic void onClick(View v) {\n\t\tswitch (v.getId()) {\n\t\tcase R.id.homep_menu:\n\t\t\tswitchLeftLayout();\n\t\t\tbreak;\n\t\tcase R.id.homep_refresh:\n\t\t\tif(Appliction.isNetWorkConnect(getApplicationContext()))\n\t\t\t{\n\t\t\t\trefresh();\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tToast.makeText(getApplicationContext(), \"网络未连接，请检查网络设置\",0).show();\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase R.id.btn_life:\n\t\t\tswitchLeftLayout();\n\t\t\tswitchFragment(new LifeIndexFragment(),null);\n\t\t\tbreak;\n\t\tcase R.id.btn_city_manager:\n\t\t\tswitchLeftLayout();\n\t\t\tswitchFragment(citymanager, null);\n\t\t\tbreak;\n\t\tcase R.id.btn_change_bag:\n\t\t\tswitchLeftLayout();\n\t\t\tswitchFragment(new ChangeBackgroundFragment(), null);\n\t\t\tbreak;\n\t\tcase R.id.btn_about:\n\t\t\tswitchLeftLayout();\n\t\t\tswitchFragment(new AboutMeFragment(), null);\n\t\t\tbreak;\n\t\tcase R.id.btn_share_app:\n\t\t\tSystemUtils.shareApp(this);\n\t\t    break;\n\t\tcase R.id.exitapp:\n\t\t\tshowExitDialog();\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tprivate void refresh()\n\t{\n\t\tshowDialog();\n\t\tswitchFragment(homecontent, null);\n\t\tnew Thread(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tsendRequest(HomePageFragment.currentcity.getText()\n\t\t\t\t\t\t.toString());\n\t\t\t}\n\t\t}).start();\n\t\t\n\t}\n\tprivate void showExitDialog()\n\t{\n\t\tfinal Dialog dialog = new Dialog(this, \n\t\t\t\tandroid.R.style.Theme_DeviceDefault_Dialog_NoActionBar);\n\t\tView exitappview = getLayoutInflater().inflate\n\t\t\t\t(R.layout.exitapp_dialog, null);\n\t\tTextView exitapp_text = (TextView) exitappview.findViewById(R.id.exitapp_text);\n\t\tButton leftbutton = (Button) exitappview.findViewById(R.id.leftbutton);\n\t\tButton rightbutton = (Button) exitappview.findViewById(R.id.rightbutton);\n\t\texitapp_text.setText(\"退出程序\");\n\t\tleftbutton.setText(\"确定\");\n\t\trightbutton.setText(\"取消\");\n\t\tleftbutton.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tfinish();\n\t\t\t}\n\t\t});\n\t\trightbutton.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdialog.dismiss();\n\t\t\t}\n\t\t});\n\t\tdialog.setContentView(exitappview);\n\t\tdialog.show();\n\t\t\n\t}\n\n\tprivate void fromJson(String wetherdata) {\n\t\tGsonBuilder gson = new GsonBuilder();//\n\t\tresponse2 = gson.create().fromJson(wetherdata, ResponseWrapper.class);\n\t\tif (response2.getError() == 0) {\n\t\t\tresponse = response2;\n\t\t\thomecontent.setpagedata();\n\t\t\tif (tag == 4 && inputcity != null) {\n\t\t\t\tcloseinput(inputcity);\n\t\t\t}\n\t\t} else if (response2.getError() == -3 || response2.getError() == -2) {\n\t\t\tshowToast(getString(R.string.input_truename));\n\t\t} else {\n\t\t\tshowToast(getString(R.string.getdata_fail));\n\t\t}\n\t\tif(HomePageFragment.pDialog != null){\n\t\t\tHomePageFragment.pDialog.dismiss();\n\t\t}\n\t}\n\n\t/**\n\t * 点击多次bt，Toast只显示一次的解决方案\n\t */\n\tpublic Toast toast = null;\n\n\tpublic void showToast(String text) {\n\t\tif (toast == null) {\n\t\t\ttoast = Toast.makeText(this, text, Toast.LENGTH_SHORT);\n\t\t} else {\n\t\t\ttoast.setText(text);\n\t\t}\n\t\ttoast.show();\n\t}\n\n\t/**\n\t * 向服务器发送数据请求\n\t */\n\tpublic void sendRequest(String cityname) {\n\t\tString getData = null;\n\t\tMHttpEntity mhe = null;\n\t\ttry {\n\t\t\tSendDataEntity.setCity(cityname);// 获取用户输入的城市名\n\t\t\tmhe = MHttpEntity.sendHttpRequest(SendDataEntity.getData());\n\t\t\tif (mhe.getHentity() != null) {\n\t\t\t\tgetData = EntityUtils.toString(mhe.getHentity());\n\t\t\t\tmhe.getMessage().obj = getData;\n\t\t\t}\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\thandler.sendMessage(mhe.getMessage());// 使用Handler对网络状态做处理\n\t}\n\n\tHandler handler = new Handler() {\n\t\t@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tif (pDialog != null)\n\t\t\t\tpDialog.dismiss();\n\t\t\tif (msg != null)\n\t\t\t\tswitch (msg.arg1) {\n\t\t\t\tcase succeed:// 与服务器连接成功\n\t\t\t\t\tif (msg.obj != null) {\n\t\t\t\t\t\tfromJson(msg.obj.toString());\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase fail:// 与服务器连接失败\n\t\t\t\t\tshowToast(getString(R.string.net_fail));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * 关联menu键\n\t */\n\tprivate void switchLeftLayout() {\n\t\tif (mainDrawerLayout.isDrawerOpen(leftDrawer)) {\n\t\t\tmainDrawerLayout.closeDrawer(leftDrawer);\n\t\t} else {\n\t\t\tmainDrawerLayout.openDrawer(leftDrawer);\n\t\t}\n\t}\n\n\tpublic void switchFragment(Fragment fragment, String str) {\n\t\tFragmentManager fm = getSupportFragmentManager();\n\t\tFragmentTransaction ft = fm.beginTransaction();\n\t\tft.replace(R.id.fragmentlayout, fragment, null);\n\t\t//ft.replace(R.id.fragmentlayout, fragment, str);\n\t\tft.commit();\n\t}\n\n\t/**\n\t * 关闭输入法键盘\n\t */\n\tpublic void closeinput(EditText editText) {\n\t\teditText.setText(\"\");\n\t\tInputMethodManager imm = (InputMethodManager) \n\t\t\t\tgetSystemService(MainActivity.INPUT_METHOD_SERVICE);\n\t\timm.hideSoftInputFromWindow(editText.getWindowToken(), 0);\n\t}\n\n\t/**\n\t * 连续按两次返回则退出程序\n\t */\n\t@Override\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\n\t\tif (keyCode == KeyEvent.KEYCODE_BACK) {\n\t\t\tif (System.currentTimeMillis() - nowtime > 2000) {\n\t\t\t\tToast.makeText(this, R.string.click_exit, Toast.LENGTH_SHORT)\n\t\t\t\t\t\t.show();\n\t\t\t\tnowtime = System.currentTimeMillis();\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tfinish();\n\t\t\t}\n\t\t}\n\t\treturn super.onKeyDown(keyCode, event);\n\t}\n\n\t@Override\n\tpublic void senddata(EditText inputcity) {\n\t\tthis.inputcity = inputcity;\n\t}\n\n\t@Override\n\tpublic void sendcitytext(final String inputcitytext) {\n//\t\tthis.inputcitytext = inputcitytext;\n\t\ttag = 4;\n\t\tif (\"\".equals(inputcitytext)) {\n\t\t\tshowToast(getString(R.string.edittext_hint));\n\t\t\tif(HomePageFragment.pDialog != null){\n\t\t\t\tHomePageFragment.pDialog.dismiss();\n\t\t\t}\n\t\t} else {\n\t\t\tSendDataEntity.setCity(inputcitytext);// 获取用户输入城市\n\t\t\tnew Thread(new Runnable() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tsendRequest(inputcitytext);\n\t\t\t\t}\n\t\t\t}).start();\n\t\t}\n\t}\n\n\tprivate void registerBroadCast()\n\t{\n\t\tmReceiver = new ChangeBgReceiver();\n\t\tIntentFilter filter = new IntentFilter(\"change_background\");\n\t\tregisterReceiver(mReceiver, filter);\n\t}\n\tprivate class ChangeBgReceiver extends BroadcastReceiver {\n\t\t@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\tString path = intent.getStringExtra(\"path\");\n\t\t\tif(path==null)\n\t\t\t\tLog.i(\"weather\", \"path is null\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tLog.i(\"weather\", path);\n\t\t\t}\n\t\t\tboolean auto=intent.getBooleanExtra(\"auto\",false);\n\t\t\tBitmap bitmap = getBitmapByPath(path,auto);\n\t\t\tif(bitmap != null) {\n\t\t\t\tmainDrawerLayout.setBackgroundDrawable(new BitmapDrawable(getResources(), bitmap));\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tpublic Bitmap getBitmapByPath(String path,boolean auto) {\n\t//\tLog.i(\"weather\", \"getbitmap is called\");\n\t\tAssetManager am = this.getAssets();\n\t\tBitmap bitmap = null;\n\t\tInputStream is =null;\n\t\ttry {\n\t\t\tif(auto==false)\n\t\t\t{\n\t\t\t  is = am.open(\"bkgs/\" + path);\n\t\t\t}else if(auto==true)\n\t\t\t{\n\t\t\t\tLog.i(\"weather\", \"before open auto_bkgs\");\n\t\t\t\tis = am.open(\"autobkgs/\" + path);\n\t\t\t\t\n\t\t\t\tLog.i(\"weather\", path);\n\t\t\t}\n\t\t\tbitmap = BitmapFactory.decodeStream(is);\n\t\t\tis.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tLog.i(\"weather\", \"open file error\");\n\t\t}\n\t\treturn bitmap;\n\t}\n\t\n\t@Override\n\tpublic void showDialog() {\n\t\tpDialog = new ProgressDialog(MainActivity.this);\n\t\tpDialog.setCancelable(true);// 点击可以取消Dialog的展现\n\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t\tpDialog.setMessage(\"正在更新...\");\n\t\tpDialog.show();\n\t}\n\tprivate void initBgPic()\n\t{\n        String path=new SharePrefrenceUtil(this).getPath();\n\t\tIntent intent=new Intent(\"change_background\");\n\t\tintent.putExtra(\"path\", path);\n\t\tsendBroadcast(intent);\n\t\t\n\t}\n\n\t@Override\n\tprotected void onDestroy() {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onDestroy();\n\t\tunregisterReceiver(mReceiver);\n\t}\n\t\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/WelcomeActivity.java",
    "content": "package com.htq.coolweather;\n\nimport java.io.IOException;\nimport org.apache.http.ParseException;\nimport org.apache.http.util.EntityUtils;\nimport android.app.Activity;\nimport android.app.ProgressDialog;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Message;\nimport android.util.Log;\nimport android.view.KeyEvent;\nimport android.widget.Toast;\nimport com.baidu.location.BDLocation;\nimport com.baidu.location.BDLocationListener;\nimport com.baidu.location.LocationClient;\nimport com.baidu.location.LocationClientOption;\nimport com.baidu.location.LocationClientOption.LocationMode;\nimport com.htq.coolweather.R;\nimport com.google.gson.GsonBuilder;\nimport com.htq.coolweather.entity.MHttpEntity;\nimport com.htq.coolweather.entity.ResponseWrapper;\nimport com.htq.coolweather.entity.SendDataEntity;\n\n/**\n * @author htq 爱丽颖的颖火虫\n * 博客地址:bolg.csdn.net/htq__\n * \n */\npublic class WelcomeActivity extends Activity {\n\n\t\n\tpublic static ResponseWrapper response;// 数据结构的对象\n\tpublic static final int succeed = 1;\n\tpublic static final int fail = 2;\n\tpublic static final int nonet = 3;\n\tpublic String normalDistrict;\n\tpublic String locationCity = \"武汉\";\n\tpublic LocationClient mLocationClient = null;\n\tpublic BDLocationListener mListener;\n\tprivate ProgressDialog pDialog;\n\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.welcome_activity);\n\t\t\n\t\tinitData();\n\t\t\n\t}\n\n\tprivate void initData()\n\t{\n\t\tshowProgressDialog(\"自动定位中...\");\n\t\tinitBaiduMapLocation();\n\n\t\tnew Thread(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(2000);\n\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tsendRequest();\n\t\t\t}\n\t\t}).start();\n\t\t\n\t}\n\nprivate void initBaiduMapLocation()\n\t{\n\t\tmLocationClient = new LocationClient(this.getApplicationContext());\n\t\tmListener = new MyLocationListener();\n\t\tmLocationClient.registerLocationListener(mListener);// 娉ㄥ唽鐩戝惉鍑芥暟\n\t\tLocationClientOption option = new LocationClientOption();\n\t\toption.setLocationMode(LocationMode.Hight_Accuracy);\n\t\toption.setIsNeedAddress(true);\n\t\tmLocationClient.setLocOption(option);\n\t\tmLocationClient.start();\n\t}\n\tprivate void showProgressDialog(String title)\n\t{\n\n\t\tpDialog = new ProgressDialog(this);\n\t\tpDialog.setCancelable(false);\n\t\tpDialog.setMessage(title+\"...\");\n\t\tpDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t\tpDialog.show();\n\t}\n\t\n\tprivate void sendRequest() {\n\t\t\n\t\tString getData = null;\n\t\tMHttpEntity mhe = null;\n\t\ttry {\n\t\t\tSendDataEntity.setCity(normalDistrict);\n\t\t\tLog.e(\"TAG\", normalDistrict + \"==>>normalDistrict\");\n\t\t\tmhe = MHttpEntity.sendHttpRequest(SendDataEntity.getData());\n\t\t\tif (mhe.getHentity() != null) {\n\t\t\t\tgetData = EntityUtils.toString(mhe.getHentity());\n\t\t\t\tGsonBuilder gson = new GsonBuilder();//\n\t\t\t\tresponse = gson.create().fromJson(getData,\n\t\t\t\t\t\tResponseWrapper.class);\n\t\t\t\tLog.i(\"TAG\", response.getError() + \"-->response.getError()\");\n\t\t\t\tif (response.getError() == -3) {\n\t\t\t\t\t\n\t\t\t\t\tSendDataEntity.setCity(normalDistrict);\n\t\t\t\t\tmhe = MHttpEntity.sendHttpRequest(SendDataEntity.getData());\n\t\t\t\t\tif (mhe.getHentity() != null) {\n\t\t\t\t\t\tgetData = EntityUtils.toString(mhe.getHentity());\n\t\t\t\t\t\tLog.i(\"weather_info\", getData + \"-->getData\");\n\t\t\t\t\t}\n\t\t\t\t\tif (response.getError() == -3) {\n\t\t\t\t\t\tSendDataEntity.setCity(locationCity);\n\t\t\t\t\t\t\n\t\t\t\t\t\tmhe = MHttpEntity\n\t\t\t\t\t\t\t\t.sendHttpRequest(SendDataEntity.getData());\n\t\t\t\t\t\tif (mhe.getHentity() != null) {\n\t\t\t\t\t\t\tLog.e(\"TAG\", mhe.getHentity() + \"==>>mhe.getHentity()\");\n\t\t\t\t\t\t\tgetData = EntityUtils.toString(mhe.getHentity());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmhe.getMessage().obj = getData;\n\t\t\t}\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\thandler.sendMessage(mhe.getMessage());// 使用Handler对网络状态做处理\n\t}\n\n\t/**\n\t * 对网络连接状态做处理\n\t */\n\tHandler handler = new Handler() {\n\n\t\t@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tif(pDialog != null){\n\t\t\t\tpDialog.dismiss();\n\t\t\t}\n\t\t\tif (msg != null)\n\t\t\t\tswitch (msg.arg1) {\n\t\t\t\tcase succeed:// 与服务器连接成功，则传递数据并跳转\n\t\t\t\t\tIntent intent = new Intent(WelcomeActivity.this,\n\t\t\t\t\t\t\tMainActivity.class);\n\t\t\t\t\tif (msg.obj != null)\n\t\t\t\t\t\tintent.putExtra(\"weather_data\", (String) msg.obj);\n\t\t\t\t\tintent.putExtra(\"normal_city\", locationCity);\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\tfinish();\n\t\t\t\t\tbreak;\n\t\t\t\tcase fail:// 与服务器连接失败，弹出错误提示Toast\n\t\t\t\t\tToast.makeText(WelcomeActivity.this,\n\t\t\t\t\t\t\tgetString(R.string.net_fail), Toast.LENGTH_SHORT)\n\t\t\t\t\t\t\t.show();\n\t\t\t\t\t intent = new Intent(WelcomeActivity.this,\n\t\t\t\t\t\t\tMainActivity.class);\n\t\t\t\t\t intent.putExtra(\"weather_data\", (String) msg.obj);\n\t\t\t\t\t startActivity(intent);\n\t\t\t\t\t finish();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * 拦截返回键\n\t */\n\t@Override\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\n\t\tif (keyCode == KeyEvent.KEYCODE_BACK) {\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onKeyDown(keyCode, event);\n\t}\n\n\tpublic class MyLocationListener implements BDLocationListener {\n\n\t\t@Override\n\t\tpublic void onReceiveLocation(BDLocation location) {\n\t\t\tif (location != null) {\n\t\t\t\tnormalDistrict = location.getDistrict();\n\t\t\t\tlocationCity = location.getCity();\n\t\t\t\t\n\t\t\t\tif(locationCity == null){\n\t\t\t\t\tToast.makeText(WelcomeActivity.this, \"定位失败，请检查网络\", Toast.LENGTH_SHORT).show();\n\t\t\t\t}else{\n\t\t\t\t\tString[] str = locationCity.split(\"市\");\n\t\t\t\t\tlocationCity = str[0];\n\t\t\t\t\tif(\"\".equals(locationCity)){\n\t\t\t\t\t\tToast.makeText(WelcomeActivity.this, \"定位失败，默认为武汉\", Toast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/adapter/BgPicGridAdapter.java",
    "content": "package com.htq.coolweather.adapter;\n\nimport java.util.List;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.entity.BgPicEntity;\nimport com.htq.coolweather.utils.SharePrefrenceUtil;\n\nimport android.app.Activity;\nimport android.content.res.Resources;\nimport android.graphics.Bitmap;\nimport android.graphics.drawable.BitmapDrawable;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.ImageView;\n/**\n * \n * @author htq 爱丽颖的颖火虫\n * 博客地址：blog.csdn.net/htq__\n */\n\npublic class BgPicGridAdapter extends BaseAdapter {\n\t\n\n\tprivate List<BgPicEntity> bgList;\n\tprivate Resources resources;\n\tprivate Activity mActivity;\n\tprivate String mDefaultBgPath;\n\tprivate SharePrefrenceUtil sharePrefrenceUtil;\n\tpublic BgPicGridAdapter(Activity mActivity,List<BgPicEntity> list)\n\t{\n\t\tthis.bgList = list;\n\t\tthis.mActivity=mActivity;\n\t\tthis.resources = mActivity.getResources();\n\t\tsharePrefrenceUtil=new SharePrefrenceUtil(mActivity);\n\t\t\n\t}\n\t\n\t@Override\n\tpublic int getCount() {\n\t\t// TODO Auto-generated method stub\n\t\treturn bgList.size();\n\t}\n\n\t@Override\n\tpublic Object getItem(int position) {\n\t\t// TODO Auto-generated method stub\n\t\treturn bgList.get(position);\n\t}\n\n\t@Override\n\tpublic long getItemId(int position) {\n\t\t// TODO Auto-generated method stub\n\t\treturn position;\n\t}\n\n\t\n\t@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\t// TODO Auto-generated method stub\n\t\tViewHolder viewHolder;\n\t\tif (convertView == null) {\n\t\t\tviewHolder = new ViewHolder();\n\t\t\tconvertView = LayoutInflater.from(mActivity).inflate(\n\t\t\t\t\tR.layout.bg_pic_grid_item, null);\n\t\t\tviewHolder.backgroundIv = (ImageView) convertView\n\t\t\t\t\t.findViewById(R.id.gridview_item_iv);\n\t\t\tviewHolder.checkedIv = (ImageView) convertView\n\t\t\t\t\t.findViewById(R.id.gridview_item_checked_iv);\n\t\t\tconvertView.setTag(viewHolder);\n\t\t} else {\n\t\t\tviewHolder = (ViewHolder) convertView.getTag();\n\t\t}\n\n\t\tviewHolder.backgroundIv.setBackgroundDrawable(new BitmapDrawable(\n\t\t\t\tresources, ((BgPicEntity)getItem(position)).bitmap));\n\t\t\n\t\tmDefaultBgPath=sharePrefrenceUtil.getPath();\n\t\tif (((BgPicEntity)getItem(position)).path.equals(mDefaultBgPath)) {\n\t\t\tviewHolder.checkedIv.setVisibility(View.VISIBLE);\n\t\t} else {\n\t\t\tviewHolder.checkedIv.setVisibility(View.GONE);\n\t\t}\n\n\t\treturn convertView;\n\t\t\n\t\t\n\t}\n\tprivate class ViewHolder {\n\t\tImageView checkedIv, backgroundIv;\n\t}\n\n\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/adapter/GridAddCityAdapter.java",
    "content": "package com.htq.coolweather.adapter;\n\nimport android.content.Context;\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.util.Log;\nimport android.util.SparseBooleanArray;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.TextView;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.entity.SQLiteCityManager;\n\npublic class GridAddCityAdapter extends BaseAdapter {\n\n\tprivate LayoutInflater mInflater;\n\tprivate static final String[] cityname = \n\t\t\t{ \"北京\", \"上海\", \"广州\",\"南京\", \"成都\", \"武汉\", \"杭州\", \"西安\", \"济南\", \"长春\", \"东莞\",\n\t\t\t\t\t\"沈阳\", \"天津\", \"哈尔滨\", \"长沙\", \"呼和浩特\", \"石家庄\", \"重庆\", \"无锡\", \"包头\",\n\t\t\t\t\t\"大连\", \"深圳\", \"福州\", \"海口\", \"乌鲁木齐\", \"兰州\", \"银川\", \"太原\", \"郑州\",\n\t\t\t\t\t\"合肥\", \"南昌\", \"南宁\", \"贵阳\", \"昆明\", \"拉萨\", \"西宁\", \"台北\", \"香港\", \"澳门\" };\n\tSparseBooleanArray sba = new SparseBooleanArray();\n\tprivate String nowcityname;\n\n\tpublic GridAddCityAdapter(Context context) {\n\t\tthis.mInflater = LayoutInflater.from(context);\n\n\t\tSQLiteCityManager sqlite = new SQLiteCityManager(context, \"weatherdb\", null, 1);\n\t\tSQLiteDatabase db = sqlite.getReadableDatabase();\n\t\tCursor cursor = db.query(\"coolWeather\", null, null, null, null, null, null);\n\t\twhile(cursor.moveToNext()){\n\t\t\tnowcityname = cursor.getString(cursor.getColumnIndex(\"cityname\"));\n\t\t\tLog.i(\"TAG\", nowcityname+\"-->nowcityname\");\n\t\t\tfor(int i=0;i<cityname.length;i++){\n\t\t\t\tif(nowcityname.equals(cityname[i])){\n\t\t\t\t\tsba.put(i, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic int getCount() {\n\t\treturn cityname == null ? 0 : cityname.length;\n\t}\n\n\t@Override\n\tpublic Object getItem(int position) {\n\t\treturn position;\n\t}\n\n\t@Override\n\tpublic long getItemId(int position) {\n\t\treturn position;\n\t}\n\n\t@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tif (convertView == null) {\n\t\t\tconvertView = mInflater.inflate(R.layout.item_gridview_addcity,\n\t\t\t\t\tparent, false);// 此处需要加上第二个参数parent，否则item中的设置无效。如item高度设置。\n\t\t}\n\t\tTextView citytext = (TextView) convertView.findViewById(R.id.citytext);\n\t\tcitytext.setText(cityname[position]);\n\n\t\t// 查询数据库，数据库中有该城市则设置勾选\n\t\tif (sba.get(position)) {\n\t\t\tcitytext.setCompoundDrawablesWithIntrinsicBounds(0, 0,\n\t\t\t\t\tR.drawable.city_checkbox_selected, 0);\n\t\t}\n\t\treturn convertView;\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/adapter/GridCityMAdapter.java",
    "content": "package com.htq.coolweather.adapter;\n\nimport java.util.List;\n\nimport android.app.Dialog;\nimport android.content.Context;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.graphics.Color;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.View.OnClickListener;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.Button;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.base.CHImageView;\nimport com.htq.coolweather.entity.CityManagerEntity;\nimport com.htq.coolweather.entity.SQLiteCityManager;\n\npublic class GridCityMAdapter extends BaseAdapter {\n\n\tprivate LayoutInflater mInflater;\n\tprivate List<CityManagerEntity> citymanager;\n\tprivate Context context;\n\tprivate Dialog mDialog;\n\n\tpublic GridCityMAdapter(Context context, List<CityManagerEntity> citymanager) {\n\t\tthis.context = context;\n\t\tthis.mInflater = LayoutInflater.from(context);\n\t\tthis.citymanager = citymanager;\n\t}\n\n\t@Override\n\tpublic int getCount() {\n\t\treturn citymanager == null ? 0 : citymanager.size();\n\t}\n\n\t@Override\n\tpublic Object getItem(int position) {\n\t\treturn position;\n\t}\n\n\t@Override\n\tpublic long getItemId(int position) {\n\t\treturn position;\n\t}\n\n\t@Override\n\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\t\tif (convertView == null) {\n\t\t\tconvertView = mInflater.inflate(R.layout.item_gridview_citymanager,\n\t\t\t\t\tparent, false);\n\t\t}\n\t\tfinal TextView grid_city = (TextView) convertView\n\t\t\t\t.findViewById(R.id.grid_city);\n\t\tTextView grid_temp = (TextView) convertView\n\t\t\t\t.findViewById(R.id.grid_temp);\n\t\tCHImageView grid_weatherimage = (CHImageView) convertView\n\t\t\t\t.findViewById(R.id.grid_weatherimage);\n\t\tTextView grid_weather = (TextView) convertView\n\t\t\t\t.findViewById(R.id.grid_weather); \n\t\tButton grid_set_normal = (Button) convertView\n\t\t\t\t.findViewById(R.id.grid_set_normal);\n\t\tTextView city_item_layout = (TextView) convertView\n\t\t\t\t.findViewById(R.id.city_item_layout);\n\t\tTextView grid_item_delete = (TextView) convertView\n\t\t\t\t.findViewById(R.id.grid_item_delete);\n\t\t\n\t\tgrid_item_delete.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tmDialog = new Dialog(context, \n\t\t\t\t\t\tandroid.R.style.Theme_DeviceDefault_Dialog_NoActionBar);\n\t\t\t\tView deleteview = LayoutInflater.from(context).inflate(R.layout.exitapp_dialog, null);\n\t\t\t\tTextView exitapp_text = (TextView) deleteview.findViewById(R.id.exitapp_text);\n\t\t\t\tButton leftbutton = (Button) deleteview.findViewById(R.id.leftbutton);\n\t\t\t\tButton rightbutton = (Button) deleteview.findViewById(R.id.rightbutton);\n\t\t\t\texitapp_text.setText(\"删除城市\");\n\t\t\t\tleftbutton.setText(\"确定\");\n\t\t\t\trightbutton.setText(\"取消\");\n\t\t\t\tleftbutton.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tSQLiteCityManager sqlite = new SQLiteCityManager(context,\n\t\t\t\t\t\t\t\t\"weatherdb\", null, 1);\n\t\t\t\t\t\tSQLiteDatabase db = sqlite.getWritableDatabase();\n\t\t\t\t\t\tString mcityname = grid_city.getText().toString();\n\t\t\t\t\t\tint index = db.delete(\"coolWeather\", \"cityname = ?\", new String []{mcityname});\n\t\t\t\t\t\tif(index == 0){\n\t\t\t\t\t\t\tToast.makeText(context, \"删除失败，请重试\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmDialog.dismiss();\n\t\t\t\t\t\tfor(int i = 0; i < citymanager.size(); i++){\n\t\t\t\t\t\t\tif(mcityname.equals(citymanager.get(i).getCity())){\n\t\t\t\t\t\t\t\tcitymanager.remove(i);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnotifyDataSetChanged();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\trightbutton.setOnClickListener(new OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tmDialog.dismiss();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tmDialog.setContentView(deleteview);\n\t\t\t\tmDialog.show();\n\t\t\t}\n\t\t});\n\t\tgrid_set_normal.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// 设为默认的点击事件\n\t\t\t}\n\t\t});\n\t\tif (position == citymanager.size() - 1) {\n\t\t\tgrid_city.setText(\"\");\n\t\t\tgrid_temp.setText(\"\");\n\t\t\tgrid_weather.setText(\"\");\n\t\t\tgrid_set_normal.setText(\"\");\n\t\t\tgrid_weatherimage.setImageDrawable(null);\n\t\t\tgrid_set_normal.setBackgroundColor(Color.TRANSPARENT);\n\t\t\tcity_item_layout.setBackgroundResource(R.drawable.cityadd_bg);\n\t\t\tgrid_item_delete.setText(\"\");\n\t\t} else {\n\t\t\tgrid_item_delete.setText(\"×\");\n\t\t\tgrid_city.setText(citymanager.get(position).getCity());\n\t\t\tgrid_temp.setText(citymanager.get(position).getTemp());\n\t\t\tgrid_weatherimage.loadImage(citymanager.get(position)\n\t\t\t\t\t.getWeatherimage());\n\t\t\tgrid_weather.setText(citymanager.get(position).getWeather());\n\t\t\tgrid_set_normal.setBackgroundResource(R.drawable.citym_normal_bg);\n\t\t\tif (position == 0) {\n\t\t\t\tgrid_set_normal.setText(\"默认\");\n\t\t\t} else {\n\t\t\t\tgrid_set_normal.setText(\"设为默认\");\n\t\t\t}\n\t\t\tcity_item_layout.setBackgroundResource(Color.TRANSPARENT);\n\t\t}\n\t\treturn convertView;\n\t}\n\n\tpublic void setCitymanager(List<CityManagerEntity> citymanager) {\n\t\tthis.citymanager = citymanager;\n\t}\n\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/adapter/GridTodayCAdapter.java",
    "content": "package com.htq.coolweather.adapter;\n\nimport java.util.List;\n\nimport android.content.Context;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.entity.LivingIndexEntity;\n\npublic class GridTodayCAdapter extends BaseAdapter {\n\n\tprivate LayoutInflater mInflater;\n\tprivate List<LivingIndexEntity> sportIndex;\n\tprivate int[] resours = {  \n\t\t    R.drawable.ic_todaycan_dress,\n\t\t\tR.drawable.ic_todaycan_carwash, R.drawable.ic_todaycan_tour,\n\t\t\tR.drawable.ic_todaycan_coldl, R.drawable.ic_todaycan_sport,\n\t\t\tR.drawable.ic_todaycan_ultravioletrays };\n\n\tpublic GridTodayCAdapter(Context context, List<LivingIndexEntity> sportIndex) {\n\t\tthis.mInflater = LayoutInflater.from(context);\n\t\tthis.sportIndex = sportIndex;\n\t}\n\n\t@Override\n\tpublic int getCount() {\n\t\treturn sportIndex == null ? 0 : sportIndex.size();\n\t}\n\n\t@Override\n\tpublic Object getItem(int position) {\n\t\treturn position;\n\t}\n\n\t@Override\n\tpublic long getItemId(int position) {\n\t\treturn position;\n\t}\n\n\t@Override\n\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\t\tif (convertView == null) {\n\t\t\t// 此处需要加上第二个参数parent，否则item中的设置无效。如item高度设置。\n\t\t\tconvertView = mInflater.inflate(R.layout.item_gridview_todaycan,\n\t\t\t\t\tparent, false);\n\t\t}\n\t\tTextView dothing = (TextView) convertView.findViewById(R.id.dothing);\n\t\tTextView index = (TextView) convertView.findViewById(R.id.index);\n\t\tImageView image_index = (ImageView) convertView\n\t\t\t\t.findViewById(R.id.image_index);\n\t\tImageView image_click = (ImageView) convertView\n\t\t\t\t.findViewById(R.id.image_click);\n\n\t\t// 设置数据\n\t\tif (position == 0){\n\t\t\tdothing.setText(\"穿衣指数\");\n\t\t}else if (position == 1) {\n\t\t\tdothing.setText(\"洗车指数\");\n\t\t}else if (position == 2){\n\t\t\tdothing.setText(\"旅游指数\");\n\t\t}else if (position == 3) {\n\t\t\tdothing.setText(\"感冒指数\");\n\t\t}else if (position == 4) {\n\t\t\tdothing.setText(\"运动指数\");\n\t\t}else if (position == 5) {\n\t\t\tdothing.setText(\"紫外线指数\");\n\t\t}\n\t\telse {\n\t\t\tdothing.setText(sportIndex.get(position).getTipt());\n\t\t}\n\n\t\tindex.setText(\"点击查看详情\");\n\n\t\tLog.i(\"TAG\", sportIndex.size()+\"sportIndex.size()\");\n\t\timage_index.setBackgroundResource(resours[position]);\n\t\timage_click.setBackgroundResource(R.drawable.ic_todaycan_clickbt);\n\t\treturn convertView;\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/adapter/ListWeatherAdapter.java",
    "content": "package com.htq.coolweather.adapter;\n\nimport java.util.List;\n\nimport android.content.Context;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.TextView;\n\nimport com.htq.coolweather.R;\nimport com.htq.coolweather.base.CHImageView;\nimport com.htq.coolweather.entity.WeatherSubEntity;\n\npublic class ListWeatherAdapter extends BaseAdapter {\n\n\tprivate LayoutInflater mInflater;\n\tprivate List<WeatherSubEntity> tweather;\n\n\tpublic ListWeatherAdapter(Context context, List<WeatherSubEntity> tweather) {\n\t\tthis.mInflater = LayoutInflater.from(context);\n\t\tthis.tweather = tweather;\n\t}\n\n\t@Override\n\tpublic int getCount() {\n\t\treturn tweather == null ? 0 : tweather.size();\n\t}\n\n\t@Override\n\tpublic Object getItem(int position) {\n\t\treturn position;\n\t}\n\n\t@Override\n\tpublic long getItemId(int position) {\n\t\treturn position;\n\t}\n\n\t@Override\n\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\t\tif (convertView == null) {\n\t\t\tconvertView = mInflater.inflate(R.layout.item_listview_tomorrow,\n\t\t\t\t\tnull);\n\t\t}\n\t\t// 日期\n\t\tTextView list_date_nextday = (TextView) convertView\n\t\t\t\t.findViewById(R.id.list_date_nextday);\n\t\tif (position > 0) {\n\t\t\tlist_date_nextday.setText(tweather.get(position).getDate());\n\t\t} else if (position == 0) {\n\t\t\tlist_date_nextday.setText(\"今天\");\n\t\t} \n\n\t\t// 白天天气图片\n\t\tCHImageView list_day_picture = (CHImageView) convertView\n\t\t\t\t.findViewById(R.id.list_day_picture);\n\t\tString dayp = tweather.get(position).getDayPictureUrl();\n\t\tlist_day_picture.loadImage(dayp);\n\t\t\n\t\t// 夜晚天气图片\n\t\tCHImageView list_night_picture = (CHImageView) convertView\n\t\t\t\t.findViewById(R.id.list_night_picture);\n\t\tString nightp = tweather.get(position).getNightPictureUrl();\n\t\tlist_night_picture.loadImage(nightp);\n\n\t\t// 天气情况\n\t\tTextView list_weather = (TextView) convertView\n\t\t\t\t.findViewById(R.id.list_weather);\n\t\tlist_weather.setText(tweather.get(position).getWeather());\n\t\t// 温度\n\t\tTextView list_temperature = (TextView) convertView\n\t\t\t\t.findViewById(R.id.list_temperature);\n\t\tString str = tweather.get(position).getTemperature();\n\t\tif(str.length() > 4){\n\t\t\t//默认将最低温度显示在前面的算法\n\t\t\tString str1 = str.substring(0, str.length()-1);\n\t\t\tString str2 = str.substring(str.length()-1, str.length());\n\t\t\tLog.i(\"TAG\", str2);\n\t\t\tString [] mstr = str1.split(\"~\", 2);\n\t\t\tlist_temperature.setText(mstr[1]+\" ~ \"+mstr[0]+str2);\n\t\t}else{\n\t\t\tlist_temperature.setText(str);\n\t\t}\n\t\t\n\t\t// 风力\n\t\tTextView list_wind = (TextView) convertView\n\t\t\t\t.findViewById(R.id.list_wind);\n\t\tlist_wind.setText(tweather.get(position).getWind());\n\n\t\treturn convertView;\n\t}\n\n\t/**\n\t * 屏蔽item的点击事件\n\t */\n\t@Override\n\tpublic boolean isEnabled(int position) {\n\t\treturn false;\n\t}\n\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/base/Appliction.java",
    "content": "package com.htq.coolweather.base;\n\nimport android.app.Application;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.net.ConnectivityManager;\nimport android.net.NetworkInfo;\nimport android.text.TextDirectionHeuristic;\n\nimport com.htq.coolweather.utils.SharePrefrenceUtil;\nimport com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;\nimport com.nostra13.universalimageloader.core.ImageLoader;\nimport com.nostra13.universalimageloader.core.ImageLoaderConfiguration;\nimport com.nostra13.universalimageloader.core.assist.QueueProcessingType;\n\npublic class Appliction extends Application{\n\t\n\t@Override\n\tpublic void onCreate() {\n\t\t\n\t\tinitImageLoader(this);\n\t}\n\t\n\tprivate void initImageLoader(Context ctx) {\n\t\tImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(\n\t\t\t\tctx).threadPriority(Thread.NORM_PRIORITY - 2)\n\t\t\t\t.denyCacheImageMultipleSizesInMemory()\n\t\t\t\t.discCacheFileNameGenerator(new Md5FileNameGenerator())\n\t\t\t\t.tasksProcessingOrder(QueueProcessingType.LIFO)\n\t\t\t\t.discCacheSize(32 * 1024 * 1024)\n\t\t\t\t.memoryCacheSize(4 * 1024 * 1024).enableLogging().build();\n\t\tImageLoader.getInstance().init(config);\n\t\t\n\t}\n\t\n\t\n\tpublic static boolean isNetWorkConnect(Context context)\n\t{\n\t\tConnectivityManager connectivityManager=(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tNetworkInfo networkInfo=connectivityManager.getActiveNetworkInfo();\n\t\tif(networkInfo==null||!networkInfo.isAvailable())\n\t    \treturn false;\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/base/AutoLocation.java",
    "content": "package com.htq.coolweather.base;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport android.location.Location;\nimport android.location.LocationListener;\nimport android.location.LocationManager;\nimport android.os.Bundle;\nimport android.os.IBinder;\nimport android.widget.Toast;\n\npublic class AutoLocation extends Service implements LocationListener{\n\n\tprivate LocationManager locationmanager;\n\t\n\t@Override\n\tpublic IBinder onBind(Intent intent) {\n\t\treturn null;\n\t}\n\t\n\t@Override\n\tpublic void onCreate() {\n\t\tlocationmanager = (LocationManager) getSystemService(LOCATION_SERVICE);\n\t}\n\n\n\t@Override\n\tpublic int onStartCommand(Intent intent, int flags, int startId) {\n\t\tif(locationmanager.getProvider(LocationManager.NETWORK_PROVIDER) != null){\n\t\t\tlocationmanager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);\n\t\t}else if(locationmanager.getProvider(LocationManager.GPS_PROVIDER) != null){\n\t\t\tlocationmanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);\n\t\t}else{\n\t\t\tToast.makeText(this, \"无法定位\", Toast.LENGTH_SHORT).show();\n\t\t}\n\t\treturn super.onStartCommand(intent, flags, startId);\n\t}\n\n\t@Override\n\tpublic boolean stopService(Intent name) {\n\t\treturn super.stopService(name);\n\t}\n\n\t@Override\n\tpublic void onLocationChanged(Location location) {\n\t\t//通知Activity\n\t\tIntent intent = new Intent();\n\t\tintent.setAction(\"locationAction\");\n\t\tintent.putExtra(\"location\", location.toString());\n\t\tsendBroadcast(intent);\n\t\t//移除监听，停止服务\n\t\tlocationmanager.removeUpdates(this);\n\t\tstopSelf();\n\t}\n\n\t@Override\n\tpublic void onStatusChanged(String provider, int status, Bundle extras) {\n\t\t\n\t}\n\n\t@Override\n\tpublic void onProviderEnabled(String provider) {\n\t\t\n\t}\n\n\t@Override\n\tpublic void onProviderDisabled(String provider) {\n\t\t\n\t}\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/base/CHImageView.java",
    "content": "/**\n * File:IVideoImageView.java\n * Date:2013-12-2\n *\n * 四川长虹网络科技有限责任公司 (智能应用研发�?© 版权�?�� \n */\npackage com.htq.coolweather.base;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.util.AttributeSet;\nimport android.widget.ImageView;\n\nimport com.nostra13.universalimageloader.core.DisplayImageOptions;\nimport com.nostra13.universalimageloader.core.ImageLoader;\n\n/**\n * 继承自ImageView，用于异步加载图片，在下载图片时使用设置的loading图片占位，图片下载好后刷新View\n * \n * @author 段文\n */\npublic class CHImageView extends ImageView {\n\t/**\n\t * 用于记录默认下载中状态的图片\n\t */\n\tprivate int downLoadingImageId = 0;\n\tprivate int downLoadingImagefailureId = 0;\n\t// 图片是否加载成功\n\tprivate boolean loadSuccess = false;\n\n\t/**\n\t * 不设置将使用默认图片 设置下载中，与加载失败的图片,\n\t * \n\t * @param downlding\n\t *            加载�? * @param failureId 加载失败\n\t */\n\tpublic void setDefultDownLoadAndFailureImage(int downlding, int failureId) {\n\t\tdownLoadingImageId = downlding;\n\t\tdownLoadingImagefailureId = failureId;\n\t}\n\n\tpublic CHImageView(Context context) {\n\t\tsuper(context);\n\t}\n\n\tpublic CHImageView(Context context, AttributeSet attrs) {\n\t\tsuper(context, attrs);\n\t}\n\n\tpublic CHImageView(Context context, AttributeSet attrs, int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t}\n\n\t/**\n\t * 对外接口，用于调用ImageView的异步下载图片功�? *\n\t * \n\t * @param url\n\t *            图片的URL\n\t */\n\tpublic void loadImage(String url) {\n\n\t\tDisplayImageOptions options = new DisplayImageOptions.Builder()\n\t\t\t\t.showStubImage(downLoadingImageId)\n\t\t\t\t.showImageForEmptyUri(downLoadingImagefailureId)\n\t\t\t\t.cacheInMemory().cacheOnDisc()\n\t\t\t\t.showImageOnFail(downLoadingImagefailureId)\n\t\t\t\t.bitmapConfig(Bitmap.Config.RGB_565)\n\t\t\t\t.build();\n\t\tImageLoader.getInstance().displayImage(url, this,options);\n//\t\t\n//\t\tImageLoader.getInstance().loadImage(url, options,\n//\t\t\t\tnew ImageLoadingListener() {\n//\n//\t\t\t\t\t@Override\n//\t\t\t\t\tpublic void onLoadingStarted(String arg0, View arg1) {\n//\t\t\t\t\t\tloadSuccess = false;\n//\t\t\t\t\t\tsetImageResource(downLoadingImageId);\n//\t\t\t\t\t}\n//\n//\t\t\t\t\t@Override\n//\t\t\t\t\tpublic void onLoadingFailed(String arg0, View arg1,\n//\t\t\t\t\t\t\tFailReason arg2) {\n//\t\t\t\t\t\tloadSuccess = false;\n//\t\t\t\t\t\tsetImageResource(downLoadingImagefailureId);\n//\t\t\t\t\t}\n//\n//\t\t\t\t\t@Override\n//\t\t\t\t\tpublic void onLoadingComplete(String arg0, View arg1,\n//\t\t\t\t\t\t\tBitmap arg2) {\n//\t\t\t\t\t\t\n//\t\t\t\t\t\tif (getTag() == null || arg0.equals(getTag())) {\n//\t\t\t\t\t\t\tloadSuccess = true;\n//\t\t\t\t\t\t\tsetImageBitmap(arg2);\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\n//\t\t\t\t\t@Override\n//\t\t\t\t\tpublic void onLoadingCancelled(String arg0, View arg1) {\n//\t\t\t\t\t\tloadSuccess = false;\n//\t\t\t\t\t\tsetImageResource(downLoadingImagefailureId);\n//\t\t\t\t\t}\n//\t\t\t\t});\n\t}\n\n\tpublic boolean isLoadSuccess() {\n\t\treturn loadSuccess;\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/base/MHttpEntity.java",
    "content": "package com.htq.coolweather.base;\n\nimport java.io.IOException;\nimport java.net.SocketTimeoutException;\n\nimport org.apache.http.HttpEntity;\nimport org.apache.http.HttpResponse;\nimport org.apache.http.client.ClientProtocolException;\nimport org.apache.http.client.HttpClient;\nimport org.apache.http.client.methods.HttpGet;\nimport org.apache.http.impl.client.DefaultHttpClient;\nimport org.apache.http.params.HttpConnectionParams;\n\nimport android.net.Uri;\nimport android.os.Message;\n\npublic class MHttpEntity {\n\t\n\tprivate Message message;\n\tprivate HttpEntity hentity;\n\tpublic static final int succeed = 1;\n\tpublic static final int fail = 2;\n\tpublic static final int nonet = 3;\n\t\n\tpublic Message getMessage() {\n\t\treturn message;\n\t}\n\tpublic void setMessage(Message message) {\n\t\tthis.message = message;\n\t}\n\tpublic HttpEntity getHentity() {\n\t\treturn hentity;\n\t}\n\tpublic void setHentity(HttpEntity hentity) {\n\t\tthis.hentity = hentity;\n\t}\n\n\tpublic static MHttpEntity sendhttpclient(String str) {\n\t\tMHttpEntity mhe = new MHttpEntity();\n\t\tMessage Mesg = Message.obtain();\n\t\tHttpEntity he = null;\n\t\tHttpClient hClient = new DefaultHttpClient();// 实例化得到一个网络连接对象\n\t\tHttpConnectionParams.setConnectionTimeout(hClient.getParams(), 5000);//连接超时设置\n\t\tString mstr = Uri.decode(str);// 将String类型转为uri.有中文则必有此句。\n\t\tHttpGet hget = new HttpGet(mstr);// 创建Http请求(get请求)\n\t\ttry {\n\t\t\tHttpResponse re = hClient.execute(hget);// 执行一个请求\n\t\t\tif (re.getStatusLine().getStatusCode() == 200) {\n\t\t\t\the = re.getEntity();// 获得数据实体\n\t\t\t\tMesg.arg1 = succeed;// 保存网络状态\n\t\t\t} else {\n\t\t\t\tMesg.arg1 = fail;// 保存网络状态\n\t\t\t}\n\t\t} catch (SocketTimeoutException e) {\n\t\t\tMesg.arg1 = fail;\n\t\t\te.printStackTrace();\n\t\t} catch (ClientProtocolException e) {\n\t\t\tMesg.arg1 = fail;\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tMesg.arg1 = fail;\n\t\t\te.printStackTrace();\n\t\t}\n\t\tmhe.setMessage(Mesg);\n\t\tmhe.setHentity(he);\n\t\treturn mhe;\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/base/SQLiteCityManager.java",
    "content": "package com.htq.coolweather.base;\n\nimport android.content.Context;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.database.sqlite.SQLiteDatabase.CursorFactory;\nimport android.database.sqlite.SQLiteOpenHelper;\n\npublic class SQLiteCityManager extends SQLiteOpenHelper{\n\n\tpublic SQLiteCityManager(Context context, String name,\n\t\t\tCursorFactory factory, int version) {\n\t\tsuper(context, name, factory, version);\n\t}\n\n\t@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tString sql = \"create table coolWeather(_id integer primary key autoincrement, cityname varchar(20), \"\n\t\t\t\t+ \"imageurl varchar(20), weather varchar(20), temp varchar(20));\";\n\t\tdb.execSQL(sql);\n\t}\n\n\t@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"drop table if exists person;\");\n\t}\n\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/base/SendDataEntity.java",
    "content": "package com.htq.coolweather.base;\n\n\npublic class SendDataEntity {\n\n\tpublic static String city = \"\";\n\tpublic static String json = \"json\";\n\tpublic static String ak = \"iGs8rFvzh1e8c7C9DjXT5toK\";\n\t\n\tpublic static void setCity(String city) {\n\t\tSendDataEntity.city = city;\n\t}\n\tpublic static void setJson(String json) {\n\t\tSendDataEntity.json = json;\n\t}\n\tpublic static void setAk(String ak) {\n\t\tSendDataEntity.ak = ak;\n\t}\n\tpublic static String getCity() {\n\t\treturn city;\n\t}\n\tpublic static String getJson() {\n\t\treturn json;\n\t}\n\tpublic static String getAk() {\n\t\treturn ak;\n\t}\n\tpublic static String getData() {\n\t\treturn \"http://api.map.baidu.com/telematics/v3/weather?location=\" +\n\t\t\t\tcity + \"&output=\"+ json +\"&ak=\"+ ak;\n\t}\n\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/BgPicEntity.java",
    "content": "package com.htq.coolweather.entity;\n\nimport android.graphics.Bitmap;\n\npublic class BgPicEntity {\n\tpublic Bitmap bitmap;\n\tpublic String path;\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/CityManagerEntity.java",
    "content": "package com.htq.coolweather.entity;\n\n\npublic class CityManagerEntity {\n\n\tprivate String city;//城市\n\tprivate String weatherimage;//天气图片\n\tprivate String temp;//温度\n\tprivate String weather;//天气\n\tprivate String dec;//描述\n\t\n\tpublic String getWeather() {\n\t\treturn weather;\n\t}\n\tpublic void setWeather(String weather) {\n\t\tthis.weather = weather;\n\t}\n\tpublic String getCity() {\n\t\treturn city;\n\t}\n\tpublic void setCity(String city) {\n\t\tthis.city = city;\n\t}\n\tpublic String getWeatherimage() {\n\t\treturn weatherimage;\n\t}\n\tpublic void setWeatherimage(String weatherimage) {\n\t\tthis.weatherimage = weatherimage;\n\t}\n\tpublic String getTemp() {\n\t\treturn temp;\n\t}\n\tpublic void setTemp(String temp) {\n\t\tthis.temp = temp;\n\t}\n\tpublic String getDec() {\n\t\treturn dec;\n\t}\n\tpublic void setDec(String dec) {\n\t\tthis.dec = dec;\n\t}\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/LivingIndexEntity.java",
    "content": "package com.htq.coolweather.entity;\n\n\npublic class LivingIndexEntity {\n\n\tprivate String title;//标题(穿衣，洗车，旅游，感冒 ，运动，紫外线强度)\n\tprivate String suitable;//是否适宜\n\tprivate String tipt;//各项指数名称\n\tprivate String des;//简介\n\t\n\tpublic String getTitle() {\n\t\treturn title;\n\t}\n\tpublic void setTitle(String title) {\n\t\tthis.title = title;\n\t}\n\tpublic String getZs() {\n\t\treturn suitable;\n\t}\n\tpublic void setZs(String suitable) {\n\t\tthis.suitable = suitable;\n\t}\n\tpublic String getTipt() {\n\t\treturn tipt;\n\t}\n\tpublic void setTipt(String tipt) {\n\t\tthis.tipt = tipt;\n\t}\n\tpublic String getDes() {\n\t\treturn des;\n\t}\n\tpublic void setDes(String des) {\n\t\tthis.des = des;\n\t}\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/MHttpEntity.java",
    "content": "package com.htq.coolweather.entity;\n\nimport java.io.IOException;\nimport java.net.SocketTimeoutException;\n\nimport org.apache.http.HttpEntity;\nimport org.apache.http.HttpResponse;\nimport org.apache.http.client.ClientProtocolException;\nimport org.apache.http.client.HttpClient;\nimport org.apache.http.client.methods.HttpGet;\nimport org.apache.http.impl.client.DefaultHttpClient;\nimport org.apache.http.params.HttpConnectionParams;\n\nimport android.net.Uri;\nimport android.os.Message;\nimport android.util.Log;\n\npublic class MHttpEntity {//之所以命名为MHttpEntity是因为在安卓中已存在HttpEntity\n\t\n\tprivate Message message;\n\tprivate HttpEntity hentity;\n\tpublic static final int succeed = 1;\n\tpublic static final int fail = 2;\n\tpublic static final int nonet = 3;\n\t\n\tpublic Message getMessage() {\n\t\treturn message;\n\t}\n\tpublic void setMessage(Message message) {\n\t\tthis.message = message;\n\t}\n\tpublic HttpEntity getHentity() {\n\t\treturn hentity;\n\t}\n\tpublic void setHentity(HttpEntity hentity) {\n\t\tthis.hentity = hentity;\n\t}\n\n\tpublic static MHttpEntity sendHttpRequest(String str) {\n\t\tLog.i(\"TAG\", System.currentTimeMillis()+\"System.currentTimeMillis()333\");\n\t\tMHttpEntity mhe = new MHttpEntity();\n\t\tMessage Mesg = Message.obtain();\n\t\tHttpEntity he = null;\n\t\tHttpClient hClient = new DefaultHttpClient();// 实例化得到一个网络连接对象\n\t\tHttpConnectionParams.setConnectionTimeout(hClient.getParams(), 5000);//连接超时设置\n\t\tString mstr = Uri.decode(str);// 将String类型转为uri.有中文则必有此句。\n\t\tHttpGet hget = new HttpGet(mstr);// 创建Http请求(get请求)\n\t\ttry {\n\t\t\tHttpResponse re = hClient.execute(hget);// 执行一个请求\n\t\t\tif (re.getStatusLine().getStatusCode() == 200) {\n\t\t\t\the = re.getEntity();// 获得数据实体\n\t\t\t\tMesg.arg1 = succeed;// 保存网络状态\n\t\t\t} else {\n\t\t\t\tMesg.arg1 = fail;// 保存网络状态\n\t\t\t}\n\t\t} catch (SocketTimeoutException e) {\n\t\t\tMesg.arg1 = fail;\n\t\t\te.printStackTrace();\n\t\t} catch (ClientProtocolException e) {\n\t\t\tMesg.arg1 = fail;\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tMesg.arg1 = fail;\n\t\t\te.printStackTrace();\n\t\t}\n\t\tmhe.setMessage(Mesg);\n\t\tmhe.setHentity(he);\n\t\tLog.i(\"TAG\", mhe.getHentity() + \" mhe.getHentity()\");\n\t\treturn mhe;\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/ResponseWrapper.java",
    "content": "package com.htq.coolweather.entity;\n\nimport java.util.List;\n\n/**\n * \n * @author htq 爱丽颖的颖火虫\n * bolg:www.csdn.net/htq__\n */\npublic class ResponseWrapper {\n\n\tprivate int error;//错误次数\n\tprivate String status;//返回结果状态信息\n\tprivate String date;//当前时间\n\tprivate List<WeatherEntity> results;//天气预报信息\n\t\n\tpublic int getError() {\n\t\treturn error;\n\t}\n\tpublic void setError(int error) {\n\t\tthis.error = error;\n\t}\n\tpublic String getStatus() {\n\t\treturn status;\n\t}\n\tpublic void setStatus(String status) {\n\t\tthis.status = status;\n\t}\n\tpublic String getDate() {\n\t\treturn date;\n\t}\n\tpublic void setDate(String date) {\n\t\tthis.date = date;\n\t}\n\tpublic List<WeatherEntity> getResults() {\n\t\treturn results;\n\t}\n\tpublic void setResults(List<WeatherEntity> results) {\n\t\tthis.results = results;\n\t}\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/SQLiteCityManager.java",
    "content": "package com.htq.coolweather.entity;\n\nimport android.content.Context;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.database.sqlite.SQLiteDatabase.CursorFactory;\nimport android.database.sqlite.SQLiteOpenHelper;\n\npublic class SQLiteCityManager extends SQLiteOpenHelper{\n\n\tpublic SQLiteCityManager(Context context, String name,\n\t\t\tCursorFactory factory, int version) {\n\t\tsuper(context, name, factory, version);\n\t}\n\n\t@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tString sql = \"create table coolWeather(_id integer primary key autoincrement, cityname varchar(20), \"\n\t\t\t\t+ \"imageurl varchar(20), weather varchar(20), temp varchar(20));\";\n\t\tdb.execSQL(sql);\n\t}\n\n\t@Override\n\tpublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n\t\tdb.execSQL(\"drop table if exists person;\");\n\t}\n\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/SendDataEntity.java",
    "content": "package com.htq.coolweather.entity;\n\n/**\n * \n * @author htq \n * blog:http://www.csdn.net/htq__\n */\n\npublic class SendDataEntity {//通过百度地图定位得到的城市名来获取该城市的天气信息的实体类\n\n\tpublic static String city = \"\";\n\tpublic static String json = \"json\";\n\tpublic static String ak = \"iGs8rFvzh1e8c7C9DjXT5toK\";\n\t\n\tpublic static void setCity(String city) {\n\t\tSendDataEntity.city = city;\n\t}\n\tpublic static void setJson(String json) {\n\t\tSendDataEntity.json = json;\n\t}\n\tpublic static void setAk(String ak) {\n\t\tSendDataEntity.ak = ak;\n\t}\n\tpublic static String getCity() {\n\t\treturn city;\n\t}\n\tpublic static String getJson() {\n\t\treturn json;\n\t}\n\tpublic static String getAk() {\n\t\treturn ak;\n\t}\n\tpublic static String getData() {\n\t\treturn \"http://api.map.baidu.com/telematics/v3/weather?location=\" +\n\t\t\t\tcity + \"&output=\"+ json +\"&ak=\"+ ak;\n\t}\n//http://api.map.baidu.com/telematics/v3/weather?location=武汉&output=json&ak=iGs8rFvzh1e8c7C9DjXT5toK\n\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/WeatherEntity.java",
    "content": "package com.htq.coolweather.entity;\n\nimport java.util.List;\n\n/**\n * \n * @author htq\n * bolg:www.csdn.net/htq__\n */\npublic class WeatherEntity {\n\n\tprivate String currentCity;//当前城市\n\tprivate List<WeatherSubEntity> weather_data;//天气预报信息\n\tprivate String pm25;//PM2.5值\n\tprivate List<LivingIndexEntity> index;//各项指数\n\t\n\tpublic String getCurrentCity() {\n\t\treturn currentCity;\n\t}\n\tpublic void setCurrentCity(String currentCity) {\n\t\tthis.currentCity = currentCity;\n\t}\n\tpublic List<WeatherSubEntity> getWeather_data() {\n\t\treturn weather_data;\n\t}\n\tpublic void setWeather_data(List<WeatherSubEntity> weather_data) {\n\t\tthis.weather_data = weather_data;\n\t}\n\tpublic String getPm25() {\n\t\treturn pm25;\n\t}\n\tpublic void setPm25(String pm25) {\n\t\tthis.pm25 = pm25;\n\t}\n\tpublic List<LivingIndexEntity> getIndex() {\n\t\treturn index;\n\t}\n\tpublic void setIndex(List<LivingIndexEntity> index) {\n\t\tthis.index = index;\n\t}\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/entity/WeatherSubEntity.java",
    "content": "package com.htq.coolweather.entity;\n\npublic class WeatherSubEntity {\n\n\tprivate String date;//天气预报时间\n\tprivate String dayPictureUrl;//白天的天气预报图片url\n\tprivate String nightPictureUrl;//晚上的天气预报图片url\n\tprivate String weather;//天气状况\n\tprivate String wind;//风力\n\tprivate String temperature;//温度\n\t\n\tpublic String getDate() {\n\t\treturn date;\n\t}\n\tpublic void setDate(String date) {\n\t\tthis.date = date;\n\t}\n\tpublic String getDayPictureUrl() {\n\t\treturn dayPictureUrl;\n\t}\n\tpublic void setDayPictureUrl(String dayPictureUrl) {\n\t\tthis.dayPictureUrl = dayPictureUrl;\n\t}\n\tpublic String getNightPictureUrl() {\n\t\treturn nightPictureUrl;\n\t}\n\tpublic void setNightPictureUrl(String nightPictureUrl) {\n\t\tthis.nightPictureUrl = nightPictureUrl;\n\t}\n\tpublic String getWeather() {\n\t\treturn weather;\n\t}\n\tpublic void setWeather(String weather) {\n\t\tthis.weather = weather;\n\t}\n\tpublic String getWind() {\n\t\treturn wind;\n\t}\n\tpublic void setWind(String wind) {\n\t\tthis.wind = wind;\n\t}\n\tpublic String getTemperature() {\n\t\treturn temperature;\n\t}\n\tpublic void setTemperature(String temperature) {\n\t\tthis.temperature = temperature;\n\t}\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/utils/CircleImageView.java",
    "content": "package com.htq.coolweather.utils;\n\nimport com.htq.coolweather.R;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapShader;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.ColorFilter;\nimport android.graphics.Matrix;\nimport android.graphics.Paint;\nimport android.graphics.RectF;\nimport android.graphics.Shader;\nimport android.graphics.drawable.BitmapDrawable;\nimport android.graphics.drawable.ColorDrawable;\nimport android.graphics.drawable.Drawable;\nimport android.net.Uri;\nimport android.util.AttributeSet;\nimport android.widget.ImageView;\n\npublic class CircleImageView extends ImageView {\n\n    private static final ScaleType SCALE_TYPE = ScaleType.CENTER_CROP;\n\n    private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;\n    private static final int COLORDRAWABLE_DIMENSION = 2;\n\n    private static final int DEFAULT_BORDER_WIDTH = 0;\n    private static final int DEFAULT_BORDER_COLOR = Color.BLACK;\n    private static final int DEFAULT_FILL_COLOR = Color.TRANSPARENT;\n    private static final boolean DEFAULT_BORDER_OVERLAY = false;\n\n    private final RectF mDrawableRect = new RectF();\n    private final RectF mBorderRect = new RectF();\n\n    private final Matrix mShaderMatrix = new Matrix();\n    private final Paint mBitmapPaint = new Paint();\n    private final Paint mBorderPaint = new Paint();\n    private final Paint mFillPaint = new Paint();\n\n    private int mBorderColor = DEFAULT_BORDER_COLOR;\n    private int mBorderWidth = DEFAULT_BORDER_WIDTH;\n    private int mFillColor = DEFAULT_FILL_COLOR;\n\n    private Bitmap mBitmap;\n    private BitmapShader mBitmapShader;\n    private int mBitmapWidth;\n    private int mBitmapHeight;\n\n    private float mDrawableRadius;\n    private float mBorderRadius;\n\n    private ColorFilter mColorFilter;\n\n    private boolean mReady;\n    private boolean mSetupPending;\n    private boolean mBorderOverlay;\n\n    public CircleImageView(Context context) {\n        super(context);\n\n        init();\n    }\n\n    public CircleImageView(Context context, AttributeSet attrs) {\n        this(context, attrs, 0);\n    }\n\n    public CircleImageView(Context context, AttributeSet attrs, int defStyle) {\n        super(context, attrs, defStyle);\n\n        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView, defStyle, 0);\n\n        mBorderWidth = a.getDimensionPixelSize(R.styleable.CircleImageView_civ_border_width, DEFAULT_BORDER_WIDTH);\n        mBorderColor = a.getColor(R.styleable.CircleImageView_civ_border_color, DEFAULT_BORDER_COLOR);\n        mBorderOverlay = a.getBoolean(R.styleable.CircleImageView_civ_border_overlay, DEFAULT_BORDER_OVERLAY);\n        mFillColor = a.getColor(R.styleable.CircleImageView_civ_fill_color, DEFAULT_FILL_COLOR);\n\n        a.recycle();\n\n        init();\n    }\n\n    private void init() {\n        super.setScaleType(SCALE_TYPE);\n        mReady = true;\n\n        if (mSetupPending) {\n            setup();\n            mSetupPending = false;\n        }\n    }\n\n    @Override\n    public ScaleType getScaleType() {\n        return SCALE_TYPE;\n    }\n\n    @Override\n    public void setScaleType(ScaleType scaleType) {\n        if (scaleType != SCALE_TYPE) {\n            throw new IllegalArgumentException(String.format(\"ScaleType %s not supported.\", scaleType));\n        }\n    }\n\n    @Override\n    public void setAdjustViewBounds(boolean adjustViewBounds) {\n        if (adjustViewBounds) {\n            throw new IllegalArgumentException(\"adjustViewBounds not supported.\");\n        }\n    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        if (mBitmap == null) {\n            return;\n        }\n\n        if (mFillColor != Color.TRANSPARENT) {\n            canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mDrawableRadius, mFillPaint);\n        }\n        canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mDrawableRadius, mBitmapPaint);\n        if (mBorderWidth != 0) {\n            canvas.drawCircle(getWidth() / 2.0f, getHeight() / 2.0f, mBorderRadius, mBorderPaint);\n        }\n    }\n\n    @Override\n    protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n        super.onSizeChanged(w, h, oldw, oldh);\n        setup();\n    }\n\n    public int getBorderColor() {\n        return mBorderColor;\n    }\n\n    public void setBorderColor( int borderColor) {\n        if (borderColor == mBorderColor) {\n            return;\n        }\n\n        mBorderColor = borderColor;\n        mBorderPaint.setColor(mBorderColor);\n        invalidate();\n    }\n\n    public void setBorderColorResource( int borderColorRes) {\n        setBorderColor(getContext().getResources().getColor(borderColorRes));\n    }\n\n    public int getFillColor() {\n        return mFillColor;\n    }\n\n    public void setFillColor( int fillColor) {\n        if (fillColor == mFillColor) {\n            return;\n        }\n\n        mFillColor = fillColor;\n        mFillPaint.setColor(fillColor);\n        invalidate();\n    }\n\n    public void setFillColorResource( int fillColorRes) {\n        setFillColor(getContext().getResources().getColor(fillColorRes));\n    }\n\n    public int getBorderWidth() {\n        return mBorderWidth;\n    }\n\n    public void setBorderWidth(int borderWidth) {\n        if (borderWidth == mBorderWidth) {\n            return;\n        }\n\n        mBorderWidth = borderWidth;\n        setup();\n    }\n\n    public boolean isBorderOverlay() {\n        return mBorderOverlay;\n    }\n\n    public void setBorderOverlay(boolean borderOverlay) {\n        if (borderOverlay == mBorderOverlay) {\n            return;\n        }\n\n        mBorderOverlay = borderOverlay;\n        setup();\n    }\n\n    @Override\n    public void setImageBitmap(Bitmap bm) {\n        super.setImageBitmap(bm);\n        mBitmap = bm;\n        setup();\n    }\n\n    @Override\n    public void setImageDrawable(Drawable drawable) {\n        super.setImageDrawable(drawable);\n        mBitmap = getBitmapFromDrawable(drawable);\n        setup();\n    }\n\n    @Override\n    public void setImageResource( int resId) {\n        super.setImageResource(resId);\n        mBitmap = getBitmapFromDrawable(getDrawable());\n        setup();\n    }\n\n    @Override\n    public void setImageURI(Uri uri) {\n        super.setImageURI(uri);\n        mBitmap = uri != null ? getBitmapFromDrawable(getDrawable()) : null;\n        setup();\n    }\n\n    @Override\n    public void setColorFilter(ColorFilter cf) {\n        if (cf == mColorFilter) {\n            return;\n        }\n\n        mColorFilter = cf;\n        mBitmapPaint.setColorFilter(mColorFilter);\n        invalidate();\n    }\n\n    private Bitmap getBitmapFromDrawable(Drawable drawable) {\n        if (drawable == null) {\n            return null;\n        }\n\n        if (drawable instanceof BitmapDrawable) {\n            return ((BitmapDrawable) drawable).getBitmap();\n        }\n\n        try {\n            Bitmap bitmap;\n\n            if (drawable instanceof ColorDrawable) {\n                bitmap = Bitmap.createBitmap(COLORDRAWABLE_DIMENSION, COLORDRAWABLE_DIMENSION, BITMAP_CONFIG);\n            } else {\n                bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), BITMAP_CONFIG);\n            }\n\n            Canvas canvas = new Canvas(bitmap);\n            drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());\n            drawable.draw(canvas);\n            return bitmap;\n        } catch (Exception e) {\n            e.printStackTrace();\n            return null;\n        }\n    }\n\n    private void setup() {\n        if (!mReady) {\n            mSetupPending = true;\n            return;\n        }\n\n        if (getWidth() == 0 && getHeight() == 0) {\n            return;\n        }\n\n        if (mBitmap == null) {\n            invalidate();\n            return;\n        }\n\n        mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);\n\n        mBitmapPaint.setAntiAlias(true);\n        mBitmapPaint.setShader(mBitmapShader);\n\n        mBorderPaint.setStyle(Paint.Style.STROKE);\n        mBorderPaint.setAntiAlias(true);\n        mBorderPaint.setColor(mBorderColor);\n        mBorderPaint.setStrokeWidth(mBorderWidth);\n\n        mFillPaint.setStyle(Paint.Style.FILL);\n        mFillPaint.setAntiAlias(true);\n        mFillPaint.setColor(mFillColor);\n\n        mBitmapHeight = mBitmap.getHeight();\n        mBitmapWidth = mBitmap.getWidth();\n\n        mBorderRect.set(0, 0, getWidth(), getHeight());\n        mBorderRadius = Math.min((mBorderRect.height() - mBorderWidth) / 2.0f, (mBorderRect.width() - mBorderWidth) / 2.0f);\n\n        mDrawableRect.set(mBorderRect);\n        if (!mBorderOverlay) {\n            mDrawableRect.inset(mBorderWidth, mBorderWidth);\n        }\n        mDrawableRadius = Math.min(mDrawableRect.height() / 2.0f, mDrawableRect.width() / 2.0f);\n\n        updateShaderMatrix();\n        invalidate();\n    }\n\n    private void updateShaderMatrix() {\n        float scale;\n        float dx = 0;\n        float dy = 0;\n\n        mShaderMatrix.set(null);\n\n        if (mBitmapWidth * mDrawableRect.height() > mDrawableRect.width() * mBitmapHeight) {\n            scale = mDrawableRect.height() / (float) mBitmapHeight;\n            dx = (mDrawableRect.width() - mBitmapWidth * scale) * 0.5f;\n        } else {\n            scale = mDrawableRect.width() / (float) mBitmapWidth;\n            dy = (mDrawableRect.height() - mBitmapHeight * scale) * 0.5f;\n        }\n\n        mShaderMatrix.setScale(scale, scale);\n        mShaderMatrix.postTranslate((int) (dx + 0.5f) + mDrawableRect.left, (int) (dy + 0.5f) + mDrawableRect.top);\n\n        mBitmapShader.setLocalMatrix(mShaderMatrix);\n    }\n\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/utils/SharePrefrenceUtil.java",
    "content": "package com.htq.coolweather.utils;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.content.SharedPreferences.Editor;\nimport android.graphics.Bitmap;\n\npublic class SharePrefrenceUtil {\n\n\n\tprivate static final String BG_PIC_PATH =\"bg_pic_path\";\n\tprivate SharedPreferences mSp;\n\tprivate  Editor mEditor;\n\tpublic SharePrefrenceUtil(Context context) {\n\t\tmSp = context.getSharedPreferences(\"coolWeather\",\n\t\t\t\tContext.MODE_WORLD_WRITEABLE);\n\t\tmEditor = mSp.edit();\n\t}\n\n\t/**\n\t * 保存背景皮肤图片的地址\n\t * @author: htq\n\t */\n\tpublic  void saveBgPicPath(String path)\n\t{\n\t\tmEditor.putString(BG_PIC_PATH, path);\n\t\tmEditor.commit();\n\t}\n\t/**\n\t * 获取背景皮肤图片的地址\n\t */\n\tpublic  String getPath() {\n\t\treturn mSp.getString(BG_PIC_PATH, null);\n\t}\n\n\t\n}\n"
  },
  {
    "path": "src/com/htq/coolweather/utils/SystemUtils.java",
    "content": "package com.htq.coolweather.utils;\n\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Bitmap.CompressFormat;\nimport android.net.Uri;\n\npublic class SystemUtils {\n\n\t/**\n\t * @author htq_\n\t * @param mActivity\n\t * bolg:www.csdn.net/htq__\n\t */\n\tpublic static void shareApp(Activity mActivity)\n\t{\n      String shareAppContent=\"各位亲爱的小伙伴们，我发现了一款简约好用且颜值爆表的天气APP酷我天气，分享给大家，记得关注作者的博客http://blog.csdn.net/htq__，福利多多哦！\";\n    \n      new File(mActivity.getFilesDir(), \"share.png\").deleteOnExit();\n\t\tFileOutputStream fileOutputStream=null;\n\t\ttry {\n\t\t\tfileOutputStream = mActivity.openFileOutput(\n\t\t\t\t\t\"share.png\", 1);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n     \n\t\t  Bitmap pic=BitmapFactory.decodeResource(mActivity.getResources(),com.htq.coolweather.R.drawable.cool_weather_icon);\n\t\t  pic.compress(CompressFormat.JPEG, 100,fileOutputStream);\n\t\t  \n      \n        Intent intent = new Intent(\"android.intent.action.SEND\");\n\t\tintent.setType(\"image/*\");\n\t\tintent.putExtra(\"sms_body\", shareAppContent);\n\t\tintent.putExtra(\"android.intent.extra.TEXT\",shareAppContent);\n\t\tintent.putExtra(\"android.intent.extra.STREAM\",\n\t\t\t\tUri.fromFile(new File(mActivity.getFilesDir(), \"share.png\")));\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\tmActivity.startActivity(Intent.createChooser(intent,\"好东西要与小伙伴们一起分享\"));\n\t}\n}\n"
  }
]