[
  {
    "path": ".gitignore",
    "content": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <option name=\"DEFAULT_COMPILER\" value=\"Javac\" />\n    <resourceExtensions />\n    <wildcardResourcePatterns>\n      <entry name=\"!?*.java\" />\n      <entry name=\"!?*.form\" />\n      <entry name=\"!?*.class\" />\n      <entry name=\"!?*.groovy\" />\n      <entry name=\"!?*.scala\" />\n      <entry name=\"!?*.flex\" />\n      <entry name=\"!?*.kt\" />\n      <entry name=\"!?*.clj\" />\n    </wildcardResourcePatterns>\n    <annotationProcessing>\n      <profile default=\"true\" name=\"Default\" enabled=\"false\">\n        <processorPath useClasspath=\"true\" />\n      </profile>\n    </annotationProcessing>\n  </component>\n</project>"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "content": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/encodings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Encoding\">\n    <file url=\"PROJECT\" charset=\"UTF-8\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleJvm\" value=\"1.8\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"EntryPointsManager\">\n    <entry_points version=\"2.0\" />\n  </component>\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectLevelVcsManager\" settingsEditedManually=\"false\">\n    <OptionsSetting value=\"true\" id=\"Add\" />\n    <OptionsSetting value=\"true\" id=\"Remove\" />\n    <OptionsSetting value=\"true\" id=\"Checkout\" />\n    <OptionsSetting value=\"true\" id=\"Update\" />\n    <OptionsSetting value=\"true\" id=\"Status\" />\n    <OptionsSetting value=\"true\" id=\"Edit\" />\n    <ConfirmationsSetting value=\"0\" id=\"Add\" />\n    <ConfirmationsSetting value=\"0\" id=\"Remove\" />\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_8\" default=\"true\" assert-keyword=\"true\" jdk-15=\"true\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/TaoSchool-master.iml\" filepath=\"$PROJECT_DIR$/TaoSchool-master.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"$PROJECT_DIR$\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "README.md",
    "content": "**该APP已经不再维护了，如果您需要的话 请看 https://github.com/Hankkin/Reading** \n*Reading是一款基于WanAndroid OpenApi开发的阅读类工具，如果你是一个热衷于Android开发者，那么这款软件能帮助你阅读精品Android文章。 同时Reading中还包含\"英文单词\"、\"账号本子\"、\"天气\"、\"查单词\"、\"快递查询\"等小工具。项目基于\"Kotlin+MVP\"架构开发，风格大概也许属于Material Desgin原质化风格，包含主题颜色切换、百变Logo、 等功能。在此感谢WanAndroid的OpenApi,以及其它开源项目的贡献。\n*\n# TaoSchool\n一款基于Material Desgin设计的APP\n\n###look at the screenshot:\n\n<img src=\"http://img.blog.csdn.net/20160101143739659\" width = \"320\" height = \"640\" alt=\"高仿微信群聊头像\" align=center />\n\n<img src=\"http://img.blog.csdn.net/20151229160604230\" width = \"200\" height = \"200\" alt=\"高仿微信群聊头像\" align=center />\n###download：\n网站： \nhttp://hankkin.bmob.cn \n\nPRE： \nhttp://pre.im/x9nH \n\n360开发者平台： \nhttp://zhushou.360.cn/detail/index/soft_id/3181637?recrefer=SE_D_%E6%B7%98School \n\n百度开发平台 \nhttp://shouji.baidu.com/soft/item?docid=8561791&from=&f=search_app_淘School%40list_1_title%401%40header_all_input \n\n###tech:\n1.Android Support Desgin\n\nCollapsingAvatarToolbar 头像随ListView滚动缩回到ActionBar特效 \nTextInputLayout带动画的输入框\n\n2.ActionBarDrawerToggle、DrawerLayout、ActionBar 结合\n\n3.RippleEffect水波纹效果\n\n4.PagerSlidingTabStrip+viewpager实现选项卡左右滑动\n\n5.FloatActiconButton悬浮按钮实现仿钉钉悬浮按钮\n\n6.PullToZoomScrollView实现下拉自动放大头部View\n\n7.materialdialog实现的对话框\n\n8.MaterialSpinner实现的带效果的spinner\n\n9.butterknife注解框架\n\nCSDN博客地址：http://blog.csdn.net/lyhhj/article/details/50413625\n\n微信：huang1019283569\n\n\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/app.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":app\" external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$/..\" external.system.id=\"GRADLE\" external.system.module.group=\"CompusTrading\" external.system.module.version=\"unspecified\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"android-gradle\" name=\"Android-Gradle\">\n      <configuration>\n        <option name=\"GRADLE_PROJECT_PATH\" value=\":app\" />\n      </configuration>\n    </facet>\n    <facet type=\"android\" name=\"Android\">\n      <configuration>\n        <option name=\"SELECTED_BUILD_VARIANT\" value=\"debug\" />\n        <option name=\"ASSEMBLE_TASK_NAME\" value=\"assembleDebug\" />\n        <option name=\"COMPILE_JAVA_TASK_NAME\" value=\"compileDebugSources\" />\n        <afterSyncTasks>\n          <task>generateDebugSources</task>\n        </afterSyncTasks>\n        <option name=\"ALLOW_USER_CONFIGURATION\" value=\"false\" />\n        <option name=\"MANIFEST_FILE_RELATIVE_PATH\" value=\"/src/main/AndroidManifest.xml\" />\n        <option name=\"RES_FOLDER_RELATIVE_PATH\" value=\"/src/main/res\" />\n        <option name=\"RES_FOLDERS_RELATIVE_PATH\" value=\"file://$MODULE_DIR$/src/main/res\" />\n        <option name=\"ASSETS_FOLDER_RELATIVE_PATH\" value=\"/src/main/assets\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" LANGUAGE_LEVEL=\"JDK_1_7\" inherit-compiler-output=\"false\">\n    <output url=\"file://$MODULE_DIR$/build/intermediates/classes/debug\" />\n    <output-test url=\"file://$MODULE_DIR$/build/intermediates/classes/test/debug\" />\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/r/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/aidl/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/rs/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/apt/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/resValues/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/r/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/shaders\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/rs\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/shaders\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/shaders\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/rs\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/shaders\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/rs\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/shaders\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/assets\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/blame\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/builds\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/classes\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental-classes\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental-safeguard\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental-verifier\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/instant-run-resources\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/instant-run-support\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/jniLibs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/manifests\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/reload-dex\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/res\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/restart-dex\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/rs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/shaders\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/split-apk\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/symbols\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/transforms\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/outputs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/tmp\" />\n    </content>\n    <orderEntry type=\"jdk\" jdkName=\"Android API 25 Platform\" jdkType=\"Android SDK\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"butterknife-7.0.1\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"design-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"transition-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"library-1.2.8\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-core-ui-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"library-1.1.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"fadingactionbar-3.1.2\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"glide-3.7.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-core-utils-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-fragment-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"library-2.4.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"fadingactionbar-abc-3.1.2\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"universal-image-loader-1.9.5\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-v4-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-compat-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"materialish-progress-1.7\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" scope=\"TEST\" name=\"hamcrest-core-1.3\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-media-compat-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"bmob-sdk-3.5.5\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"http-legacy-1.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" scope=\"TEST\" name=\"junit-4.12\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"appcompat-v7-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"recyclerview-v7-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-annotations-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-vector-drawable-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"animated-vector-drawable-25.2.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"org.apache.http.legacy-android-25\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 25\n    buildToolsVersion \"25.0.2\"\n    useLibrary 'org.apache.http.legacy'\n    defaultConfig {\n        applicationId \"com.hankkin.compustrading\"\n        minSdkVersion 14\n        targetSdkVersion 22\n        versionCode 3\n        versionName \"1.1.0\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(include: ['*.jar'], dir: 'libs')\n    testCompile 'junit:junit:4.12'\n    compile 'com.android.support:appcompat-v7:25.2.0'\n    compile 'cn.bmob.android:bmob-sdk:3.5.5'\n    compile 'cn.bmob.android:http-legacy:1.0'\n    compile 'com.android.support:support-v4:25.2.0'\n    compile 'com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2'\n    compile 'com.pnikosis:materialish-progress:1.7'\n    compile 'me.drakeet.materialdialog:library:1.2.8'\n    compile 'com.jakewharton:butterknife:7.0.1'\n    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'\n    compile 'com.weiwangcn.betterspinner:library:1.1.0'\n    compile 'com.nineoldandroids:library:2.4.0'\n    compile 'com.android.support:design:25.2.0'\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/Hankkin/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\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-optimizationpasses 5          # 指定代码的压缩级别\n-dontusemixedcaseclassnames   # 是否使用大小写混合\n-dontpreverify           # 混淆时是否做预校验\n-verbose                # 混淆时是否记录日志\n\n-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*  # 混淆时所采用的算法\n\n-keep public class * extends android.app.Activity      # 保持哪些类不被混淆\n-keep public class * extends android.app.Application   # 保持哪些类不被混淆\n-keep public class * extends android.app.Service       # 保持哪些类不被混淆\n-keep public class * extends android.content.BroadcastReceiver  # 保持哪些类不被混淆\n-keep public class * extends android.content.ContentProvider    # 保持哪些类不被混淆\n-keep public class * extends android.app.backup.BackupAgentHelper # 保持哪些类不被混淆\n-keep public class * extends android.preference.Preference        # 保持哪些类不被混淆\n-keep public class com.android.vending.licensing.ILicensingService    # 保持哪些类不被混淆\n\n-keepclasseswithmembernames class * {  # 保持 native 方法不被混淆\n    native <methods>;\n}\n-keepclasseswithmembers class * {   # 保持自定义控件类不被混淆\n    public <init>(android.content.Context, android.util.AttributeSet);\n}\n-keepclasseswithmembers class * {# 保持自定义控件类不被混淆\n    public <init>(android.content.Context, android.util.AttributeSet, int);\n}\n-keepclassmembers class * extends android.app.Activity { # 保持自定义控件类不被混淆\n    public void *(android.view.View);\n}\n-keepclassmembers enum * {     # 保持枚举 enum 类不被混淆\n    public static **[] values();\n    public static ** valueOf(java.lang.String);\n}\n-keep class * implements android.os.Parcelable { # 保持 Parcelable 不被混淆\n    public static final android.os.Parcelable$Creator *;\n}"
  },
  {
    "path": "app/src/androidTest/java/com/hankkin/compustrading/ApplicationTest.java",
    "content": "package com.hankkin.compustrading;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n    public ApplicationTest() {\n        super(Application.class);\n    }\n}"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.hankkin.compustrading\" >\n\n    <uses-permission android:name=\"android.permission.INTERNET\"/>\n    <uses-permission android:name=\"android.permission.CALL_PHONE\"/>\n    <uses-permission android:name=\"android.permission.CAMERA\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>\n    <uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>\n    <uses-permission android:name=\"android.permission.PROCESS_OUTGOING_CALLS\"/>\n    <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>\n    <uses-permission android:name=\"android.permission.INTERACT_ACROSS_USERS_FULL\"/>\n    <uses-permission android:name=\"android.permission.READ_CONTACTS\"/>\n    <uses-permission android:name=\"android.permission.WAKE_LOCK\"/>\n    <uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>\n\n    <uses-feature android:name=\"android.hardware.Camera\"/>\n    <uses-feature android:name=\"android.hardware.camera.autofocus\"/>\n\n    <uses-permission android:name=\"android.permission.READ_LOGS\"/>\n    <uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>\n    <uses-permission android:name=\"android.permission.CAMERA\"/>\n\n\n    <!-- BmobSDK权限 -->\n    <!--允许联网 -->\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <!--获取GSM（2g）、WCDMA（联通3g）等网络状态的信息  -->\n    <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n    <!--获取wifi网络状态的信息 -->\n    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n    <!--保持CPU 运转，屏幕和键盘灯有可能是关闭的,用于文件上传和下载 -->\n    <uses-permission android:name=\"android.permission.WAKE_LOCK\" />\n    <!--获取sd卡写的权限，用于文件上传和下载-->\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n    <!--推送权限-->\n    <!--允许读取手机状态 -->\n    <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n    <!--允许接收屏幕解锁广播 -->\n    <uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\" />\n    <!--允许接收开机广播 -->\n    <uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />\n    <!-- 其他权限 -->\n    <uses-permission android:name=\"android.permission.VIBRATE\" />\n\n    <meta-data android:value=\"Channel ID\" android:name=\"BMOB_CHANNEL\"/>\n    <!-- 往SDCard写入数据权限 -->\n    <application\n        android:name=\".Application.MyApplication\"\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/logo\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme.WithoutActionBar\" >\n        <activity\n            android:name=\".MainActivity\"\n            android:label=\"@string/app_name\" >\n        </activity>\n        <activity\n            android:name=\".activity.MainShowActivity\"\n            android:theme=\"@style/AppTheme\" >\n        </activity>\n        <activity\n            android:name=\".activity.PersonActivity\"\n            android:label=\"@string/title_activity_person\" >\n        </activity>\n        <activity\n            android:name=\".activity.ProdectDetailActivity\"\n            android:label=\"@string/title_activity_prodect_detail\" >\n        </activity>\n        <activity\n            android:name=\".activity.LoginActivity\"\n            android:label=\"@string/title_activity_login\" >\n        </activity>\n        <activity\n            android:name=\".activity.RegisterActivity\"\n            android:label=\"@string/title_activity_register\" >\n        </activity>\n        <activity\n            android:name=\".activity.NewProductActivity\"\n            android:label=\"@string/title_activity_new_product\" >\n        </activity>\n        <activity\n            android:name=\".activity.SearchProActivity\"\n            android:label=\"@string/title_activity_search_pro\" >\n        </activity>\n        <activity\n            android:name=\".activity.SplasActivity\"\n            android:label=\"@string/app_name\" >\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        <activity\n            android:name=\"cn.bmob.v3.update.UpdateDialogActivity\"\n            android:theme=\"@android:style/Theme.Translucent.NoTitleBar\" >\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/Application/MyApplication.java",
    "content": "package com.hankkin.compustrading.Application;\n\nimport android.app.Application;\nimport android.graphics.Bitmap;\nimport android.os.Environment;\nimport android.os.Handler;\n\nimport com.hankkin.compustrading.R;\nimport com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;\nimport com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator;\nimport com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache;\nimport com.nostra13.universalimageloader.core.DisplayImageOptions;\nimport com.nostra13.universalimageloader.core.ImageLoader;\nimport com.nostra13.universalimageloader.core.ImageLoaderConfiguration;\nimport com.nostra13.universalimageloader.core.assist.ImageScaleType;\nimport com.nostra13.universalimageloader.core.assist.QueueProcessingType;\nimport com.nostra13.universalimageloader.core.decode.BaseImageDecoder;\nimport com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;\nimport com.nostra13.universalimageloader.core.download.BaseImageDownloader;\n\nimport java.io.File;\n\nimport cn.bmob.v3.Bmob;\n\n/**\n * Created by Hankkin on 15/11/28.\n */\npublic class MyApplication extends Application {\n\n    private static String DB_PATH = null;\n    private MyApplication instance;\n\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        instance = this;\n        //初始化Bmob Key\n        Bmob.initialize(this,\"b493c51d9d5c205dde89e4f4dedc10cd\");\n\n        initImageloader();\n    }\n\n    /**\n     * 初始化imageloader\n     * by Hankkin at:2015-12-23 19:29:57\n     */\n    public void initImageloader(){\n        DisplayImageOptions options = new DisplayImageOptions.Builder()\n                .showImageOnLoading(R.drawable.ic_download)\n                .showImageOnFail(R.drawable.ic_download)\n                .resetViewBeforeLoading(false)  // default\n                .delayBeforeLoading(0)\n                .cacheInMemory(true) // default\n                .cacheOnDisk(true) // default\n                .considerExifParams(true) // default\n                .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) // default\n                .bitmapConfig(Bitmap.Config.ARGB_8888) // default\n                .displayer(new SimpleBitmapDisplayer()) // default\n                .handler(new Handler()) // default\n                .build();\n\n        // This configuration tuning is custom. You can tune every option, you may tune some of them,\n        // or you can create default configuration by\n        // ImageLoaderConfiguration.createDefault(this);\n        // method.\n//        File cacheDir = StorageUtils.getCacheDirectory(context);\n        File file = new File(Environment.getExternalStorageDirectory().getPath() + \"/compustrading\");\n        if (!file.exists()) {\n            file.mkdir();\n        }\n        String path = file.getAbsolutePath() + \"/files\";\n        File fileSD = new File(path);\n        if (!fileSD.exists()) {\n            fileSD.mkdir();\n        }\n        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())\n                .memoryCacheExtraOptions(480, 800) // default = device screen dimensions\n                .diskCacheExtraOptions(480, 800, null)\n                .threadPoolSize(3) // default\n                .threadPriority(Thread.NORM_PRIORITY - 1) // default\n                .tasksProcessingOrder(QueueProcessingType.FIFO) // default\n                .denyCacheImageMultipleSizesInMemory()\n                .memoryCache(new LruMemoryCache(2 * 1024 * 1024))\n                .memoryCacheSize(2 * 1024 * 1024)\n                .memoryCacheSizePercentage(13) // default\n                .diskCache(new UnlimitedDiskCache(file)) // default\n                .diskCacheSize(50 * 1024 * 1024)\n                .diskCacheFileCount(1000)\n                .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default\n                .imageDownloader(new BaseImageDownloader(getApplicationContext())) // default\n                .imageDecoder(new BaseImageDecoder(true)) // default\n                .defaultDisplayImageOptions(options) // default\n                .writeDebugLogs()\n                .build();\n        // Initialize ImageLoader with configuration.\n        ImageLoader.getInstance().init(config);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/MainActivity.java",
    "content": "package com.hankkin.compustrading;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.View;\nimport android.widget.Button;\n\nimport com.hankkin.compustrading.activity.MainShowActivity;\n\nimport butterknife.Bind;\nimport butterknife.ButterKnife;\nimport butterknife.OnClick;\n\n\npublic class MainActivity extends AppCompatActivity {\n\n    @Bind(R.id.btn_login)\n    Button btnLogin;\n\n\n\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        init();\n    }\n\n    private void init() {\n        ButterKnife.bind(this);\n//        Product product = new Product(0,\"九成新Iphone6\",4000,\"\")\n    }\n\n    @OnClick(R.id.btn_login)\n    public void btnLoginClick() {\n        Intent intent = new Intent(MainActivity.this, MainShowActivity.class);\n        startActivity(intent);\n        finish();\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/User/UserBean.java",
    "content": "package com.hankkin.myapplication.User;\n\nimport cn.bmob.v3.BmobObject;\n\n/**\n * Created by Hankkin on 15/11/28.\n */\npublic class UserBean extends BmobObject {\n    private String name;\n    private String tel;\n    private String icon_url;\n\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getTel() {\n        return tel;\n    }\n\n    public void setTel(String tel) {\n        this.tel = tel;\n    }\n\n    public String getIcon_url() {\n        return icon_url;\n    }\n\n    public void setIcon_url(String icon_url) {\n        this.icon_url = icon_url;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/Utils/BitmapUtils.java",
    "content": "package com.hankkin.compustrading.Utils;\n\nimport android.app.Activity;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Matrix;\nimport android.media.ExifInterface;\nimport android.net.Uri;\nimport android.os.Environment;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\n\n/**\n * Created by Hankkin on 15/12/24.\n */\npublic class BitmapUtils {\n\n    public static Bitmap getCompressedBitmap(Activity act, String filepath) {\n        Bitmap tempBitmap = null;\n        float width = act.getResources().getDisplayMetrics().widthPixels;\n        float height = act.getResources().getDisplayMetrics().heightPixels;\n        try {\n            if (width > 640) {\n                tempBitmap = getSuitableBitmap(act, Uri.fromFile(new java.io.File(filepath)), 640, (640 / width) * height);\n            } else {\n                tempBitmap = getSuitableBitmap(act, Uri.fromFile(new java.io.File(filepath)), (int) width, (int) height);\n            }\n\n        } catch (FileNotFoundException e) {\n            e.printStackTrace();\n        }\n\n        return tempBitmap;\n    }\n\n    /**\n     * 说明：请调用getSuitableBitmap()方法并传入图像路径，返回Bitmap\n     * <p/>\n     * 修改宽高压缩比例\n     * by:Hankkin at:2015-2-14\n     */\n    public static Bitmap getSuitableBitmap(Activity act, Uri uri, float ww, float hh)\n            throws FileNotFoundException {\n        BitmapFactory.Options newOpts = new BitmapFactory.Options();\n        newOpts.inJustDecodeBounds = true;//只读边,不读内容\n        Bitmap bitmap = null;\n        bitmap = BitmapFactory.decodeStream(act.getContentResolver().openInputStream(uri), null, newOpts);\n\n        newOpts.inJustDecodeBounds = false;\n        float w = newOpts.outWidth;\n        float h = newOpts.outHeight;\n\n        float wwh = 640f;//\n        float hhh = (wwh / w) * h;//\n        int be = 1;\n        if (w > h && w > wwh) {\n            be = (int) (newOpts.outWidth / wwh);\n        } else if (w < h && h > hhh) {\n            be = (int) (newOpts.outHeight / hhh);\n            be += 1;\n        }\n        if (be <= 0)\n            be = 1;\n        newOpts.inSampleSize = be;//设置采样率\n\n        newOpts.inPreferredConfig = Bitmap.Config.ARGB_8888;//该模式是默认的,可不设\n        newOpts.inPurgeable = true;// 同时设置才会有效\n        newOpts.inInputShareable = true;//。当系统内存不够时候图片自动被回收\n\n        bitmap = BitmapFactory.decodeStream(act.getContentResolver().openInputStream(uri), null, newOpts);\n//      return compressBmpFromBmp(bitmap);//原来的方法调用了这个方法企图进行二次压缩\n        //其实是无效的,大家尽管尝试\n        return bitmap;\n\n    }\n\n    /**\n     * 质量压缩\n     * by:Hankkin at:2015-2-14\n     *\n     * @param image\n     * @return\n     */\n    public static ByteArrayOutputStream compressImage(Bitmap image) {\n\n        int options = 100;\n        ByteArrayOutputStream baos = new ByteArrayOutputStream();\n        image.compress(Bitmap.CompressFormat.JPEG, options, baos);//质量压缩方法，这里100表示不压缩，把压缩后的数据存放到baos中\n\n        while (baos.size() / 1024 > 30 && options > 40) {  //循环判断如果压缩后图片是否大于100kb,大于继续压缩\n            baos.reset();\n            options -= 10;//每次都减少10\n            image.compress(Bitmap.CompressFormat.JPEG, options, baos);//这里压缩options%，把压缩后的数据存放到baos中\n        }\n        return baos;\n    }\n\n    /**\n     * bitmap临时转为文件等待上传\n     * by Hankkin at:2015-4-24\n     *\n     * @param bitmap\n     * @param path\n     * @return\n     */\n    public static String saveBitmap(Bitmap bitmap, String path) {\n        String filePath = null;\n        String updatePath = Environment.getExternalStorageDirectory().getPath() + \"/compustrading/tempUploadPic\";\n        File fileSD = new File(updatePath);\n        if (!fileSD.exists()) {\n            fileSD.mkdir();\n        }\n        try {\n            filePath = updatePath + \"/\" + path;\n            FileOutputStream out = new FileOutputStream(filePath);\n            bitmap.compress(Bitmap.CompressFormat.JPEG, 30, out);\n            out.flush();\n            out.close();\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        return filePath.trim();\n    }\n\n\n    /**\n     * 读取照片exif信息中的旋转角度\n     *\n     * @param path 照片路径\n     * @return角度\n     */\n    public static int readPictureDegree(String path) {\n        int degree = 0;\n        try {\n            ExifInterface exifInterface = new ExifInterface(path);\n            int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n            switch (orientation) {\n                case ExifInterface.ORIENTATION_ROTATE_90:\n                    degree = 90;\n                    break;\n                case ExifInterface.ORIENTATION_ROTATE_180:\n                    degree = 180;\n                    break;\n                case ExifInterface.ORIENTATION_ROTATE_270:\n                    degree = 270;\n                    break;\n            }\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n        return degree;\n    }\n\n    /**\n     * 旋转照片\n     * by Hankkin at:2015年10月8日 11:17:04\n     * @param img\n     * @return\n     */\n    public static Bitmap toturn(Bitmap img){\n        Matrix matrix = new Matrix();\n        matrix.postRotate(+90); /*翻转90度*/\n        int width = img.getWidth();\n        int height =img.getHeight();\n        img = Bitmap.createBitmap(img, 0, 0, width, height, matrix, true);\n        return img;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/Utils/HankkinUtils.java",
    "content": "/**\n * YUtils.java[V1.0.0]\n * classes : com.wadiankeji.creditsmanager.util.YUtils\n *\n * @author Hankkin Create at 2014年11月27日 下午7:48:31\n */\npackage com.hankkin.compustrading.Utils;\n\nimport android.annotation.SuppressLint;\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.content.*;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport android.database.Cursor;\nimport android.graphics.Bitmap;\nimport android.graphics.Bitmap.CompressFormat;\nimport android.graphics.Rect;\nimport android.media.ExifInterface;\nimport android.media.MediaMetadataRetriever;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.os.Environment;\nimport android.os.Handler;\nimport android.provider.DocumentsContract;\nimport android.provider.MediaStore;\nimport android.telephony.TelephonyManager;\nimport android.text.TextUtils;\nimport android.util.DisplayMetrics;\nimport android.util.Log;\nimport android.view.Gravity;\nimport android.view.View;\nimport android.view.WindowManager;\nimport android.view.inputmethod.InputMethodManager;\nimport android.widget.Toast;\n\nimport java.io.*;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.*;\nimport java.util.regex.Matcher;\nimport java.util.regex.Pattern;\n\n/**\n * by 李斐 at 2014年11月27日 下午7:48:31\n * 增加getPath相关方法\n * by：李斐 at:2015-06-18 10:51:16\n */\npublic class HankkinUtils {\n    private static final String TAG = \"YUtils\";\n\n    // 记录屏幕的高度、宽度、密度等信息。\n    public static int screenH;\n    public static int screenW;\n    public static float screenDensity; // 屏幕密度（0.75 / 1.0 / 1.5）\n    public static int screenDensityDpi; // 屏幕密度DPI（120 / 160 / 240）\n    public static int statusBarHeight; // 状态栏高度\n\n    @SuppressLint(\"SimpleDateFormat\")\n    public static String longtimeToDate(long time) {\n        Date now = new Date(time * 1000);\n        SimpleDateFormat dateFormat = new SimpleDateFormat(\n                \"yyyy-MM-dd HH:mm:ss\");// 可以方便地修改日期格式\n        dateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+8\"));\n        String dateStr = dateFormat.format(now);\n        return dateStr;\n    }\n\n    /**\n     * 修改时间戳转化时间\n     * by黄海杰 at:2015年7月27日 15:44:16\n     *\n     * @param time\n     * @return\n     */\n    @SuppressLint(\"SimpleDateFormat\")\n    public static String longtimeToDayDate(long time) {\n        SimpleDateFormat dateFormat = new SimpleDateFormat(\"MM-dd HH:mm\");// 可以方便地修改日期格式\n        String dateStr = dateFormat.format(new Date(time));\n        return dateStr;\n    }\n\n    public static String getCurrentTime(String format) {\n        Date date = new Date();\n        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());\n        sdf.setTimeZone(TimeZone.getTimeZone(\"GMT+8\"));\n        String currentTime = sdf.format(date);\n        return currentTime;\n    }\n\n\n    @SuppressLint(\"SimpleDateFormat\")\n    public static String longtimeToDateYMD(long time) {\n        Date now = new Date(time);\n        SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");// 可以方便地修改日期格式\n        dateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT+8\"));\n        String dateStr = dateFormat.format(now);\n        return dateStr;\n    }\n\n\n    /**\n     * 根据yyyy-MM-dd HH:mm:ss格式时间字符串转为long型时间戳\n     *\n     * @param dateStr\n     * @return date long\n     * by:Hankkin at:2015年6月25日 17:38:25 修改时区设置\n     */\n    public static long stringDateToLong(String dateStr) {\n\n        SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n        sdf.setTimeZone(TimeZone.getTimeZone(\"GMT+8\"));\n        Date date = null;\n        try {\n            date = sdf.parse(dateStr);\n        } catch (ParseException e) {\n            // TODO Auto-generated catch block\n            e.printStackTrace();\n        }\n        return date.getTime();\n    }\n\n    public static String getCurrentTime() {\n        return getCurrentTime(\"yyyy-MM-dd  HH:mm:ss\");\n    }\n\n\n    /**\n     * 将时间戳转为代表\"距现在多久之前\"的字符串\n     * 修改为向下取整\n     * by黄海杰 at:2015年7月1日 17:08:55\n     *\n     * @param dateTime 时间戳\n     * @return\n     */\n    public static String getStandardDate(long dateTime) {\n\n        StringBuffer sb = new StringBuffer();\n//\t\tlong t = Long.parseLong(timeStr);\n//\t\tlong time = System.currentTimeMillis() - (t*1000);\n        long time = System.currentTimeMillis() - (dateTime);\n        long mill = (long) Math.floor(time / 1000);//秒前\n\n        long minute = (long) Math.floor(time / 60 / 1000.0f);// 分钟前\n\n        long hour = (long) Math.floor(time / 60 / 60 / 1000.0f);// 小时\n\n        long day = (long) Math.floor(time / 24 / 60 / 60 / 1000.0f);// 天前\n\n        if (day - 1 > 0) {\n            sb.append(day + \"天\");\n        } else if (hour - 1 > 0) {\n            if (hour >= 24) {\n                sb.append(\"1天\");\n            } else {\n                sb.append(hour + \"小时\");\n            }\n        } else if (minute - 1 > 0) {\n            if (minute == 60) {\n                sb.append(\"1小时\");\n            } else {\n                sb.append(minute + \"分钟\");\n            }\n        } else if (mill - 1 > 0) {\n            if (mill == 60) {\n                sb.append(\"1分钟\");\n            } else {\n                sb.append(mill + \"秒\");\n            }\n        } else {\n            sb.append(\"刚刚\");\n        }\n        if (!sb.toString().equals(\"刚刚\")) {\n            sb.append(\"前\");\n        }\n        return sb.toString();\n    }\n\n    /**\n     * 根据时间戳的差获取时间差\n     * by黄海杰 at:2015年7月13日 11:24:25\n     * 修改超过一天的显示时间\n     * by黄海杰 at:2015年7月27日 15:44:32\n     *\n     * @param dateTime\n     * @return\n     */\n    public static String getDateAgo(long dateTime) {\n\n        String days = null;\n//\t\tlong t = Long.parseLong(timeStr);\n//\t\tlong time = System.currentTimeMillis() - (t*1000);\n        long timeInterval = (System.currentTimeMillis() - (dateTime)) / 1000;\n\n\n        if (timeInterval < 60) {\n            days = \"1分钟前\";\n        } else if (timeInterval < 3600) {\n            days = \"\" + (int) Math.round(timeInterval / 60) + \"分钟内\";\n        } else if (timeInterval < 86400) {\n            if (timeInterval % 3600 > 1800) {\n                days = \"\" + (int) Math.round((timeInterval / 3600) + 1) + \"小时内\";\n            } else {\n                days = \"\" + (int) Math.round((timeInterval / 3600)) + \"小时内\";\n            }\n        }\n//\t\telse if (timeInterval<2592000){\n//\t\t\tdays = \"\"+(int)Math.floor(timeInterval/86400)+\"天前\";\n//\t\t}\n//\t\telse if (timeInterval<31536000){\n//\t\t\tdays = \"\"+(int)Math.floor(timeInterval/2592000)+\"个月前\";\n//\t\t}\n//\t\telse {\n//\t\t\tdays = \"\"+(int)Math.floor(timeInterval/31536000)+\"年前\";\n//\t\t}\n        else {\n            days = longtimeToDayDate(dateTime);\n        }\n        return days;\n    }\n\n    /**\n     * 升级检测\n     *\n     * @param locVersionName\n     * @param lastVersion\n     * @return 是否升级\n     */\n    public static boolean checkUpdate(String locVersionName, String lastVersion) {\n        boolean hasUpdate = false;\n        String[] locVersionS = locVersionName.split(\"\\\\.\");\n        String[] lastVersionS = lastVersion.split(\"\\\\.\");\n\n        if (!locVersionName.equals(lastVersion)) {\n            if (locVersionS != null && lastVersion != null) {\n                int localLenth = locVersionS.length;\n                int lastVerLenth = lastVersionS.length;\n\n                // int netLenth = lastVersion.length();\n                for (int i = 0; i < lastVerLenth; i++) {\n                    if (localLenth < lastVerLenth && i == localLenth) {\n                        hasUpdate = true;\n                        return hasUpdate;\n                    }\n\n                    if (Integer.valueOf(lastVersionS[i]) > Integer\n                            .valueOf(locVersionS[i])) {\n                        hasUpdate = true;\n                        return hasUpdate;\n                    } else if (Integer.valueOf(lastVersionS[i]) < Integer\n                            .valueOf(locVersionS[i])) {\n                        hasUpdate = false;\n                        return hasUpdate;\n                    }\n                }\n            }\n        } else {\n            hasUpdate = false;\n        }\n        return hasUpdate;\n    }\n\n    /**\n     * bitmap转byte数组\n     *\n     * @param bmp\n     * @param needRecycle\n     * @return\n     */\n    public static byte[] bmpToByteArray(final Bitmap bmp,\n                                        final boolean needRecycle) {\n        ByteArrayOutputStream output = new ByteArrayOutputStream();\n        bmp.compress(CompressFormat.PNG, 100, output);\n        if (needRecycle) {\n            bmp.recycle();\n        }\n\n        byte[] result = output.toByteArray();\n        try {\n            output.close();\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n\n        return result;\n    }\n\n    /**\n     * 实现文本复制功能 add by lif\n     *\n     * @param content\n     */\n    public static void copy(String content, Context context) {\n        // 得到剪贴板管理器\n        ClipboardManager cmb = (ClipboardManager) context\n                .getSystemService(Context.CLIPBOARD_SERVICE);\n        cmb.setText(content.trim());\n        HankkinUtils.showToast(context, \"内容已复制\");\n    }\n\n    /**\n     * 实现粘贴功能 add by lif\n     *\n     * @param context\n     * @return\n     */\n    public static String paste(Context context) {\n        // 得到剪贴板管理器\n        ClipboardManager cmb = (ClipboardManager) context\n                .getSystemService(Context.CLIPBOARD_SERVICE);\n        return cmb.getText().toString().trim();\n    }\n\n    /**\n     * 隐藏软键盘\n     */\n    public static void hideSoftInputMethod(Activity act) {\n        View view = act.getWindow().peekDecorView();\n        if (view != null) {\n            // 隐藏虚拟键盘\n            InputMethodManager inputmanger = (InputMethodManager) act\n                    .getSystemService(act.INPUT_METHOD_SERVICE);\n            inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0);\n        }\n    }\n\n    /**\n     * 切换软件盘 显示隐藏\n     */\n    public static void switchSoftInputMethod(Activity act) {\n        // 方法一(如果输入法在窗口上已经显示，则隐藏，反之则显示)\n        InputMethodManager iMM = (InputMethodManager) act\n                .getSystemService(Context.INPUT_METHOD_SERVICE);\n        iMM.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);\n    }\n\n\n\n\n    /**\n     * 验证是否手机号码\n     *\n     * @param mobiles\n     * @return\n     */\n    public static boolean isMobileNO(String mobiles) {\n        String telRegex = \"[1][358]\\\\d{9}\";//\"[1]\"代表第1位为数字1，\"[358]\"代表第二位可以为3、5、8中的一个，\"\\\\d{9}\"代表后面是可以是0～9的数字，有9位。\n        if (TextUtils.isEmpty(mobiles)) return false;\n        else return mobiles.matches(telRegex);\n    }\n\n    /**\n     * 中文识别\n     */\n    public static boolean hasChinese(String source) {\n        String reg_charset = \"([\\\\u4E00-\\\\u9FA5]*+)\";\n        Pattern p = Pattern.compile(reg_charset);\n        Matcher m = p.matcher(source);\n        boolean hasChinese = false;\n        while (m.find()) {\n            if (!\"\".equals(m.group(1))) {\n                hasChinese = true;\n            }\n        }\n        return hasChinese;\n    }\n\n    /**\n     * 用户名规则判断\n     *\n     * @param uname\n     * @return\n     */\n    public static boolean isAccountStandard(String uname) {\n        Pattern p = Pattern.compile(\"[A-Za-z0-9_]+\");\n        Matcher m = p.matcher(uname);\n        return m.matches();\n    }\n\n    // java 合并两个byte数组\n    public static byte[] byteMerger(byte[] byte_1, byte[] byte_2) {\n        byte[] byte_3 = new byte[byte_1.length + byte_2.length];\n        System.arraycopy(byte_1, 0, byte_3, 0, byte_1.length);\n        System.arraycopy(byte_2, 0, byte_3, byte_1.length, byte_2.length);\n        return byte_3;\n    }\n\n    /**\n     * 删除文件夹下所有文件\n     * Hankkin at:2015年4月21日 20:05:01\n     *\n     * @param file\n     */\n    public static void delete(File file) {\n        if (file.isFile()) {\n            file.delete();\n            return;\n        }\n        if (file.isDirectory()) {\n            File[] childFiles = file.listFiles();\n            if (childFiles == null || childFiles.length == 0) {\n                file.delete();\n                return;\n            }\n            for (int i = 0; i < childFiles.length; i++) {\n                delete(childFiles[i]);\n            }\n//\t\t\tfile.delete();\n        }\n    }\n\n\n    /**\n     * 取得系统版本号\n     * by: Hankkin at: 2015-04-13\n     *\n     * @param context\n     * @return version 当前项目版本号\n     */\n    public static String GetVersion(Context context) {\n        try {\n            PackageInfo manager = context.getPackageManager().getPackageInfo(\n                    context.getPackageName(), 0);\n            return manager.versionName;\n        } catch (PackageManager.NameNotFoundException e) {\n            return \"Unknown\";\n        }\n    }\n\n\n\n\n\n    public static boolean isExternalStorageDocument(Uri uri) {\n        return \"com.android.externalstorage.documents\".equals(uri\n                .getAuthority());\n    }\n\n\n    public static boolean isDownloadsDocument(Uri uri) {\n        return \"com.android.providers.downloads.documents\".equals(uri\n                .getAuthority());\n    }\n\n    public static boolean isMediaDocument(Uri uri) {\n        return \"com.android.providers.media.documents\".equals(uri\n                .getAuthority());\n    }\n\n    public static boolean isGooglePhotosUri(Uri uri) {\n        return \"com.google.android.apps.photos.content\".equals(uri\n                .getAuthority());\n    }\n\n//\tpublic static String getDateAgo(int timeline){\n//\t\tlong curTimeline = System.currentTimeMillis();\n//\t\tint timeInterval = timeline - curTimeline;\n//\t\tif (timeInterval<60){\n//\t\t\treturn \"1分钟内\";\n//\t\t}\n//\t\telse if (timeInterval<3600){\n//\t\t\treturn \"\"+Math.floor(timeInterval/60)+\"分钟前\";\n//\t\t}\n//\t\telse if (timeInterval<86400){\n//\t\t\treturn \"\"+Math.floor(timeInterval/3600)+\"小时前\";\n//\t\t}\n//\t\telse if (timeInterval<2592000){\n//\t\t\treturn \"\"+Math.floor(timeInterval/86400)+\"天前\";\n//\t\t}\n//\t\telse if (timeInterval<31536000){\n//\t\t\treturn \"\"+Math.floor(timeInterval/2592000)+\"个月前\";\n//\t\t}\n//\t\telse {\n//\t\t\treturn \"\"+Math.floor(timeInterval/31536000)+\"年前\";\n//\t\t}\n//\t}\n\n\n    /**\n     * 创建视频临时帧图片\n     * by Hankkin at:2015年8月18日 11:21:03\n     *\n     * @param filePath\n     * @return\n     */\n    public static Bitmap getVideoThumbnail(String filePath) {\n        Bitmap bitmap = null;\n        MediaMetadataRetriever retriever = new MediaMetadataRetriever();\n        try {\n            retriever.setDataSource(filePath);\n            bitmap = retriever.getFrameAtTime();\n        } catch (IllegalArgumentException e) {\n            e.printStackTrace();\n        } catch (RuntimeException e) {\n            e.printStackTrace();\n        } finally {\n            try {\n                retriever.release();\n            } catch (RuntimeException e) {\n                e.printStackTrace();\n            }\n        }\n        return bitmap;\n    }\n\n\n    public static boolean isDebug = true;// 是否需要打印bug，可以在application的onCreate函数里面初始化\n    /**\n     * 记录上次点击时间\n     */\n    private static long lastClickTime;\n\n    /**\n     * 是否快速双击点击\n     *\n     * @return isFastDoubleClick\n     */\n    public static boolean isFastDoubleClick() {\n        long time = System.currentTimeMillis();\n        if (time - lastClickTime < 600) {\n            return true;\n        } else {\n            lastClickTime = time;\n            return false;\n        }\n    }\n\n/*-----------------------toast start-----------------------*/\n\n    /**\n     * 提示字符串\n     * short Toast\n     *\n     * @param context\n     * @param text\n     */\n    public static void showToast(Context context, String text) {\n        Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);\n        toast.setGravity(Gravity.CENTER, 0, 0);\n        toast.show();\n    }\n\n    /**\n     * 提示字符串\n     * short Toast\n     *\n     * @param context\n     * @param text\n     */\n    public static void showLToast(Context context, String text) {\n        Toast toast = Toast.makeText(context, text, Toast.LENGTH_LONG);\n        toast.setGravity(Gravity.CENTER, 0, 0);\n        toast.show();\n    }\n\n    /**\n     * 提示根据ResId关联字符串\n     * short Toast\n     * by:Hankkin at:2015年4月30日 14:39:41\n     *\n     * @param context\n     * @param resId\n     */\n    public static void showToast(Context context, int resId) {\n        Toast toast = Toast.makeText(context, resId, Toast.LENGTH_SHORT);\n        toast.setGravity(Gravity.CENTER, 0, 0);\n        toast.show();\n    }\n\n    /**\n     * 提示根据ResId关联字符串\n     * 时常long\tToast\n     * by:Hankkin at:2015年4月30日 14:39:41\n     *\n     * @param context\n     * @param resId\n     */\n    public static void showLToast(Context context, int resId) {\n        Toast toast = Toast.makeText(context, resId, Toast.LENGTH_LONG);\n        ;\n        toast.setGravity(Gravity.CENTER, 0, 0);\n        toast.show();\n    }\n    /*-----------------------toast end-----------------------*/\n    /*获得屏幕相关的辅助类*/\n    /*-----------------------screen start-----------------------*/\n\n    /**\n     * 获得屏幕高度\n     *\n     * @param context\n     * @return\n     */\n    public static int getScreenWidth(Context context) {\n        WindowManager wm = (WindowManager) context\n                .getSystemService(Context.WINDOW_SERVICE);\n        DisplayMetrics outMetrics = new DisplayMetrics();\n        wm.getDefaultDisplay().getMetrics(outMetrics);\n        return outMetrics.widthPixels;\n    }\n\n    /**\n     * 获得屏幕宽度\n     *\n     * @param context\n     * @return\n     */\n    public static int getScreenHeight(Context context) {\n        WindowManager wm = (WindowManager) context\n                .getSystemService(Context.WINDOW_SERVICE);\n        DisplayMetrics outMetrics = new DisplayMetrics();\n        wm.getDefaultDisplay().getMetrics(outMetrics);\n        return outMetrics.heightPixels;\n    }\n\n    /**\n     * 获取屏幕密度\n     *\n     * @param context\n     * @return\n     */\n    public static float getScreenDensity(Context context) {\n        return context.getResources().getDisplayMetrics().density;\n    }\n\n    /**\n     * dip转px像素\n     *\n     * @param context\n     * @param px\n     * @return\n     */\n    public static int dip2px(Context context, float px) {\n        final float scale = getScreenDensity(context);\n        return (int) (px * scale + 0.5);\n    }\n\n    /**\n     * 获得状态栏的高度\n     *\n     * @param context\n     * @return\n     */\n    public static int getStatusHeight(Context context) {\n\n        int statusHeight = -1;\n        try {\n            Class<?> clazz = Class.forName(\"com.android.internal.R$dimen\");\n            Object object = clazz.newInstance();\n            int height = Integer.parseInt(clazz.getField(\"status_bar_height\")\n                    .get(object).toString());\n            statusHeight = context.getResources().getDimensionPixelSize(height);\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        return statusHeight;\n    }\n\n    /**\n     * 获取当前屏幕截图，包含状态栏\n     *\n     * @param activity\n     * @return\n     */\n    public static Bitmap snapShotWithStatusBar(Activity activity) {\n        View view = activity.getWindow().getDecorView();\n        view.setDrawingCacheEnabled(true);\n        view.buildDrawingCache();\n        Bitmap bmp = view.getDrawingCache();\n        int width = getScreenWidth(activity);\n        int height = getScreenHeight(activity);\n        Bitmap bp = null;\n        bp = Bitmap.createBitmap(bmp, 0, 0, width, height);\n        view.destroyDrawingCache();\n        return bp;\n\n    }\n\n    /**\n     * 获取当前屏幕截图，不包含状态栏\n     *\n     * @param activity\n     * @return\n     */\n    public static Bitmap snapShotWithoutStatusBar(Activity activity) {\n        View view = activity.getWindow().getDecorView();\n        view.setDrawingCacheEnabled(true);\n        view.buildDrawingCache();\n        Bitmap bmp = view.getDrawingCache();\n        Rect frame = new Rect();\n        activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);\n        int statusBarHeight = frame.top;\n\n        int width = getScreenWidth(activity);\n        int height = getScreenHeight(activity);\n        Bitmap bp = null;\n        bp = Bitmap.createBitmap(bmp, 0, statusBarHeight, width, height\n                - statusBarHeight);\n        view.destroyDrawingCache();\n        return bp;\n\n    }\n\n\n    /**\n     * 根据手机的分辨率从 px(像素) 的单位 转成为 dp\n     */\n    public static int px2dip(Context context, float pxValue) {\n        final float scale = context.getResources().getDisplayMetrics().density;\n        return (int) (pxValue / scale + 0.5f);\n    }\n\n\n    /**\n     * 读取照片exif信息中的旋转角度\n     *\n     * @param path 照片路径\n     * @return角度\n     */\n    public static int readPictureDegree(String path) {\n        int degree = 0;\n        try {\n            ExifInterface exifInterface = new ExifInterface(path);\n            int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);\n            switch (orientation) {\n                case ExifInterface.ORIENTATION_ROTATE_90:\n                    degree = 90;\n                    break;\n                case ExifInterface.ORIENTATION_ROTATE_180:\n                    degree = 180;\n                    break;\n                case ExifInterface.ORIENTATION_ROTATE_270:\n                    degree = 270;\n                    break;\n            }\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n        return degree;\n    }\n\n\n\n    /*-----------------------screen end-----------------------*/\n    /*日志打印*/\n    /*-----------------------log start-----------------------*/\n    // 下面四个是默认tag的函数\n    public static void i(String msg) {\n        if (isDebug)\n            Log.i(TAG, msg);\n    }\n\n    public static void d(String msg) {\n        if (isDebug)\n            Log.d(TAG, msg);\n    }\n\n    public static void e(String msg) {\n        if (isDebug)\n            Log.e(TAG, msg);\n    }\n\n    public static void v(String msg) {\n        if (isDebug)\n            Log.v(TAG, msg);\n    }\n\n    // 下面是传入自定义tag的函数\n    public static void i(String tag, String msg) {\n        if (isDebug)\n            Log.i(tag, msg);\n    }\n\n    public static void d(String tag, String msg) {\n        if (isDebug)\n            Log.i(tag, msg);\n    }\n\n    public static void e(String tag, String msg) {\n        if (isDebug)\n            Log.i(tag, msg);\n    }\n\n    public static void v(String tag, String msg) {\n        if (isDebug)\n            Log.i(tag, msg);\n    }\n    /*-----------------------log end-----------------------*/\n\n    /**\n     * 字符串转MD5\n     * by黄海杰 at:2015-10-29 16:15:32\n     *\n     * @param string\n     * @return\n     */\n    public static String md5(String string) {\n\n        byte[] hash;\n\n        try {\n\n            hash = MessageDigest.getInstance(\"MD5\").digest(string.getBytes(\"UTF-8\"));\n\n        } catch (NoSuchAlgorithmException e) {\n\n            throw new RuntimeException(\"Huh, MD5 should be supported?\", e);\n\n        } catch (UnsupportedEncodingException e) {\n\n            throw new RuntimeException(\"Huh, UTF-8 should be supported?\", e);\n\n        }\n\n\n        StringBuilder hex = new StringBuilder(hash.length * 2);\n\n        for (byte b : hash) {\n\n            if ((b & 0xFF) < 0x10) hex.append(\"0\");\n\n            hex.append(Integer.toHexString(b & 0xFF));\n\n        }\n\n        return hex.toString();\n\n    }\n\n\n    /**\n     * 获取手机号\n     * by Hankkin\n     * @param context\n     * @return\n     */\n    public static String getPhoneNumber(Context context){\n        TelephonyManager mTelephonyMgr;\n        mTelephonyMgr = (TelephonyManager)  context.getSystemService(Context.TELEPHONY_SERVICE);\n        return mTelephonyMgr.getLine1Number();\n    }\n\n\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/BaseActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.content.ContentUris;\nimport android.content.Context;\nimport android.content.CursorLoader;\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.os.PersistableBundle;\nimport android.provider.DocumentsContract;\nimport android.provider.MediaStore;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.LinearLayout;\n\nimport com.hankkin.compustrading.FileUploadListener;\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.model.Person;\nimport com.pnikosis.materialishprogress.ProgressWheel;\n\nimport java.io.File;\n\nimport cn.bmob.v3.datatype.BmobFile;\nimport cn.bmob.v3.exception.BmobException;\nimport cn.bmob.v3.listener.UploadFileListener;\nimport me.drakeet.materialdialog.MaterialDialog;\n\n/**\n * Created by Hankkin on 15/12/20.\n */\npublic class BaseActivity extends AppCompatActivity {\n\n    /*请求相机Code*/\n    public static final int REQUST_CODE_CAMERA = 0;\n    /*请求相册Code*/\n    public static final int REQUEST_CODE_GALLERY = 1;\n    /*发布商品Code*/\n    public static final int REQUEST_CODE_FABU = 2;\n\n    public MaterialDialog loadDialog;\n\n    @Override\n    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {\n        super.onCreate(savedInstanceState, persistentState);\n    }\n\n\n    public Person getCurrentPerson(Context context){\n        Person person = Person.getCurrentUser(Person.class);\n        return person;\n    }\n\n    /**\n     * 调用相册\n     * by Hankkin at:2015-12-20 23:00:16\n     * @param act\n     */\n    public  void getImageFromGallery(Activity act) {\n        Intent intent = new Intent(Intent.ACTION_PICK);\n        intent.setType(\"image/*\");\n        // 开启一个带有返回值的Activity，请求码为PHOTO_REQUEST_GALLERY\n        act.startActivityForResult(intent, REQUEST_CODE_GALLERY);\n    }\n\n    /**\n     * 上传图片\n     * by Hankkin at:2015-12-20 23:00:34\n     */\n\n    public void uploadImg(final String filepath, Context context, final FileUploadListener listener){\n        final BmobFile file = new BmobFile(new File(filepath));\n        file.upload(new UploadFileListener() {\n            @Override\n            public void done(BmobException e) {\n                if (e == null){\n                    listener.success(file.getFileUrl());\n                }\n                else {\n                    listener.fail();\n                }\n            }\n        });\n\n    }\n\n\n    public void showLoadingDialog(){\n        loadDialog = new MaterialDialog(this);\n        View view = LayoutInflater.from(this).inflate(R.layout.loading,null,false);\n        ProgressWheel wheel = (ProgressWheel) view.findViewById(R.id.pw_loading);\n        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(80,80);\n        params.height = HankkinUtils.dip2px(this,80);\n        params.width = HankkinUtils.dip2px(this,80);\n        wheel.setLayoutParams(params);\n        wheel.setBackgroundColor(getResources().getColor(R.color.light_white));\n        loadDialog.setView(view);\n        loadDialog.setBackgroundResource(getResources().getColor(R.color.transparent));\n        loadDialog.show();\n    }\n\n    public void dimissDialog(){\n        if (loadDialog!=null){\n            loadDialog.dismiss();\n        }\n    }\n\n    /**\n     * 初始化图片路径\n     *\n     * @return\n     */\n    public static String iniFilePath(Activity act) {\n        String filepath = null;\n        String path = null;\n        File fileSD = null;\n\n        // 准备存储位置\n        boolean sdExist = Environment.getExternalStorageState()\n                .equals(android.os.Environment.MEDIA_MOUNTED);\n        if (!sdExist) {\n            HankkinUtils.showLToast(act, \"没有找到SD存储卡\");\n            return null;\n\n        } else {\n            //TODO 内容提示完善\n            path = Environment.getExternalStorageDirectory().getPath() + \"/compustrading/Camera\";\n            fileSD = new File(path);\n            if (fileSD.exists()) {\n                filepath = path + \"/\" + System.currentTimeMillis() + \".jpg\";\n            } else {\n                fileSD.mkdir();\n                filepath = fileSD.getAbsolutePath() + \"/\" + System.currentTimeMillis() + \".jpg\";\n            }\n            return filepath;\n        }\n    }\n\n    /**\n     * 调用相机\n     *\n     * @param act\n     */\n    public static void goCamera(Activity act, String filepath) {\n        File file = new File(filepath);\n        // 启动Camera\n        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));\n        act.startActivityForResult(intent, REQUST_CODE_CAMERA);\n    }\n\n\n    /**\n     * 从URI获取本地路径\n     *\n     * @param selectedVideoUri\n     * @param contentResolver\n     * @return\n     */\n    public static  String getAbsoluteImagePath(Activity activity, Uri contentUri) {\n\n        //如果是对媒体文件，在android开机的时候回去扫描，然后把路径添加到数据库中。\n        //由打印的contentUri可以看到：2种结构。正常的是：content://那么这种就要去数据库读取path。\n        //另外一种是Uri是 file:///那么这种是 Uri.fromFile(File file);得到的\n        System.out.println(contentUri);\n\n        String[] projection = { MediaStore.Images.Media.DATA };\n        String urlpath;\n        CursorLoader loader = new CursorLoader(activity,contentUri, projection, null, null, null);\n        Cursor cursor = loader.loadInBackground();\n        try\n        {\n            int column_index = cursor.getColumnIndex(MediaStore.Images.Media.DATA);\n            cursor.moveToFirst();\n            urlpath =cursor.getString(column_index);\n            //如果是正常的查询到数据库。然后返回结构\n            return urlpath;\n        }\n        catch (Exception e)\n        {\n\n            e.printStackTrace();\n            // TODO: handle exception\n        }finally{\n            if(cursor != null){\n                cursor.close();\n            }\n        }\n\n        //如果是文件。Uri.fromFile(File file)生成的uri。那么下面这个方法可以得到结果\n        urlpath = contentUri.getPath();\n        return urlpath;\n    }\n\n    /**\n     * android系统版本选择图库图片解决方法---获取图片路径\n     * by Hankkin at:2015-3-10\n     *\n     * @param context\n     * @param uri\n     * @return\n     */\n    @TargetApi(Build.VERSION_CODES.KITKAT)\n    public static String getPath(final Context context, final Uri uri) {\n        final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;\n        // DocumentProvider\n        if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {\n            // ExternalStorageProvider\n            if (isExternalStorageDocument(uri)) {\n                final String docId = DocumentsContract.getDocumentId(uri);\n                final String[] split = docId.split(\":\");\n                final String type = split[0];\n                if (\"primary\".equalsIgnoreCase(type)) {\n                    return Environment.getExternalStorageDirectory() + \"/\"\n                            + split[1];\n                }\n                // TODO handle non-primary volumes\n            }\n            // DownloadsProvider\n            else if (isDownloadsDocument(uri)) {\n                final String id = DocumentsContract.getDocumentId(uri);\n                final Uri contentUri = ContentUris.withAppendedId(\n                        Uri.parse(\"content://downloads/public_downloads\"),\n                        Long.valueOf(id));\n                return getDataColumn(context, contentUri, null, null);\n            }\n            // MediaProvider\n            else if (isMediaDocument(uri)) {\n                final String docId = DocumentsContract.getDocumentId(uri);\n                final String[] split = docId.split(\":\");\n                final String type = split[0];\n                Uri contentUri = null;\n                if (\"image\".equals(type)) {\n                    contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;\n                } else if (\"video\".equals(type)) {\n                    contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;\n                } else if (\"audio\".equals(type)) {\n                    contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\n                }\n                final String selection = MediaStore.MediaColumns._ID + \"=?\";\n                final String[] selectionArgs = new String[]{split[1]};\n                return getDataColumn(context, contentUri, selection,\n                        selectionArgs);\n            }\n        }\n        // MediaStore (and general)\n        else if (\"content\".equalsIgnoreCase(uri.getScheme())) {\n            // Return the remote address\n            if (isGooglePhotosUri(uri))\n                return uri.getLastPathSegment();\n            return getDataColumn(context, uri, null, null);\n        }\n        // File\n        else if (\"file\".equalsIgnoreCase(uri.getScheme())) {\n            return uri.getPath();\n        }\n        return null;\n    }\n    /**\n     * android系统版本选择图库图片解决方法--获取数据\n     * by Hankkin at:2015-3-10\n     *\n     * @param context\n     * @param uri\n     * @param selection\n     * @param selectionArgs\n     * @return\n     */\n    public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {\n        Cursor cursor = null;\n        final String column = MediaStore.MediaColumns.DATA;\n        final String[] projection = {column};\n        try {\n            cursor = context.getContentResolver().query(uri, projection,\n                    selection, selectionArgs, null);\n            if (cursor != null && cursor.moveToFirst()) {\n                final int index = cursor.getColumnIndexOrThrow(column);\n                return cursor.getString(index);\n            }\n        } finally {\n            if (cursor != null)\n                cursor.close();\n        }\n        return null;\n    }\n\n    public static boolean isExternalStorageDocument(Uri uri) {\n        return \"com.android.externalstorage.documents\".equals(uri\n                .getAuthority());\n    }\n\n\n    public static boolean isDownloadsDocument(Uri uri) {\n        return \"com.android.providers.downloads.documents\".equals(uri\n                .getAuthority());\n    }\n\n    public static boolean isMediaDocument(Uri uri) {\n        return \"com.android.providers.media.documents\".equals(uri\n                .getAuthority());\n    }\n\n    public static boolean isGooglePhotosUri(Uri uri) {\n        return \"com.google.android.apps.photos.content\".equals(uri\n                .getAuthority());\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/LoginActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.text.TextUtils;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.model.Person;\nimport com.hankkin.compustrading.sharepreference.MySP;\nimport com.pnikosis.materialishprogress.ProgressWheel;\n\nimport butterknife.Bind;\nimport butterknife.ButterKnife;\nimport butterknife.OnClick;\nimport cn.bmob.v3.exception.BmobException;\nimport cn.bmob.v3.listener.LogInListener;\n\npublic class LoginActivity extends AppCompatActivity {\n\n    @Bind(R.id.btn_login)\n    Button btnLogin;\n    @Bind(R.id.tv_back)\n    TextView tvBack;\n    @Bind(R.id.tv_register)\n    TextView tvRegister;\n    @Bind(R.id.et_login_name)\n    EditText etName;\n    @Bind(R.id.et_login_pwd)\n    EditText etPwd;\n    @Bind(R.id.pw_loading)\n    ProgressWheel wheel;\n\n    public static LoginActivity instance;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        instance = this;\n        setContentView(R.layout.activity_login);\n\n        ButterKnife.bind(this);\n        initViews();\n    }\n\n\n    private void initViews() {\n        wheel.stopSpinning();\n    }\n\n    @OnClick(R.id.tv_register)\n    public void register() {\n        Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);\n        startActivity(intent);\n    }\n\n    @OnClick(R.id.tv_back)\n    public void back() {\n        finish();\n    }\n\n    @OnClick(R.id.btn_login)\n    public void login() {\n        wheel.spin();\n        final String name = etName.getText().toString().trim();\n        final String pwd = etPwd.getText().toString().trim();\n        if (TextUtils.isEmpty(name)) {\n            HankkinUtils.showToast(LoginActivity.this, \"用户名不能为空\");\n            return;\n        }\n        if (TextUtils.isEmpty(pwd)) {\n            HankkinUtils.showToast(LoginActivity.this, \"密码不能为空\");\n            return;\n        }\n        Person.loginByAccount(name, pwd, new LogInListener<Person>() {\n            @Override\n            public void done(Person person, BmobException e) {\n                MySP.setPASSWoRD(LoginActivity.this, pwd);\n                MySP.setUSERNAME(LoginActivity.this, name);\n                wheel.stopSpinning();\n                HankkinUtils.showToast(LoginActivity.this, \"登录成功\");\n                Intent intent = new Intent(LoginActivity.this, MainShowActivity.class);\n                startActivity(intent);\n                finish();\n                if (LoginActivity.instance != null) {\n                    LoginActivity.instance.finish();\n                }\n                if (PersonActivity.instance != null) {\n                    PersonActivity.instance.finish();\n                }\n                if (MainShowActivity.instance!=null){\n                    MainShowActivity.instance.finish();\n                }\n            }\n        });\n    }\n\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/MainShowActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.content.res.Configuration;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Message;\nimport android.support.v4.view.ViewPager;\nimport android.support.v4.widget.DrawerLayout;\nimport android.support.v7.app.ActionBarDrawerToggle;\nimport android.text.TextUtils;\nimport android.view.KeyEvent;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.adapter.CategoryFragmentAdapter;\nimport com.hankkin.compustrading.fragment.CateDetailFragment;\nimport com.hankkin.compustrading.model.Category;\nimport com.hankkin.compustrading.model.Person;\nimport com.hankkin.compustrading.model.Product;\nimport com.hankkin.compustrading.view.PagerSlidingTabStrip;\nimport com.hankkin.compustrading.view.RippleView;\nimport com.hankkin.compustrading.view.RoundedImageView;\nimport com.hankkin.compustrading.view.floatbutton.FloatingActionButton;\nimport com.hankkin.compustrading.view.floatbutton.FloatingActionsMenu;\nimport com.nostra13.universalimageloader.core.ImageLoader;\n\nimport java.io.Serializable;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport butterknife.Bind;\nimport butterknife.ButterKnife;\nimport cn.bmob.v3.BmobQuery;\nimport cn.bmob.v3.BmobUser;\nimport cn.bmob.v3.exception.BmobException;\nimport cn.bmob.v3.listener.FindListener;\nimport cn.bmob.v3.update.BmobUpdateAgent;\n\n\npublic class MainShowActivity extends BaseActivity {\n\n\n    /**\n     * 分类滑动选项卡\n     */\n    private PagerSlidingTabStrip pagerTab;\n    /**\n     * 滑动组件\n     */\n    private ViewPager pager;\n    /**\n     * 选项fragment界面\n     */\n    private ArrayList<CateDetailFragment> fragments;\n\n    /**\n     * 分类数组\n     */\n    private ArrayList<Category> categories = new ArrayList<>();\n    /**\n     * 分类界面适配器\n     */\n    private CategoryFragmentAdapter adapter;\n\n    DrawerLayout drawerLayout;\n    ActionBarDrawerToggle drawerToggle;\n    @Bind(R.id.rv_usericon)\n    RoundedImageView rvUser;\n    @Bind(R.id.tv_person)\n    TextView tvPerson;\n    @Bind(R.id.rv_logreg)\n    RippleView rvLogReg;\n    @Bind(R.id.tv_username)\n    TextView tvName;\n    @Bind(R.id.rv_buy)\n    RippleView rvBuy;\n    @Bind(R.id.rv_sale)\n    RippleView rvSale;\n    @Bind(R.id.rv_sina)\n    RippleView rvSina;\n    @Bind(R.id.rv_qq)\n    RippleView rvQQ;\n    @Bind(R.id.tv_qq)\n    TextView tvQQ;\n    @Bind(R.id.tv_sina)\n    TextView tvSina;\n    @Bind(R.id.tv_buy)\n    TextView tvBuy;\n    @Bind(R.id.tv_sale)\n    TextView tvSale;\n    @Bind(R.id.tv_show)\n    TextView tvShow;\n\n    private Handler handler;\n    private Person person;\n\n    @Bind(R.id.multiple_actions)\n    FloatingActionsMenu floatingActionsMenu;\n    public static MainShowActivity instance;\n\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        instance = this;\n        setContentView(R.layout.activity_main_show);\n        BmobUpdateAgent.update(this);\n        ButterKnife.bind(this);\n        init();\n\n        handler = new Handler() {\n            @Override\n            public void handleMessage(Message msg) {\n                super.handleMessage(msg);\n                if (msg.what == 0) {\n                    for (int i = 0; i < categories.size(); i++) {\n                        CateDetailFragment fragment = new CateDetailFragment();\n                        fragment.setFab(floatingActionsMenu);\n                        Bundle bundle = new Bundle();\n                        bundle.putInt(\"cid\", categories.get(i).getId());\n                        bundle.putSerializable(\"products\", (Serializable) msg.obj);\n                        fragment.setArguments(bundle);\n                        fragments.add(fragment);\n                    }\n\n                    adapter = new CategoryFragmentAdapter(getSupportFragmentManager(), fragments, categories);\n                    pager.setAdapter(adapter);\n                    pagerTab.setViewPager(pager);\n                    dimissDialog();\n                }\n            }\n        };\n\n    }\n\n    /**\n     * 初始化数据\n     * by Hankkin at:2015-11-29 19:29:52\n     */\n    private void init() {\n\n\n        drawerLayout = (DrawerLayout) findViewById(R.id.drawerlayout);\n        drawerToggle = new ActionBarDrawerToggle(MainShowActivity.this, drawerLayout, R.string.hello_world, R.string.hello_world);\n        drawerLayout.setDrawerListener(drawerToggle);\n\n        //设定左上角突变可点击\n        getSupportActionBar().setHomeButtonEnabled(true);\n        // 给左上角图标的左边加上一个返回的图标 。对应ActionBar.DISPLAY_HOME_AS_UP\n        getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n        //设置标题\n        getSupportActionBar().setTitle(getResources().getString(R.string.action_title));\n\n        pager = (ViewPager) findViewById(R.id.pager);\n        pagerTab = (PagerSlidingTabStrip) findViewById(R.id.tab);\n        pager.setOffscreenPageLimit(4);\n\n\n        fragments = new ArrayList<>();\n\n\n        /**\n         * 更新按钮点击事件\n         * by Hankkin at:2015-12-23 17:29:52\n         */\n        FloatingActionButton fbUpdate = (FloatingActionButton) findViewById(R.id.fb_update);\n        fbUpdate.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                fragments.get(pager.getCurrentItem()).hideFab();\n                fragments.get(pager.getCurrentItem()).updatePeo();\n\n            }\n        });\n        /**\n         * 新建按钮点击事件\n         * by Hankkin at:2015-12-23 17:30:17\n         */\n        FloatingActionButton fbWrite = (FloatingActionButton) findViewById(R.id.fb_new);\n        fbWrite.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                Person person = BmobUser.getCurrentUser(Person.class);\n                if (person != null) {\n                    fragments.get(pager.getCurrentItem()).hideFab();\n                    Intent intent = new Intent(MainShowActivity.this, NewProductActivity.class);\n                    startActivity(intent);\n                } else {\n                    fragments.get(pager.getCurrentItem()).hideFab();\n                    Intent intent = new Intent(MainShowActivity.this, LoginActivity.class);\n                    startActivity(intent);\n                    HankkinUtils.showToast(MainShowActivity.this, \"请先登录\");\n                }\n            }\n        });\n\n        FloatingActionButton fbMy = (FloatingActionButton) findViewById(R.id.fb_person);\n        fbMy.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                fragments.get(pager.getCurrentItem()).hideFab();\n                Intent intent = new Intent(MainShowActivity.this, PersonActivity.class);\n                startActivity(intent);\n            }\n        });\n\n        person = getCurrentPerson(MainShowActivity.this);\n        if (person != null) {\n            rvBuy.setVisibility(View.VISIBLE);\n            rvSale.setVisibility(View.VISIBLE);\n            rvQQ.setVisibility(View.GONE);\n            rvSina.setVisibility(View.GONE);\n            if (!TextUtils.isEmpty(person.getUser_icon())) {\n                ImageLoader.getInstance().displayImage(person.getUser_icon(), rvUser);\n            }\n            tvPerson.setText(\"个人中心\");\n            if (!TextUtils.isEmpty(person.getNickname())) {\n                tvName.setText(person.getNickname());\n            } else {\n                tvName.setText(\"用户\" + person.getUsername().substring(0, 3));\n            }\n            tvShow.setText(\"我的\");\n        } else {\n            rvUser.setBackground(getResources().getDrawable(R.drawable.defaut));\n            tvPerson.setText(\"登录或注册\");\n            tvName.setText(\"\");\n            rvBuy.setVisibility(View.GONE);\n            rvSale.setVisibility(View.GONE);\n            rvQQ.setVisibility(View.VISIBLE);\n            rvSina.setVisibility(View.VISIBLE);\n            tvShow.setText(\"其他登录方式\");\n        }\n\n\n        rvLogReg.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {\n            @Override\n            public void onComplete(RippleView rippleView) {\n                if (person != null) {\n                    Intent intent = new Intent(MainShowActivity.this, PersonActivity.class);\n                    startActivity(intent);\n                } else {\n                    Intent intent = new Intent(MainShowActivity.this, LoginActivity.class);\n                    startActivity(intent);\n                }\n            }\n        });\n        rvBuy.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {\n            @Override\n            public void onComplete(RippleView rippleView) {\n                drawerLayout.closeDrawers();\n            }\n        });\n        rvSale.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {\n            @Override\n            public void onComplete(RippleView rippleView) {\n                Intent intent = new Intent(MainShowActivity.this, NewProductActivity.class);\n                startActivity(intent);\n                drawerLayout.closeDrawers();\n            }\n        });\n\n\n        ArrayList<Category> categoryList = new ArrayList<>();\n        categoryList = (ArrayList<Category>) getIntent().getSerializableExtra(\"categories\");\n        if (categoryList!=null){\n            if (categoryList.size()>0){\n                categories.addAll(categoryList);\n                queryProductsHttp();\n            }\n            else {\n                queryCategory();\n            }\n        }\n        else {\n            queryCategory();\n        }\n    }\n\n\n\n\n    private void queryProductsHttp() {\n        BmobQuery<Product> productBmobQuery = new BmobQuery<>();\n        productBmobQuery.order(\"-createdAt\");\n        productBmobQuery.findObjects(new FindListener<Product>() {\n            @Override\n            public void done(List<Product> list, BmobException e) {\n                if (e == null){\n                    if (list != null && list.size() > 0) {\n                        List<Product> data = new ArrayList<Product>();\n                        for (Product p : list) {\n                            data.add(p);\n                        }\n                        Message msg = new Message();\n                        msg.what = 0;\n                        msg.obj = data;\n                        handler.sendMessage(msg);\n                    }\n                }\n            }\n        });\n\n    }\n\n    @Override\n    public void onPostCreate(Bundle savedInstanceState) {\n        super.onPostCreate(savedInstanceState);\n        //该方法会自动和actionBar关联, 将开关的图片显示在了action上，如果不设置，也可以有抽屉的效果，不过是默认的图标\n        drawerToggle.syncState();\n    }\n\n    /** 设备配置改变时 */\n    @Override\n    public void onConfigurationChanged(Configuration newConfig) {\n        super.onConfigurationChanged(newConfig);\n        drawerToggle.onConfigurationChanged(newConfig);\n    }\n\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        // Inflate the menu; this adds items to the action bar if it is present.\n        getMenuInflater().inflate(R.menu.menu_main, menu);\n        return true;\n    }\n\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        if (drawerToggle.onOptionsItemSelected(item))\n            return true;\n\n        // Handle action bar item clicks here. The action bar will\n        // automatically handle clicks on the Home/Up button, so long\n        // as you specify a parent activity in AndroidManifest.xml.\n        int id = item.getItemId();\n\n        //noinspection SimplifiableIfStatement\n        if (id == R.id.action_person) {\n            Intent intent = new Intent(MainShowActivity.this, PersonActivity.class);\n            startActivity(intent);\n        }\n\n        return super.onOptionsItemSelected(item);\n    }\n\n\n    @Override\n    protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n        super.onActivityResult(requestCode, resultCode, data);\n    }\n\n    @Override\n    public boolean onKeyDown(int keyCode, KeyEvent event) {\n        if (keyCode == KeyEvent.KEYCODE_BACK) {\n            if (floatingActionsMenu.isExpanded()) {\n                floatingActionsMenu.collapse();\n                return true;\n            }\n        }\n        return super.onKeyDown(keyCode, event);\n    }\n\n    /**\n     * Bmob查询分类数据显示选项卡\n     * by Hankkin at:2015-11-29 19:39:45\n     */\n    private void queryCategory() {\n        showLoadingDialog();\n        BmobQuery<Category> categoryBmobQuery = new BmobQuery<>();\n        categoryBmobQuery.order(\"createdAt\");// 按照时间降序\n        categoryBmobQuery.findObjects(new FindListener<Category>() {\n            @Override\n            public void done(List<Category> list, BmobException e) {\n                if (e == null){\n                    if (list != null && list.size() > 0) {\n                        categories = new ArrayList<Category>();\n                        categories.addAll(list);\n                        queryProductsHttp();\n                    }\n                }\n                else {\n                    HankkinUtils.showToast(MainShowActivity.this, e.getMessage());\n                }\n            }\n        });\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/NewProductActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport android.os.Bundle;\nimport android.text.TextUtils;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.AdapterView;\nimport android.widget.ArrayAdapter;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.ImageView;\nimport android.widget.ListView;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.FileUploadListener;\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.BitmapUtils;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.model.Product;\nimport com.weiwangcn.betterspinner.library.BetterSpinner;\n\nimport java.util.Date;\n\nimport butterknife.Bind;\nimport butterknife.ButterKnife;\nimport butterknife.OnClick;\nimport cn.bmob.v3.exception.BmobException;\nimport cn.bmob.v3.listener.SaveListener;\nimport me.drakeet.materialdialog.MaterialDialog;\n\npublic class NewProductActivity extends BaseActivity {\n\n    @Bind(R.id.et_tel)\n    EditText etTel;\n    @Bind(R.id.et_name)\n    EditText etName;\n    @Bind(R.id.et_price)\n    EditText etPrice;\n    @Bind(R.id.spinner_school)\n    BetterSpinner spinnerSchool;\n    @Bind(R.id.tv_cate)\n    TextView tvCate;\n    @Bind(R.id.btn_fabu)\n    Button btnFabu;\n    @Bind(R.id.iv_add_pro)\n    ImageView ivAddPro;\n    @Bind(R.id.tv_back)\n    TextView tvBack;\n\n    private String[] schools;\n    private String filePath = \"\";\n    private int cid=0;\n\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_new_product);\n        ButterKnife.bind(this);\n\n        init();\n\n    }\n\n    private void init(){\n        schools = getResources().getStringArray(R.array.school);\n        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,\n                android.R.layout.simple_dropdown_item_1line, schools);\n        spinnerSchool.setAdapter(adapter);\n//        String tel = HankkinUtils.getPhoneNumber(NewProductActivity.this);\n//        if (!TextUtils.isEmpty(tel)){\n//            etTel.setText(tel);\n//        }\n\n        tvBack.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                finish();\n            }\n        });\n    }\n\n    /**\n     * 选择分类对话框\n     * by Hankkin at:2015-12-24 17:39:17\n     */\n    @OnClick(R.id.tv_cate)\n    void showCate(){\n        final ArrayAdapter<String> arrayAdapter\n                = new ArrayAdapter<String>(this,\n                android.R.layout.simple_list_item_1);\n        final String[] cates = getResources().getStringArray(R.array.cate);\n        for (int j = 0; j < cates.length; j++) {\n            arrayAdapter.add(cates[j]);\n        }\n\n        ListView listView = new ListView(this);\n        listView.setLayoutParams(new ViewGroup.LayoutParams(\n                ViewGroup.LayoutParams.MATCH_PARENT,\n                ViewGroup.LayoutParams.MATCH_PARENT));\n        float scale = getResources().getDisplayMetrics().density;\n        listView.setDividerHeight(1);\n        listView.setAdapter(arrayAdapter);\n        final MaterialDialog alert = new MaterialDialog(this).setTitle(\n                \"请选择分类\").setContentView(listView);\n\n        alert.show();\n        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n            @Override\n            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n                String cate = cates[position];\n                tvCate.setText(cate);\n                cid = position;\n                alert.dismiss();\n            }\n        });\n    }\n\n\n    /**\n     * 选择图片对话框\n     * by Hankkin at:2015-12-20 23:25:37\n     */\n    @OnClick(R.id.iv_add_pro)\n    void showMDdialog() {\n        View view = LayoutInflater.from(NewProductActivity.this).inflate(R.layout.view_select_img, null, false);\n        final MaterialDialog dialog = new MaterialDialog(this).setView(view);\n        dialog.show();\n        TextView tvGallery = (TextView) view.findViewById(R.id.tv_gallery);\n        tvGallery.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                dialog.dismiss();\n                getImageFromGallery(NewProductActivity.this);\n            }\n        });\n        TextView tvCamera = (TextView) view.findViewById(R.id.tv_camera);\n        tvCamera.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                dialog.dismiss();\n                filePath = iniFilePath(NewProductActivity.this);\n                goCamera(NewProductActivity.this, filePath);\n            }\n        });\n    }\n\n    /**\n     * 接受选择照片的结果显示\n     * by Hankkin at:2015-12-24 17:41:49\n     * @param requestCode\n     * @param resultCode\n     * @param data\n     */\n    @Override\n    protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n        super.onActivityResult(requestCode, resultCode, data);\n\n        if (requestCode == REQUEST_CODE_GALLERY) {\n            if(data == null){\n                return;\n            }\n            filePath = getAbsoluteImagePath(NewProductActivity.this, data.getData());\n            if (!TextUtils.isEmpty(filePath)) {\n                ivAddPro.setImageBitmap(BitmapUtils.getCompressedBitmap(NewProductActivity.this, filePath));\n            }\n        } else if (requestCode == REQUST_CODE_CAMERA) {\n            if (!TextUtils.isEmpty(filePath)) {\n              Bitmap  temp  =  BitmapUtils.getCompressedBitmap(NewProductActivity.this, filePath);\n                if(temp==null){\n                    return;\n                }\n                ivAddPro.setImageBitmap(temp);\n            }\n        }\n    }\n\n    /**\n     * 发布按钮点击事件\n     * 上传图片， 创建新商品\n     * by Hankkin at:2015-12-24 18:33:15\n     */\n    @OnClick(R.id.btn_fabu)\n    void addNewPro(){\n        if (!HankkinUtils.isMobileNO(etTel.getText().toString().trim())){\n            HankkinUtils.showToast(NewProductActivity.this,\"请输入正确的手机号\");\n            return;\n        }\n        if (TextUtils.isEmpty(etPrice.getText().toString().trim())||\n                TextUtils.isEmpty(etTel.getText().toString().trim())||\n                TextUtils.isEmpty(etName.getText().toString().trim())){\n            HankkinUtils.showToast(NewProductActivity.this,\"请完善信息\");\n            return;\n        }\n        if (TextUtils.isEmpty(tvCate.getText())||TextUtils.isEmpty(spinnerSchool.getText().toString())){\n            HankkinUtils.showToast(NewProductActivity.this,\"请完善信息\");\n            return;\n        }\n        if (!TextUtils.isEmpty(filePath)){\n            showLoadingDialog();\n            Bitmap tempBitmap = BitmapUtils.getCompressedBitmap(NewProductActivity.this, filePath);\n            if (BitmapUtils.readPictureDegree(filePath) == 90) {\n                tempBitmap = BitmapUtils.toturn(tempBitmap);\n            }\n            filePath = BitmapUtils.saveBitmap(tempBitmap,new Date().getTime() + \"\");\n\n            uploadImg(filePath, NewProductActivity.this, new FileUploadListener() {\n                @Override\n                public void success(String url) {\n                    Product product = new Product();\n                    product.setName(etName.getText().toString());\n                    product.setCid(cid);\n                    product.setUsername(getCurrentPerson(NewProductActivity.this).getNickname());\n                    product.setPrice(etPrice.getText().toString());\n                    product.setSchool(spinnerSchool.getText().toString());\n                    product.setProduct_url(url);\n                    product.setUser_tel(etTel.getText().toString());\n                    product.setUser_icon_url(getCurrentPerson(NewProductActivity.this).getUser_icon());\n                    addProHttp(product);\n                }\n\n                @Override\n                public void fail() {\n                    dimissDialog();\n                    HankkinUtils.showToast(NewProductActivity.this, \"发布失败\");\n                }\n            });\n        }\n    }\n\n    /**\n     * 保存新商品\n     * by Hankkin at:2015-12-24 18:32:38\n     * @param product\n     */\n    private void addProHttp(final Product product){\n        product.save(new SaveListener<String>() {\n            @Override\n            public void done(String s, BmobException e) {\n                if (e == null){\n                    dimissDialog();\n                    HankkinUtils.showToast(NewProductActivity.this, \"发布成功\");\n                    finish();\n                }\n                else {\n                    dimissDialog();\n                    HankkinUtils.showToast(NewProductActivity.this,\"发布失败\");\n                }\n            }\n        });\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/PersonActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport android.os.Bundle;\nimport android.text.TextUtils;\nimport android.util.DisplayMetrics;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.FileUploadListener;\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.BitmapUtils;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.model.Person;\nimport com.hankkin.compustrading.model.PersonShow;\nimport com.hankkin.compustrading.view.PullToZoomScrollViewEx;\nimport com.hankkin.compustrading.view.RippleView;\nimport com.hankkin.compustrading.view.RoundedImageView;\nimport com.nostra13.universalimageloader.core.ImageLoader;\n\nimport java.util.ArrayList;\nimport java.util.Date;\nimport java.util.List;\n\nimport butterknife.Bind;\nimport cn.bmob.v3.exception.BmobException;\nimport cn.bmob.v3.listener.UpdateListener;\nimport me.drakeet.materialdialog.MaterialDialog;\n\npublic class PersonActivity extends BaseActivity {\n    @Bind(R.id.tv_back)\n    TextView tvBack;\n    private PullToZoomScrollViewEx scrollView;\n    private List<PersonShow> data = new ArrayList<>();\n\n    private TextView tvLogin, tvRegister;\n    private RoundedImageView ivUserIcon;\n\n    View headView;\n    View zoomView;\n    View contentView;\n\n    public static PersonActivity instance;\n    private String filePath = \"\";\n    private RippleView rvLogout;\n    private RippleView rvBuy;\n    private RippleView rvSale;\n    private TextView tvLogout;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        instance = this;\n        setContentView(R.layout.activity_person);\n        initViews();\n        initData();\n    }\n\n    private void initViews() {\n        tvBack = (TextView) findViewById(R.id.tv_back);\n        scrollView = (PullToZoomScrollViewEx) findViewById(R.id.my_pull_scoll);\n        loadViewForCode();\n\n        scrollView.getPullRootView().findViewById(R.id.tv_test1).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n            }\n        });\n\n\n        DisplayMetrics localDisplayMetrics = new DisplayMetrics();\n        getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);\n        int mScreenHeight = localDisplayMetrics.heightPixels;\n        int mScreenWidth = localDisplayMetrics.widthPixels;\n        LinearLayout.LayoutParams localObject = new LinearLayout.LayoutParams(mScreenWidth, (int) (9.0F * (mScreenWidth / 16.0F)));\n        scrollView.setHeaderLayoutParams(localObject);\n\n        tvBack.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                finish();\n            }\n        });\n    }\n\n    private void initData() {\n\n        Person person = Person.getCurrentUser(Person.class);\n        if (person != null) {\n            ImageLoader.getInstance().displayImage(person.getUser_icon(), ivUserIcon);\n            tvLogin.setVisibility(View.GONE);\n            tvRegister.setVisibility(View.GONE);\n            tvLogout.setText(\"退出账号\");\n        } else {\n            tvLogin.setVisibility(View.VISIBLE);\n            tvRegister.setVisibility(View.VISIBLE);\n            ivUserIcon.setImageDrawable(getResources().getDrawable(R.drawable.defaut));\n            tvLogout.setText(\"登录\");\n        }\n\n    }\n\n    private void loadViewForCode() {\n        PullToZoomScrollViewEx scrollView = (PullToZoomScrollViewEx) findViewById(R.id.my_pull_scoll);\n        headView = LayoutInflater.from(this).inflate(R.layout.profile_head_view, null, false);\n        zoomView = LayoutInflater.from(this).inflate(R.layout.profile_zoom_view, null, false);\n        contentView = LayoutInflater.from(this).inflate(R.layout.profile_contect_view, null, false);\n        scrollView.setHeaderView(headView);\n        scrollView.setZoomView(zoomView);\n        scrollView.setScrollContentView(contentView);\n\n        tvLogin = (TextView) headView.findViewById(R.id.tv_login);\n        tvRegister = (TextView) headView.findViewById(R.id.tv_register);\n        ivUserIcon = (RoundedImageView) headView.findViewById(R.id.iv_user_head);\n        rvLogout = (RippleView) contentView.findViewById(R.id.rv_logout);\n        tvLogout = (TextView) contentView.findViewById(R.id.tv_logout);\n        rvLogout.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {\n            @Override\n            public void onComplete(RippleView rippleView) {\n                Person.logOut();\n                HankkinUtils.showToast(PersonActivity.this, \"已注销\");\n                initData();\n                finish();\n            }\n        });\n\n        rvBuy = (RippleView) contentView.findViewById(R.id.rv_buy);\n        rvBuy.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {\n            @Override\n            public void onComplete(RippleView rippleView) {\n                finish();\n            }\n        });\n\n        rvSale = (RippleView) contentView.findViewById(R.id.rv_sale);\n        rvSale.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {\n            @Override\n            public void onComplete(RippleView rippleView) {\n                Intent intent = new Intent(PersonActivity.this,NewProductActivity.class);\n                startActivity(intent);\n                finish();\n            }\n        });\n\n        tvLogin.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                Intent intent = new Intent(PersonActivity.this, LoginActivity.class);\n                startActivity(intent);\n            }\n        });\n\n        tvRegister.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                Intent intent = new Intent(PersonActivity.this, RegisterActivity.class);\n                startActivity(intent);\n            }\n        });\n        ivUserIcon.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                if (getCurrentPerson(PersonActivity.this)!=null){\n                    showMDdialog();\n                }\n            }\n        });\n    }\n\n    /**\n     * 选择图片对话框\n     * by Hankkin at:2015-12-20 23:25:37\n     */\n    private void showMDdialog() {\n        View view = LayoutInflater.from(PersonActivity.this).inflate(R.layout.view_select_img, null, false);\n        final MaterialDialog dialog = new MaterialDialog(this).setView(view);\n        dialog.show();\n        TextView tvGallery = (TextView) view.findViewById(R.id.tv_gallery);\n        tvGallery.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                dialog.dismiss();\n                getImageFromGallery(PersonActivity.this);\n            }\n        });\n        TextView tvCamera = (TextView) view.findViewById(R.id.tv_camera);\n        tvCamera.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                dialog.dismiss();\n                filePath = iniFilePath(PersonActivity.this);\n                goCamera(PersonActivity.this, filePath);\n            }\n        });\n    }\n\n    @Override\n    protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n        super.onActivityResult(requestCode, resultCode, data);\n        if (requestCode == REQUEST_CODE_GALLERY) {\n            showLoadingDialog();\n            filePath = getPath(PersonActivity.this, data.getData());\n            if (!TextUtils.isEmpty(filePath)) {\n                uploadImg(filePath, PersonActivity.this, new FileUploadListener() {\n\n                    @Override\n                    public void success(final String url) {\n                        Person person = Person.getCurrentUser( Person.class);\n                        person.setUser_icon(url);\n                        ImageLoader.getInstance().displayImage(url, ivUserIcon);\n                        updateUser(person);\n                    }\n\n                    @Override\n                    public void fail() {\n                        dimissDialog();\n                        HankkinUtils.showToast(PersonActivity.this, \"上传失败\");\n                    }\n                });\n            }\n        } else if (requestCode == REQUST_CODE_CAMERA) {\n            showLoadingDialog();\n            if (!TextUtils.isEmpty(filePath)) {\n                Bitmap tempBitmap = BitmapUtils.getCompressedBitmap(PersonActivity.this, filePath);\n                if (BitmapUtils.readPictureDegree(filePath) == 90) {\n                    tempBitmap = BitmapUtils.toturn(tempBitmap);\n                }\n                filePath = BitmapUtils.saveBitmap(tempBitmap,new Date().getTime() + \"\");\n                uploadImg(filePath, PersonActivity.this, new FileUploadListener() {\n\n                    @Override\n                    public void success(String url) {\n                        Person person = Person.getCurrentUser(Person.class);\n                        person.setUser_icon(url);\n//                        MyImageLoader.getInstance().displayImage(PersonActivity.this,url, ivUserIcon);\n                        ImageLoader.getInstance().displayImage(url, ivUserIcon);\n                        updateUser(person);\n                    }\n\n                    @Override\n                    public void fail() {\n                        dimissDialog();\n                        HankkinUtils.showToast(PersonActivity.this, \"上传失败\");\n                    }\n                });\n            }\n        }\n    }\n\n    /**\n     * 更新个人用户信息\n     * by Hankkin at:2015-12-23 19:34:17\n     *\n     * @param person\n     */\n    private void updateUser(Person person) {\n        person.update(person.getObjectId(), new UpdateListener() {\n            @Override\n            public void done(BmobException e) {\n                if (e == null){\n                    dimissDialog();\n                    HankkinUtils.showToast(PersonActivity.this, \"上传成功\");\n                }\n            }\n        });\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/ProdectDetailActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.os.Bundle;\nimport android.support.design.widget.CollapsingToolbarLayout;\nimport android.support.v7.app.AppCompatActivity;\nimport android.support.v7.widget.Toolbar;\nimport android.view.Gravity;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.view.WindowManager;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.model.Product;\nimport com.nostra13.universalimageloader.core.ImageLoader;\n\npublic class ProdectDetailActivity extends AppCompatActivity {\n\n    private Product product;\n    private TextView tvDesc,tvProName,tvTime,tvSchool,tvPrice;\n    private ImageView ivPro;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_prodect_detail);\n\n        product = (Product) getIntent().getSerializableExtra(\"product\");\n\n        tvDesc = (TextView) findViewById(R.id.tv_pro_desc);\n        tvProName = (TextView) findViewById(R.id.tv_pro_name);\n        ivPro = (ImageView) findViewById(R.id.iv_product);\n        tvTime = (TextView) findViewById(R.id.tv_time);\n        tvSchool = (TextView) findViewById(R.id.tv_school);\n        tvPrice = (TextView) findViewById(R.id.tv_price);\n\n        //透明状态栏\n        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n        //透明导航栏\n        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n        toolbar.setNavigationIcon(android.support.v7.appcompat.R.drawable.abc_ic_ab_back_material);\n        toolbar.setNavigationOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                finish();\n            }\n        });\n        toolbar.inflateMenu(R.menu.menu_prodect_detail);\n        toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {\n            @Override\n            public boolean onMenuItemClick(MenuItem item) {\n                switch (item.getItemId()) {\n                    case R.id.action_share:\n                        HankkinUtils.showToast(ProdectDetailActivity.this, \"分享\");\n                        break;\n                    case R.id.action_settings:\n                        HankkinUtils.showToast(ProdectDetailActivity.this, \"举报\");\n                        break;\n                }\n                return false;\n            }\n        });\n\n        CollapsingToolbarLayout collapsingAvatarToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);\n        collapsingAvatarToolbar.setBackgroundColor(getResources().getColor(R.color.theme_color));\n        collapsingAvatarToolbar.setExpandedTitleGravity(Gravity.CENTER_VERTICAL);\n        collapsingAvatarToolbar.setExpandedTitleColor(getResources().getColor(R.color.theme_color));\n        TextView tv = (TextView) findViewById(R.id.username);\n        tv.setText(product.getUsername());\n\n\n        tvProName.setText(product.getName());\n        tvDesc.setText(product.getDesc());\n        ImageLoader.getInstance().displayImage(product.getProduct_url(),ivPro);\n        tvPrice.setText(\"￥\" + product.getPrice());\n        tvSchool.setText(product.getSchool());\n        tvTime.setText(product.getCreatedAt());\n\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/RegisterActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.text.TextUtils;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.model.Person;\nimport com.hankkin.compustrading.sharepreference.MySP;\nimport com.pnikosis.materialishprogress.ProgressWheel;\n\nimport butterknife.Bind;\nimport butterknife.ButterKnife;\nimport butterknife.OnClick;\nimport cn.bmob.v3.BmobUser;\nimport cn.bmob.v3.exception.BmobException;\nimport cn.bmob.v3.listener.LogInListener;\nimport cn.bmob.v3.listener.SaveListener;\n\npublic class RegisterActivity extends AppCompatActivity {\n\n    @Bind(R.id.btn_register)\n    Button btnRegister;\n    @Bind(R.id.et_login_name)\n    EditText etName;\n    @Bind(R.id.et_login_pwd)\n    EditText etPwd;\n    @Bind(R.id.tv_back)\n    TextView tvBack;\n    @Bind(R.id.pw_loading)\n    ProgressWheel wheel;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_register);\n\n        ButterKnife.bind(this);\n\n        initViews();\n    }\n\n    private void initViews(){\n        wheel.stopSpinning();\n    }\n\n    /**\n     * 注册用户\n     * by Hankkin at:2015-12-20 21:13:02\n     */\n    @OnClick(R.id.btn_register)\n    public void register(View view){\n        wheel.spin();\n        final String name = etName.getText().toString().trim();\n        final String pwd = etPwd.getText().toString().trim();\n        if (TextUtils.isEmpty(name)){\n            HankkinUtils.showToast(RegisterActivity.this,\"用户名不能为空\");\n            return;\n        }\n        if (TextUtils.isEmpty(pwd)){\n            HankkinUtils.showToast(RegisterActivity.this,\"密码不能为空\");\n            return;\n        }\n        if (!HankkinUtils.isMobileNO(name)){\n            HankkinUtils.showToast(RegisterActivity.this,\"请输入正确的手机号\");\n            return;\n        }\n        Person person = new Person();\n        person.setUsername(name);\n        person.setPassword(pwd);\n        person.signUp(new SaveListener<Object>() {\n            @Override\n            public void done(Object o, BmobException e) {\n                if (e == null){\n                    MySP.setPASSWoRD(RegisterActivity.this,pwd);\n                    MySP.setUSERNAME(RegisterActivity.this, name);\n                    wheel.stopSpinning();\n                    HankkinUtils.showToast(RegisterActivity.this, \"注册成功\");\n                    Intent intent = new Intent(RegisterActivity.this,MainShowActivity.class);\n                    startActivity(intent);\n                    finish();\n                    if (LoginActivity.instance!=null){\n                        LoginActivity.instance.finish();\n                    }\n                    if (PersonActivity.instance!=null){\n                        PersonActivity.instance.finish();\n                    }\n                    if (MainShowActivity.instance!=null){\n                        MainShowActivity.instance.finish();\n                    }\n                    BmobUser.loginByAccount(\"username\", \"用户密码\", new LogInListener<Person>() {\n                        @Override\n                        public void done(Person person, BmobException e) {\n                            if (e == null){\n\n                            }\n                        }\n                    });\n                }\n                else {\n                    wheel.stopSpinning();\n                    HankkinUtils.showToast(RegisterActivity.this, \"注册失败\");\n                }\n            }\n        });\n    }\n\n    @OnClick(R.id.tv_back)\n    void back(){\n        finish();\n    }\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/SearchProActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.view.Menu;\nimport android.view.MenuItem;\n\nimport com.hankkin.compustrading.R;\n\npublic class SearchProActivity extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_search_pro);\n    }\n\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        // Inflate the menu; this adds items to the action bar if it is present.\n        getMenuInflater().inflate(R.menu.menu_search, menu);\n        return true;\n    }\n\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        // Handle action bar item clicks here. The action bar will\n        // automatically handle clicks on the Home/Up button, so long\n        // as you specify a parent activity in AndroidManifest.xml.\n        int id = item.getItemId();\n\n        //noinspection SimplifiableIfStatement\n        if (id == R.id.action_settings) {\n            return true;\n        }\n\n        return super.onOptionsItemSelected(item);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/SplasActivity.java",
    "content": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.WindowManager;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.model.Category;\n\nimport java.io.File;\nimport java.io.Serializable;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport cn.bmob.v3.BmobQuery;\nimport cn.bmob.v3.exception.BmobException;\nimport cn.bmob.v3.listener.FindListener;\n\npublic class SplasActivity extends BaseActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_splas);\n        //透明状态栏\n        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n        //透明导航栏\n        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n        long size = new File(Environment.getExternalStorageDirectory().getPath() + File.separator + \"compustrading\" +\"/app-release.apk\").length();\n        new Thread(new Runnable() {\n            @Override\n            public void run() {\n                try {\n                    Thread.sleep(2000);\n                    queryCategory();\n                } catch (InterruptedException e) {\n                    e.printStackTrace();\n                }\n            }\n        }).start();\n    }\n\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        // Inflate the menu; this adds items to the action bar if it is present.\n        getMenuInflater().inflate(R.menu.menu_splas, menu);\n        return true;\n    }\n\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        // Handle action bar item clicks here. The action bar will\n        // automatically handle clicks on the Home/Up button, so long\n        // as you specify a parent activity in AndroidManifest.xml.\n        int id = item.getItemId();\n\n        //noinspection SimplifiableIfStatement\n        if (id == R.id.action_settings) {\n            return true;\n        }\n\n        return super.onOptionsItemSelected(item);\n    }\n\n    /**\n     * Bmob查询分类数据显示选项卡\n     * by Hankkin at:2015-11-29 19:39:45\n     */\n    private void queryCategory() {\n        BmobQuery<Category> categoryBmobQuery = new BmobQuery<>();\n        categoryBmobQuery.order(\"createdAt\");// 按照时间降序\n        categoryBmobQuery.findObjects(new FindListener<Category>() {\n            @Override\n            public void done(List<Category> list, BmobException e) {\n                if (e == null){\n                    if (list != null && list.size() > 0) {\n                        ArrayList<Category> categories = new ArrayList<Category>();\n                        categories.addAll(list);\n                        Intent intent = new Intent(SplasActivity.this,MainShowActivity.class);\n                        Bundle bundle = new Bundle();\n                        bundle.putSerializable(\"categories\", (Serializable) categories);\n                        intent.putExtras(bundle);\n                        startActivity(intent);\n                        finish();\n                    }\n                }\n                else {\n                    HankkinUtils.showToast(SplasActivity.this, e.getMessage());\n                }\n            }\n\n        });\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/adapter/CategoryFragmentAdapter.java",
    "content": "package com.hankkin.compustrading.adapter;\n\nimport android.support.v4.app.Fragment;\nimport android.support.v4.app.FragmentManager;\nimport android.support.v4.app.FragmentPagerAdapter;\n\nimport com.hankkin.compustrading.fragment.CateDetailFragment;\nimport com.hankkin.compustrading.model.Category;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Created by Hankkin on 15/11/29.\n */\npublic class CategoryFragmentAdapter extends FragmentPagerAdapter {\n\n    private List<CateDetailFragment> fragments;\n    private ArrayList<Category> categories;\n\n    public CategoryFragmentAdapter(FragmentManager fm, List<CateDetailFragment> fragments,ArrayList<Category> categories) {\n        super(fm);\n        this.fragments = fragments;\n        this.categories = categories;\n    }\n\n    public CategoryFragmentAdapter(FragmentManager fm) {\n        super(fm);\n    }\n\n    @Override\n    public Fragment getItem(int position) {\n        return fragments.get(position);\n    }\n\n    @Override\n    public int getCount() {\n        return categories.size();\n    }\n\n    public String getPageTitle(int i){\n        return categories.get(i).getName();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/adapter/PersonInfoAdapter.java",
    "content": "package com.hankkin.compustrading.adapter;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.model.PersonShow;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\n\n/**\n * Created by Hankkin on 15/12/6.\n */\npublic class PersonInfoAdapter extends BaseAdapter {\n    private List<PersonShow> data = new ArrayList<>();\n    private Context context;\n    private LayoutInflater inflater;\n\n    public PersonInfoAdapter(List<PersonShow> data, Context context) {\n        this.data = data;\n        this.context = context;\n        this.inflater = LayoutInflater.from(context);\n    }\n\n    @Override\n    public int getCount() {\n        return data.size();\n    }\n\n    @Override\n    public Object getItem(int position) {\n        return data.get(position);\n    }\n\n    @Override\n    public long getItemId(int position) {\n        return position;\n    }\n\n    @Override\n    public View getView(int position, View convertView, ViewGroup parent) {\n        ViewHolder holder = null;\n        if (convertView == null){\n            holder = new ViewHolder();\n            convertView = inflater.inflate(R.layout.listview_personinfo,null);\n            holder.tvTitle = (TextView) convertView.findViewById(R.id.tv_title);\n            holder.tvContent = (TextView) convertView.findViewById(R.id.tv_content);\n            convertView.setTag(holder);\n        }\n        else {\n            holder = (ViewHolder) convertView.getTag();\n        }\n        holder.tvTitle.setText(data.get(position).getTitle());\n        holder.tvContent.setText(data.get(position).getContent());\n        return convertView;\n    }\n\n    class ViewHolder{\n        TextView tvTitle,tvContent;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/adapter/ProductAdapter.java",
    "content": "package com.hankkin.compustrading.adapter;\n\nimport android.content.Context;\nimport android.text.TextUtils;\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.hankkin.compustrading.R;\nimport com.hankkin.compustrading.model.Product;\nimport com.hankkin.compustrading.view.RoundedImageView;\nimport com.nostra13.universalimageloader.core.ImageLoader;\n\nimport java.util.List;\n\n/**\n * Created by Hankkin on 15/11/29.\n */\npublic class ProductAdapter extends BaseAdapter {\n\n    private List<Product> data;\n    private LayoutInflater inflater;\n    private Context context;\n\n    public ProductAdapter(List<Product> data, Context context) {\n        this.data = data;\n        this.context = context;\n        inflater = LayoutInflater.from(context);\n    }\n\n    @Override\n    public int getCount() {\n        return data.size();\n    }\n\n    @Override\n    public Object getItem(int position) {\n        return data.get(position);\n    }\n\n    @Override\n    public long getItemId(int position) {\n        return position;\n    }\n\n    @Override\n    public View getView(int position, View convertView, ViewGroup parent) {\n        ViewHolder holder = null;\n        if (convertView == null){\n            holder = new ViewHolder();\n            convertView = inflater.inflate(R.layout.lv_product_item,null);\n            holder.ivProduct = (ImageView) convertView.findViewById(R.id.iv_product);\n            holder.rivUserIcon = (RoundedImageView) convertView.findViewById(R.id.riv_usericon);\n            holder.tvName = (TextView) convertView.findViewById(R.id.tv_name);\n            holder.tvPrice = (TextView) convertView.findViewById(R.id.tv_price);\n            holder.tvPubTime = (TextView) convertView.findViewById(R.id.tv_pub_time);\n            holder.tvSchool = (TextView) convertView.findViewById(R.id.tv_school);\n            holder.tvContent = (TextView) convertView.findViewById(R.id.tv_content);\n            convertView.setTag(holder);\n        }\n        else {\n            holder = (ViewHolder) convertView.getTag();\n        }\n        Product product = data.get(position);\n        holder.tvSchool.setText(product.getSchool());\n        holder.tvPubTime.setText(product.getCreatedAt());\n        if (!TextUtils.isEmpty(product.getUsername())){\n            holder.tvName.setText(product.getUsername());\n        }\n        else {\n            holder.tvName.setText(product.getUser_tel());\n        }\n        if (!TextUtils.isEmpty(product.getUser_icon_url())){\n            ImageLoader.getInstance().displayImage(product.getUser_icon_url(),holder.rivUserIcon);\n        }\n        else {\n            holder.rivUserIcon.setImageDrawable(context.getResources().getDrawable(R.drawable.defaut));\n        }\n        holder.tvPrice.setText(\"￥\"+product.getPrice());\n        holder.tvContent.setText(product.getName());\n        ImageLoader.getInstance().displayImage(product.getProduct_url(),holder.ivProduct);\n        return convertView;\n    }\n\n    class ViewHolder{\n        TextView tvPrice,tvPubTime,tvName,tvSchool,tvContent;\n        ImageView ivProduct;\n        RoundedImageView rivUserIcon;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/fragment/CateDetailFragment.java",
    "content": "package com.hankkin.compustrading.fragment;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.support.annotation.Nullable;\nimport android.support.v4.app.Fragment;\nimport android.support.v4.widget.SwipeRefreshLayout;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.AbsListView;\nimport android.widget.AdapterView;\nimport android.widget.ListView;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.ScrollDirectionListener;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\nimport com.hankkin.compustrading.activity.ProdectDetailActivity;\nimport com.hankkin.compustrading.adapter.ProductAdapter;\nimport com.hankkin.compustrading.model.Product;\nimport com.hankkin.compustrading.view.RefreshLayout;\nimport com.hankkin.compustrading.view.floatbutton.FloatingActionsMenu;\n\nimport java.io.Serializable;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.ArrayList;\nimport java.util.Date;\nimport java.util.List;\n\nimport cn.bmob.v3.BmobQuery;\nimport cn.bmob.v3.datatype.BmobDate;\nimport cn.bmob.v3.exception.BmobException;\nimport cn.bmob.v3.listener.FindListener;\n\n/**\n * Created by Hankkin on 15/11/29.\n */\npublic class CateDetailFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener,RefreshLayout.OnLoadListener{\n    private RefreshLayout swipeRefreshLayout;\n    private ListView lvProduct;\n    private List<Product> productList = new ArrayList<>();\n\n    private int cid = 0;\n    private ProductAdapter adapter;\n    private FloatingActionsMenu fab;\n\n\n    @Override\n    public void onCreate(@Nullable Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        if (getArguments() != null) {\n            cid = getArguments().getInt(\"cid\");\n            List<Product> data = (List<Product>) getArguments().getSerializable(\"products\");\n            productList.clear();\n            for (int i = 0; i < data.size(); i++) {\n                if (data.get(i).getCid() == cid) {\n                    productList.add(data.get(i));\n                }\n            }\n        }\n    }\n\n    @Nullable\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n        View view = inflater.inflate(R.layout.fragment_item, container, false);\n        initViews(view);\n\n        return view;\n    }\n\n\n    private void initViews(View view) {\n        lvProduct = (ListView) view.findViewById(R.id.lv_product);\n        swipeRefreshLayout = (RefreshLayout) view.findViewById(R.id.swipeRefreshLayout);\n        swipeRefreshLayout.setChildView(lvProduct);\n        //设置卷内的颜色\n        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,\n                android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);\n        swipeRefreshLayout.setOnLoadListener(this);\n        swipeRefreshLayout.setOnRefreshListener(this);\n\n\n\n        adapter = new ProductAdapter(productList, getActivity());\n        lvProduct.setAdapter(adapter);\n\n    }\n\n    @Override\n    public void onActivityCreated(@Nullable Bundle savedInstanceState) {\n        super.onActivityCreated(savedInstanceState);\n\n        lvProduct.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n            @Override\n            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n                Intent intent = new Intent(getActivity(), ProdectDetailActivity.class);\n                Bundle bundle = new Bundle();\n                bundle.putSerializable(\"product\", (Serializable) adapter.getItem(position));\n                intent.putExtras(bundle);\n                startActivity(intent);\n            }\n        });\n\n        if (fab!=null){\n            fab.attachToListView(lvProduct, new ScrollDirectionListener() {\n                @Override\n                public void onScrollDown() {\n                    Log.d(\"ListViewFragment\", \"onScrollDown()\");\n                }\n\n                @Override\n                public void onScrollUp() {\n                    Log.d(\"ListViewFragment\", \"onScrollUp()\");\n                }\n            }, new AbsListView.OnScrollListener() {\n                @Override\n                public void onScrollStateChanged(AbsListView view, int scrollState) {\n                    Log.d(\"ListViewFragment\", \"onScrollStateChanged()\");\n                }\n\n                @Override\n                public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {\n                    Log.d(\"ListViewFragment\", \"onScroll()\");\n                }\n            });\n        }\n    }\n\n    /**\n     * 根据商品Id查询商品\n     * by Hankkin at:2015-12-19 23:19:41\n     * @param cid\n     */\n    private void queryProductsByIdHttp(int cid) {\n        BmobQuery<Product> productBmobQuery = new BmobQuery<>();\n        productBmobQuery.order(\"-createdAt\");\n        productBmobQuery.setLimit(10);\n        productBmobQuery.addWhereEqualTo(\"cid\", cid);\n        productBmobQuery.findObjects(new FindListener<Product>() {\n            @Override\n            public void done(List<Product> list, BmobException e) {\n                if (e == null){\n                    if (list != null && list.size() > 0) {\n                        productList.clear();\n                        productList.addAll(list);\n                        adapter = new ProductAdapter(productList, getActivity());\n                        lvProduct.setAdapter(adapter);\n                        swipeRefreshLayout.setRefreshing(false);\n                    }\n                }\n                else {\n                    HankkinUtils.showLToast(getActivity(),e.getMessage());\n                }\n            }\n\n\n        });\n    }\n\n    private void queryProductsByIdHttp1(int cid) {\n        BmobQuery<Product> productBmobQuery = new BmobQuery<>();\n        Product product = (Product) adapter.getItem(adapter.getCount() - 1);\n        String time = product.getCreatedAt();\n        SimpleDateFormat sdf = new SimpleDateFormat(time);\n        try {\n            Date date = sdf.parse(time);\n            productBmobQuery.addWhereLessThan(\"createdAt\",new BmobDate(date));\n        } catch (ParseException e) {\n            e.printStackTrace();\n        }\n        productBmobQuery.order(\"-createdAt\");\n        productBmobQuery.setLimit(10);\n        productBmobQuery.addWhereEqualTo(\"cid\", cid);\n        productBmobQuery.findObjects(new FindListener<Product>() {\n            @Override\n            public void done(List<Product> list, BmobException e) {\n                if (e == null){\n                    if (list != null && list.size() > 0) {\n                        productList.addAll(list);\n                        adapter.notifyDataSetChanged();\n                        swipeRefreshLayout.setLoading(false);\n                    } else {\n                        HankkinUtils.showToast(getActivity().getApplicationContext(), \"暂无新数据\");\n                        swipeRefreshLayout.setLoading(false);\n                    }\n                }else {\n                    HankkinUtils.showLToast(getActivity(),e.getMessage());\n                }\n            }\n        });\n    }\n\n    public void updatePeo() {\n        swipeRefreshLayout.setRefreshing(true);\n        new Handler().postDelayed(new Runnable() {\n            @Override\n            public void run() {\n                queryProductsByIdHttp(cid);\n            }\n        }, 2000);\n    }\n\n    @Override\n    public void onLoad() {\n        swipeRefreshLayout.postDelayed(new Runnable() {\n            @Override\n            public void run() {\n                queryProductsByIdHttp1(cid);\n            }\n        }, 2000);\n    }\n\n    @Override\n    public void onRefresh() {\n        swipeRefreshLayout.postDelayed(new Runnable() {\n            @Override\n            public void run() {\n                queryProductsByIdHttp(cid);\n            }\n        }, 2000);\n    }\n\n    public ListView getLvProduct(){\n        return lvProduct;\n    }\n\n    public void  setFab(FloatingActionsMenu fab){\n        this.fab = fab;\n    }\n\n    public void hideFab(){\n        fab.toggle();\n    }\n\n}\n\n\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/interface/FileUploadListener.java",
    "content": "package com.hankkin.compustrading;\n\n/**\n * Created by Hankkin on 15/12/20.\n */\npublic interface FileUploadListener  {\n    void success(String url);\n    void fail();\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/interface/ScrollDirectionListener.java",
    "content": "package com.hankkin.compustrading;\n\npublic interface ScrollDirectionListener {\n    void onScrollDown();\n\n    void onScrollUp();\n}"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/model/Category.java",
    "content": "package com.hankkin.compustrading.model;\n\n\nimport cn.bmob.v3.BmobObject;\n\n/**\n * Created by Hankkin on 15/11/29.\n */\npublic class Category extends BmobObject{\n    private Integer id;\n    private String name;\n    private String desc;\n    private int pid;\n\n    public Category(Integer id,String name, String desc, int pid) {\n        this.id = id;\n        this.name = name;\n        this.desc = desc;\n        this.pid = pid;\n    }\n\n    public int getId() {\n        return id;\n    }\n\n    public void setId(int id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getDesc() {\n        return desc;\n    }\n\n    public void setDesc(String desc) {\n        this.desc = desc;\n    }\n\n    public int getPid() {\n        return pid;\n    }\n\n    public void setPid(int pid) {\n        this.pid = pid;\n    }\n\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/model/Person.java",
    "content": "package com.hankkin.compustrading.model;\n\nimport cn.bmob.v3.BmobObject;\nimport cn.bmob.v3.BmobUser;\n\n/**\n * Created by Hankkin on 15/12/6.\n */\npublic class Person extends BmobUser {\n    private String name;\n    private String tel;\n    private String user_icon;\n    private String nickname;\n    private String sex;\n    private String birth;\n\n\n\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getTel() {\n        return tel;\n    }\n\n    public void setTel(String tel) {\n        this.tel = tel;\n    }\n\n    public String getUser_icon() {\n        return user_icon;\n    }\n\n    public void setUser_icon(String user_icon) {\n        this.user_icon = user_icon;\n    }\n\n    public String getNickname() {\n        return nickname;\n    }\n\n    public void setNickname(String nickname) {\n        this.nickname = nickname;\n    }\n\n    public String getSex() {\n        return sex;\n    }\n\n    public void setSex(String sex) {\n        this.sex = sex;\n    }\n\n    public String getBirth() {\n        return birth;\n    }\n\n    public void setBirth(String birth) {\n        this.birth = birth;\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/model/PersonShow.java",
    "content": "package com.hankkin.compustrading.model;\n\n/**\n * Created by Hankkin on 15/12/6.\n */\npublic class PersonShow {\n    private String title;\n    private String content;\n\n\n    public PersonShow(String title, String content) {\n        this.title = title;\n        this.content = content;\n    }\n\n    public String getTitle() {\n        return title;\n    }\n\n    public void setTitle(String title) {\n        this.title = title;\n    }\n\n    public String getContent() {\n        return content;\n    }\n\n    public void setContent(String content) {\n        this.content = content;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/model/Product.java",
    "content": "package com.hankkin.compustrading.model;\n\nimport cn.bmob.v3.BmobObject;\n\n/**\n * Created by Hankkin on 15/11/29.\n */\npublic class Product extends BmobObject {\n    private int id;\n    private String name;\n    private String price;\n    private String desc;\n    private String user_tel;\n    private int cid;\n    private String product_url;\n    private String school;\n    private String username;\n    private String user_icon_url;\n\n\n    public Product() {\n    }\n\n    public Product(int id,String name,String price,String desc,String user_tel,int category_id){\n        this.id=id;\n        this.name = name;\n        this.price=price;\n        this.desc=desc;\n        this.user_tel=user_tel;\n        this.cid=category_id;\n    }\n\n    public int getId() {\n        return id;\n    }\n\n    public void setId(int id) {\n        this.id = id;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getPrice() {\n        return price;\n    }\n\n    public void setPrice(String price) {\n        this.price = price;\n    }\n\n    public String getDesc() {\n        return desc;\n    }\n\n    public void setDesc(String desc) {\n        this.desc = desc;\n    }\n\n    public String getUser_tel() {\n        return user_tel;\n    }\n\n    public void setUser_tel(String user_tel) {\n        this.user_tel = user_tel;\n    }\n\n    public int getCid() {\n        return cid;\n    }\n\n    public void setCid(int cid) {\n        this.cid = cid;\n    }\n\n    public String getProduct_url() {\n        return product_url;\n    }\n\n    public void setProduct_url(String product_url) {\n        this.product_url = product_url;\n    }\n\n    public String getSchool() {\n        return school;\n    }\n\n    public void setSchool(String school) {\n        this.school = school;\n    }\n\n    public String getUsername() {\n        return username;\n    }\n\n    public void setUsername(String username) {\n        this.username = username;\n    }\n\n    public String getUser_icon_url() {\n        return user_icon_url;\n    }\n\n    public void setUser_icon_url(String user_icon_url) {\n        this.user_icon_url = user_icon_url;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/sharepreference/MySP.java",
    "content": "package com.hankkin.compustrading.sharepreference;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\n\n/**\n * Created by Hankkin on 15/12/20.\n */\npublic class MySP {\n\n    private static final String PREFERENCE_NAME = \"SYSTEM\";\n    static SharedPreferences mSP = null;\n\n    public static String USERNAME = \"username\";\n    public static String PASSWORD = \"password\";\n\n    public static String getUSERNAME(Context context) {\n        return getStringData(context,PASSWORD);\n    }\n\n    public static void setUSERNAME(Context context,String username) {\n        saveData(context,USERNAME,username);\n    }\n\n    public static String getPASSWoRD(Context context) {\n        return getStringData(context,PASSWORD);\n    }\n\n    public static void setPASSWoRD(Context context,String password) {\n       saveData(context,PASSWORD,password);\n    }\n\n\n    static boolean saveData(Context context, String key, Object value) {\n        if (context == null || key == null || value == null) {\n            return false;\n        }\n        if (mSP == null) {\n            mSP = context.getSharedPreferences(PREFERENCE_NAME,\n                    Context.MODE_PRIVATE);\n        }\n        SharedPreferences.Editor editor = mSP.edit();\n\n        if (value instanceof Boolean) {\n            editor.putBoolean(key, (Boolean) value);\n        } else if (value instanceof Float) {\n            editor.putFloat(key, (Float) value);\n        } else if (value instanceof Integer) {\n            editor.putInt(key, (Integer) value);\n        } else if (value instanceof Long) {\n            editor.putLong(key, (Long) value);\n        } else if (value instanceof String) {\n            editor.putString(key, (String) value);\n        } else {\n            return false;\n        }\n        return editor.commit();\n    }\n\n    static String getStringData(Context context, String key) {\n        String value = null;\n        if (context == null || key == null) {\n            return value;\n        }\n        if (mSP == null) {\n            mSP = context.getSharedPreferences(PREFERENCE_NAME,\n                    Context.MODE_PRIVATE);\n        }\n        value = mSP.getString(key, null);\n        return value;\n\n    }\n\n    static boolean getBooleanData(Context context, String key) {\n        boolean value = false;\n        if (context == null || key == null) {\n            return value;\n        }\n        if (mSP == null) {\n            mSP = context.getSharedPreferences(PREFERENCE_NAME,\n                    Context.MODE_PRIVATE);\n        }\n        value = mSP.getBoolean(key, false);\n        return value;\n\n    }\n\n    static int getIntData(Context context, String key) {\n        int value = 0;\n        if (context == null || key == null) {\n            return value;\n        }\n        if (mSP == null) {\n            mSP = context.getSharedPreferences(PREFERENCE_NAME,\n                    Context.MODE_PRIVATE);\n        }\n        value = mSP.getInt(key, 0);\n        return value;\n\n    }\n\n    static long getLongData(Context context, String key) {\n        long value = -1;\n        if (context == null || key == null) {\n            return value;\n        }\n        if (mSP == null) {\n            mSP = context.getSharedPreferences(PREFERENCE_NAME,\n                    Context.MODE_PRIVATE);\n        }\n        value = mSP.getLong(key, 0);\n        return value;\n\n    }\n\n    static boolean deleteKey(Context context, String key) {\n        if (context == null || key == null) {\n            return false;\n        }\n        if (mSP == null) {\n            mSP = context.getSharedPreferences(PREFERENCE_NAME,\n                    Context.MODE_PRIVATE);\n        }\n        SharedPreferences.Editor editor = mSP.edit();\n        editor.remove(key);\n        return editor.commit();\n    }\n\n    static boolean deleteKeys(Context context, String... keys) {\n        if (context == null || keys == null) {\n            return false;\n        }\n        if (mSP == null) {\n            mSP = context.getSharedPreferences(PREFERENCE_NAME,\n                    Context.MODE_PRIVATE);\n        }\n        SharedPreferences.Editor editor = mSP.edit();\n        for (int i = 0; i < keys.length; i++) {\n            editor.remove(keys[i]);\n        }\n        return editor.commit();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/CustomViewAbove.java",
    "content": "package com.hankkin.compustrading.slidingmenu;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Rect;\nimport android.os.Build;\nimport android.support.v4.view.KeyEventCompat;\nimport android.support.v4.view.MotionEventCompat;\nimport android.support.v4.view.VelocityTrackerCompat;\nimport android.support.v4.view.ViewCompat;\nimport android.support.v4.view.ViewConfigurationCompat;\nimport android.util.AttributeSet;\nimport android.util.FloatMath;\nimport android.util.Log;\nimport android.view.FocusFinder;\nimport android.view.KeyEvent;\nimport android.view.MotionEvent;\nimport android.view.SoundEffectConstants;\nimport android.view.VelocityTracker;\nimport android.view.View;\nimport android.view.ViewConfiguration;\nimport android.view.ViewGroup;\nimport android.view.animation.Interpolator;\nimport android.widget.Scroller;\n\n\n\npublic class CustomViewAbove extends ViewGroup {\n\n\tprivate static final String TAG = \"CustomViewAbove\";\n\tprivate static final boolean DEBUG = false;\n\n\t//是否使用缓存\n\tprivate static final boolean USE_CACHE = false;\n\n\t//最大持续的时间\n\tprivate static final int MAX_SETTLE_DURATION = 600; // ms\n\t\n\t//最小滑动的距离\n\tprivate static final int MIN_DISTANCE_FOR_FLING = 25; // dips\n\n\t/**\n\t * 定义一个修饰动画的效果类\n\t * Interpolator被用来修饰动画效果，定义动画的变化率，可以使存在的动画效果可以 accelerated(加速)，decelerated(减速),repeated(重复),bounced(弹跳)等。\n\t */\n\tprivate static final Interpolator sInterpolator = new Interpolator() {\n\t\tpublic float getInterpolation(float t) {\n\t\t\tt -= 1.0f;\n\t\t\treturn t * t * t * t * t + 1.0f;\n\t\t}\n\t};\n\n\t//定义内容视图\n\tprivate View mContent;\n\n\t//当前的选项\n\tprivate int mCurItem;\n\t\n\t//滚动滑轮\n\tprivate Scroller mScroller;\n\n\t//是否能够使用滑动缓存\n\tprivate boolean mScrollingCacheEnabled;\n\n\t//是否正在滑动\n\tprivate boolean mScrolling;\n\n\t//是否正在拖动\n\tprivate boolean mIsBeingDragged;\n\t\n\t//是否能够拖动\n\tprivate boolean mIsUnableToDrag;\n\t\n\t//定义触摸溢出的值\n\tprivate int mTouchSlop;\n\t\n\t//初始化触摸屏幕X轴的值\n\tprivate float mInitialMotionX;\n\t\n\t//最后移动到的X、Y的坐标\n\tprivate float mLastMotionX,mLastMotionY;\n\t\n\t/**\n\t * 定义一个活动指针，在多点触摸的时候调用\n\t */\n\tprotected int mActivePointerId = INVALID_POINTER;\n\t\n\t/**\n\t * 为当前的活动指针赋值\n\t */\n\tprivate static final int INVALID_POINTER = -1;\n\n\t/**\n\t * 触摸滚动期间的绝对速度\n\t */\n\tprotected VelocityTracker mVelocityTracker;\n\t\n\t//最小滑动速度值\n\tprivate int mMinimumVelocity;\n\t\n\t//最大滑动速度值\n\tprotected int mMaximumVelocity;\n\t\n\t//滑动的距离\n\tprivate int mFlingDistance;\n\n\t//定义下方视图对象\n\tprivate CustomViewBehind mViewBehind;\n\n\t//是否能够使用\n\tprivate boolean mEnabled = true;\n\n\t//页面改变监听器\n\tprivate OnPageChangeListener mOnPageChangeListener;\n\t\n\t//内部页面改变监听器\n\tprivate OnPageChangeListener mInternalPageChangeListener;\n\n\t//关闭监听器\n\tprivate SlidingMenu.OnClosedListener mClosedListener;\n\t\n\t//打开监听器\n\tprivate SlidingMenu.OnOpenedListener mOpenedListener;\n\n\t//存放被忽略的视图组件列表\n\tprivate List<View> mIgnoredViews = new ArrayList<View>();\n\n\t/**\n\t * 调用此接口去响应改变选中页面的状态\n\t */\n\tpublic interface OnPageChangeListener {\n\n\t\t/**\n\t\t * This method will be invoked when the current page is scrolled, either as part\n\t\t * of a programmatically initiated smooth scroll or a user initiated touch scroll.\n\t\t *\n\t\t * @param position Position index of the first page currently being displayed.\n\t\t *                 Page position+1 will be visible if positionOffset is nonzero.\n\t\t * @param positionOffset Value from [0, 1) indicating the offset from the page at position.\n\t\t * @param positionOffsetPixels Value in pixels indicating the offset from position.\n\t\t */\n\t\tpublic void onPageScrolled(int position, float positionOffset, int positionOffsetPixels);\n\n\t\t/**\n\t\t * This method will be invoked when a new page becomes selected. Animation is not\n\t\t * necessarily complete.\n\t\t *\n\t\t * @param position Position index of the new selected page.\n\t\t */\n\t\tpublic void onPageSelected(int position);\n\n\t}\n\n\t/**\n\t * Simple implementation of the {@link OnPageChangeListener} interface with stub\n\t * implementations of each method. Extend this if you do not intend to override\n\t * every method of {@link OnPageChangeListener}.\n\t */\n\tpublic static class SimpleOnPageChangeListener implements OnPageChangeListener {\n\n\t\tpublic void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\t\t\t// This space for rent\n\t\t}\n\n\t\tpublic void onPageSelected(int position) {\n\t\t\t// This space for rent\n\t\t}\n\n\t\tpublic void onPageScrollStateChanged(int state) {\n\t\t\t// This space for rent\n\t\t}\n\n\t}\n\n\tpublic CustomViewAbove(Context context) {\n\t\tthis(context, null);\n\t}\n\n\tpublic CustomViewAbove(Context context, AttributeSet attrs) {\n\t\tsuper(context, attrs);\n\t\tinitCustomViewAbove();\n\t}\n\n\t/**\n\t * 初始化最上方视图\n\t */\n\tvoid initCustomViewAbove() {\n\t\t//设置是否能够调用自定义的布局，false是可以\n\t\tsetWillNotDraw(false);\n\t\t//优先其子类控件而获取到焦点\n\t\tsetDescendantFocusability(FOCUS_AFTER_DESCENDANTS);\n\t\t//设置是否能够获取焦点\n\t\tsetFocusable(true);\n\t\t\n\t\t//得到上下文\n\t\tfinal Context context = getContext();\n\t\t\n\t\t//实例化滚动器\n\t\tmScroller = new Scroller(context, sInterpolator);\n\t\t\n\t\tfinal ViewConfiguration configuration = ViewConfiguration.get(context);\n\t\t\n\t\t//获得能够进行手势滑动的距离，表示滑动的时候，手的移动要大于这个距离才开始移动控件\n\t\tmTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);\n\t\t\n\t\t//获得允许执行一个fling手势动作的最小速度值\n\t\tmMinimumVelocity = configuration.getScaledMinimumFlingVelocity();\n\t\t\n\t\t//获得允许执行一个fling手势动作的最大速度值\n\t\tmMaximumVelocity = configuration.getScaledMaximumFlingVelocity();\n\t\t\n\t\tsetInternalPageChangeListener(new SimpleOnPageChangeListener() {\n\t\t\tpublic void onPageSelected(int position) {\n\t\t\t\tif (mViewBehind != null) {\n\t\t\t\t\tswitch (position) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tmViewBehind.setChildrenEnabled(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tmViewBehind.setChildrenEnabled(false);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t//获得该手机设备的屏幕密度值\n\t\tfinal float density = context.getResources().getDisplayMetrics().density;\n\t\t//滑动的距离\n\t\tmFlingDistance = (int) (MIN_DISTANCE_FOR_FLING * density);\n\t}\n\n\t/**\n\t * 设置当前选中的项\n\t */\n\tpublic void setCurrentItem(int item) {\n\t\tsetCurrentItemInternal(item, true, false);\n\t}\n\n\t/**\n\t * 设置当前选中的项，是否平滑的过渡到选中项的页面\n\t */\n\tpublic void setCurrentItem(int item, boolean smoothScroll) {\n\t\tsetCurrentItemInternal(item, smoothScroll, false);\n\t}\n\n\t/**\n\t * 得到当前选中的项\n\t */\n\tpublic int getCurrentItem() {\n\t\treturn mCurItem;\n\t}\n\n\t/**\n\t * 设置当前内部选中的项\n\t */\n\tvoid setCurrentItemInternal(int item, boolean smoothScroll, boolean always) {\n\t\tsetCurrentItemInternal(item, smoothScroll, always, 0);\n\t}\n\n\t/**\n\t * 设置当前内部选中的项\n\t */\n\tvoid setCurrentItemInternal(int item, boolean smoothScroll, boolean always, int velocity) {\n\t\tif (!always && mCurItem == item) {\n\t\t\tsetScrollingCacheEnabled(false);\n\t\t\treturn;\n\t\t}\n\n\t\titem = mViewBehind.getMenuPage(item);\n\n\t\tfinal boolean dispatchSelected = mCurItem != item;\n\t\tmCurItem = item;\n\t\tfinal int destX = getDestScrollX(mCurItem);\n\t\tif (dispatchSelected && mOnPageChangeListener != null) {\n\t\t\tmOnPageChangeListener.onPageSelected(item);\n\t\t}\n\t\tif (dispatchSelected && mInternalPageChangeListener != null) {\n\t\t\tmInternalPageChangeListener.onPageSelected(item);\n\t\t}\n\t\tif (smoothScroll) {\n\t\t\tsmoothScrollTo(destX, 0, velocity);\n\t\t} else {\n\t\t\tcompleteScroll();\n\t\t\tscrollTo(destX, 0);\n\t\t}\n\t}\n\n\t/**\n\t * 设置一个监听事件当页面改变或者加速滚动的时候调用\n\t */\n\tpublic void setOnPageChangeListener(OnPageChangeListener listener) {\n\t\tmOnPageChangeListener = listener;\n\t}\n\n\t/**\n\t * 设置打开监听事件\n\t */\n\tpublic void setOnOpenedListener(SlidingMenu.OnOpenedListener l) {\n\t\tmOpenedListener = l;\n\t}\n\n\t/**\n\t * 设置关闭监听事件\n\t */\n\tpublic void setOnClosedListener(SlidingMenu.OnClosedListener l) {\n\t\tmClosedListener = l;\n\t}\n\n\t/**\n\t * Set a separate OnPageChangeListener for internal use by the support library.\n\t *\n\t * @param listener Listener to set\n\t * @return The old listener that was set, if any.\n\t */\n\tOnPageChangeListener setInternalPageChangeListener(OnPageChangeListener listener) {\n\t\tOnPageChangeListener oldListener = mInternalPageChangeListener;\n\t\tmInternalPageChangeListener = listener;\n\t\treturn oldListener;\n\t}\n\n\t/**\n\t * 添加被忽略的组件\n\t */\n\tpublic void addIgnoredView(View v) {\n\t\tif (!mIgnoredViews.contains(v)) {\n\t\t\tmIgnoredViews.add(v);\n\t\t}\n\t}\n\n\t/**\n\t * 移除被忽略的组件\n\t */\n\tpublic void removeIgnoredView(View v) {\n\t\tmIgnoredViews.remove(v);\n\t}\n\n\t/**\n\t * 清空被忽略的组件\n\t */\n\tpublic void clearIgnoredViews() {\n\t\tmIgnoredViews.clear();\n\t}\n\n\t// We want the duration of the page snap animation to be influenced by the distance that\n\t// the screen has to travel, however, we don't want this duration to be effected in a\n\t// purely linear fashion. Instead, we use this method to moderate the effect that the distance\n\t// of travel has on the overall snap duration.\n\tfloat distanceInfluenceForSnapDuration(float f) {\n\t\tf -= 0.5f; // center the values about 0.\n\t\tf *= 0.3f * Math.PI / 2.0f;\n\t\treturn (float) Math.sin(f);\n\t}\n\n\t/**\n\t * 得到滑动到的X轴的坐标\n\t */\n\tpublic int getDestScrollX(int page) {\n\t\tswitch (page) {\n\t\tcase 0:\n\t\tcase 2:\n\t\t\treturn mViewBehind.getMenuLeft(mContent, page);\n\t\tcase 1:\n\t\t\treturn mContent.getLeft();\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * 得到左边框\n\t */\n\tprivate int getLeftBound() {\n\t\treturn mViewBehind.getAbsLeftBound(mContent);\n\t}\n\n\t/**\n\t * 得到右边框\n\t */\n\tprivate int getRightBound() {\n\t\treturn mViewBehind.getAbsRightBound(mContent);\n\t}\n\n\tpublic int getContentLeft() {\n\t\treturn mContent.getLeft() + mContent.getPaddingLeft();\n\t}\n\n\t/**\n\t * 得到滑动菜单是否打开\n\t */\n\tpublic boolean isMenuOpen() {\n\t\treturn mCurItem == 0 || mCurItem == 2;\n\t}\n\n\t/**\n\t * 是否忽略视图\n\t */\n\tprivate boolean isInIgnoredView(MotionEvent ev) {\n\t\tRect rect = new Rect();\n\t\tfor (View v : mIgnoredViews) {\n\t\t\tv.getHitRect(rect);\n\t\t\tif (rect.contains((int)ev.getX(), (int)ev.getY())) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 得到下方视图的宽度\n\t */\n\tpublic int getBehindWidth() {\n\t\tif (mViewBehind == null) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn mViewBehind.getBehindWidth();\n\t\t}\n\t}\n\n\t/**\n\t * 得到子控件的宽度\n\t */\n\tpublic int getChildWidth(int i) {\n\t\tswitch (i) {\n\t\tcase 0:\n\t\t\treturn getBehindWidth();\n\t\tcase 1:\n\t\t\treturn mContent.getWidth();\n\t\tdefault:\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\t/**\n\t * 得到是否能够滑动\n\t */\n\tpublic boolean isSlidingEnabled() {\n\t\treturn mEnabled;\n\t}\n\n\t/**\n\t * 设置是否能够滑动\n\t */\n\tpublic void setSlidingEnabled(boolean b) {\n\t\tmEnabled = b;\n\t}\n\n\t/**\n\t * 平滑的滑动到指定的位置\n\t */\n\tvoid smoothScrollTo(int x, int y) {\n\t\tsmoothScrollTo(x, y, 0);\n\t}\n\n\t/**\n\t * 通过设置速度来平滑的滑动到指定的位置\n\t */\n\tvoid smoothScrollTo(int x, int y, int velocity) {\n\t\tif (getChildCount() == 0) {\n\t\t\t// Nothing to do.\n\t\t\tsetScrollingCacheEnabled(false);\n\t\t\treturn;\n\t\t}\n\t\t//获得当前View显示部分的左边到第一个View的左边的距离\n\t\tint sx = getScrollX();\n\t\tint sy = getScrollY();\n\t\t\n\t\tint dx = x - sx;\n\t\tint dy = y - sy;\n\t\t\n\t\t//如果都等于0，说明正好是滑动了一个屏幕的距离\n\t\tif (dx == 0 && dy == 0) {\n\t\t\tcompleteScroll();\n\t\t\tif (isMenuOpen()) {\n\t\t\t\tif (mOpenedListener != null)\n\t\t\t\t\tmOpenedListener.onOpened();\n\t\t\t} else {\n\t\t\t\tif (mClosedListener != null)\n\t\t\t\t\tmClosedListener.onClosed();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tsetScrollingCacheEnabled(true);\n\t\tmScrolling = true;\n\n\t\t//获得下方视图的宽度\n\t\tfinal int width = getBehindWidth();\n\t\t\n\t\tfinal int halfWidth = width / 2;\n\t\t\n\t\t//取两数中最小的值赋给滑动距离与下方视图宽度的比值\n\t\tfinal float distanceRatio = Math.min(1f, 1.0f * Math.abs(dx) / width);\n\t\t\n\t\t//获得当前滑动的距离\n\t\tfinal float distance = halfWidth + halfWidth * distanceInfluenceForSnapDuration(distanceRatio);\n\n\t\t//初始化持续的时间\n\t\tint duration = 0;\n\t\t\n\t\t//获得速度的绝对值\n\t\tvelocity = Math.abs(velocity);\n\t\t\n\t\tif (velocity > 0) {\n\t\t\t//Math.round()四舍五入\n\t\t\tduration = 4 * Math.round(1000 * Math.abs(distance / velocity));\n\t\t} else {\n\t\t\tfinal float pageDelta = (float) Math.abs(dx) / width;\n\t\t\tduration = (int) ((pageDelta + 1) * 100);\n\t\t\tduration = MAX_SETTLE_DURATION;\n\t\t}\n\t\t//取两数中最小的一个值赋给持续的时间\n\t\tduration = Math.min(duration, MAX_SETTLE_DURATION);\n\n\t\t//开始滑动\n\t\tmScroller.startScroll(sx, sy, dx, dy, duration);\n\t\t\n\t\t//刷新界面\n\t\tinvalidate();\n\t}\n\n\t/**\n\t * 设置内容视图\n\t */\n\tpublic void setContent(View v) {\n\t\tif (mContent != null) \n\t\t\tthis.removeView(mContent);\n\t\tmContent = v;\n\t\taddView(mContent);\n\t}\n\n\t/**\n\t * 得到内容视图\n\t */\n\tpublic View getContent() {\n\t\treturn mContent;\n\t}\n\n\t/**\n\t * 设置下方视图\n\t */\n\tpublic void setCustomViewBehind(CustomViewBehind cvb) {\n\t\tmViewBehind = cvb;\n\t}\n\n\t/**\n\t * 在父元素正要放置该控件时调用。它会问一个问题，“你想要用多大地方啊？”，然后传入两个参数——widthMeasureSpec和heightMeasureSpec。\n\t */\n\t@Override\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\t\tint width = getDefaultSize(0, widthMeasureSpec);\n\t\tint height = getDefaultSize(0, heightMeasureSpec);\n\t\tsetMeasuredDimension(width, height);\n\n\t\tfinal int contentWidth = getChildMeasureSpec(widthMeasureSpec, 0, width);\n\t\tfinal int contentHeight = getChildMeasureSpec(heightMeasureSpec, 0, height);\n\t\tmContent.measure(contentWidth, contentHeight);\n\t}\n\n\t/**\n\t * 当视图尺寸改变的时候调用\n\t */\n\t@Override\n\tprotected void onSizeChanged(int w, int h, int oldw, int oldh) {\n\t\tsuper.onSizeChanged(w, h, oldw, oldh);\n\t\t// Make sure scroll position is set correctly.\n\t\tif (w != oldw) {\n\t\t\t// [ChrisJ] - This fixes the onConfiguration change for orientation issue..\n\t\t\t// maybe worth having a look why the recomputeScroll pos is screwing\n\t\t\t// up?\n\t\t\tcompleteScroll();\n\t\t\tscrollTo(getDestScrollX(mCurItem), getScrollY());\n\t\t}\n\t}\n\t\n\t@Override\n\tprotected void onLayout(boolean changed, int l, int t, int r, int b) {\n\t\tfinal int width = r - l;\n\t\tfinal int height = b - t;\n\t\tmContent.layout(0, 0, width, height);\n\t}\n\n\t/**\n\t * 设置上方视图的偏移量\n\t */\n\tpublic void setAboveOffset(int i) {\t\t\n\t\tmContent.setPadding(i, mContent.getPaddingTop(), mContent.getPaddingRight(), mContent.getPaddingBottom());\n\t}\n\n\n\t@Override\n\tpublic void computeScroll() {\n\t\tif (!mScroller.isFinished()) {\n\t\t\tif (mScroller.computeScrollOffset()) {\n\t\t\t\tint oldX = getScrollX();\n\t\t\t\tint oldY = getScrollY();\n\t\t\t\tint x = mScroller.getCurrX();\n\t\t\t\tint y = mScroller.getCurrY();\n\n\t\t\t\tif (oldX != x || oldY != y) {\n\t\t\t\t\tscrollTo(x, y);\n\t\t\t\t\tpageScrolled(x);\n\t\t\t\t}\n\n\t\t\t\t// Keep on drawing until the animation has finished.\n\t\t\t\tinvalidate();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t//完成滑动，清除状态\n\t\tcompleteScroll();\n\t}\n\n\t/**\n\t * 页面滚动\n\t */\n\tprivate void pageScrolled(int xpos) {\n\t\tfinal int widthWithMargin = getWidth();\n\t\tfinal int position = xpos / widthWithMargin;\n\t\tfinal int offsetPixels = xpos % widthWithMargin;\n\t\tfinal float offset = (float) offsetPixels / widthWithMargin;\n\n\t\tonPageScrolled(position, offset, offsetPixels);\n\t}\n\n\t/**\n\t * 页面滚动\n\t *\n\t * @param position Position index of the first page currently being displayed.\n\t *                 Page position+1 will be visible if positionOffset is nonzero.\n\t * @param offset Value from [0, 1) indicating the offset from the page at position.\n\t * @param offsetPixels Value in pixels indicating the offset from position.\n\t */\n\tprotected void onPageScrolled(int position, float offset, int offsetPixels) {\n\t\tif (mOnPageChangeListener != null) {\n\t\t\tmOnPageChangeListener.onPageScrolled(position, offset, offsetPixels);\n\t\t}\n\t\tif (mInternalPageChangeListener != null) {\n\t\t\tmInternalPageChangeListener.onPageScrolled(position, offset, offsetPixels);\n\t\t}\n\t}\n\n\t/**\n\t * 完成滑动\n\t */\n\tprivate void completeScroll() {\n\t\t//是否需要移动\n\t\tboolean needPopulate = mScrolling;\n\t\t\n\t\tif (needPopulate) {\n\t\t\t// Done with scroll, no longer want to cache view drawing.\n\t\t\tsetScrollingCacheEnabled(false);\n\t\t\t//终止动画效果\n\t\t\tmScroller.abortAnimation();\n\t\t\t\n\t\t\t//获得滚动条初始的坐标\n\t\t\tint oldX = getScrollX();\n\t\t\tint oldY = getScrollY();\n\t\t\t\n\t\t\t//获得滚动条当前的坐标\n\t\t\tint x = mScroller.getCurrX();\n\t\t\tint y = mScroller.getCurrY();\n\t\t\t\n\t\t\t//如果滚动条初始的坐标和当前的坐标不等则滑动\n\t\t\tif (oldX != x || oldY != y) {\n\t\t\t\tscrollTo(x, y);\n\t\t\t}\n\t\t\tif (isMenuOpen()) {\n\t\t\t\tif (mOpenedListener != null)\n\t\t\t\t\tmOpenedListener.onOpened();\n\t\t\t} else {\n\t\t\t\tif (mClosedListener != null)\n\t\t\t\t\tmClosedListener.onClosed();\n\t\t\t}\n\t\t}\n\t\t//将滑动的状态设置为false\n\t\tmScrolling = false;\n\t}\n\n\t//获得触摸模式的值\n\tprotected int mTouchMode = SlidingMenu.TOUCHMODE_MARGIN;\n\n\t/**\n\t * 设置触摸的模式\n\t */\n\tpublic void setTouchMode(int i) {\n\t\tmTouchMode = i;\n\t}\n\n\t/**\n\t * 得到触摸的模式\n\t */\n\tpublic int getTouchMode() {\n\t\treturn mTouchMode;\n\t}\n\n\t/**\n\t * 判断是否允许触摸打开滑动菜单\n\t */\n\tprivate boolean thisTouchAllowed(MotionEvent ev) {\n\t\tint x = (int) (ev.getX() + mScrollX);\n\t\tif (isMenuOpen()) {\n\t\t\treturn mViewBehind.menuOpenTouchAllowed(mContent, mCurItem, x);\n\t\t} else {\n\t\t\tswitch (mTouchMode) {\n\t\t\tcase SlidingMenu.TOUCHMODE_FULLSCREEN:\n\t\t\t\treturn !isInIgnoredView(ev);\n\t\t\tcase SlidingMenu.TOUCHMODE_NONE:\n\t\t\t\treturn false;\n\t\t\tcase SlidingMenu.TOUCHMODE_MARGIN:\n\t\t\t\treturn mViewBehind.marginTouchAllowed(mContent, x);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 判断是否允许滑动\n\t */\n\tprivate boolean thisSlideAllowed(float dx) {\n\t\tboolean allowed = false;\n\t\tif (isMenuOpen()) {\n\t\t\tallowed = mViewBehind.menuOpenSlideAllowed(dx);\n\t\t} else {\n\t\t\tallowed = mViewBehind.menuClosedSlideAllowed(dx);\n\t\t}\n\t\tif (DEBUG)\n\t\t\tLog.v(TAG, \"this slide allowed \" + allowed + \" dx: \" + dx);\n\t\treturn allowed;\n\t}\n\n\t/**\n\t * 得到指针的索引值\n\t */\n\tprivate int getPointerIndex(MotionEvent ev, int id) {\n\t\tint activePointerIndex = MotionEventCompat.findPointerIndex(ev, id);\n\t\tif (activePointerIndex == -1)\n\t\t\tmActivePointerId = INVALID_POINTER;\n\t\treturn activePointerIndex;\n\t}\n\n\tprivate boolean mQuickReturn = false;\n\n\t@Override\n\tpublic boolean onInterceptTouchEvent(MotionEvent ev) {\n\n\t\tif (!mEnabled)\n\t\t\treturn false;\n\n\t\tfinal int action = ev.getAction() & MotionEventCompat.ACTION_MASK;\n\n\t\tif (DEBUG)\n\t\t\tif (action == MotionEvent.ACTION_DOWN)\n\t\t\t\tLog.v(TAG, \"Received ACTION_DOWN\");\n\n\t\tif (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP\n\t\t\t\t|| (action != MotionEvent.ACTION_DOWN && mIsUnableToDrag)) {\n\t\t\tendDrag();\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (action) {\n\t\tcase MotionEvent.ACTION_MOVE:\n\t\t\tdetermineDrag(ev);\n\t\t\tbreak;\n\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\tint index = MotionEventCompat.getActionIndex(ev);\n\t\t\tmActivePointerId = MotionEventCompat.getPointerId(ev, index);\n\t\t\tif (mActivePointerId == INVALID_POINTER)\n\t\t\t\tbreak;\n\t\t\tmLastMotionX = mInitialMotionX = MotionEventCompat.getX(ev, index);\n\t\t\tmLastMotionY = MotionEventCompat.getY(ev, index);\n\t\t\tif (thisTouchAllowed(ev)) {\n\t\t\t\tmIsBeingDragged = false;\n\t\t\t\tmIsUnableToDrag = false;\n\t\t\t\tif (isMenuOpen() && mViewBehind.menuTouchInQuickReturn(mContent, mCurItem, ev.getX() + mScrollX)) {\n\t\t\t\t\tmQuickReturn = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmIsUnableToDrag = true;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase MotionEventCompat.ACTION_POINTER_UP:\n\t\t\tonSecondaryPointerUp(ev);\n\t\t\tbreak;\n\t\t}\n\n\t\tif (!mIsBeingDragged) {\n\t\t\tif (mVelocityTracker == null) {\n\t\t\t\tmVelocityTracker = VelocityTracker.obtain();\n\t\t\t}\n\t\t\tmVelocityTracker.addMovement(ev);\n\t\t}\n\t\treturn mIsBeingDragged || mQuickReturn;\n\t}\n\n\n\t@Override\n\tpublic boolean onTouchEvent(MotionEvent ev) {\n\n\t\tif (!mEnabled)\n\t\t\treturn false;\n\n\t\tif (!mIsBeingDragged && !thisTouchAllowed(ev))\n\t\t\treturn false;\n\n\t\t//\t\tif (!mIsBeingDragged && !mQuickReturn)\n\t\t//\t\t\treturn false;\n\n\t\tfinal int action = ev.getAction();\n\n\t\tif (mVelocityTracker == null) {\n\t\t\tmVelocityTracker = VelocityTracker.obtain();\n\t\t}\n\t\tmVelocityTracker.addMovement(ev);\n\n\t\tswitch (action & MotionEventCompat.ACTION_MASK) {\n\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t/*\n\t\t\t * If being flinged and user touches, stop the fling. isFinished\n\t\t\t * will be false if being flinged.\n\t\t\t */\n\t\t\tcompleteScroll();\n\n\t\t\t// Remember where the motion event started\n\t\t\tint index = MotionEventCompat.getActionIndex(ev);\n\t\t\tmActivePointerId = MotionEventCompat.getPointerId(ev, index);\n\t\t\tmLastMotionX = mInitialMotionX = ev.getX();\n\t\t\tbreak;\n\t\tcase MotionEvent.ACTION_MOVE:\n\t\t\tif (!mIsBeingDragged) {\t\n\t\t\t\tdetermineDrag(ev);\n\t\t\t\tif (mIsUnableToDrag)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (mIsBeingDragged) {\n\t\t\t\t// Scroll to follow the motion event\n\t\t\t\tfinal int activePointerIndex = getPointerIndex(ev, mActivePointerId);\n\t\t\t\tif (mActivePointerId == INVALID_POINTER)\n\t\t\t\t\tbreak;\n\t\t\t\tfinal float x = MotionEventCompat.getX(ev, activePointerIndex);\n\t\t\t\tfinal float deltaX = mLastMotionX - x;\n\t\t\t\tmLastMotionX = x;\n\t\t\t\tfloat oldScrollX = getScrollX();\n\t\t\t\tfloat scrollX = oldScrollX + deltaX;\n\t\t\t\tfinal float leftBound = getLeftBound();\n\t\t\t\tfinal float rightBound = getRightBound();\n\t\t\t\tif (scrollX < leftBound) {\n\t\t\t\t\tscrollX = leftBound;\n\t\t\t\t} else if (scrollX > rightBound) {\n\t\t\t\t\tscrollX = rightBound;\n\t\t\t\t}\n\t\t\t\t// Don't lose the rounded component\n\t\t\t\tmLastMotionX += scrollX - (int) scrollX;\n\t\t\t\tscrollTo((int) scrollX, getScrollY());\n\t\t\t\tpageScrolled((int) scrollX);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase MotionEvent.ACTION_UP:\n\t\t\tif (mIsBeingDragged) {\n\t\t\t\tfinal VelocityTracker velocityTracker = mVelocityTracker;\n\t\t\t\tvelocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);\n\t\t\t\tint initialVelocity = (int) VelocityTrackerCompat.getXVelocity(\n\t\t\t\t\t\tvelocityTracker, mActivePointerId);\n\t\t\t\tfinal int scrollX = getScrollX();\n\t\t\t\t//\t\t\t\tfinal int widthWithMargin = getWidth();\n\t\t\t\t//\t\t\t\tfinal float pageOffset = (float) (scrollX % widthWithMargin) / widthWithMargin;\n\t\t\t\t// TODO test this. should get better flinging behavior\n\t\t\t\tfinal float pageOffset = (float) (scrollX - getDestScrollX(mCurItem)) / getBehindWidth();\n\t\t\t\tfinal int activePointerIndex = getPointerIndex(ev, mActivePointerId);\n\t\t\t\tif (mActivePointerId != INVALID_POINTER) {\n\t\t\t\t\tfinal float x = MotionEventCompat.getX(ev, activePointerIndex);\n\t\t\t\t\tfinal int totalDelta = (int) (x - mInitialMotionX);\n\t\t\t\t\tint nextPage = determineTargetPage(pageOffset, initialVelocity, totalDelta);\n\t\t\t\t\tsetCurrentItemInternal(nextPage, true, true, initialVelocity);\n\t\t\t\t} else {\t\n\t\t\t\t\tsetCurrentItemInternal(mCurItem, true, true, initialVelocity);\n\t\t\t\t}\n\t\t\t\tmActivePointerId = INVALID_POINTER;\n\t\t\t\tendDrag();\n\t\t\t} else if (mQuickReturn && mViewBehind.menuTouchInQuickReturn(mContent, mCurItem, ev.getX() + mScrollX)) {\n\t\t\t\t// close the menu\n\t\t\t\tsetCurrentItem(1);\n\t\t\t\tendDrag();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase MotionEvent.ACTION_CANCEL:\n\t\t\tif (mIsBeingDragged) {\n\t\t\t\tsetCurrentItemInternal(mCurItem, true, true);\n\t\t\t\tmActivePointerId = INVALID_POINTER;\n\t\t\t\tendDrag();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase MotionEventCompat.ACTION_POINTER_DOWN: {\n\t\t\tfinal int indexx = MotionEventCompat.getActionIndex(ev);\n\t\t\tmLastMotionX = MotionEventCompat.getX(ev, indexx);\n\t\t\tmActivePointerId = MotionEventCompat.getPointerId(ev, indexx);\n\t\t\tbreak;\n\t\t}\n\t\tcase MotionEventCompat.ACTION_POINTER_UP:\n\t\t\tonSecondaryPointerUp(ev);\n\t\t\tint pointerIndex = getPointerIndex(ev, mActivePointerId);\n\t\t\tif (mActivePointerId == INVALID_POINTER)\n\t\t\t\tbreak;\n\t\t\tmLastMotionX = MotionEventCompat.getX(ev, pointerIndex);\n\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}\n\t\n\tprivate void determineDrag(MotionEvent ev) {\n\t\tfinal int activePointerId = mActivePointerId;\n\t\tfinal int pointerIndex = getPointerIndex(ev, activePointerId);\n\t\tif (activePointerId == INVALID_POINTER)\n\t\t\treturn;\n\t\tfinal float x = MotionEventCompat.getX(ev, pointerIndex);\n\t\tfinal float dx = x - mLastMotionX;\n\t\tfinal float xDiff = Math.abs(dx);\n\t\tfinal float y = MotionEventCompat.getY(ev, pointerIndex);\n\t\tfinal float dy = y - mLastMotionY;\n\t\tfinal float yDiff = Math.abs(dy);\n\t\tif (xDiff > (isMenuOpen()?mTouchSlop/2:mTouchSlop) && xDiff > yDiff && thisSlideAllowed(dx)) {\t\t\n\t\t\tstartDrag();\n\t\t\tmLastMotionX = x;\n\t\t\tmLastMotionY = y;\n\t\t\tsetScrollingCacheEnabled(true);\n\t\t\t// TODO add back in touch slop check\n\t\t} else if (xDiff > mTouchSlop) {\n\t\t\tmIsUnableToDrag = true;\n\t\t}\n\t}\n\n\t@Override\n\tpublic void scrollTo(int x, int y) {\n\t\tsuper.scrollTo(x, y);\n\t\tmScrollX = x;\n\t\tmViewBehind.scrollBehindTo(mContent, x, y);\t\n\t\t((SlidingMenu)getParent()).manageLayers(getPercentOpen());\n\t}\n\n\tprivate int determineTargetPage(float pageOffset, int velocity, int deltaX) {\n\t\tint targetPage = mCurItem;\n\t\tif (Math.abs(deltaX) > mFlingDistance && Math.abs(velocity) > mMinimumVelocity) {\n\t\t\tif (velocity > 0 && deltaX > 0) {\n\t\t\t\ttargetPage -= 1;\n\t\t\t} else if (velocity < 0 && deltaX < 0){\n\t\t\t\ttargetPage += 1;\n\t\t\t}\n\t\t} else {\n\t\t\ttargetPage = (int) Math.round(mCurItem + pageOffset);\n\t\t}\n\t\treturn targetPage;\n\t}\n\n\tprotected float getPercentOpen() {\n\t\treturn Math.abs(mScrollX-mContent.getLeft()) / getBehindWidth();\n\t}\n\n\t@Override\n\tprotected void dispatchDraw(Canvas canvas) {\n\t\tsuper.dispatchDraw(canvas);\n\t\t// Draw the margin drawable if needed.\n\t\tmViewBehind.drawShadow(mContent, canvas);\n\t\tmViewBehind.drawFade(mContent, canvas, getPercentOpen());\n\t\tmViewBehind.drawSelector(mContent, canvas, getPercentOpen());\n\t}\n\n\t// variables for drawing\n\tprivate float mScrollX = 0.0f;\n\n\tprivate void onSecondaryPointerUp(MotionEvent ev) {\n\t\tif (DEBUG) Log.v(TAG, \"onSecondaryPointerUp called\");\n\t\tfinal int pointerIndex = MotionEventCompat.getActionIndex(ev);\n\t\tfinal int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);\n\t\tif (pointerId == mActivePointerId) {\n\t\t\t// This was our active pointer going up. Choose a new\n\t\t\t// active pointer and adjust accordingly.\n\t\t\tfinal int newPointerIndex = pointerIndex == 0 ? 1 : 0;\n\t\t\tmLastMotionX = MotionEventCompat.getX(ev, newPointerIndex);\n\t\t\tmActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex);\n\t\t\tif (mVelocityTracker != null) {\n\t\t\t\tmVelocityTracker.clear();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * 开始拖动\n\t */\n\tprivate void startDrag() {\n\t\tmIsBeingDragged = true;\n\t\tmQuickReturn = false;\n\t}\n\n\t/**\n\t * 结束拖动\n\t */\n\tprivate void endDrag() {\n\t\tmQuickReturn = false;\n\t\tmIsBeingDragged = false;\n\t\tmIsUnableToDrag = false;\n\t\tmActivePointerId = INVALID_POINTER;\n\n\t\tif (mVelocityTracker != null) {\n\t\t\tmVelocityTracker.recycle();\n\t\t\tmVelocityTracker = null;\n\t\t}\n\t}\n\n\t/**\n\t * 设置能否使用滑动缓存\n\t */\n\tprivate void setScrollingCacheEnabled(boolean enabled) {\n\t\tif (mScrollingCacheEnabled != enabled) {\n\t\t\tmScrollingCacheEnabled = enabled;\n\t\t\tif (USE_CACHE) {\n\t\t\t\tfinal int size = getChildCount();\n\t\t\t\tfor (int i = 0; i < size; ++i) {\n\t\t\t\t\tfinal View child = getChildAt(i);\n\t\t\t\t\tif (child.getVisibility() != GONE) {\n\t\t\t\t\t\tchild.setDrawingCacheEnabled(enabled);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Tests scrollability within child views of v given a delta of dx.\n\t *\n\t * @param v View to test for horizontal scrollability\n\t * @param checkV Whether the view v passed should itself be checked for scrollability (true),\n\t *               or just its children (false).\n\t * @param dx Delta scrolled in pixels\n\t * @param x X coordinate of the active touch point\n\t * @param y Y coordinate of the active touch point\n\t * @return true if child views of v can be scrolled by delta of dx.\n\t */\n\tprotected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {\n\t\tif (v instanceof ViewGroup) {\n\t\t\tfinal ViewGroup group = (ViewGroup) v;\n\t\t\tfinal int scrollX = v.getScrollX();\n\t\t\tfinal int scrollY = v.getScrollY();\n\t\t\tfinal int count = group.getChildCount();\n\t\t\t// Count backwards - let topmost views consume scroll distance first.\n\t\t\tfor (int i = count - 1; i >= 0; i--) {\n\t\t\t\tfinal View child = group.getChildAt(i);\n\t\t\t\tif (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() &&\n\t\t\t\t\t\ty + scrollY >= child.getTop() && y + scrollY < child.getBottom() &&\n\t\t\t\t\t\tcanScroll(child, true, dx, x + scrollX - child.getLeft(),\n\t\t\t\t\t\t\t\ty + scrollY - child.getTop())) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn checkV && ViewCompat.canScrollHorizontally(v, -dx);\n\t}\n\n\n\t@Override\n\tpublic boolean dispatchKeyEvent(KeyEvent event) {\n\t\t// Let the focused view and/or our descendants get the key first\n\t\treturn super.dispatchKeyEvent(event) || executeKeyEvent(event);\n\t}\n\n\t/**\n\t * 执行按键响应事件\n\t */\n\tpublic boolean executeKeyEvent(KeyEvent event) {\n\t\tboolean handled = false;\n\t\tif (event.getAction() == KeyEvent.ACTION_DOWN) {\n\t\t\tswitch (event.getKeyCode()) {\n\t\t\tcase KeyEvent.KEYCODE_DPAD_LEFT:\n\t\t\t\thandled = arrowScroll(FOCUS_LEFT);\n\t\t\t\tbreak;\n\t\t\tcase KeyEvent.KEYCODE_DPAD_RIGHT:\n\t\t\t\thandled = arrowScroll(FOCUS_RIGHT);\n\t\t\t\tbreak;\n\t\t\tcase KeyEvent.KEYCODE_TAB:\n\t\t\t\tif (Build.VERSION.SDK_INT >= 11) {\n\t\t\t\t\t// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD\n\t\t\t\t\t// before Android 3.0. Ignore the tab key on those devices.\n\t\t\t\t\tif (KeyEventCompat.hasNoModifiers(event)) {\n\t\t\t\t\t\thandled = arrowScroll(FOCUS_FORWARD);\n\t\t\t\t\t} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {\n\t\t\t\t\t\thandled = arrowScroll(FOCUS_BACKWARD);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn handled;\n\t}\n\n\t/**\n\t * 获得滑动的方向\n\t */\n\tpublic boolean arrowScroll(int direction) {\n\t\tView currentFocused = findFocus();\n\t\tif (currentFocused == this) currentFocused = null;\n\n\t\tboolean handled = false;\n\n\t\tView nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused,\n\t\t\t\tdirection);\n\t\tif (nextFocused != null && nextFocused != currentFocused) {\n\t\t\tif (direction == View.FOCUS_LEFT) {\n\t\t\t\thandled = nextFocused.requestFocus();\n\t\t\t} else if (direction == View.FOCUS_RIGHT) {\n\t\t\t\t// If there is nothing to the right, or this is causing us to\n\t\t\t\t// jump to the left, then what we really want to do is page right.\n\t\t\t\tif (currentFocused != null && nextFocused.getLeft() <= currentFocused.getLeft()) {\n\t\t\t\t\thandled = pageRight();\n\t\t\t\t} else {\n\t\t\t\t\thandled = nextFocused.requestFocus();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == FOCUS_LEFT || direction == FOCUS_BACKWARD) {\n\t\t\t// Trying to move left and nothing there; try to page.\n\t\t\thandled = pageLeft();\n\t\t} else if (direction == FOCUS_RIGHT || direction == FOCUS_FORWARD) {\n\t\t\t// Trying to move right and nothing there; try to page.\n\t\t\thandled = pageRight();\n\t\t}\n\t\tif (handled) {\n\t\t\tplaySoundEffect(SoundEffectConstants.getContantForFocusDirection(direction));\n\t\t}\n\t\treturn handled;\n\t}\n\n\t/**\n\t * 页面是否向左移动\n\t */\n\tboolean pageLeft() {\n\t\tif (mCurItem > 0) {\n\t\t\tsetCurrentItem(mCurItem-1, true);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 页面是否向右移动\n\t */\n\tboolean pageRight() {\n\t\tif (mCurItem < 1) {\n\t\t\tsetCurrentItem(mCurItem+1, true);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/CustomViewBehind.java",
    "content": "package com.hankkin.compustrading.slidingmenu;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.drawable.Drawable;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.util.TypedValue;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport com.hankkin.compustrading.R;\n\n\npublic class CustomViewBehind extends ViewGroup {\n\n\tprivate static final String TAG = \"CustomViewBehind\";\n\n\t//边缘滑动的临界值\n\tprivate static final int MARGIN_THRESHOLD = 48; // dips\n\t\n\t//初始化触摸的模式\n\tprivate int mTouchMode = SlidingMenu.TOUCHMODE_MARGIN;\n\n\t//定义上方视图\n\tprivate CustomViewAbove mViewAbove;\n\n\t//定义内容视图\n\tprivate View mContent;\n\tprivate View mSecondaryContent;\n\t\n\t//定义滑动边缘的临界值\n\tprivate int mMarginThreshold;\n\t\n\t//宽度的偏移量\n\tprivate int mWidthOffset;\n\t\n\tprivate SlidingMenu.CanvasTransformer mTransformer;\n\t\n\t//是否能够使用子视图\n\tprivate boolean mChildrenEnabled;\n\n\tpublic CustomViewBehind(Context context) {\n\t\tthis(context, null);\n\t}\n\n\tpublic CustomViewBehind(Context context, AttributeSet attrs) {\n\t\tsuper(context, attrs);\n\t\tmMarginThreshold = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, \n\t\t\t\tMARGIN_THRESHOLD, getResources().getDisplayMetrics());\n\t}\n\n\tpublic void setCustomViewAbove(CustomViewAbove customViewAbove) {\n\t\tmViewAbove = customViewAbove;\n\t}\n\n\tpublic void setCanvasTransformer(SlidingMenu.CanvasTransformer t) {\n\t\tmTransformer = t;\n\t}\n\n\t/**\n\t * 设置宽度的偏移量\n\t */\n\tpublic void setWidthOffset(int i) {\n\t\tmWidthOffset = i;\n\t\trequestLayout();\n\t}\n\t\n\t/**\n\t * 设置边缘滑动的临界值\n\t */\n\tpublic void setMarginThreshold(int marginThreshold) {\n\t\tmMarginThreshold = marginThreshold;\n\t}\n\t\n\t/**\n\t * 得到边缘滑动的临界值\n\t */\n\tpublic int getMarginThreshold() {\n\t\treturn mMarginThreshold;\n\t}\n\n\t/**\n\t * 得到视图的宽度\n\t */\n\tpublic int getBehindWidth() {\n\t\treturn mContent.getWidth();\n\t}\n\n\t/**\n\t * 设置视图的内容\n\t */\n\tpublic void setContent(View v) {\n\t\tif (mContent != null)\n\t\t\tremoveView(mContent);\n\t\tmContent = v;\n\t\taddView(mContent);\n\t}\n\n\t/**\n\t * 得到视图的内容\n\t */\n\tpublic View getContent() {\n\t\treturn mContent;\n\t}\n\n\t/**\n\t * 设置右边滑动菜单的内容，当模式设置为LEFT_RIGHT模式时\n\t */\n\tpublic void setSecondaryContent(View v) {\n\t\tif (mSecondaryContent != null)\n\t\t\tremoveView(mSecondaryContent);\n\t\tmSecondaryContent = v;\n\t\taddView(mSecondaryContent);\n\t}\n\n\t/**\n\t * 得到右边滑动菜单的内容\n\t */\n\tpublic View getSecondaryContent() {\n\t\treturn mSecondaryContent;\n\t}\n\n\t/**\n\t * 设置是否能够使用子视图\n\t */\n\tpublic void setChildrenEnabled(boolean enabled) {\n\t\tmChildrenEnabled = enabled;\n\t}\n\n\t@Override\n\tpublic void scrollTo(int x, int y) {\n\t\tsuper.scrollTo(x, y);\n\t\tif (mTransformer != null)\n\t\t\tinvalidate();\n\t}\n\n\t@Override\n\tpublic boolean onInterceptTouchEvent(MotionEvent e) {\n\t\treturn !mChildrenEnabled;\n\t}\n\n\t@Override\n\tpublic boolean onTouchEvent(MotionEvent e) {\n\t\treturn !mChildrenEnabled;\n\t}\n\n\t@Override\n\tprotected void dispatchDraw(Canvas canvas) {\n\t\tif (mTransformer != null) {\n\t\t\tcanvas.save();\n\t\t\tmTransformer.transformCanvas(canvas, mViewAbove.getPercentOpen());\n\t\t\tsuper.dispatchDraw(canvas);\n\t\t\tcanvas.restore();\n\t\t} else\n\t\t\tsuper.dispatchDraw(canvas);\n\t}\n\n\t@Override\n\tprotected void onLayout(boolean changed, int l, int t, int r, int b) {\n\t\tfinal int width = r - l;\n\t\tfinal int height = b - t;\n\t\tmContent.layout(0, 0, width-mWidthOffset, height);\n\t\tif (mSecondaryContent != null)\n\t\t\tmSecondaryContent.layout(0, 0, width-mWidthOffset, height);\n\t}\n\n\t@Override\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\t\tint width = getDefaultSize(0, widthMeasureSpec);\n\t\tint height = getDefaultSize(0, heightMeasureSpec);\n\t\tsetMeasuredDimension(width, height);\n\t\tfinal int contentWidth = getChildMeasureSpec(widthMeasureSpec, 0, width-mWidthOffset);\n\t\tfinal int contentHeight = getChildMeasureSpec(heightMeasureSpec, 0, height);\n\t\tmContent.measure(contentWidth, contentHeight);\n\t\tif (mSecondaryContent != null)\n\t\t\tmSecondaryContent.measure(contentWidth, contentHeight);\n\t}\n\n\t//定义模式的值\n\tprivate int mMode;\n\t\n\t//是否能够使用渐入渐出效果\n\tprivate boolean mFadeEnabled;\n\t\n\t//定义渐入渐出的值\n\tprivate float mFadeDegree;\n\t\n\t//定义渐入渐出效果画笔\n\tprivate final Paint mFadePaint = new Paint();\n\t\n\t//定义滑动缩放的值\n\tprivate float mScrollScale;\n\t\n\t//定义滑动菜单的阴影\n\tprivate Drawable mShadowDrawable;\n\t\n\t//定义右边滑动菜单的阴影图片\n\tprivate Drawable mSecondaryShadowDrawable;\n\t\n\t//定义阴影的宽度\n\tprivate int mShadowWidth;\n\t\n\t/**\n\t * 设置模式的值\n\t */\n\tpublic void setMode(int mode) {\n\t\tif (mode == SlidingMenu.LEFT || mode == SlidingMenu.RIGHT) {\n\t\t\tif (mContent != null)\n\t\t\t\tmContent.setVisibility(View.VISIBLE);\n\t\t\tif (mSecondaryContent != null)\n\t\t\t\tmSecondaryContent.setVisibility(View.INVISIBLE);\n\t\t}\n\t\tmMode = mode;\n\t}\n\n\t/**\n\t * 得到模式的值\n\t */\n\tpublic int getMode() {\n\t\treturn mMode;\n\t}\n\n\t/**\n\t * 设置滑动缩放的值\n\t */\n\tpublic void setScrollScale(float scrollScale) {\n\t\tmScrollScale = scrollScale;\n\t}\n\n\t/**\n\t * 得到滑动缩放的值\n\t */\n\tpublic float getScrollScale() {\n\t\treturn mScrollScale;\n\t}\n\n\t/**\n\t * 设置滑动菜单的阴影\n\t */\n\tpublic void setShadowDrawable(Drawable shadow) {\n\t\tmShadowDrawable = shadow;\n\t\tinvalidate();\n\t}\n\n\t/**\n\t * 设置右边滑动菜单的阴影\n\t */\n\tpublic void setSecondaryShadowDrawable(Drawable shadow) {\n\t\tmSecondaryShadowDrawable = shadow;\n\t\tinvalidate();\n\t}\n\n\t/**\n\t * 设置阴影的宽度\n\t */\n\tpublic void setShadowWidth(int width) {\n\t\tmShadowWidth = width;\n\t\tinvalidate();\n\t}\n\n\t/**\n\t * 设置能否使用渐入渐出效果\n\t */\n\tpublic void setFadeEnabled(boolean b) {\n\t\tmFadeEnabled = b;\n\t}\n\n\t/**\n\t * 设置渐入渐出的值\n\t */\n\tpublic void setFadeDegree(float degree) {\n\t\tif (degree > 1.0f || degree < 0.0f)\n\t\t\tthrow new IllegalStateException(\"The BehindFadeDegree must be between 0.0f and 1.0f\");\n\t\tmFadeDegree = degree;\n\t}\n\n\t/**\n\t * 得到菜单页面\n\t */\n\tpublic int getMenuPage(int page) {\n\t\tpage = (page > 1) ? 2 : ((page < 1) ? 0 : page);\n\t\tif (mMode == SlidingMenu.LEFT && page > 1) {\n\t\t\treturn 0;\n\t\t} else if (mMode == SlidingMenu.RIGHT && page < 1) {\n\t\t\treturn 2;\n\t\t} else {\n\t\t\treturn page;\n\t\t}\n\t}\n\n\t/**\n\t * 滑动下方视图到达的位置\n\t */\n\tpublic void scrollBehindTo(View content, int x, int y) {\n\t\tint vis = View.VISIBLE;\t\t\n\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\tif (x >= content.getLeft()) vis = View.INVISIBLE;\n\t\t\tscrollTo((int)((x + getBehindWidth())*mScrollScale), y);\n\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\tif (x <= content.getLeft()) vis = View.INVISIBLE;\n\t\t\tscrollTo((int)(getBehindWidth() - getWidth() + \n\t\t\t\t\t(x-getBehindWidth())*mScrollScale), y);\n\t\t} else if (mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\tmContent.setVisibility(x >= content.getLeft() ? View.INVISIBLE : View.VISIBLE);\n\t\t\tmSecondaryContent.setVisibility(x <= content.getLeft() ? View.INVISIBLE : View.VISIBLE);\n\t\t\tvis = x == 0 ? View.INVISIBLE : View.VISIBLE;\n\t\t\tif (x <= content.getLeft()) {\n\t\t\t\tscrollTo((int)((x + getBehindWidth())*mScrollScale), y);\t\t\t\t\n\t\t\t} else {\n\t\t\t\tscrollTo((int)(getBehindWidth() - getWidth() + \n\t\t\t\t\t\t(x-getBehindWidth())*mScrollScale), y);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif (vis == View.INVISIBLE)\n\t\t\tLog.v(TAG, \"behind INVISIBLE\");\n\t\tsetVisibility(vis);\n\t}\n\n\t/**\n\t * 得到左边菜单的视图\n\t */\n\tpublic int getMenuLeft(View content, int page) {\n\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\tswitch (page) {\n\t\t\tcase 0:\n\t\t\t\treturn content.getLeft() - getBehindWidth();\n\t\t\tcase 2:\n\t\t\t\treturn content.getLeft();\n\t\t\t}\n\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\tswitch (page) {\n\t\t\tcase 0:\n\t\t\t\treturn content.getLeft();\n\t\t\tcase 2:\n\t\t\t\treturn content.getLeft() + getBehindWidth();\t\n\t\t\t}\n\t\t} else if (mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\tswitch (page) {\n\t\t\tcase 0:\n\t\t\t\treturn content.getLeft() - getBehindWidth();\n\t\t\tcase 2:\n\t\t\t\treturn content.getLeft() + getBehindWidth();\n\t\t\t}\n\t\t}\n\t\treturn content.getLeft();\n\t}\n\n\t/**\n\t * 得到左边框视图\n\t */\n\tpublic int getAbsLeftBound(View content) {\n\t\tif (mMode == SlidingMenu.LEFT || mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\treturn content.getLeft() - getBehindWidth();\n\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\treturn content.getLeft();\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * 得到右边框视图\n\t */\n\tpublic int getAbsRightBound(View content) {\n\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\treturn content.getLeft();\n\t\t} else if (mMode == SlidingMenu.RIGHT || mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\treturn content.getLeft() + getBehindWidth();\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/**\n\t * 是否允许触摸屏幕的边缘\n\t */\n\tpublic boolean marginTouchAllowed(View content, int x) {\n\t\tint left = content.getLeft();\n\t\tint right = content.getRight();\n\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\treturn (x >= left && x <= mMarginThreshold + left);\n\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\treturn (x <= right && x >= right - mMarginThreshold);\n\t\t} else if (mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\treturn (x >= left && x <= mMarginThreshold + left) || \n\t\t\t\t\t(x <= right && x >= right - mMarginThreshold);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 设置触摸模式的值\n\t */\n\tpublic void setTouchMode(int i) {\n\t\tmTouchMode = i;\n\t}\n\n\t/**\n\t * 是否允许通过触摸打开滑动菜单\n\t */\n\tpublic boolean menuOpenTouchAllowed(View content, int currPage, float x) {\n\t\tswitch (mTouchMode) {\n\t\tcase SlidingMenu.TOUCHMODE_FULLSCREEN:\n\t\t\treturn true;\n\t\tcase SlidingMenu.TOUCHMODE_MARGIN:\n\t\t\treturn menuTouchInQuickReturn(content, currPage, x);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 滑动菜单快速返回\n\t */\n\tpublic boolean menuTouchInQuickReturn(View content, int currPage, float x) {\n\t\tif (mMode == SlidingMenu.LEFT || (mMode == SlidingMenu.LEFT_RIGHT && currPage == 0)) {\n\t\t\treturn x >= content.getLeft();\n\t\t} else if (mMode == SlidingMenu.RIGHT || (mMode == SlidingMenu.LEFT_RIGHT && currPage == 2)) {\n\t\t\treturn x <= content.getRight();\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 是否允许关闭滑动菜单\n\t */\n\tpublic boolean menuClosedSlideAllowed(float dx) {\n\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\treturn dx > 0;\n\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\treturn dx < 0;\n\t\t} else if (mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 是否允许打开滑动菜单\n\t */\n\tpublic boolean menuOpenSlideAllowed(float dx) {\n\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\treturn dx < 0;\n\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\treturn dx > 0;\n\t\t} else if (mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 画滑动菜单的阴影\n\t */\n\tpublic void drawShadow(View content, Canvas canvas) {\n\t\tif (mShadowDrawable == null || mShadowWidth <= 0) return;\n\t\tint left = 0;\n\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\tleft = content.getLeft() - mShadowWidth;\n\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\tleft = content.getRight();\n\t\t} else if (mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\tif (mSecondaryShadowDrawable != null) {\n\t\t\t\tleft = content.getRight();\n\t\t\t\tmSecondaryShadowDrawable.setBounds(left, 0, left + mShadowWidth, getHeight());\n\t\t\t\tmSecondaryShadowDrawable.draw(canvas);\n\t\t\t}\n\t\t\tleft = content.getLeft() - mShadowWidth;\n\t\t}\n\t\tmShadowDrawable.setBounds(left, 0, left + mShadowWidth, getHeight());\n\t\tmShadowDrawable.draw(canvas);\n\t}\n\n\t/**\n\t * 画出渐入渐出效果\n\t */\n\tpublic void drawFade(View content, Canvas canvas, float openPercent) {\n\t\tif (!mFadeEnabled) return;\n\t\tfinal int alpha = (int) (mFadeDegree * 255 * Math.abs(1-openPercent));\n\t\tmFadePaint.setColor(Color.argb(alpha, 0, 0, 0));\n\t\tint left = 0;\n\t\tint right = 0;\n\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\tleft = content.getLeft() - getBehindWidth();\n\t\t\tright = content.getLeft();\n\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\tleft = content.getRight();\n\t\t\tright = content.getRight() + getBehindWidth();\t\t\t\n\t\t} else if (mMode == SlidingMenu.LEFT_RIGHT) {\n\t\t\tleft = content.getLeft() - getBehindWidth();\n\t\t\tright = content.getLeft();\n\t\t\tcanvas.drawRect(left, 0, right, getHeight(), mFadePaint);\n\t\t\tleft = content.getRight();\n\t\t\tright = content.getRight() + getBehindWidth();\t\t\t\n\t\t}\n\t\tcanvas.drawRect(left, 0, right, getHeight(), mFadePaint);\n\t}\n\t\n\tprivate boolean mSelectorEnabled = true;\n\tprivate Bitmap mSelectorDrawable;\n\tprivate View mSelectedView;\n\t\n\tpublic void drawSelector(View content, Canvas canvas, float openPercent) {\n\t\tif (!mSelectorEnabled) return;\n\t\tif (mSelectorDrawable != null && mSelectedView != null) {\n\t\t\tString tag = (String) mSelectedView.getTag(R.id.selected_view);\n\t\t\tif (tag.equals(TAG+\"SelectedView\")) {\n\t\t\t\tcanvas.save();\n\t\t\t\tint left, right, offset;\n\t\t\t\toffset = (int) (mSelectorDrawable.getWidth() * openPercent);\n\t\t\t\tif (mMode == SlidingMenu.LEFT) {\n\t\t\t\t\tright = content.getLeft();\n\t\t\t\t\tleft = right - offset;\n\t\t\t\t\tcanvas.clipRect(left, 0, right, getHeight());\n\t\t\t\t\tcanvas.drawBitmap(mSelectorDrawable, left, getSelectorTop(), null);\t\t\n\t\t\t\t} else if (mMode == SlidingMenu.RIGHT) {\n\t\t\t\t\tleft = content.getRight();\n\t\t\t\t\tright = left + offset;\n\t\t\t\t\tcanvas.clipRect(left, 0, right, getHeight());\n\t\t\t\t\tcanvas.drawBitmap(mSelectorDrawable, right - mSelectorDrawable.getWidth(), getSelectorTop(), null);\n\t\t\t\t}\n\t\t\t\tcanvas.restore();\n\t\t\t}\n\t\t}\n\t}\n\t\n\tpublic void setSelectorEnabled(boolean b) {\n\t\tmSelectorEnabled = b;\n\t}\n\n\tpublic void setSelectedView(View v) {\n\t\tif (mSelectedView != null) {\n\t\t\tmSelectedView.setTag(R.id.selected_view, null);\n\t\t\tmSelectedView = null;\n\t\t}\n\t\tif (v != null && v.getParent() != null) {\n\t\t\tmSelectedView = v;\n\t\t\tmSelectedView.setTag(R.id.selected_view, TAG+\"SelectedView\");\n\t\t\tinvalidate();\n\t\t}\n\t}\n\n\tprivate int getSelectorTop() {\n\t\tint y = mSelectedView.getTop();\n\t\ty += (mSelectedView.getHeight() - mSelectorDrawable.getHeight()) / 2;\n\t\treturn y;\n\t}\n\n\tpublic void setSelectorBitmap(Bitmap b) {\n\t\tmSelectorDrawable = b;\n\t\trefreshDrawableState();\n\t}\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingActivityBase.java",
    "content": "package com.hankkin.compustrading.slidingmenu;\n\nimport android.view.View;\nimport android.view.ViewGroup.LayoutParams;\n\n\npublic interface SlidingActivityBase {\n\t\n\t/**\n\t * Set the behind view content to an explicit view. This view is placed directly into the behind view 's view hierarchy.\n\t * It can itself be a complex view hierarchy.\n\t *\n\t * @param view The desired content to display.\n\t * @param layoutParams Layout parameters for the view.\n\t */\n\tpublic void setBehindContentView(View view, LayoutParams layoutParams);\n\n\t/**\n\t * Set the behind view content to an explicit view. This view is placed directly into the behind view 's view hierarchy.\n\t * It can itself be a complex view hierarchy. When calling this method, the layout parameters of the specified\n\t * view are ignored. Both the width and the height of the view are set by default to MATCH_PARENT. To use your\n\t * own layout parameters, invoke setContentView(android.view.View, android.view.ViewGroup.LayoutParams) instead.\n\t *\n\t * @param view The desired content to display.\n\t */\n\tpublic void setBehindContentView(View view);\n\n\t/**\n\t * Set the behind view content from a layout resource. The resource will be inflated, adding all top-level views\n\t * to the behind view.\n\t *\n\t * @param layoutResID Resource ID to be inflated.\n\t */\n\tpublic void setBehindContentView(int layoutResID);\n\n\t/**\n\t * Gets the SlidingMenu associated with this activity.\n\t *\n\t * @return the SlidingMenu associated with this activity.\n\t */\n\tpublic SlidingMenu getSlidingMenu();\n\t\t\n\t/**\n\t * Toggle the SlidingMenu. If it is open, it will be closed, and vice versa.\n\t */\n\tpublic void toggle();\n\t\n\t/**\n\t * Close the SlidingMenu and show the content view.\n\t */\n\tpublic void showContent();\n\t\n\t/**\n\t * Open the SlidingMenu and show the menu view.\n\t */\n\tpublic void showMenu();\n\n\t/**\n\t * Open the SlidingMenu and show the secondary (right) menu view. Will default to the regular menu\n\t * if there is only one.\n\t */\n\tpublic void showSecondaryMenu();\n\t\n\t/**\n\t * Controls whether the ActionBar slides along with the above view when the menu is opened,\n\t * or if it stays in place.\n\t *\n\t * @param slidingActionBarEnabled True if you want the ActionBar to slide along with the SlidingMenu,\n\t * false if you want the ActionBar to stay in place\n\t */\n\tpublic void setSlidingActionBarEnabled(boolean slidingActionBarEnabled);\n\t\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingActivityHelper.java",
    "content": "package com.hankkin.compustrading.slidingmenu;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.view.KeyEvent;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup.LayoutParams;\n\nimport com.hankkin.compustrading.R;\n\n\npublic class SlidingActivityHelper {\n\n\tprivate Activity mActivity;\n\n\tprivate SlidingMenu mSlidingMenu;\n\n\tprivate View mViewAbove;\n\n\tprivate View mViewBehind;\n\n\tprivate boolean mBroadcasting = false;\n\n\tprivate boolean mOnPostCreateCalled = false;\n\n\tprivate boolean mEnableSlide = true;\n\n\t/**\n\t * Instantiates a new SlidingActivityHelper.\n\t *\n\t * @param activity the associated activity\n\t */\n\tpublic SlidingActivityHelper(Activity activity) {\n\t\tmActivity = activity;\n\t}\n\n\t/**\n\t * Sets mSlidingMenu as a newly inflated SlidingMenu. Should be called within the activitiy's onCreate()\n\t *\n\t * @param savedInstanceState the saved instance state (unused)\n\t */\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tmSlidingMenu = (SlidingMenu) LayoutInflater.from(mActivity).inflate(R.layout.slidingmenumain, null);\n\t}\n\n\t/**\n\t * Further SlidingMenu initialization. Should be called within the activitiy's onPostCreate()\n\t *\n\t * @param savedInstanceState the saved instance state (unused)\n\t */\n\tpublic void onPostCreate(Bundle savedInstanceState) {\n\t\tif (mViewBehind == null || mViewAbove == null) {\n\t\t\tthrow new IllegalStateException(\"Both setBehindContentView must be called \" +\n\t\t\t\t\t\"in onCreate in addition to setContentView.\");\n\t\t}\n\n\t\tmOnPostCreateCalled = true;\n\n\t\tmSlidingMenu.attachToActivity(mActivity, \n\t\t\t\tmEnableSlide ? SlidingMenu.SLIDING_WINDOW : SlidingMenu.SLIDING_CONTENT);\n\t\t\n\t\tfinal boolean open;\n\t\tfinal boolean secondary;\n\t\tif (savedInstanceState != null) {\n\t\t\topen = savedInstanceState.getBoolean(\"SlidingActivityHelper.open\");\n\t\t\tsecondary = savedInstanceState.getBoolean(\"SlidingActivityHelper.secondary\");\n\t\t} else {\n\t\t\topen = false;\n\t\t\tsecondary = false;\n\t\t}\n\t\tnew Handler().post(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tif (open) {\n\t\t\t\t\tif (secondary) {\n\t\t\t\t\t\tmSlidingMenu.showSecondaryMenu(false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmSlidingMenu.showMenu(false);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmSlidingMenu.showContent(false);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Controls whether the ActionBar slides along with the above view when the menu is opened,\n\t * or if it stays in place.\n\t *\n\t * @param slidingActionBarEnabled True if you want the ActionBar to slide along with the SlidingMenu,\n\t * false if you want the ActionBar to stay in place\n\t */\n\tpublic void setSlidingActionBarEnabled(boolean slidingActionBarEnabled) {\n\t\tif (mOnPostCreateCalled)\n\t\t\tthrow new IllegalStateException(\"enableSlidingActionBar must be called in onCreate.\");\n\t\tmEnableSlide = slidingActionBarEnabled;\n\t}\n\n\t/**\n\t * Finds a view that was identified by the id attribute from the XML that was processed in onCreate(Bundle).\n\t * \n\t * @param id the resource id of the desired view\n\t * @return The view if found or null otherwise.\n\t */\n\tpublic View findViewById(int id) {\n\t\tView v;\n\t\tif (mSlidingMenu != null) {\n\t\t\tv = mSlidingMenu.findViewById(id);\n\t\t\tif (v != null)\n\t\t\t\treturn v;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Called to retrieve per-instance state from an activity before being killed so that the state can be\n\t * restored in onCreate(Bundle) or onRestoreInstanceState(Bundle) (the Bundle populated by this method\n\t * will be passed to both). \n\t *\n\t * @param outState Bundle in which to place your saved state.\n\t */\n\tpublic void onSaveInstanceState(Bundle outState) {\n\t\toutState.putBoolean(\"SlidingActivityHelper.open\", mSlidingMenu.isMenuShowing());\n\t\toutState.putBoolean(\"SlidingActivityHelper.secondary\", mSlidingMenu.isSecondaryMenuShowing());\n\t}\n\n\t/**\n\t * Register the above content view.\n\t *\n\t * @param v the above content view to register\n\t * @param params LayoutParams for that view (unused)\n\t */\n\tpublic void registerAboveContentView(View v, LayoutParams params) {\n\t\tif (!mBroadcasting)\n\t\t\tmViewAbove = v;\n\t}\n\n\t/**\n\t * Set the activity content to an explicit view. This view is placed directly into the activity's view\n\t * hierarchy. It can itself be a complex view hierarchy. When calling this method, the layout parameters\n\t * of the specified view are ignored. Both the width and the height of the view are set by default to\n\t * MATCH_PARENT. To use your own layout parameters, invoke setContentView(android.view.View,\n\t * android.view.ViewGroup.LayoutParams) instead.\n\t *\n\t * @param v The desired content to display.\n\t */\n\tpublic void setContentView(View v) {\n\t\tmBroadcasting = true;\n\t\tmActivity.setContentView(v);\n\t}\n\n\t/**\n\t * Set the behind view content to an explicit view. This view is placed directly into the behind view 's view hierarchy.\n\t * It can itself be a complex view hierarchy.\n\t *\n\t * @param view The desired content to display.\n\t * @param layoutParams Layout parameters for the view. (unused)\n\t */\n\tpublic void setBehindContentView(View view, LayoutParams layoutParams) {\n\t\tmViewBehind = view;\n\t\tmSlidingMenu.setMenu(mViewBehind);\n\t}\n\n\t/**\n\t * Gets the SlidingMenu associated with this activity.\n\t *\n\t * @return the SlidingMenu associated with this activity.\n\t */\n\tpublic SlidingMenu getSlidingMenu() {\n\t\treturn mSlidingMenu;\n\t}\n\n\t/**\n\t * Toggle the SlidingMenu. If it is open, it will be closed, and vice versa.\n\t */\n\tpublic void toggle() {\n\t\tmSlidingMenu.toggle();\n\t}\n\n\t/**\n\t * Close the SlidingMenu and show the content view.\n\t */\n\tpublic void showContent() {\n\t\tmSlidingMenu.showContent();\n\t}\n\n\t/**\n\t * Open the SlidingMenu and show the menu view.\n\t */\n\tpublic void showMenu() {\n\t\tmSlidingMenu.showMenu();\n\t}\n\n\t/**\n\t * Open the SlidingMenu and show the secondary menu view. Will default to the regular menu\n\t * if there is only one.\n\t */\n\tpublic void showSecondaryMenu() {\n\t\tmSlidingMenu.showSecondaryMenu();\n\t}\n\n\t/**\n\t * On key up.\n\t *\n\t * @param keyCode the key code\n\t * @param event the event\n\t * @return true, if successful\n\t */\n\tpublic boolean onKeyUp(int keyCode, KeyEvent event) {\n\t\tif (keyCode == KeyEvent.KEYCODE_BACK && mSlidingMenu.isMenuShowing()) {\n\t\t\tshowContent();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingMenu.java",
    "content": "package com.hankkin.compustrading.slidingmenu;\n\nimport java.lang.reflect.Method;\n\nimport android.annotation.SuppressLint;\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Canvas;\nimport android.graphics.Point;\nimport android.graphics.Rect;\nimport android.graphics.drawable.Drawable;\nimport android.os.Build;\nimport android.os.Handler;\nimport android.os.Parcel;\nimport android.os.Parcelable;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.view.Display;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.WindowManager;\nimport android.widget.FrameLayout;\nimport android.widget.RelativeLayout;\n\nimport com.hankkin.compustrading.R;\n\n\npublic class SlidingMenu extends RelativeLayout {\n\n\tprivate static final String TAG = \"SlidingMenu\";\n\n\tpublic static final int SLIDING_WINDOW = 0;\n\tpublic static final int SLIDING_CONTENT = 1;\n\tprivate boolean mActionbarOverlay = false;\n\n\t/**\n\t * 为setTouchModeAbove()方法设置一个常量值，允许滑动菜单通过滑动屏幕的边缘被打开 \n\t */\n\tpublic static final int TOUCHMODE_MARGIN = 0;\n\n\t/** \n\t * 为setTouchModeAbove()方法设置一个常量值，允许滑动菜单通过滑动屏幕的任何地方被打开\n\t */\n\tpublic static final int TOUCHMODE_FULLSCREEN = 1;\n\n\t/** \n\t * 为setTouchModeAbove()方法设置一个常量值，不允许滑动菜单通过滑动屏幕被打开\n\t */\n\tpublic static final int TOUCHMODE_NONE = 2;\n\n\t/** \n\t * 为setMode()方法设置一个常量值，把滑动菜单放在左边\n\t */\n\tpublic static final int LEFT = 0;\n\n\t/** \n\t * 为setMode()方法设置一个常量值，把滑动菜单放在右边\n\t */\n\tpublic static final int RIGHT = 1;\n\n\t/** \n\t * 为setMode()方法设置一个常量值，把滑动菜单放在左右两边\n\t */\n\tpublic static final int LEFT_RIGHT = 2;\n\n\t/**\n\t * 定义上方视图对象\n\t */\n\tprivate CustomViewAbove mViewAbove;\n\n\t/**\n\t * 定义下方视图对象\n\t */\n\tprivate CustomViewBehind mViewBehind;\n\n\t/**\n\t * 定义滑动菜单打开的监听对象\n\t */\n\tprivate OnOpenListener mOpenListener;\n\n\t/**\n\t * 定义滑动菜单关闭的监听对象\n\t */\n\tprivate OnCloseListener mCloseListener;\n\n\t/**\n\t * 滑动菜单打开时的监听事件\n\t */\n\tpublic interface OnOpenListener {\t\n\t\tpublic void onOpen();\n\t}\n\n\t/**\n\t * 监测滑动菜单是否已经打开的监听事件\n\t */\n\tpublic interface OnOpenedListener {\n\t\tpublic void onOpened();\n\t}\n\n\t/**\n\t * 滑动菜单关闭时的监听事件\n\t */\n\tpublic interface OnCloseListener {\n\t\tpublic void onClose();\n\t}\n\n\t/**\n\t * 监测滑动菜单是否已经关闭的监听事件\n\t */\n\tpublic interface OnClosedListener {\n\t\tpublic void onClosed();\n\t}\n\n\t/**\n\t * The Interface CanvasTransformer.\n\t */\n\tpublic interface CanvasTransformer {\n\n\t\t/**\n\t\t * Transform canvas.\n\t\t *\n\t\t * @param canvas the canvas\n\t\t * @param percentOpen the percent open\n\t\t */\n\t\tpublic void transformCanvas(Canvas canvas, float percentOpen);\n\t}\n\n\t/**\n\t * 初始化滑动菜单\n\t *\n\t * @param context the associated Context\n\t */\n\tpublic SlidingMenu(Context context) {\n\t\tthis(context, null);\n\t}\n\n\t/**\n\t * 初始化滑动菜单\n\t *\n\t * @param activity the activity to attach slidingmenu\n\t * @param slideStyle the slidingmenu style\n\t */\n\tpublic SlidingMenu(Activity activity, int slideStyle) {\n\t\tthis(activity, null);\n\t\tthis.attachToActivity(activity, slideStyle);\n\t}\n\n\t/**\n\t * 初始化滑动菜单\n\t *\n\t * @param context the associated Context\n\t * @param attrs the attrs\n\t */\n\tpublic SlidingMenu(Context context, AttributeSet attrs) {\n\t\tthis(context, attrs, 0);\n\t}\n\n\t/**\n\t * 初始化滑动菜单\n\t *\n\t * @param context the associated Context\n\t * @param attrs the attrs\n\t * @param defStyle the def style\n\t */\n\tpublic SlidingMenu(Context context, AttributeSet attrs, int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t\t\n\t\tLayoutParams behindParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\tmViewBehind = new CustomViewBehind(context);\n\t\taddView(mViewBehind, behindParams);\n\t\tLayoutParams aboveParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);\n\t\tmViewAbove = new CustomViewAbove(context);\n\t\taddView(mViewAbove, aboveParams);\n\t\t// register the CustomViewBehind with the CustomViewAbove\n\t\tmViewAbove.setCustomViewBehind(mViewBehind);\n\t\tmViewBehind.setCustomViewAbove(mViewAbove);\n\t\tmViewAbove.setOnPageChangeListener(new CustomViewAbove.OnPageChangeListener() {\n\t\t\tpublic static final int POSITION_OPEN = 0;\n\t\t\tpublic static final int POSITION_CLOSE = 1;\n\n\t\t\tpublic void onPageScrolled(int position, float positionOffset,\n\t\t\t\t\tint positionOffsetPixels) { }\n\n\t\t\tpublic void onPageSelected(int position) {\n\t\t\t\tif (position == POSITION_OPEN && mOpenListener != null) {\n\t\t\t\t\tmOpenListener.onOpen();\n\t\t\t\t} else if (position == POSITION_CLOSE && mCloseListener != null) {\n\t\t\t\t\tmCloseListener.onClose();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// now style everything!\n\t\tTypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.SlidingMenu);\n\t\t// set the above and behind views if defined in xml\n\t\tint mode = ta.getInt(R.styleable.SlidingMenu_mode, LEFT);\n\t\tsetMode(mode);\n\t\tint viewAbove = ta.getResourceId(R.styleable.SlidingMenu_viewAbove, -1);\n\t\tif (viewAbove != -1) {\n\t\t\tsetContent(viewAbove);\n\t\t} else {\n\t\t\tsetContent(new FrameLayout(context));\n\t\t}\n\t\tint viewBehind = ta.getResourceId(R.styleable.SlidingMenu_viewBehind, -1);\n\t\tif (viewBehind != -1) {\n\t\t\tsetMenu(viewBehind); \n\t\t} else {\n\t\t\tsetMenu(new FrameLayout(context));\n\t\t}\n\t\tint touchModeAbove = ta.getInt(R.styleable.SlidingMenu_touchModeAbove, TOUCHMODE_MARGIN);\n\t\tsetTouchModeAbove(touchModeAbove);\n\t\tint touchModeBehind = ta.getInt(R.styleable.SlidingMenu_touchModeBehind, TOUCHMODE_MARGIN);\n\t\tsetTouchModeBehind(touchModeBehind);\n\n\t\tint offsetBehind = (int) ta.getDimension(R.styleable.SlidingMenu_behindOffset, -1);\n\t\tint widthBehind = (int) ta.getDimension(R.styleable.SlidingMenu_behindWidth, -1);\n\t\tif (offsetBehind != -1 && widthBehind != -1)\n\t\t\tthrow new IllegalStateException(\"Cannot set both behindOffset and behindWidth for a SlidingMenu\");\n\t\telse if (offsetBehind != -1)\n\t\t\tsetBehindOffset(offsetBehind);\n\t\telse if (widthBehind != -1)\n\t\t\tsetBehindWidth(widthBehind);\n\t\telse\n\t\t\tsetBehindOffset(0);\n\t\tfloat scrollOffsetBehind = ta.getFloat(R.styleable.SlidingMenu_behindScrollScale, 0.33f);\n\t\tsetBehindScrollScale(scrollOffsetBehind);\n\t\tint shadowRes = ta.getResourceId(R.styleable.SlidingMenu_shadowDrawable, -1);\n\t\tif (shadowRes != -1) {\n\t\t\tsetShadowDrawable(shadowRes);\n\t\t}\n\t\tint shadowWidth = (int) ta.getDimension(R.styleable.SlidingMenu_shadowWidth, 0);\n\t\tsetShadowWidth(shadowWidth);\n\t\tboolean fadeEnabled = ta.getBoolean(R.styleable.SlidingMenu_fadeEnabled, true);\n\t\tsetFadeEnabled(fadeEnabled);\n\t\tfloat fadeDeg = ta.getFloat(R.styleable.SlidingMenu_fadeDegree, 0.33f);\n\t\tsetFadeDegree(fadeDeg);\n\t\tboolean selectorEnabled = ta.getBoolean(R.styleable.SlidingMenu_selectorEnabled, false);\n\t\tsetSelectorEnabled(selectorEnabled);\n\t\tint selectorRes = ta.getResourceId(R.styleable.SlidingMenu_selectorDrawable, -1);\n\t\tif (selectorRes != -1)\n\t\t\tsetSelectorDrawable(selectorRes);\n\t\tta.recycle();\n\t}\n\n\t/**\n\t * 把滑动菜单添加进所有的Activity中\n\t * \n\t * @param activity the Activity\n\t * @param slideStyle either SLIDING_CONTENT or SLIDING_WINDOW\n\t */\n\tpublic void attachToActivity(Activity activity, int slideStyle) {\n\t\tattachToActivity(activity, slideStyle, false);\n\t}\n\n\t/**\n\t * 把滑动菜单添加进所有的Activity中\n\t * \n\t * @param activity the Activity\n\t * @param slideStyle either SLIDING_CONTENT or SLIDING_WINDOW\n\t * @param actionbarOverlay whether or not the ActionBar is overlaid\n\t */\n\tpublic void attachToActivity(Activity activity, int slideStyle, boolean actionbarOverlay) {\n\t\tif (slideStyle != SLIDING_WINDOW && slideStyle != SLIDING_CONTENT)\n\t\t\tthrow new IllegalArgumentException(\"slideStyle must be either SLIDING_WINDOW or SLIDING_CONTENT\");\n\n\t\tif (getParent() != null)\n\t\t\tthrow new IllegalStateException(\"This SlidingMenu appears to already be attached\");\n\n\t\t// get the window background\n\t\tTypedArray a = activity.getTheme().obtainStyledAttributes(new int[] {android.R.attr.windowBackground});\n\t\tint background = a.getResourceId(0, 0);\n\t\ta.recycle();\n\n\t\tswitch (slideStyle) {\n\t\tcase SLIDING_WINDOW:\n\t\t\tmActionbarOverlay = false;\n\t\t\tViewGroup decor = (ViewGroup) activity.getWindow().getDecorView();\n\t\t\tViewGroup decorChild = (ViewGroup) decor.getChildAt(0);\n\t\t\t// save ActionBar themes that have transparent assets\n\t\t\tdecorChild.setBackgroundResource(background);\n\t\t\tdecor.removeView(decorChild);\n\t\t\tdecor.addView(this);\n\t\t\tsetContent(decorChild);\n\t\t\tbreak;\n\t\tcase SLIDING_CONTENT:\n\t\t\tmActionbarOverlay = actionbarOverlay;\n\t\t\t// take the above view out of\n\t\t\tViewGroup contentParent = (ViewGroup)activity.findViewById(android.R.id.content);\n\t\t\tView content = contentParent.getChildAt(0);\n\t\t\tcontentParent.removeView(content);\n\t\t\tcontentParent.addView(this);\n\t\t\tsetContent(content);\n\t\t\t// save people from having transparent backgrounds\n\t\t\tif (content.getBackground() == null)\n\t\t\t\tcontent.setBackgroundResource(background);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * 从布局资源文件中设置上方的视图内容，这个布局会被填充添加到所有图层的最上方\n\t */\n\tpublic void setContent(int res) {\n\t\tsetContent(LayoutInflater.from(getContext()).inflate(res, null));\n\t}\n\n\t/**\n\t * 通过View来设置上方的视图内容\n\t */\n\tpublic void setContent(View view) {\n\t\tmViewAbove.setContent(view);\n\t\tshowContent();\n\t}\n\n\t/**\n\t * 得到上方的视图内容\n\t */\n\tpublic View getContent() {\n\t\treturn mViewAbove.getContent();\n\t}\n\n\t/**\n\t * 从布局资源文件中设置下方（滑动菜单）的视图内容，这个布局会被填充添加到所有图层的最下方\n\t * \n\t * @param res the new content\n\t */\n\tpublic void setMenu(int res) {\n\t\tsetMenu(LayoutInflater.from(getContext()).inflate(res, null));\n\t}\n\n\t/**\n\t * 得到下方（滑动菜单）的视图内容\n\t *\n\t * @param The desired content to display.\n\t */\n\tpublic void setMenu(View v) {\n\t\tmViewBehind.setContent(v);\n\t}\n\n\t/**\n\t * 得到下方（滑动菜单）的视图内容\n\t */\n\tpublic View getMenu() {\n\t\treturn mViewBehind.getContent();\n\t}\n\n\t/**\n\t * 从布局资源文件中设置下方（右边滑动菜单）的视图内容，这个布局会被填充添加到所有图层的最下方\n\t */\n\tpublic void setSecondaryMenu(int res) {\n\t\tsetSecondaryMenu(LayoutInflater.from(getContext()).inflate(res, null));\n\t}\n\n\t/**\n\t * 设置下方（右边滑动菜单）的视图内容\n\t */\n\tpublic void setSecondaryMenu(View v) {\n\t\tmViewBehind.setSecondaryContent(v);\n\t}\n\n\t/**\n\t * 得到下方（右边滑动菜单）的视图内容\n\t */\n\tpublic View getSecondaryMenu() {\n\t\treturn mViewBehind.getSecondaryContent();\n\t}\n\n\t/**\n\t * 设置上方视图是否能够滑动\n\t */\n\tpublic void setSlidingEnabled(boolean b) {\n\t\tmViewAbove.setSlidingEnabled(b);\n\t}\n\n\t/**\n\t * 检测上方视图是否能够滑动\n\t */\n\tpublic boolean isSlidingEnabled() {\n\t\treturn mViewAbove.isSlidingEnabled();\n\t}\n\n\t/**\n\t * 设置滑动菜单出现在视图中的位置\n\t * \n\t * @param mode must be either SlidingMenu.LEFT or SlidingMenu.RIGHT\n\t */\n\tpublic void setMode(int mode) {\n\t\tif (mode != LEFT && mode != RIGHT && mode != LEFT_RIGHT) {\n\t\t\tthrow new IllegalStateException(\"SlidingMenu mode must be LEFT, RIGHT, or LEFT_RIGHT\");\n\t\t}\n\t\tmViewBehind.setMode(mode);\n\t}\n\n\t/**\n\t * 得到滑动菜单在视图中的位置\n\t * \n\t * @return the current mode, either SlidingMenu.LEFT or SlidingMenu.RIGHT\n\t */\n\tpublic int getMode() {\n\t\treturn mViewBehind.getMode();\n\t}\n\n\t/**\n\t * 设置滑动菜单是否是静态模式(不能够使用滑动菜单)\n\t */\n\tpublic void setStatic(boolean b) {\n\t\tif (b) {\n\t\t\tsetSlidingEnabled(false);\n\t\t\tmViewAbove.setCustomViewBehind(null);\n\t\t\tmViewAbove.setCurrentItem(1);\n\t\t\t//\t\t\tmViewBehind.setCurrentItem(0);\t\n\t\t} else {\n\t\t\tmViewAbove.setCurrentItem(1);\n\t\t\t//\t\t\tmViewBehind.setCurrentItem(1);\n\t\t\tmViewAbove.setCustomViewBehind(mViewBehind);\n\t\t\tsetSlidingEnabled(true);\n\t\t}\n\t}\n\n\t/**\n\t * 打开滑动菜单并显示菜单的视图\n\t */\n\tpublic void showMenu() {\n\t\tshowMenu(true);\n\t}\n\n\t/**\n\t * 是否使用动画效果打开滑动菜单并显示菜单的视图\n\t */\n\tpublic void showMenu(boolean animate) {\n\t\tmViewAbove.setCurrentItem(0, animate);\n\t}\n\n\t/**\n\t * 打开右边的滑动菜单并显示菜单的视图 \n\t */\n\tpublic void showSecondaryMenu() {\n\t\tshowSecondaryMenu(true);\n\t}\n\n\t/**\n\t * 是否使用动画效果打开右边的滑动菜单并显示菜单的视图\n\t */\n\tpublic void showSecondaryMenu(boolean animate) {\n\t\tmViewAbove.setCurrentItem(2, animate);\n\t}\n\n\t/**\n\t * 关闭菜单并显示上方的视图\n\t */\n\tpublic void showContent() {\n\t\tshowContent(true);\n\t}\n\n\t/**\n\t * 是否使用动画效果关闭菜单并显示上方的视图\n\t */\n\tpublic void showContent(boolean animate) {\n\t\tmViewAbove.setCurrentItem(1, animate);\n\t}\n\n\t/**\n\t * 滑动菜单的开关\n\t */\n\tpublic void toggle() {\n\t\ttoggle(true);\n\t}\n\n\t/**\n\t * 是否使用动画效果打开或关闭滑动菜单\n\t */\n\tpublic void toggle(boolean animate) {\n\t\tif (isMenuShowing()) {\n\t\t\tshowContent(animate);\n\t\t} else {\n\t\t\tshowMenu(animate);\n\t\t}\n\t}\n\n\t/**\n\t * 检测滑动菜单是否正在被显示\n\t */\n\tpublic boolean isMenuShowing() {\n\t\treturn mViewAbove.getCurrentItem() == 0 || mViewAbove.getCurrentItem() == 2;\n\t}\n\t\n\t/**\n\t * 检测右边滑动菜单是否正在被显示\n\t */\n\tpublic boolean isSecondaryMenuShowing() {\n\t\treturn mViewAbove.getCurrentItem() == 2;\n\t}\n\n\t/**\n\t * 得到下方视图的偏移量\n\t */\n\tpublic int getBehindOffset() {\n\t\treturn ((RelativeLayout.LayoutParams)mViewBehind.getLayoutParams()).rightMargin;\n\t}\n\n\t/**\n\t * 根据像素的值来设置下方视图的偏移量\n\t *\n\t * @param i The margin, in pixels, on the right of the screen that the behind view scrolls to.\n\t */\n\tpublic void setBehindOffset(int i) {\t\t\n\t\tmViewBehind.setWidthOffset(i);\n\t}\n\n\t/**\n\t * 根据dimension资源文件的ID来设置下方视图的偏移量\n\t *\n\t * @param resID The dimension resource id to be set as the behind offset.\n\t * The menu, when open, will leave this width margin on the right of the screen.\n\t */\n\tpublic void setBehindOffsetRes(int resID) {\n\t\tint i = (int) getContext().getResources().getDimension(resID);\n\t\tsetBehindOffset(i);\n\t}\n\n\t/**\n\t * 根据像素的值来设置上方视图的偏移量\n\t *\n\t * @param i the new above offset, in pixels\n\t */\n\tpublic void setAboveOffset(int i) {\n\t\tmViewAbove.setAboveOffset(i);\n\t}\n\n\t/**\n\t * 根据dimension资源文件的ID来设置上方视图的偏移量\n\t *\n\t * @param resID The dimension resource id to be set as the above offset.\n\t */\n\tpublic void setAboveOffsetRes(int resID) {\n\t\tint i = (int) getContext().getResources().getDimension(resID);\n\t\tsetAboveOffset(i);\n\t}\n\n\t/**\n\t * 根据像素的值来设置下方视图的宽度\n\t *\n\t * @param i The width the Sliding Menu will open to, in pixels\n\t */\n\tpublic void setBehindWidth(int i) {\n\t\tint width;\n\t\tDisplay display = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE))\n\t\t\t\t.getDefaultDisplay();\n\t\ttry {\n\t\t\tClass<?> cls = Display.class;\n\t\t\tClass<?>[] parameterTypes = {Point.class};\n\t\t\tPoint parameter = new Point();\n\t\t\tMethod method = cls.getMethod(\"getSize\", parameterTypes);\n\t\t\tmethod.invoke(display, parameter);\n\t\t\twidth = parameter.x;\n\t\t} catch (Exception e) {\n\t\t\twidth = display.getWidth();\n\t\t}\n\t\tsetBehindOffset(width-i);\n\t}\n\n\t/**\n\t * 根据dimension资源文件的ID来设置下方视图的宽度\n\t *\n\t * @param res The dimension resource id to be set as the behind width offset.\n\t * The menu, when open, will open this wide.\n\t */\n\tpublic void setBehindWidthRes(int res) {\n\t\tint i = (int) getContext().getResources().getDimension(res);\n\t\tsetBehindWidth(i);\n\t}\n\n\t/**\n\t * 得到下方视图的在滚动时的缩放比例\n\t *\n\t * @return The scale of the parallax scroll\n\t */\n\tpublic float getBehindScrollScale() {\n\t\treturn mViewBehind.getScrollScale();\n\t}\n\t\n\t/**\n\t * 设置下方视图的在滚动时的缩放比例\n\t *\n\t * @param f The scale of the parallax scroll (i.e. 1.0f scrolls 1 pixel for every\n\t * 1 pixel that the above view scrolls and 0.0f scrolls 0 pixels)\n\t */\n\tpublic void setBehindScrollScale(float f) {\n\t\tif (f < 0 && f > 1)\n\t\t\tthrow new IllegalStateException(\"ScrollScale must be between 0 and 1\");\n\t\tmViewBehind.setScrollScale(f);\n\t}\n\t\n\t/**\n\t * 得到边缘触摸的临界值\n\t */\n\tpublic int getTouchmodeMarginThreshold() {\n\t\treturn mViewBehind.getMarginThreshold();\n\t}\n\t\n\t/**\n\t * 当触摸的的模式为边缘触摸时，设置边缘触摸的临界值\n\t */\n\tpublic void setTouchmodeMarginThreshold(int touchmodeMarginThreshold) {\n\t\tmViewBehind.setMarginThreshold(touchmodeMarginThreshold);\n\t}\n\n\t/**\n\t * Sets the behind canvas transformer.\n\t *\n\t * @param t the new behind canvas transformer\n\t */\n\tpublic void setBehindCanvasTransformer(CanvasTransformer t) {\n\t\tmViewBehind.setCanvasTransformer(t);\n\t}\n\n\t/**\n\t * 得到上方视图的触摸模式的值\n\t */\n\tpublic int getTouchModeAbove() {\n\t\treturn mViewAbove.getTouchMode();\n\t}\n\n\n\t/**\n\t * 设置上方视图的触摸模式的值\n\t */\n\tpublic void setTouchModeAbove(int i) {\n\t\tif (i != TOUCHMODE_FULLSCREEN && i != TOUCHMODE_MARGIN\n\t\t\t\t&& i != TOUCHMODE_NONE) {\n\t\t\tthrow new IllegalStateException(\"TouchMode must be set to either\" +\n\t\t\t\t\t\"TOUCHMODE_FULLSCREEN or TOUCHMODE_MARGIN or TOUCHMODE_NONE.\");\n\t\t}\n\t\tmViewAbove.setTouchMode(i);\n\t}\n\n\t/**\n\t * 设置下方视图的触摸模式的值\n\t */\n\tpublic void setTouchModeBehind(int i) {\n\t\tif (i != TOUCHMODE_FULLSCREEN && i != TOUCHMODE_MARGIN\n\t\t\t\t&& i != TOUCHMODE_NONE) {\n\t\t\tthrow new IllegalStateException(\"TouchMode must be set to either\" +\n\t\t\t\t\t\"TOUCHMODE_FULLSCREEN or TOUCHMODE_MARGIN or TOUCHMODE_NONE.\");\n\t\t}\n\t\tmViewBehind.setTouchMode(i);\n\t}\n\n\t/**\n\t * 根据资源文件ID来设置滑动菜单的阴影效果\n\t *\n\t * @param resId the resource ID of the new shadow drawable\n\t */\n\tpublic void setShadowDrawable(int resId) {\n\t\tsetShadowDrawable(getContext().getResources().getDrawable(resId));\n\t}\n\n\t/**\n\t * 根据Drawable来设置滑动菜单的阴影效果\n\t *\n\t * @param d the new shadow drawable\n\t */\n\tpublic void setShadowDrawable(Drawable d) {\n\t\tmViewBehind.setShadowDrawable(d);\n\t}\n\n\t/**\n\t * 根据资源文件ID来设置右边滑动菜单的阴影效果\n\t *\n\t * @param resId the resource ID of the new shadow drawable\n\t */\n\tpublic void setSecondaryShadowDrawable(int resId) {\n\t\tsetSecondaryShadowDrawable(getContext().getResources().getDrawable(resId));\n\t}\n\n\t/**\n\t * 根据Drawable来设置滑动菜单的阴影效果\n\t *\n\t * @param d the new shadow drawable\n\t */\n\tpublic void setSecondaryShadowDrawable(Drawable d) {\n\t\tmViewBehind.setSecondaryShadowDrawable(d);\n\t}\n\n\t/**\n\t * 根据dimension资源文件的ID来设置阴影的宽度\n\t *\n\t * @param resId The dimension resource id to be set as the shadow width.\n\t */\n\tpublic void setShadowWidthRes(int resId) {\n\t\tsetShadowWidth((int)getResources().getDimension(resId));\n\t}\n\n\t/**\n\t * 根据像素的值来设置阴影的宽度\n\t *\n\t * @param pixels the new shadow width, in pixels\n\t */\n\tpublic void setShadowWidth(int pixels) {\n\t\tmViewBehind.setShadowWidth(pixels);\n\t}\n\n\t/**\n\t * 设置是否能够使用滑动菜单渐入渐出的效果\n\t **/\n\tpublic void setFadeEnabled(boolean b) {\n\t\tmViewBehind.setFadeEnabled(b);\n\t}\n\n\t/**\n\t * 设置渐入渐出效果的值\n\t *\n\t * @param f the new fade degree, between 0.0f and 1.0f\n\t */\n\tpublic void setFadeDegree(float f) {\n\t\tmViewBehind.setFadeDegree(f);\n\t}\n\n\t/**\n\t * Enables or disables whether the selector is drawn\n\t *\n\t * @param b true to draw the selector, false to not draw the selector\n\t */\n\tpublic void setSelectorEnabled(boolean b) {\n\t\tmViewBehind.setSelectorEnabled(true);\n\t}\n\n\t/**\n\t * Sets the selected view. The selector will be drawn here\n\t *\n\t * @param v the new selected view\n\t */\n\tpublic void setSelectedView(View v) {\n\t\tmViewBehind.setSelectedView(v);\n\t}\n\n\t/**\n\t * Sets the selector drawable.\n\t *\n\t * @param res a resource ID for the selector drawable\n\t */\n\tpublic void setSelectorDrawable(int res) {\n\t\tmViewBehind.setSelectorBitmap(BitmapFactory.decodeResource(getResources(), res));\n\t}\n\n\t/**\n\t * Sets the selector drawable.\n\t *\n\t * @param b the new selector bitmap\n\t */\n\tpublic void setSelectorBitmap(Bitmap b) {\n\t\tmViewBehind.setSelectorBitmap(b);\n\t}\n\n\t/**\n\t * 添加被忽略的视图\n\t */\n\tpublic void addIgnoredView(View v) {\n\t\tmViewAbove.addIgnoredView(v);\n\t}\n\n\t/**\n\t * 移除被忽略的视图\n\t */\n\tpublic void removeIgnoredView(View v) {\n\t\tmViewAbove.removeIgnoredView(v);\n\t}\n\n\t/**\n\t * 当模式为Fullscreen模式时，触摸屏幕清除所有被忽略的视图\n\t */\n\tpublic void clearIgnoredViews() {\n\t\tmViewAbove.clearIgnoredViews();\n\t}\n\n\t/**\n\t * 设置打开监听事件，当滑动菜单被打开时调用\n\t */\n\tpublic void setOnOpenListener(OnOpenListener listener) {\n\t\tmOpenListener = listener;\n\t}\n\n\t/**\n\t * 设置关闭监听事件，当滑动菜单被关闭时调用\n\t */\n\tpublic void setOnCloseListener(OnCloseListener listener) {\n\t\t//mViewAbove.setOnCloseListener(listener);\n\t\tmCloseListener = listener;\n\t}\n\n\t/**\n\t * 设置打开监听事件，当滑动菜单被打开过之后调用\n\t */\n\tpublic void setOnOpenedListener(OnOpenedListener listener) {\n\t\tmViewAbove.setOnOpenedListener(listener);\n\t}\n\n\t/**\n\t * 设置关闭监听事件，当滑动菜单被关闭过之后调用\n\t */\n\tpublic void setOnClosedListener(OnClosedListener listener) {\n\t\tmViewAbove.setOnClosedListener(listener);\n\t}\n\n\t/**\n\t * 功能描述：保存状态的类，继承自BaseSavedState\n\t */\n\tpublic static class SavedState extends BaseSavedState {\n\t\tprivate final int mItem;\n\n\t\tpublic SavedState(Parcelable superState, int item) {\n\t\t\tsuper(superState);\n\t\t\tmItem = item;\n\t\t}\n\n\t\tprivate SavedState(Parcel in) {\n\t\t\tsuper(in);\n\t\t\tmItem = in.readInt();\n\t\t}\n\n\t\tpublic int getItem() {\n\t\t\treturn mItem;\n\t\t}\n\n\t\t/* (non-Javadoc)\n\t\t * @see android.view.AbsSavedState#writeToParcel(android.os.Parcel, int)\n\t\t */\n\t\tpublic void writeToParcel(Parcel out, int flags) {\n\t\t\tsuper.writeToParcel(out, flags);\n\t\t\tout.writeInt(mItem);\n\t\t}\n\n\t\tpublic static final Parcelable.Creator<SavedState> CREATOR =\n\t\t\t\tnew Parcelable.Creator<SavedState>() {\n\t\t\tpublic SavedState createFromParcel(Parcel in) {\n\t\t\t\treturn new SavedState(in);\n\t\t\t}\n\n\t\t\tpublic SavedState[] newArray(int size) {\n\t\t\t\treturn new SavedState[size];\n\t\t\t}\n\t\t};\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.view.View#onSaveInstanceState()\n\t */\n\t@Override\n\tprotected Parcelable onSaveInstanceState() {\n\t\tParcelable superState = super.onSaveInstanceState();\n\t\tSavedState ss = new SavedState(superState, mViewAbove.getCurrentItem());\n\t\treturn ss;\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.view.View#onRestoreInstanceState(android.os.Parcelable)\n\t */\n\t@Override\n\tprotected void onRestoreInstanceState(Parcelable state) {\n\t\tSavedState ss = (SavedState)state;\n\t\tsuper.onRestoreInstanceState(ss.getSuperState());\n\t\tmViewAbove.setCurrentItem(ss.getItem());\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.view.ViewGroup#fitSystemWindows(android.graphics.Rect)\n\t */\n\t@SuppressLint(\"NewApi\")\n\t@Override\n\tprotected boolean fitSystemWindows(Rect insets) {\n\t\tint leftPadding = insets.left;\n\t\tint rightPadding = insets.right;\n\t\tint topPadding = insets.top;\n\t\tint bottomPadding = insets.bottom;\n\t\tif (!mActionbarOverlay) {\n\t\t\tLog.v(TAG, \"setting padding!\");\n\t\t\tsetPadding(leftPadding, topPadding, rightPadding, bottomPadding);\n\t\t}\n\t\treturn true;\n\t}\n\t\n\tprivate Handler mHandler = new Handler();\n\n\t@TargetApi(Build.VERSION_CODES.HONEYCOMB)\n\tpublic void manageLayers(float percentOpen) {\n\t\tif (Build.VERSION.SDK_INT < 11) return;\n\n\t\tboolean layer = percentOpen > 0.0f && percentOpen < 1.0f;\n\t\tfinal int layerType = layer ? View.LAYER_TYPE_HARDWARE : View.LAYER_TYPE_NONE;\n\n\t\tif (layerType != getContent().getLayerType()) {\n\t\t\tmHandler.post(new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tLog.v(TAG, \"changing layerType. hardware? \" + (layerType == View.LAYER_TYPE_HARDWARE));\n\t\t\t\t\tgetContent().setLayerType(layerType, null);\n\t\t\t\t\tgetMenu().setLayerType(layerType, null);\n\t\t\t\t\tif (getSecondaryMenu() != null) {\n\t\t\t\t\t\tgetSecondaryMenu().setLayerType(layerType, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n}"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingPreferenceActivity.java",
    "content": "package com.hankkin.compustrading.slidingmenu;\n\n\nimport android.os.Bundle;\nimport android.preference.PreferenceActivity;\nimport android.view.KeyEvent;\nimport android.view.View;\nimport android.view.ViewGroup.LayoutParams;\n\npublic class SlidingPreferenceActivity extends PreferenceActivity implements SlidingActivityBase {\n\n\tprivate SlidingActivityHelper mHelper;\n\n\t/* (non-Javadoc)\n\t * @see android.app.Activity#onCreate(android.os.Bundle)\n\t */\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tmHelper = new SlidingActivityHelper(this);\n\t\tsuper.onCreate(savedInstanceState);\n\t\tmHelper.onCreate(savedInstanceState);\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.app.Activity#onPostCreate(android.os.Bundle)\n\t */\n\t@Override\n\tpublic void onPostCreate(Bundle savedInstanceState) {\n\t\tsuper.onPostCreate(savedInstanceState);\n\t\tmHelper.onPostCreate(savedInstanceState);\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.app.Activity#findViewById(int)\n\t */\n\t@Override\n\tpublic View findViewById(int id) {\n\t\tView v = super.findViewById(id);\n\t\tif (v != null)\n\t\t\treturn v;\n\t\treturn mHelper.findViewById(id);\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.app.Activity#onSaveInstanceState(android.os.Bundle)\n\t */\n\t@Override\n\tprotected void onSaveInstanceState(Bundle outState) {\n\t\tsuper.onSaveInstanceState(outState);\n\t\tmHelper.onSaveInstanceState(outState);\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.app.Activity#setContentView(int)\n\t */\n\t@Override\n\tpublic void setContentView(int id) {\n\t\tsetContentView(getLayoutInflater().inflate(id, null));\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.app.Activity#setContentView(android.view.View)\n\t */\n\t@Override\n\tpublic void setContentView(View v) {\n\t\tsetContentView(v, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.app.Activity#setContentView(android.view.View, android.view.ViewGroup.LayoutParams)\n\t */\n\t@Override\n\tpublic void setContentView(View v, LayoutParams params) {\n\t\tsuper.setContentView(v, params);\n\t\tmHelper.registerAboveContentView(v, params);\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(int)\n\t */\n\tpublic void setBehindContentView(int id) {\n\t\tsetBehindContentView(getLayoutInflater().inflate(id, null));\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View)\n\t */\n\tpublic void setBehindContentView(View v) {\n\t\tsetBehindContentView(v, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setBehindContentView(android.view.View, android.view.ViewGroup.LayoutParams)\n\t */\n\tpublic void setBehindContentView(View v, LayoutParams params) {\n\t\tmHelper.setBehindContentView(v, params);\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#getSlidingMenu()\n\t */\n\tpublic SlidingMenu getSlidingMenu() {\n\t\treturn mHelper.getSlidingMenu();\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#toggle()\n\t */\n\tpublic void toggle() {\n\t\tmHelper.toggle();\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showAbove()\n\t */\n\tpublic void showContent() {\n\t\tmHelper.showContent();\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showBehind()\n\t */\n\tpublic void showMenu() {\n\t\tmHelper.showMenu();\n\t}\n\t\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#showSecondaryMenu()\n\t */\n\tpublic void showSecondaryMenu() {\n\t\tmHelper.showSecondaryMenu();\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jeremyfeinstein.slidingmenu.lib.app.SlidingActivityBase#setSlidingActionBarEnabled(boolean)\n\t */\n\tpublic void setSlidingActionBarEnabled(boolean b) {\n\t\tmHelper.setSlidingActionBarEnabled(b);\n\t}\n\n\t/* (non-Javadoc)\n\t * @see android.app.Activity#onKeyUp(int, android.view.KeyEvent)\n\t */\n\t@Override\n\tpublic boolean onKeyUp(int keyCode, KeyEvent event) {\n\t\tboolean b = mHelper.onKeyUp(keyCode, event);\n\t\tif (b) return b;\n\t\treturn super.onKeyUp(keyCode, event);\n\t}\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/CollapsingAvatarToolbar.java",
    "content": "package com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.content.res.TypedArray;\nimport android.support.annotation.NonNull;\nimport android.support.design.widget.AppBarLayout;\nimport android.support.v7.widget.Toolbar;\nimport android.util.AttributeSet;\nimport android.util.TypedValue;\nimport android.view.Gravity;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewParent;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.Utils.HankkinUtils;\n\npublic class CollapsingAvatarToolbar extends LinearLayout implements AppBarLayout.OnOffsetChangedListener {\n\n    private View avatarView;\n    private TextView titleView;\n\n    private float collapsedPadding;\n    private float expandedPadding;\n\n    private float expandedImageSize;\n    private float collapsedImageSize;\n\n    private float collapsedTextSize;\n    private float expandedTextSize;\n\n    private boolean valuesCalculatedAlready = false;\n    private Toolbar toolbar;\n    private AppBarLayout appBarLayout;\n    private float collapsedHeight;\n    private float expandedHeight;\n    private float maxOffset;\n    private int width;\n    private boolean isFirst = true;\n\n    private Context activity;\n    public CollapsingAvatarToolbar(Context context) {\n        this(context, null);\n        init();\n    }\n\n    public CollapsingAvatarToolbar(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        init();\n        this.activity = context;\n        width = HankkinUtils.getScreenWidth(context);\n\n        TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.CollapsingAvatarToolbar, 0, 0);\n\n        try {\n            collapsedPadding = a.getDimension(R.styleable.CollapsingAvatarToolbar_collapsedPadding, -1);\n            expandedPadding = a.getDimension(R.styleable.CollapsingAvatarToolbar_expandedPadding, -1);\n\n            collapsedImageSize = a.getDimension(R.styleable.CollapsingAvatarToolbar_collapsedImageSize, -1);\n            expandedImageSize = a.getDimension(R.styleable.CollapsingAvatarToolbar_expandedImageSize, -1);\n\n            collapsedTextSize = a.getDimension(R.styleable.CollapsingAvatarToolbar_collapsedTextSize, -1);\n            expandedTextSize = a.getDimension(R.styleable.CollapsingAvatarToolbar_expandedTextSize, -1);\n        } finally {\n            a.recycle();\n        }\n\n        final Resources resources = getResources();\n        if (collapsedPadding < 0) {\n            collapsedPadding = resources.getDimension(R.dimen.default_collapsed_padding);\n        }\n        if (expandedPadding < 0) {\n            expandedPadding = resources.getDimension(R.dimen.default_expanded_padding);\n        }\n        if (collapsedImageSize < 0) {\n            collapsedImageSize = resources.getDimension(R.dimen.default_collapsed_image_size);\n        }\n        if (expandedImageSize < 0) {\n            expandedImageSize = resources.getDimension(R.dimen.default_expanded_image_size);\n        }\n        if (collapsedTextSize < 0) {\n            collapsedTextSize = resources.getDimension(R.dimen.default_collapsed_text_size);\n        }\n        if (expandedTextSize < 0) {\n            expandedTextSize = resources.getDimension(R.dimen.default_expanded_text_size);\n        }\n    }\n\n    private void init() {\n        setOrientation(HORIZONTAL);\n        setGravity(Gravity.CENTER_HORIZONTAL);\n    }\n\n    @NonNull\n    private AppBarLayout findParentAppBarLayout() {\n        ViewParent parent = this.getParent();\n        if (parent instanceof AppBarLayout) {\n            return ((AppBarLayout) parent);\n        } else if (parent.getParent() instanceof AppBarLayout) {\n            return ((AppBarLayout) parent.getParent());\n        } else {\n            throw new IllegalStateException(\"Must be inside an AppBarLayout\"); //TODO actually, a collapsingtoolbar\n        }\n    }\n\n    protected void onAttachedToWindow() {\n        super.onAttachedToWindow();\n        findViews();\n        if (!isInEditMode()) {\n            appBarLayout.addOnOffsetChangedListener(this);\n        } else {\n            setExpandedValuesForEditMode();\n        }\n    }\n\n    private void setExpandedValuesForEditMode() {\n        calculateValues();\n        updateViews(1f, 0);\n    }\n\n    private void findViews() {\n        appBarLayout = findParentAppBarLayout();\n        toolbar = findSiblingToolbar();\n        avatarView = findAvatar();\n        titleView = findTitle();\n    }\n\n    @NonNull\n    private View findAvatar() {\n        View avatar = this.findViewById(R.id.usericon);\n        if (avatar == null) {\n            throw new IllegalStateException(\"View with id ta_avatar not found\");\n        }\n        return avatar;\n    }\n\n    @NonNull\n    private TextView findTitle() {\n        TextView title = (TextView) this.findViewById(R.id.username);\n        if (title == null) {\n            throw new IllegalStateException(\"TextView with id ta_title not found\");\n        }\n        return title;\n    }\n\n    @NonNull\n    private Toolbar findSiblingToolbar() {\n        ViewGroup parent = ((ViewGroup) this.getParent());\n        for (int i = 0, c = parent.getChildCount(); i < c; i++) {\n            View child = parent.getChildAt(i);\n            if (child instanceof Toolbar) {\n                return (Toolbar) child;\n            }\n        }\n        throw new IllegalStateException(\"No toolbar found as sibling\");\n    }\n\n    @Override\n    public void onOffsetChanged(AppBarLayout appBarLayout, int offset) {\n        if (!valuesCalculatedAlready) {\n            calculateValues();\n            valuesCalculatedAlready = true;\n        }\n        float expandedPercentage = 1 - (-offset / maxOffset);\n        updateViews(expandedPercentage, offset);\n    }\n\n    private void calculateValues() {\n        collapsedHeight = toolbar.getHeight();\n        expandedHeight = appBarLayout.getHeight() - toolbar.getHeight();\n        maxOffset = expandedHeight;\n    }\n\n    private void updateViews(float expandedPercentage, int currentOffset) {\n        float inversePercentage = 1 - expandedPercentage;\n        float translation = -currentOffset + ((float) toolbar.getHeight() * expandedPercentage);\n\n        float currHeight = collapsedHeight + (expandedHeight - collapsedHeight) * expandedPercentage;\n        float currentPadding = expandedPadding - (collapsedPadding - expandedPadding) * inversePercentage;\n        float currentImageSize = collapsedImageSize + (expandedImageSize - collapsedImageSize) * expandedPercentage;\n        float currentTextSize = collapsedTextSize + (expandedTextSize - collapsedTextSize) * expandedPercentage;\n\n        setContainerOffset(translation);\n        setContainerHeight((int) currHeight);\n        setPadding((int) currentPadding);\n        setAvatarSize((int) currentImageSize);\n        setTextSize(currentTextSize);\n\n    }\n\n    private void setContainerOffset(float translation) {\n        this.setTranslationY(translation);\n    }\n\n    private void setContainerHeight(int currHeight) {\n        this.getLayoutParams().height = currHeight;\n    }\n\n    private void setPadding(int currentPadding) {\n        this.setPadding(currentPadding+width/3, 0, 0, 0);\n    }\n\n    private void setTextSize(float currentTextSize) {\n        titleView.setTextSize(TypedValue.COMPLEX_UNIT_PX, currentTextSize);\n    }\n\n    public void setText(String text) {\n        titleView.setText(text);\n    }\n\n    private void setAvatarSize(int currentImageSize) {\n        avatarView.getLayoutParams().height = currentImageSize;\n        avatarView.getLayoutParams().width = currentImageSize;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/PagerSlidingTabStrip.java",
    "content": "package com.hankkin.compustrading.view;\n\n\nimport java.util.Locale;\n\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.Paint.Style;\nimport android.graphics.Typeface;\nimport android.os.Build;\nimport android.os.Parcel;\nimport android.os.Parcelable;\nimport android.support.v4.view.ViewPager;\nimport android.support.v4.view.ViewPager.OnPageChangeListener;\nimport android.util.AttributeSet;\nimport android.util.DisplayMetrics;\nimport android.util.TypedValue;\nimport android.view.Gravity;\nimport android.view.View;\nimport android.view.ViewTreeObserver.OnGlobalLayoutListener;\nimport android.widget.HorizontalScrollView;\nimport android.widget.ImageButton;\nimport android.widget.LinearLayout;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\n\n\npublic class PagerSlidingTabStrip extends HorizontalScrollView {\n\n\tpublic interface IconTabProvider {\n\t\tpublic int getPageIconResId(int position);\n\t}\n\n\t// @formatter:off\n\tprivate static final int[] ATTRS = new int[] {\n\t\t\tandroid.R.attr.textSize,\n\t\t\tandroid.R.attr.textColor\n\t};\n\t// @formatter:on\n\tprivate LinearLayout.LayoutParams defaultTabLayoutParams;\n\tprivate LinearLayout.LayoutParams expandedTabLayoutParams;\n\n\tprivate final PageListener pageListener = new PageListener();\n\tpublic OnPageChangeListener delegatePageListener;\n\n\tprivate LinearLayout tabsContainer;\n\tprivate ViewPager pager;\n\n\tprivate int tabCount;\n\n\tprivate int currentPosition = 0;\n\tprivate int selectedPosition = 0;\n\tprivate float currentPositionOffset = 0f;\n\n\tprivate Paint rectPaint;\n\tprivate Paint dividerPaint;\n\tprivate int indicatorColor = 0xFF666666;//\t滑动指示器颜色\n\tprivate int underlineColor = 0x1A000000;//在视图的底部的全宽度的线pstsunderlinecolor颜色\n\tprivate int dividerColor = 0x1A000000;//选项卡之间的分隔pstsdividercolor颜色\n\n\tprivate boolean shouldExpand = false;//pstsshouldexpand如果设置为TRUE，每个标签都给予同样的重量，默认为false\n\tprivate boolean textAllCaps = true;//pststextallcaps如果为真，所有选项卡标题都是大写，默认为true\n\n\tprivate int scrollOffset = 52;//pstsscrolloffset卷轴被选择的标签的偏移\n\tprivate int indicatorHeight = 8;//滑动指示器pstsindicatorheight\n\tprivate int underlineHeight = 2;//在视图的底部的全宽度的线pstsunderlineheight高度\n\tprivate int dividerPadding = 12;//pstsdividerpadding顶部和底部填充的分频器\n\tprivate int tabPadding = 24;//pststabpaddingleftright左、右填充每个选项卡\n\tprivate int dividerWidth = 1;//选项卡分割线宽度\n\n\tprivate int tabTextSize = 15;//选项卡字体大小\n\tprivate int tabTextColor = 0xFF666666;//选项卡字体颜色\n\tprivate int selectedTabTextColor = 0xFF666666;//当前选中字体颜色\n\tprivate Typeface tabTypeface = null;\n\tprivate int tabTypefaceStyle = Typeface.NORMAL;\n\n\tprivate int lastScrollX = 0;\n\n\tprivate int tabBackgroundResId = R.drawable.btn_login_background;//pststabbackground背景绘制的每个标签，应该是一个statelistdrawable\n\n\tprivate Locale locale;\n\n\tpublic PagerSlidingTabStrip(Context context) {\n\t\tthis(context, null);\n\t}\n\n\tpublic PagerSlidingTabStrip(Context context, AttributeSet attrs) {\n\t\tthis(context, attrs, 0);\n\t}\n\n\tpublic PagerSlidingTabStrip(Context context, AttributeSet attrs, int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\n\t\tsetFillViewport(true);//默认使子view可以拉伸来填满整个屏幕\n\t\tsetWillNotDraw(false);//默认不执行OnDraw()方法\n\t\t//初始化盛放按钮标题的线性布局\n\t\ttabsContainer = new LinearLayout(context);\n\t\ttabsContainer.setOrientation(LinearLayout.HORIZONTAL);\n\t\ttabsContainer.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));\n\t\taddView(tabsContainer);\n\n\t\tDisplayMetrics dm = getResources().getDisplayMetrics();\n\t\t//导入相应资源文件\n\t\tscrollOffset = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, scrollOffset, dm);\n\t\tindicatorHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, indicatorHeight, dm);\n\t\tunderlineHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, underlineHeight, dm);\n\t\tdividerPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dividerPadding, dm);\n\t\ttabPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, tabPadding, dm);\n\t\tdividerWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dividerWidth, dm);\n\t\ttabTextSize = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, tabTextSize, dm);\n\n\t\t// get system attrs (android:textSize and android:textColor)\n\n\t\tTypedArray a = context.obtainStyledAttributes(attrs, ATTRS);\n\n\t\ttabTextSize = a.getDimensionPixelSize(0, tabTextSize);\n\t\ttabTextColor = a.getColor(1, tabTextColor);\n\n\t\ta.recycle();\n\n\t\t// get custom attrs\n\n\t\ta = context.obtainStyledAttributes(attrs, R.styleable.PagerSlidingTabStrip);\n\n\t\tindicatorColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsIndicatorColor, indicatorColor);\n\n\t\t//tab文字选中时的颜色,默认和滑动指示器的颜色一致 \n\t\tselectedTabTextColor=a.getColor(R.styleable.PagerSlidingTabStrip_selectedTabTextColor, indicatorColor);\n\t\t//初始化属性样式\n\t\tunderlineColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsUnderlineColor, underlineColor);\n\t\tdividerColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsDividerColor, dividerColor);\n\t\tindicatorHeight = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsIndicatorHeight, indicatorHeight);\n\t\tunderlineHeight = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsUnderlineHeight, underlineHeight);\n\t\tdividerPadding = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsDividerPadding, dividerPadding);\n\t\ttabPadding = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsTabPaddingLeftRight, tabPadding);\n\t\ttabBackgroundResId = a.getResourceId(R.styleable.PagerSlidingTabStrip_pstsTabBackground, tabBackgroundResId);\n\t\tshouldExpand = a.getBoolean(R.styleable.PagerSlidingTabStrip_pstsShouldExpand, shouldExpand);\n\t\tscrollOffset = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsScrollOffset, scrollOffset);\n\t\ttextAllCaps = a.getBoolean(R.styleable.PagerSlidingTabStrip_pstsTextAllCaps, textAllCaps);\n\n\t\ta.recycle();\n\n\t\trectPaint = new Paint();\n\t\trectPaint.setAntiAlias(true);\n\t\trectPaint.setStyle(Style.FILL);\n\n\t\tdividerPaint = new Paint();\n\t\tdividerPaint.setAntiAlias(true);\n\t\tdividerPaint.setStrokeWidth(dividerWidth);\n\n\t\tdefaultTabLayoutParams = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);\n\t\texpandedTabLayoutParams = new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1.0f);\n\n\t\tif (locale == null) {\n\t\t\tlocale = getResources().getConfiguration().locale;\n\t\t}\n\t}\n\n\tpublic void setViewPager(ViewPager pager) {\n\t\tthis.pager = pager;\n\n\t\tif (pager.getAdapter() == null) {\n\t\t\tthrow new IllegalStateException(\"ViewPager does not have adapter instance.\");\n\t\t}\n\n\t\tpager.setOnPageChangeListener(pageListener);\n\n\t\tnotifyDataSetChanged();\n\t}\n\n\tpublic void setOnPageChangeListener(OnPageChangeListener listener) {\n\t\tthis.delegatePageListener = listener;\n\t}\n\n\tpublic void notifyDataSetChanged() {\n\n\t\ttabsContainer.removeAllViews();\n\n\t\ttabCount = pager.getAdapter().getCount();\n\n\t\tfor (int i = 0; i < tabCount; i++) {\n\n\t\t\tif (pager.getAdapter() instanceof IconTabProvider) {\n\t\t\t\taddIconTab(i, ((IconTabProvider) pager.getAdapter()).getPageIconResId(i));\n\t\t\t} else {\n\t\t\t\taddTextTab(i, pager.getAdapter().getPageTitle(i).toString());\n\t\t\t}\n\n\t\t}\n\n\t\tupdateTabStyles();\n\n\t\tgetViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onGlobalLayout() {\n\t\t\t\tgetViewTreeObserver().removeGlobalOnLayoutListener(this);\n\t\t\t\tcurrentPosition = pager.getCurrentItem();\n\t\t\t\tscrollToChild(currentPosition, 0);\n\t\t\t}\n\t\t});\n\n\t}\n\n\tprivate void addTextTab(final int position, String title) {\n\n\t\tTextView tab = new TextView(getContext());\n\t\ttab.setText(title);\n\t\ttab.setGravity(Gravity.CENTER);\n\t\ttab.setSingleLine();\n\t\taddTab(position, tab);\n\t}\n\n\tprivate void addIconTab(final int position, int resId) {\n\n\t\tImageButton tab = new ImageButton(getContext());\n\t\ttab.setImageResource(resId);\n\n\t\taddTab(position, tab);\n\n\t}\n\n\tprivate void addTab(final int position, View tab) {\n\t\ttab.setFocusable(true);\n\t\ttab.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tpager.setCurrentItem(position);\n\t\t\t}\n\t\t});\n\n\t\ttab.setPadding(tabPadding, 0, tabPadding, 0);\n\t\ttabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);\n\t}\n\n\tprivate void updateTabStyles() {\n\n\t\tfor (int i = 0; i < tabCount; i++) {\n\n\t\t\tView v = tabsContainer.getChildAt(i);\n\n\t\t\tv.setBackgroundResource(tabBackgroundResId);\n\n\t\t\tif (v instanceof TextView) {\n\n\t\t\t\tTextView tab = (TextView) v;\n\t\t\t\ttab.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize);\n\t\t\t\ttab.setTypeface(tabTypeface, tabTypefaceStyle);\n\t\t\t\ttab.setTextColor(tabTextColor);\n\n\t\t\t\t// setAllCaps() is only available from API 14, so the upper case is made manually if we are on a\n\t\t\t\t// pre-ICS-build\n\t\t\t\tif (textAllCaps) {\n\t\t\t\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {\n\t\t\t\t\t\ttab.setAllCaps(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttab.setText(tab.getText().toString().toUpperCase(locale));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (i == selectedPosition) {\n\t\t\t\t\ttab.setTextColor(selectedTabTextColor);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tprivate void scrollToChild(int position, int offset) {\n\n\t\tif (tabCount == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tint newScrollX = tabsContainer.getChildAt(position).getLeft() + offset;\n\n\t\tif (position > 0 || offset > 0) {\n\t\t\tnewScrollX -= scrollOffset;\n\t\t}\n\n\t\tif (newScrollX != lastScrollX) {\n\t\t\tlastScrollX = newScrollX;\n\t\t\tscrollTo(newScrollX, 0);\n\t\t}\n\n\t}\n\n\t@Override\n\tprotected void onDraw(Canvas canvas) {\n\t\tsuper.onDraw(canvas);\n\n\t\tif (isInEditMode() || tabCount == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tfinal int height = getHeight();\n\n\t\t// draw underline\n\t\trectPaint.setColor(underlineColor);\n\t\tcanvas.drawRect(0, height - underlineHeight, tabsContainer.getWidth(), height, rectPaint);\n\n\t\t// draw indicator line\n\t\trectPaint.setColor(indicatorColor);\n\n\t\t// default: line below current tab\n\t\tView currentTab = tabsContainer.getChildAt(currentPosition);\n\t\tfloat lineLeft = currentTab.getLeft();\n\t\tfloat lineRight = currentTab.getRight();\n\n\t\t// if there is an offset, start interpolating left and right coordinates between current and next tab\n\t\tif (currentPositionOffset > 0f && currentPosition < tabCount - 1) {\n\n\t\t\tView nextTab = tabsContainer.getChildAt(currentPosition + 1);\n\t\t\tfinal float nextTabLeft = nextTab.getLeft();\n\t\t\tfinal float nextTabRight = nextTab.getRight();\n\n\t\t\tlineLeft = (currentPositionOffset * nextTabLeft + (1f - currentPositionOffset) * lineLeft);\n\t\t\tlineRight = (currentPositionOffset * nextTabRight + (1f - currentPositionOffset) * lineRight);\n\t\t}\n\n\t\tcanvas.drawRect(lineLeft, height - indicatorHeight, lineRight, height, rectPaint);\n\n\t\t// draw divider\n\n\t\tdividerPaint.setColor(dividerColor);\n\t\tfor (int i = 0; i < tabCount - 1; i++) {\n\t\t\tView tab = tabsContainer.getChildAt(i);\n\t\t\tcanvas.drawLine(tab.getRight(), dividerPadding, tab.getRight(), height - dividerPadding, dividerPaint);\n\t\t}\n\t}\n\n\tprivate class PageListener implements OnPageChangeListener {\n\n\t\t@Override\n\t\tpublic void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\t\t\tcurrentPosition = position;\n\t\t\tcurrentPositionOffset = positionOffset;\n\n\t\t\tscrollToChild(position, (int) (positionOffset * tabsContainer.getChildAt(position).getWidth()));\n\n\t\t\tinvalidate();\n\n\t\t\tif (delegatePageListener != null) {\n\t\t\t\tdelegatePageListener.onPageScrolled(position, positionOffset, positionOffsetPixels);\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onPageScrollStateChanged(int state) {\n\t\t\tif (state == ViewPager.SCROLL_STATE_IDLE) {\n\t\t\t\tscrollToChild(pager.getCurrentItem(), 0);\n\t\t\t}\n\n\t\t\tif (delegatePageListener != null) {\n\t\t\t\tdelegatePageListener.onPageScrollStateChanged(state);\n\t\t\t}\n\t\t}\n\n\t\t@Override\n\t\tpublic void onPageSelected(int position) {\n\t\t\tselectedPosition = position;\n\t\t\tupdateTabStyles();\n\t\t\tif (delegatePageListener != null) {\n\t\t\t\tdelegatePageListener.onPageSelected(position);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tpublic void setIndicatorColor(int indicatorColor) {\n\t\tthis.indicatorColor = indicatorColor;\n\n\t\tinvalidate();\n\t}\n\n\tpublic void setIndicatorColorResource(int resId) {\n\t\tthis.indicatorColor = getResources().getColor(resId);\n\n\t\tinvalidate();\n\t}\n\n\tpublic int getIndicatorColor() {\n\t\treturn this.indicatorColor;\n\t}\n\n\tpublic void setIndicatorHeight(int indicatorLineHeightPx) {\n\t\tthis.indicatorHeight = indicatorLineHeightPx;\n\t\tinvalidate();\n\t}\n\n\tpublic int getIndicatorHeight() {\n\t\treturn indicatorHeight;\n\t}\n\n\tpublic void setUnderlineColor(int underlineColor) {\n\t\tthis.underlineColor = underlineColor;\n\t\tinvalidate();\n\t}\n\n\tpublic void setUnderlineColorResource(int resId) {\n\t\tthis.underlineColor = getResources().getColor(resId);\n\t\tinvalidate();\n\t}\n\n\tpublic int getUnderlineColor() {\n\t\treturn underlineColor;\n\t}\n\n\tpublic void setDividerColor(int dividerColor) {\n\t\tthis.dividerColor = dividerColor;\n\t\tinvalidate();\n\t}\n\n\tpublic void setDividerColorResource(int resId) {\n\t\tthis.dividerColor = getResources().getColor(resId);\n\t\tinvalidate();\n\t}\n\n\tpublic int getDividerColor() {\n\t\treturn dividerColor;\n\t}\n\n\tpublic void setUnderlineHeight(int underlineHeightPx) {\n\t\tthis.underlineHeight = underlineHeightPx;\n\t\tinvalidate();\n\t}\n\n\tpublic int getUnderlineHeight() {\n\t\treturn underlineHeight;\n\t}\n\n\tpublic void setDividerPadding(int dividerPaddingPx) {\n\t\tthis.dividerPadding = dividerPaddingPx;\n\t\tinvalidate();\n\t}\n\n\tpublic int getDividerPadding() {\n\t\treturn dividerPadding;\n\t}\n\n\tpublic void setScrollOffset(int scrollOffsetPx) {\n\t\tthis.scrollOffset = scrollOffsetPx;\n\t\tinvalidate();\n\t}\n\n\tpublic int getScrollOffset() {\n\t\treturn scrollOffset;\n\t}\n\n\tpublic void setShouldExpand(boolean shouldExpand) {\n\t\tthis.shouldExpand = shouldExpand;\n\t\tnotifyDataSetChanged();\n\t}\n\n\tpublic boolean getShouldExpand() {\n\t\treturn shouldExpand;\n\t}\n\n\tpublic boolean isTextAllCaps() {\n\t\treturn textAllCaps;\n\t}\n\n\tpublic void setAllCaps(boolean textAllCaps) {\n\t\tthis.textAllCaps = textAllCaps;\n\t}\n\n\tpublic void setTextSize(int textSizePx) {\n\t\tthis.tabTextSize = textSizePx;\n\t\tupdateTabStyles();\n\t}\n\n\tpublic int getTextSize() {\n\t\treturn tabTextSize;\n\t}\n\n\tpublic void setTextColor(int textColor) {\n\t\tthis.tabTextColor = textColor;\n\t\tupdateTabStyles();\n\t}\n\n\tpublic void setTextColorResource(int resId) {\n\t\tthis.tabTextColor = getResources().getColor(resId);\n\t\tupdateTabStyles();\n\t}\n\n\tpublic int getTextColor() {\n\t\treturn tabTextColor;\n\t}\n\n\tpublic void setSelectedTextColor(int textColor) {\n\t\tthis.selectedTabTextColor = textColor;\n\t\tupdateTabStyles();\n\t}\n\n\tpublic void setSelectedTextColorResource(int resId) {\n\t\tthis.selectedTabTextColor = getResources().getColor(resId);\n\t\tupdateTabStyles();\n\t}\n\n\tpublic int getSelectedTextColor() {\n\t\treturn selectedTabTextColor;\n\t}\n\n\tpublic void setTypeface(Typeface typeface, int style) {\n\t\tthis.tabTypeface = typeface;\n\t\tthis.tabTypefaceStyle = style;\n\t\tupdateTabStyles();\n\t}\n\n\tpublic void setTabBackground(int resId) {\n\t\tthis.tabBackgroundResId = resId;\n\t\tupdateTabStyles();\n\t}\n\n\tpublic int getTabBackground() {\n\t\treturn tabBackgroundResId;\n\t}\n\n\tpublic void setTabPaddingLeftRight(int paddingPx) {\n\t\tthis.tabPadding = paddingPx;\n\t\tupdateTabStyles();\n\t}\n\n\tpublic int getTabPaddingLeftRight() {\n\t\treturn tabPadding;\n\t}\n\n\t@Override\n\tpublic void onRestoreInstanceState(Parcelable state) {\n\t\tSavedState savedState = (SavedState) state;\n\t\tsuper.onRestoreInstanceState(savedState.getSuperState());\n\t\tcurrentPosition = savedState.currentPosition;\n\t\trequestLayout();\n\t}\n\n\t@Override\n\tpublic Parcelable onSaveInstanceState() {\n\t\tParcelable superState = super.onSaveInstanceState();\n\t\tSavedState savedState = new SavedState(superState);\n\t\tsavedState.currentPosition = currentPosition;\n\t\treturn savedState;\n\t}\n\n\tstatic class SavedState extends BaseSavedState {\n\t\tint currentPosition;\n\n\t\tpublic SavedState(Parcelable superState) {\n\t\t\tsuper(superState);\n\t\t}\n\n\t\tprivate SavedState(Parcel in) {\n\t\t\tsuper(in);\n\t\t\tcurrentPosition = in.readInt();\n\t\t}\n\n\t\t@Override\n\t\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\t\tsuper.writeToParcel(dest, flags);\n\t\t\tdest.writeInt(currentPosition);\n\t\t}\n\n\t\tpublic static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() {\n\t\t\t@Override\n\t\t\tpublic SavedState createFromParcel(Parcel in) {\n\t\t\t\treturn new SavedState(in);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic SavedState[] newArray(int size) {\n\t\t\t\treturn new SavedState[size];\n\t\t\t}\n\t\t};\n\t}\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/RippleView.java",
    "content": "package com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.*;\nimport android.os.Handler;\nimport android.util.AttributeSet;\nimport android.view.GestureDetector;\nimport android.view.MotionEvent;\nimport android.view.animation.Animation;\nimport android.view.animation.ScaleAnimation;\nimport android.widget.AdapterView;\nimport android.widget.RelativeLayout;\n\nimport com.hankkin.compustrading.R;\n\n/**\n * Created by Hankkin on 15/9/13.\n */\npublic class RippleView extends RelativeLayout {\n\n    private int WIDTH;\n    private int HEIGHT;\n    private int frameRate = 10;\n    private int rippleDuration = 400;\n    private int rippleAlpha = 90;\n    private Handler canvasHandler;\n    private float radiusMax = 0;\n    private boolean animationRunning = false;\n    private int timer = 0;\n    private int timerEmpty = 0;\n    private int durationEmpty = -1;\n    private float x = -1;\n    private float y = -1;\n    private int zoomDuration;\n    private float zoomScale;\n    private ScaleAnimation scaleAnimation;\n    private Boolean hasToZoom;\n    private Boolean isCentered;\n    private Integer rippleType;\n    private Paint paint;\n    private Bitmap originBitmap;\n    private int rippleColor;\n    private int ripplePadding;\n    private GestureDetector gestureDetector;\n    private final Runnable runnable = new Runnable() {\n        @Override\n        public void run() {\n            invalidate();\n        }\n    };\n\n    private OnRippleCompleteListener onCompletionListener;\n\n    public RippleView(Context context) {\n        super(context);\n    }\n\n    public RippleView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        init(context, attrs);\n    }\n\n    public RippleView(Context context, AttributeSet attrs, int defStyle) {\n        super(context, attrs, defStyle);\n        init(context, attrs);\n    }\n\n    /**\n     * Method that initializes all fields and sets listeners\n     * 初始化组件并设置监听事件\n     * @param context Context used to create this view\n     * @param attrs Attribute used to initialize fields\n     */\n    private void init(final Context context, final AttributeSet attrs) {\n        if (isInEditMode())\n            return;\n\n        final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RippleView);\n        rippleColor = typedArray.getColor(R.styleable.RippleView_rv_color, getResources().getColor(R.color.ripple));\n        rippleType = typedArray.getInt(R.styleable.RippleView_rv_type, 0);\n        hasToZoom = typedArray.getBoolean(R.styleable.RippleView_rv_zoom, false);\n        isCentered = typedArray.getBoolean(R.styleable.RippleView_rv_centered, false);\n        rippleDuration = typedArray.getInteger(R.styleable.RippleView_rv_rippleDuration, rippleDuration);\n        frameRate = typedArray.getInteger(R.styleable.RippleView_rv_framerate, frameRate);\n        rippleAlpha = typedArray.getInteger(R.styleable.RippleView_rv_alpha, rippleAlpha);\n        ripplePadding = typedArray.getDimensionPixelSize(R.styleable.RippleView_rv_ripplePadding, 0);\n        canvasHandler = new Handler();\n        zoomScale = typedArray.getFloat(R.styleable.RippleView_rv_zoomScale, 1.03f);\n        zoomDuration = typedArray.getInt(R.styleable.RippleView_rv_zoomDuration, 200);\n        typedArray.recycle();\n        paint = new Paint();\n        paint.setAntiAlias(true);   //设置画布抗锯齿标志\n        paint.setStyle(Paint.Style.FILL);   //设置画图实心\n        paint.setColor(rippleColor);    //设置画图颜色\n        paint.setAlpha(rippleAlpha);    //设置透明度\n        this.setWillNotDraw(false);     //设置将不绘画\n\n        /**\n         * 创建新的手势\n         */\n        gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {\n            @Override\n            public void onLongPress(MotionEvent event) {\n                super.onLongPress(event);\n                animateRipple(event);   //创建动画\n                sendClickEvent(true);   //发送长点击事件\n            }\n\n            @Override\n            public boolean onSingleTapConfirmed(MotionEvent e) {\n                return true;\n            }\n\n            @Override\n            public boolean onSingleTapUp(MotionEvent e) {\n                return true;\n            }\n        });\n\n        this.setDrawingCacheEnabled(true);  //更新cache，提高绘图速度\n        this.setClickable(true);\n    }\n\n    @Override\n    public void draw(Canvas canvas) {\n        super.draw(canvas);\n        if (animationRunning) {\n            if (rippleDuration <= timer * frameRate) {\n                animationRunning = false;\n                timer = 0;\n                durationEmpty = -1;\n                timerEmpty = 0;\n                canvas.save();\n                canvas.restore();\n                invalidate();\n                if (onCompletionListener != null) onCompletionListener.onComplete(this);\n                return;\n            } else\n                canvasHandler.postDelayed(runnable, frameRate);\n\n            if (timer == 0)\n                canvas.save();\n\n\n            canvas.drawCircle(x, y, (radiusMax * (((float) timer * frameRate) / rippleDuration)), paint);   //画圆的半径\n\n            paint.setColor(Color.parseColor(\"#ffff4444\"));  //设置颜色\n\n            if (rippleType == 1 && originBitmap != null && (((float) timer * frameRate) / rippleDuration) > 0.4f) {\n                if (durationEmpty == -1)\n                    durationEmpty = rippleDuration - timer * frameRate;\n\n                timerEmpty++;\n                //创建圆的bitmap\n                final Bitmap tmpBitmap = getCircleBitmap((int) ((radiusMax) * (((float) timerEmpty * frameRate) / (durationEmpty))));\n                canvas.drawBitmap(tmpBitmap, 0, 0, paint);\n                tmpBitmap.recycle();\n            }\n\n            paint.setColor(rippleColor);\n\n            if (rippleType == 1) {\n                if ((((float) timer * frameRate) / rippleDuration) > 2f)\n                    paint.setAlpha((int) (rippleAlpha - ((rippleAlpha) * (((float) timerEmpty * frameRate) / (durationEmpty)))));\n                else\n                    paint.setAlpha(rippleAlpha);\n            }\n            else\n                paint.setAlpha((int) (rippleAlpha - ((rippleAlpha) * (((float) timer * frameRate) / rippleDuration))));\n\n            timer++;\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        WIDTH = w;\n        HEIGHT = h;\n\n        scaleAnimation = new ScaleAnimation(2.0f, zoomScale, 2.0f, zoomScale, w / 2, h / 2);\n        scaleAnimation.setDuration(zoomDuration);\n        scaleAnimation.setRepeatMode(Animation.REVERSE);\n        scaleAnimation.setRepeatCount(1);\n    }\n\n    /**\n     * Launch Ripple animation for the current view with a MotionEvent\n     * 推出波纹动画与位移事件的当前视图\n     * @param event MotionEvent registered by the Ripple gesture listener\n     */\n    public void animateRipple(MotionEvent event) {\n        createAnimation(event.getX(), event.getY());\n    }\n\n    /**\n     * Launch Ripple animation for the current view centered at x and y position\n     * 以x,y为坐标启动动画\n     * @param x Horizontal position of the ripple center\n     * @param y Vertical position of the ripple center\n     */\n    public void animateRipple(final float x, final float y) {\n        createAnimation(x, y);\n    }\n\n    /**\n     * Create Ripple animation centered at x, y\n     *\n     * @param x Horizontal position of the ripple center\n     * @param y Vertical position of the ripple center\n     */\n    private void createAnimation(final float x, final float y) {\n        if (this.isEnabled() && !animationRunning) {\n            if (hasToZoom)\n                this.startAnimation(scaleAnimation);\n\n            radiusMax = Math.max(WIDTH, HEIGHT);\n\n            if (rippleType != 2)\n                radiusMax /= 1;\n\n            radiusMax -= ripplePadding;\n\n            if (isCentered || rippleType == 1) {\n                this.x = getMeasuredWidth() ;\n                this.y = getMeasuredHeight() ;\n            } else {\n                this.x = x;\n                this.y = y;\n            }\n\n            animationRunning = true;\n\n            if (rippleType == 1 && originBitmap == null)\n                originBitmap = getDrawingCache(true);\n\n            invalidate();\n        }\n    }\n\n    @Override\n    public boolean onTouchEvent(MotionEvent event) {\n        if (gestureDetector.onTouchEvent(event)) {\n            animateRipple(event);\n            sendClickEvent(false);\n        }\n        return super.onTouchEvent(event);\n    }\n\n    @Override\n    public boolean onInterceptTouchEvent(MotionEvent event) {\n        this.onTouchEvent(event);\n        return super.onInterceptTouchEvent(event);\n    }\n\n    /**\n     * Send a click event if parent view is a Listview instance\n     * 若为Listview发送点击事件\n     * @param isLongClick Is the event a long click ?\n     */\n    private void sendClickEvent(final Boolean isLongClick) {\n        if (getParent() instanceof AdapterView) {\n            final AdapterView adapterView = (AdapterView) getParent();\n            final int position = adapterView.getPositionForView(this);\n            final long id = adapterView.getItemIdAtPosition(position);\n            if (isLongClick) {\n                if (adapterView.getOnItemLongClickListener() != null)\n                    adapterView.getOnItemLongClickListener().onItemLongClick(adapterView, this, position, id);\n            } else {\n                if (adapterView.getOnItemClickListener() != null)\n                    adapterView.getOnItemClickListener().onItemClick(adapterView, this, position, id);\n            }\n        }\n    }\n\n    /**\n     * 获取波纹圆形图片\n     * @param radius\n     * @return\n     */\n    private Bitmap getCircleBitmap(final int radius) {\n        final Bitmap output = Bitmap.createBitmap(originBitmap.getWidth(), originBitmap.getHeight(), Bitmap.Config.ARGB_8888);\n        final Canvas canvas = new Canvas(output);\n        final Paint paint = new Paint();\n        final Rect rect = new Rect((int)(x - radius), (int)(y - radius), (int)(x + radius), (int)(y + radius));\n\n        paint.setAntiAlias(true);\n        canvas.drawARGB(0, 0, 0, 0);\n        canvas.drawCircle(x, y, radius, paint);\n\n        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));\n        canvas.drawBitmap(originBitmap, rect, rect, paint);\n\n        return output;\n    }\n\n    /**\n     * Set Ripple color, default is #FFFFFF\n     * 设置动画的颜色，默认为白色\n     * @param rippleColor New color resource\n     */\n\n    public void setRippleColor(int rippleColor) {\n        this.rippleColor = getResources().getColor(rippleColor);\n    }\n\n    public int getRippleColor() {\n        return rippleColor;\n    }\n\n    public RippleType getRippleType()\n    {\n        return RippleType.values()[rippleType];\n    }\n\n    /**\n     * Set Ripple type, default is RippleType.SIMPLE\n     *\n     * @param rippleType New Ripple type for next animation\n     */\n    public void setRippleType(final RippleType rippleType)\n    {\n        this.rippleType = rippleType.ordinal();\n    }\n\n    public Boolean isCentered()\n    {\n        return isCentered;\n    }\n\n    /**\n     * Set if ripple animation has to be centered in its parent view or not, default is False\n     *\n     * @param isCentered\n     */\n    public void setCentered(final Boolean isCentered)\n    {\n        this.isCentered = isCentered;\n    }\n\n    public int getRipplePadding()\n    {\n        return ripplePadding;\n    }\n\n    /**\n     * Set Ripple padding if you want to avoid some graphic glitch\n     *\n     * @param ripplePadding New Ripple padding in pixel, default is 0px\n     */\n    public void setRipplePadding(int ripplePadding)\n    {\n        this.ripplePadding = ripplePadding;\n    }\n\n    public Boolean isZooming()\n    {\n        return hasToZoom;\n    }\n\n    /**\n     * At the end of Ripple effect, the child views has to zoom\n     *\n     * @param hasToZoom Do the child views have to zoom ? default is False\n     */\n    public void setZooming(Boolean hasToZoom)\n    {\n        this.hasToZoom = hasToZoom;\n    }\n\n    public float getZoomScale()\n    {\n        return zoomScale;\n    }\n\n    /**\n     * Scale of the end animation\n     *\n     * @param zoomScale Value of scale animation, default is 1.03f\n     */\n    public void setZoomScale(float zoomScale)\n    {\n        this.zoomScale = zoomScale;\n    }\n\n    public int getZoomDuration()\n    {\n        return zoomDuration;\n    }\n\n    /**\n     * Duration of the ending animation in ms\n     *\n     * @param zoomDuration Duration, default is 200ms\n     */\n    public void setZoomDuration(int zoomDuration)\n    {\n        this.zoomDuration = zoomDuration;\n    }\n\n    public int getRippleDuration()\n    {\n        return rippleDuration;\n    }\n\n    /**\n     * Duration of the Ripple animation in ms\n     *\n     * @param rippleDuration Duration, default is 400ms\n     */\n    public void setRippleDuration(int rippleDuration)\n    {\n        this.rippleDuration = rippleDuration;\n    }\n\n    public int getFrameRate()\n    {\n        return frameRate;\n    }\n\n    /**\n     * Set framerate for Ripple animation\n     *\n     * @param frameRate New framerate value, default is 10\n     */\n    public void setFrameRate(int frameRate)\n    {\n        this.frameRate = frameRate;\n    }\n\n    public int getRippleAlpha()\n    {\n        return rippleAlpha;\n    }\n\n    /**\n     * Set alpha for ripple effect color\n     *\n     * @param rippleAlpha Alpha value between 0 and 255, default is 90\n     */\n    public void setRippleAlpha(int rippleAlpha)\n    {\n        this.rippleAlpha = rippleAlpha;\n    }\n\n    public void setOnRippleCompleteListener(OnRippleCompleteListener listener) {\n        this.onCompletionListener = listener;\n    }\n\n    /**\n     * Defines a callback called at the end of the Ripple effect\n     */\n    public interface OnRippleCompleteListener {\n        void onComplete(RippleView rippleView);\n    }\n\n    public enum RippleType {\n        SIMPLE(0),\n        DOUBLE(1),\n        RECTANGLE(2);\n\n        int type;\n\n        RippleType(int type)\n        {\n            this.type = type;\n        }\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/RoundedImageView.java",
    "content": "/**\n * 圆形控件，显示头像\n * by黄海杰 at：2015-4-7\n */\npackage com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Bitmap;\nimport android.graphics.Bitmap.Config;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.PorterDuff.Mode;\nimport android.graphics.PorterDuffXfermode;\nimport android.graphics.Rect;\nimport android.graphics.drawable.BitmapDrawable;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.NinePatchDrawable;\nimport android.util.AttributeSet;\nimport android.widget.ImageView;\n\nimport com.hankkin.compustrading.R;\n\n\npublic class RoundedImageView extends ImageView {\n\n\tpublic RoundedImageView(Context context) {\n\t\tsuper(context);\n\t}\n\n\tpublic RoundedImageView(Context context, AttributeSet attrs) {\n\t\tsuper(context, attrs);\n\t\tinit(context, attrs);\n\t}\n\n\tpublic RoundedImageView(Context context, AttributeSet attrs, int defStyle) {\n\t\tsuper(context, attrs, defStyle);\n\t\tinit(context, attrs);\n\t}\n\n\tprivate boolean hasBound = false;\n\tprivate int boundColor = -1;\n\n\tprivate void init(Context context, AttributeSet attrs) {\n\t\tif (attrs != null) {\n\t\t\tTypedArray a = context.obtainStyledAttributes(attrs,\n\t\t\t\t\tR.styleable.RoundImageView);\n\t\t\thasBound = a.getBoolean(\n\t\t\t\t\tR.styleable.RoundImageView_roundImageView_hasRound, false);\n\t\t\tboundColor = a.getColor(\n\t\t\t\t\tR.styleable.RoundImageView_roundImageView_roundColor,\n\t\t\t\t\tcontext.getResources().getColor(R.color.white));\n\t\t}\n\t}\n\n\t@Override\n\tprotected void onDraw(Canvas canvas) {\n\t\tBitmap b = null;\n\t\tif (getDrawable() instanceof NinePatchDrawable) {\n\t\t\tNinePatchDrawable dr = (NinePatchDrawable) getDrawable();\n\t\t\tb = Bitmap.createBitmap(getWidth(), getHeight(),\n\t\t\t\t\tConfig.ARGB_8888);\n\t\t\tDrawable drawable = getResources().getDrawable(\n\t\t\t\t\tR.drawable.defaut);\n\t\t\tCanvas canvas1 = new Canvas(b);\n\t\t\tdrawable.setBounds(0, 0, canvas1.getWidth(), canvas1.getHeight());\n\t\t\t// drawable.draw(canvas);\n\t\t\tdr.draw(canvas1);\n\t\t} else {\n\t\t\tDrawable drawable = getDrawable();\n\n\t\t\tif (drawable == null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (getWidth() == 0 || getHeight() == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tb = ((BitmapDrawable) drawable).getBitmap();\n\t\t}\n\t\tif (b == null) {\n\t\t\tNinePatchDrawable drawable = (NinePatchDrawable) getResources()\n\t\t\t\t\t.getDrawable(R.drawable.defaut);\n\t\t\tb = Bitmap.createBitmap(getWidth(), getHeight(),\n\t\t\t\t\tConfig.ARGB_8888);\n\t\t\tCanvas canvas1 = new Canvas(b);\n\t\t\tdrawable.setBounds(0, 0, canvas1.getWidth(), canvas1.getHeight());\n\t\t\tdrawable.draw(canvas1);\n\t\t}\n\t\tBitmap bitmap = b.copy(Config.ARGB_8888, true);\n\n\t\tint w = getWidth(), h = getHeight();\n\n\t\tBitmap roundBitmap = getCroppedBitmap(bitmap, w);\n\t\tcanvas.drawBitmap(roundBitmap, 0, 0, null);\n\n\t}\n\n\tpublic Bitmap getCroppedBitmap(Bitmap bmp, int radius) {\n\t\tBitmap sbmp;\n\t\tif (bmp.getWidth() != radius || bmp.getHeight() != radius)\n\t\t\tsbmp = Bitmap.createScaledBitmap(bmp, radius, radius, false);\n\t\telse\n\t\t\tsbmp = bmp;\n\t\tBitmap output = Bitmap.createBitmap(sbmp.getWidth(), sbmp.getHeight(),\n\t\t\t\tConfig.ARGB_8888);\n\t\tCanvas canvas = new Canvas(output);\n\n\t\tfinal int color = 0xffa19774;\n\t\tfinal Paint paint = new Paint();\n\t\tfinal Rect rect = new Rect(0, 0, sbmp.getWidth(), sbmp.getHeight());\n\n\t\tpaint.setAntiAlias(true);\n\t\tpaint.setFilterBitmap(true);\n\t\tpaint.setDither(true);\n\t\tcanvas.drawARGB(0, 0, 0, 0);\n\t\tpaint.setColor(Color.parseColor(\"#BAB399\"));\n\t\tcanvas.drawCircle(sbmp.getWidth() / 2 + 0.7f,\n\t\t\t\tsbmp.getHeight() / 2 + 0.7f, sbmp.getWidth() / 2 + 0.1f - 3,\n\t\t\t\tpaint);\n\t\tpaint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));\n\t\tcanvas.drawBitmap(sbmp, rect, rect, paint);\n\n\t\t// draw border\n\t\tif (hasBound) {\n\t\t\tPaint paint2 = new Paint();\n\t\t\tif (boundColor != -1) {\n\t\t\t\tpaint2.setColor(boundColor);\n\t\t\t} else {\n\t\t\t\tpaint2.setColor(Color.parseColor(\"#ffffff\"));\n\t\t\t}\n\t\t\tpaint2.setStyle(Paint.Style.STROKE);\n\t\t\tpaint2.setStrokeWidth((float) pxFromDp(this.getContext(), 1));\n\t\t\tpaint2.setAntiAlias(true);\n\t\t\tcanvas.drawCircle(sbmp.getWidth() / 2 + 0.7f,\n\t\t\t\t\tsbmp.getHeight() / 2 + 0.7f, sbmp.getWidth() / 2 + 0.1f - 3\n\t\t\t\t\t\t\t+ 1 - pxFromDp(this.getContext(), 1), paint2);\n\t\t}\n\t\treturn output;\n\t}\n\n\tpublic static float pxFromDp(Context context, float dp) {\n\t\treturn dp * context.getResources().getDisplayMetrics().density;\n\t}\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/AbsListViewScrollDetector.java",
    "content": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.support.annotation.NonNull;\nimport android.view.View;\nimport android.widget.AbsListView;\n\nabstract class AbsListViewScrollDetector implements AbsListView.OnScrollListener {\n    private int mLastScrollY;\n    private int mPreviousFirstVisibleItem;\n    private AbsListView mListView;\n    private int mScrollThreshold;\n\n    abstract void onScrollUp();\n\n    abstract void onScrollDown();\n\n    @Override\n    public void onScrollStateChanged(AbsListView view, int scrollState) {\n    }\n\n    @Override\n    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {\n        if(totalItemCount == 0) return;\n        if (isSameRow(firstVisibleItem)) {\n            int newScrollY = getTopItemScrollY();\n            boolean isSignificantDelta = Math.abs(mLastScrollY - newScrollY) > mScrollThreshold;\n            if (isSignificantDelta) {\n                if (mLastScrollY > newScrollY) {\n                    onScrollUp();\n                } else {\n                    onScrollDown();\n                }\n            }\n            mLastScrollY = newScrollY;\n        } else {\n            if (firstVisibleItem > mPreviousFirstVisibleItem) {\n                onScrollUp();\n            } else {\n                onScrollDown();\n            }\n\n            mLastScrollY = getTopItemScrollY();\n            mPreviousFirstVisibleItem = firstVisibleItem;\n        }\n    }\n\n    public void setScrollThreshold(int scrollThreshold) {\n        mScrollThreshold = scrollThreshold;\n    }\n\n    public void setListView(@NonNull AbsListView listView) {\n        mListView = listView;\n    }\n\n    private boolean isSameRow(int firstVisibleItem) {\n        return firstVisibleItem == mPreviousFirstVisibleItem;\n    }\n\n    private int getTopItemScrollY() {\n        if (mListView == null || mListView.getChildAt(0) == null) return 0;\n        View topChild = mListView.getChildAt(0);\n        return topChild.getTop();\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/AddFloatingActionButton.java",
    "content": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.Paint.Style;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.ShapeDrawable;\nimport android.graphics.drawable.shapes.Shape;\nimport android.support.annotation.ColorRes;\nimport android.support.annotation.DrawableRes;\nimport android.util.AttributeSet;\n\nimport com.hankkin.compustrading.R;\n\npublic class AddFloatingActionButton extends FloatingActionButton {\n  int mPlusColor;\n\n  public AddFloatingActionButton(Context context) {\n    this(context, null);\n  }\n\n  public AddFloatingActionButton(Context context, AttributeSet attrs) {\n    super(context, attrs);\n  }\n\n  public AddFloatingActionButton(Context context, AttributeSet attrs, int defStyle) {\n    super(context, attrs, defStyle);\n  }\n\n  @Override\n  void init(Context context, AttributeSet attributeSet) {\n    TypedArray attr = context.obtainStyledAttributes(attributeSet, R.styleable.AddFloatingActionButton, 0, 0);\n    mPlusColor = attr.getColor(R.styleable.AddFloatingActionButton_fab_plusIconColor, getColor(android.R.color.white));\n    attr.recycle();\n\n    super.init(context, attributeSet);\n  }\n\n  /**\n   * @return the current Color of plus icon.\n   */\n  public int getPlusColor() {\n    return mPlusColor;\n  }\n\n  public void setPlusColorResId(@ColorRes int plusColor) {\n    setPlusColor(getColor(plusColor));\n  }\n\n  public void setPlusColor(int color) {\n    if (mPlusColor != color) {\n      mPlusColor = color;\n      updateBackground();\n    }\n  }\n\n  @Override\n  public void setIcon(@DrawableRes int icon) {\n    throw new UnsupportedOperationException(\"Use FloatingActionButton if you want to use custom icon\");\n  }\n\n  @Override\n  Drawable getIconDrawable() {\n    final float iconSize = getDimension(R.dimen.fab_icon_size);\n    final float iconHalfSize = iconSize / 2f;\n\n    final float plusSize = getDimension(R.dimen.fab_plus_icon_size);\n    final float plusHalfStroke = getDimension(R.dimen.fab_plus_icon_stroke) / 2f;\n    final float plusOffset = (iconSize - plusSize) / 2f;\n\n    final Shape shape = new Shape() {\n      @Override\n      public void draw(Canvas canvas, Paint paint) {\n        canvas.drawRect(plusOffset, iconHalfSize - plusHalfStroke, iconSize - plusOffset, iconHalfSize + plusHalfStroke, paint);\n        canvas.drawRect(iconHalfSize - plusHalfStroke, plusOffset, iconHalfSize + plusHalfStroke, iconSize - plusOffset, paint);\n      }\n    };\n\n    ShapeDrawable drawable = new ShapeDrawable(shape);\n\n    final Paint paint = drawable.getPaint();\n    paint.setColor(mPlusColor);\n    paint.setStyle(Style.FILL);\n    paint.setAntiAlias(true);\n\n    return drawable;\n  }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionButton.java",
    "content": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.LinearGradient;\nimport android.graphics.Paint;\nimport android.graphics.Paint.Style;\nimport android.graphics.Rect;\nimport android.graphics.Shader;\nimport android.graphics.Shader.TileMode;\nimport android.graphics.drawable.ColorDrawable;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.LayerDrawable;\nimport android.graphics.drawable.ShapeDrawable;\nimport android.graphics.drawable.ShapeDrawable.ShaderFactory;\nimport android.graphics.drawable.StateListDrawable;\nimport android.graphics.drawable.shapes.OvalShape;\nimport android.os.Build;\nimport android.os.Build.VERSION_CODES;\nimport android.support.annotation.ColorRes;\nimport android.support.annotation.DimenRes;\nimport android.support.annotation.DrawableRes;\nimport android.support.annotation.IntDef;\nimport android.support.annotation.NonNull;\nimport android.util.AttributeSet;\nimport android.widget.ImageButton;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\n\npublic class FloatingActionButton extends ImageButton {\n\n  public static final int SIZE_NORMAL = 0;\n  public static final int SIZE_MINI = 1;\n\n  @Retention(RetentionPolicy.SOURCE)\n  @IntDef({ SIZE_NORMAL, SIZE_MINI })\n  public @interface FAB_SIZE {\n  }\n\n  int mColorNormal;\n  int mColorPressed;\n  int mColorDisabled;\n  String mTitle;\n  @DrawableRes\n  private int mIcon;\n  private Drawable mIconDrawable;\n  private int mSize;\n\n  private float mCircleSize;\n  private float mShadowRadius;\n  private float mShadowOffset;\n  private int mDrawableSize;\n  boolean mStrokeVisible;\n\n  public FloatingActionButton(Context context) {\n    this(context, null);\n  }\n\n  public FloatingActionButton(Context context, AttributeSet attrs) {\n    super(context, attrs);\n    init(context, attrs);\n  }\n\n  public FloatingActionButton(Context context, AttributeSet attrs, int defStyle) {\n    super(context, attrs, defStyle);\n    init(context, attrs);\n  }\n\n  void init(Context context, AttributeSet attributeSet) {\n    TypedArray attr = context.obtainStyledAttributes(attributeSet, R.styleable.FloatingActionButton, 0, 0);\n    mColorNormal = attr.getColor(R.styleable.FloatingActionButton_fab_colorNormal, getColor(android.R.color.holo_blue_dark));\n    mColorPressed = attr.getColor(R.styleable.FloatingActionButton_fab_colorPressed, getColor(android.R.color.holo_blue_light));\n    mColorDisabled = attr.getColor(R.styleable.FloatingActionButton_fab_colorDisabled, getColor(android.R.color.darker_gray));\n    mSize = attr.getInt(R.styleable.FloatingActionButton_fab_size, SIZE_NORMAL);\n    mIcon = attr.getResourceId(R.styleable.FloatingActionButton_fab_icon, 0);\n    mTitle = attr.getString(R.styleable.FloatingActionButton_fab_title);\n    mStrokeVisible = attr.getBoolean(R.styleable.FloatingActionButton_fab_stroke_visible, true);\n    attr.recycle();\n\n    updateCircleSize();\n    mShadowRadius = getDimension(R.dimen.fab_shadow_radius);\n    mShadowOffset = getDimension(R.dimen.fab_shadow_offset);\n    updateDrawableSize();\n\n    updateBackground();\n  }\n\n  private void updateDrawableSize() {\n    mDrawableSize = (int) (mCircleSize + 2 * mShadowRadius);\n  }\n\n  private void updateCircleSize() {\n    mCircleSize = getDimension(mSize == SIZE_NORMAL ? R.dimen.fab_size_normal : R.dimen.fab_size_mini);\n  }\n\n  public void setSize(@FAB_SIZE int size) {\n    if (size != SIZE_MINI && size != SIZE_NORMAL) {\n      throw new IllegalArgumentException(\"Use @FAB_SIZE constants only!\");\n    }\n\n    if (mSize != size) {\n      mSize = size;\n      updateCircleSize();\n      updateDrawableSize();\n      updateBackground();\n    }\n  }\n\n  @FAB_SIZE\n  public int getSize() {\n    return mSize;\n  }\n\n  public void setIcon(@DrawableRes int icon) {\n    if (mIcon != icon) {\n      mIcon = icon;\n      mIconDrawable = null;\n      updateBackground();\n    }\n  }\n\n  public void setIconDrawable(@NonNull Drawable iconDrawable) {\n    if (mIconDrawable != iconDrawable) {\n      mIcon = 0;\n      mIconDrawable = iconDrawable;\n      updateBackground();\n    }\n  }\n\n  /**\n   * @return the current Color for normal state.\n   */\n  public int getColorNormal() {\n    return mColorNormal;\n  }\n\n  public void setColorNormalResId(@ColorRes int colorNormal) {\n    setColorNormal(getColor(colorNormal));\n  }\n\n  public void setColorNormal(int color) {\n    if (mColorNormal != color) {\n      mColorNormal = color;\n      updateBackground();\n    }\n  }\n\n  /**\n   * @return the current color for pressed state.\n   */\n  public int getColorPressed() {\n    return mColorPressed;\n  }\n\n  public void setColorPressedResId(@ColorRes int colorPressed) {\n    setColorPressed(getColor(colorPressed));\n  }\n\n  public void setColorPressed(int color) {\n    if (mColorPressed != color) {\n      mColorPressed = color;\n      updateBackground();\n    }\n  }\n\n  /**\n  * @return the current color for disabled state.\n  */\n  public int getColorDisabled() {\n    return mColorDisabled;\n  }\n\n  public void setColorDisabledResId(@ColorRes int colorDisabled) {\n    setColorDisabled(getColor(colorDisabled));\n  }\n\n  public void setColorDisabled(int color) {\n    if (mColorDisabled != color) {\n        mColorDisabled = color;\n        updateBackground();\n    }\n  }\n\n  public void setStrokeVisible(boolean visible) {\n    if (mStrokeVisible != visible) {\n      mStrokeVisible = visible;\n      updateBackground();\n    }\n  }\n\n  public boolean isStrokeVisible() {\n    return mStrokeVisible;\n  }\n\n  int getColor(@ColorRes int id) {\n    return getResources().getColor(id);\n  }\n\n  float getDimension(@DimenRes int id) {\n    return getResources().getDimension(id);\n  }\n\n  public void setTitle(String title) {\n    mTitle = title;\n    TextView label = getLabelView();\n    if (label != null) {\n      label.setText(title);\n    }\n  }\n\n  TextView getLabelView() {\n    return (TextView) getTag(R.id.fab_label);\n  }\n\n  public String getTitle() {\n    return mTitle;\n  }\n\n  @Override\n  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n    super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n    setMeasuredDimension(mDrawableSize, mDrawableSize);\n  }\n\n  void updateBackground() {\n    final float strokeWidth = getDimension(R.dimen.fab_stroke_width);\n    final float halfStrokeWidth = strokeWidth / 2f;\n\n    LayerDrawable layerDrawable = new LayerDrawable(\n        new Drawable[] {\n            getResources().getDrawable(mSize == SIZE_NORMAL ? R.drawable.fab_bg_normal : R.drawable.fab_bg_mini),\n            createFillDrawable(strokeWidth),\n            createOuterStrokeDrawable(strokeWidth),\n            getIconDrawable()\n        });\n\n    int iconOffset = (int) (mCircleSize - getDimension(R.dimen.fab_icon_size)) / 2;\n\n    int circleInsetHorizontal = (int) (mShadowRadius);\n    int circleInsetTop = (int) (mShadowRadius - mShadowOffset);\n    int circleInsetBottom = (int) (mShadowRadius + mShadowOffset);\n\n    layerDrawable.setLayerInset(1,\n        circleInsetHorizontal,\n        circleInsetTop,\n        circleInsetHorizontal,\n        circleInsetBottom);\n\n    layerDrawable.setLayerInset(2,\n        (int) (circleInsetHorizontal - halfStrokeWidth),\n        (int) (circleInsetTop - halfStrokeWidth),\n        (int) (circleInsetHorizontal - halfStrokeWidth),\n        (int) (circleInsetBottom - halfStrokeWidth));\n\n    layerDrawable.setLayerInset(3,\n        circleInsetHorizontal + iconOffset,\n        circleInsetTop + iconOffset,\n        circleInsetHorizontal + iconOffset,\n        circleInsetBottom + iconOffset);\n\n    setBackgroundCompat(layerDrawable);\n  }\n\n  Drawable getIconDrawable() {\n    if (mIconDrawable != null) {\n      return mIconDrawable;\n    } else if (mIcon != 0) {\n      return getResources().getDrawable(mIcon);\n    } else {\n      return new ColorDrawable(Color.TRANSPARENT);\n    }\n  }\n\n  private StateListDrawable createFillDrawable(float strokeWidth) {\n    StateListDrawable drawable = new StateListDrawable();\n    drawable.addState(new int[] { -android.R.attr.state_enabled }, createCircleDrawable(mColorDisabled, strokeWidth));\n    drawable.addState(new int[] { android.R.attr.state_pressed }, createCircleDrawable(mColorPressed, strokeWidth));\n    drawable.addState(new int[] { }, createCircleDrawable(mColorNormal, strokeWidth));\n    return drawable;\n  }\n\n  private Drawable createCircleDrawable(int color, float strokeWidth) {\n    int alpha = Color.alpha(color);\n    int opaqueColor = opaque(color);\n\n    ShapeDrawable fillDrawable = new ShapeDrawable(new OvalShape());\n\n    final Paint paint = fillDrawable.getPaint();\n    paint.setAntiAlias(true);\n    paint.setColor(opaqueColor);\n\n    Drawable[] layers = {\n        fillDrawable,\n        createInnerStrokesDrawable(opaqueColor, strokeWidth)\n    };\n\n    LayerDrawable drawable = alpha == 255 || !mStrokeVisible\n        ? new LayerDrawable(layers)\n        : new TranslucentLayerDrawable(alpha, layers);\n\n    int halfStrokeWidth = (int) (strokeWidth / 2f);\n    drawable.setLayerInset(1, halfStrokeWidth, halfStrokeWidth, halfStrokeWidth, halfStrokeWidth);\n\n    return drawable;\n  }\n\n  private static class TranslucentLayerDrawable extends LayerDrawable {\n    private final int mAlpha;\n\n    public TranslucentLayerDrawable(int alpha, Drawable... layers) {\n      super(layers);\n      mAlpha = alpha;\n    }\n\n    @Override\n    public void draw(Canvas canvas) {\n      Rect bounds = getBounds();\n      canvas.saveLayerAlpha(bounds.left, bounds.top, bounds.right, bounds.bottom, mAlpha, Canvas.ALL_SAVE_FLAG);\n      super.draw(canvas);\n      canvas.restore();\n    }\n  }\n\n  private Drawable createOuterStrokeDrawable(float strokeWidth) {\n    ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape());\n\n    final Paint paint = shapeDrawable.getPaint();\n    paint.setAntiAlias(true);\n    paint.setStrokeWidth(strokeWidth);\n    paint.setStyle(Style.STROKE);\n    paint.setColor(Color.BLACK);\n    paint.setAlpha(opacityToAlpha(0.02f));\n\n    return shapeDrawable;\n  }\n\n  private int opacityToAlpha(float opacity) {\n    return (int) (255f * opacity);\n  }\n\n  private int darkenColor(int argb) {\n    return adjustColorBrightness(argb, 0.9f);\n  }\n\n  private int lightenColor(int argb) {\n    return adjustColorBrightness(argb, 1.1f);\n  }\n\n  private int adjustColorBrightness(int argb, float factor) {\n    float[] hsv = new float[3];\n    Color.colorToHSV(argb, hsv);\n\n    hsv[2] = Math.min(hsv[2] * factor, 1f);\n\n    return Color.HSVToColor(Color.alpha(argb), hsv);\n  }\n\n  private int halfTransparent(int argb) {\n    return Color.argb(\n        Color.alpha(argb) / 2,\n        Color.red(argb),\n        Color.green(argb),\n        Color.blue(argb)\n    );\n  }\n\n  private int opaque(int argb) {\n    return Color.rgb(\n        Color.red(argb),\n        Color.green(argb),\n        Color.blue(argb)\n    );\n  }\n\n  private Drawable createInnerStrokesDrawable(final int color, float strokeWidth) {\n    if (!mStrokeVisible) {\n      return new ColorDrawable(Color.TRANSPARENT);\n    }\n\n    ShapeDrawable shapeDrawable = new ShapeDrawable(new OvalShape());\n\n    final int bottomStrokeColor = darkenColor(color);\n    final int bottomStrokeColorHalfTransparent = halfTransparent(bottomStrokeColor);\n    final int topStrokeColor = lightenColor(color);\n    final int topStrokeColorHalfTransparent = halfTransparent(topStrokeColor);\n\n    final Paint paint = shapeDrawable.getPaint();\n    paint.setAntiAlias(true);\n    paint.setStrokeWidth(strokeWidth);\n    paint.setStyle(Style.STROKE);\n    shapeDrawable.setShaderFactory(new ShaderFactory() {\n      @Override\n      public Shader resize(int width, int height) {\n        return new LinearGradient(width / 2, 0, width / 2, height,\n            new int[] { topStrokeColor, topStrokeColorHalfTransparent, color, bottomStrokeColorHalfTransparent, bottomStrokeColor },\n            new float[] { 0f, 0.2f, 0.5f, 0.8f, 1f },\n            TileMode.CLAMP\n        );\n      }\n    });\n\n    return shapeDrawable;\n  }\n\n  @SuppressWarnings(\"deprecation\")\n  @SuppressLint(\"NewApi\")\n  private void setBackgroundCompat(Drawable drawable) {\n    if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) {\n      setBackground(drawable);\n    } else {\n      setBackgroundDrawable(drawable);\n    }\n  }\n\n  @Override\n  public void setVisibility(int visibility) {\n    TextView label = getLabelView();\n    if (label != null) {\n      label.setVisibility(visibility);\n    }\n\n    super.setVisibility(visibility);\n  }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionsMenu.java",
    "content": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.animation.Animator;\nimport android.animation.AnimatorListenerAdapter;\nimport android.animation.AnimatorSet;\nimport android.animation.ObjectAnimator;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Rect;\nimport android.graphics.drawable.Drawable;\nimport android.graphics.drawable.LayerDrawable;\nimport android.os.Build;\nimport android.os.Parcel;\nimport android.os.Parcelable;\nimport android.support.annotation.ColorRes;\nimport android.support.annotation.NonNull;\nimport android.util.AttributeSet;\nimport android.view.ContextThemeWrapper;\nimport android.view.TouchDelegate;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.ViewTreeObserver;\nimport android.view.animation.AccelerateDecelerateInterpolator;\nimport android.view.animation.DecelerateInterpolator;\nimport android.view.animation.Interpolator;\nimport android.view.animation.OvershootInterpolator;\nimport android.widget.AbsListView;\nimport android.widget.TextView;\n\nimport com.hankkin.compustrading.R;\nimport com.hankkin.compustrading.ScrollDirectionListener;\nimport com.nineoldandroids.view.ViewHelper;\nimport com.nineoldandroids.view.ViewPropertyAnimator;\n\npublic class FloatingActionsMenu extends ViewGroup {\n  public static final int EXPAND_UP = 0;\n  public static final int EXPAND_DOWN = 1;\n  public static final int EXPAND_LEFT = 2;\n  public static final int EXPAND_RIGHT = 3;\n\n  public static final int LABELS_ON_LEFT_SIDE = 0;\n  public static final int LABELS_ON_RIGHT_SIDE = 1;\n\n  private static final int ANIMATION_DURATION = 300;\n  private static final float COLLAPSED_PLUS_ROTATION = 0f;\n  private static final float EXPANDED_PLUS_ROTATION = 90f + 45f;\n\n  private int mAddButtonPlusColor;\n  private int mAddButtonColorNormal;\n  private int mAddButtonColorPressed;\n  private int mAddButtonSize;\n  private boolean mAddButtonStrokeVisible;\n  private int mExpandDirection;\n\n  private int mButtonSpacing;\n  private int mLabelsMargin;\n  private int mLabelsVerticalOffset;\n\n  private boolean mExpanded;\n\n  private AnimatorSet mExpandAnimation = new AnimatorSet().setDuration(ANIMATION_DURATION);\n  private AnimatorSet mCollapseAnimation = new AnimatorSet().setDuration(ANIMATION_DURATION);\n  private AddFloatingActionButton mAddButton;\n  private RotatingDrawable mRotatingDrawable;\n  private int mMaxButtonWidth;\n  private int mMaxButtonHeight;\n  private int mLabelsStyle;\n  private int mLabelsPosition;\n  private int mButtonsCount;\n  private boolean mVisible;\n  private int mScrollThreshold;\n  private final Interpolator mInterpolator = new AccelerateDecelerateInterpolator();\n\n  private static final int TRANSLATE_DURATION_MILLIS = 200;\n\n\n  private TouchDelegateGroup mTouchDelegateGroup;\n\n  private OnFloatingActionsMenuUpdateListener mListener;\n\n  public interface OnFloatingActionsMenuUpdateListener {\n    void onMenuExpanded();\n    void onMenuCollapsed();\n  }\n\n  public FloatingActionsMenu(Context context) {\n    this(context, null);\n  }\n\n  public FloatingActionsMenu(Context context, AttributeSet attrs) {\n    super(context, attrs);\n    init(context, attrs);\n  }\n\n  public FloatingActionsMenu(Context context, AttributeSet attrs, int defStyle) {\n    super(context, attrs, defStyle);\n    init(context, attrs);\n  }\n\n  private void init(Context context, AttributeSet attributeSet) {\n    mButtonSpacing = (int) (getResources().getDimension(R.dimen.fab_actions_spacing) - getResources().getDimension(R.dimen.fab_shadow_radius) - getResources().getDimension(R.dimen.fab_shadow_offset));\n    mLabelsMargin = getResources().getDimensionPixelSize(R.dimen.fab_labels_margin);\n    mLabelsVerticalOffset = getResources().getDimensionPixelSize(R.dimen.fab_shadow_offset);\n\n    mTouchDelegateGroup = new TouchDelegateGroup(this);\n    setTouchDelegate(mTouchDelegateGroup);\n\n    TypedArray attr = context.obtainStyledAttributes(attributeSet, R.styleable.FloatingActionsMenu, 0, 0);\n    mAddButtonPlusColor = attr.getColor(R.styleable.FloatingActionsMenu_fab_addButtonPlusIconColor, getColor(android.R.color.white));\n    mAddButtonColorNormal = attr.getColor(R.styleable.FloatingActionsMenu_fab_addButtonColorNormal, getColor(android.R.color.holo_blue_dark));\n    mAddButtonColorPressed = attr.getColor(R.styleable.FloatingActionsMenu_fab_addButtonColorPressed, getColor(android.R.color.holo_blue_light));\n    mAddButtonSize = attr.getInt(R.styleable.FloatingActionsMenu_fab_addButtonSize, FloatingActionButton.SIZE_NORMAL);\n    mAddButtonStrokeVisible = attr.getBoolean(R.styleable.FloatingActionsMenu_fab_addButtonStrokeVisible, true);\n    mExpandDirection = attr.getInt(R.styleable.FloatingActionsMenu_fab_expandDirection, EXPAND_UP);\n    mLabelsStyle = attr.getResourceId(R.styleable.FloatingActionsMenu_fab_labelStyle, 0);\n    mLabelsPosition = attr.getInt(R.styleable.FloatingActionsMenu_fab_labelsPosition, LABELS_ON_LEFT_SIDE);\n    attr.recycle();\n\n    mScrollThreshold = getResources().getDimensionPixelOffset(R.dimen.tiny_space);\n\n\n    if (mLabelsStyle != 0 && expandsHorizontally()) {\n      throw new IllegalStateException(\"Action labels in horizontal expand orientation is not supported.\");\n    }\n\n    createAddButton(context);\n  }\n\n  public void setOnFloatingActionsMenuUpdateListener(OnFloatingActionsMenuUpdateListener listener) {\n    mListener = listener;\n  }\n\n  private boolean expandsHorizontally() {\n    return mExpandDirection == EXPAND_LEFT || mExpandDirection == EXPAND_RIGHT;\n  }\n\n  private static class RotatingDrawable extends LayerDrawable {\n    public RotatingDrawable(Drawable drawable) {\n      super(new Drawable[] { drawable });\n    }\n\n    private float mRotation;\n\n    @SuppressWarnings(\"UnusedDeclaration\")\n    public float getRotation() {\n      return mRotation;\n    }\n\n    @SuppressWarnings(\"UnusedDeclaration\")\n    public void setRotation(float rotation) {\n      mRotation = rotation;\n      invalidateSelf();\n    }\n\n    @Override\n    public void draw(Canvas canvas) {\n      canvas.save();\n      canvas.rotate(mRotation, getBounds().centerX(), getBounds().centerY());\n      super.draw(canvas);\n      canvas.restore();\n    }\n  }\n\n  private void createAddButton(Context context) {\n    mAddButton = new AddFloatingActionButton(context) {\n      @Override\n      void updateBackground() {\n        mPlusColor = mAddButtonPlusColor;\n        mColorNormal = mAddButtonColorNormal;\n        mColorPressed = mAddButtonColorPressed;\n        mStrokeVisible = mAddButtonStrokeVisible;\n        super.updateBackground();\n      }\n\n      @Override\n      Drawable getIconDrawable() {\n        final RotatingDrawable rotatingDrawable = new RotatingDrawable(super.getIconDrawable());\n        mRotatingDrawable = rotatingDrawable;\n\n        final OvershootInterpolator interpolator = new OvershootInterpolator();\n\n        final ObjectAnimator collapseAnimator = ObjectAnimator.ofFloat(rotatingDrawable, \"rotation\", EXPANDED_PLUS_ROTATION, COLLAPSED_PLUS_ROTATION);\n        final ObjectAnimator expandAnimator = ObjectAnimator.ofFloat(rotatingDrawable, \"rotation\", COLLAPSED_PLUS_ROTATION, EXPANDED_PLUS_ROTATION);\n\n        collapseAnimator.setInterpolator(interpolator);\n        expandAnimator.setInterpolator(interpolator);\n\n        mExpandAnimation.play(expandAnimator);\n        mCollapseAnimation.play(collapseAnimator);\n\n        return rotatingDrawable;\n      }\n    };\n\n    mAddButton.setId(R.id.fab_expand_menu_button);\n    mAddButton.setSize(mAddButtonSize);\n    mAddButton.setOnClickListener(new OnClickListener() {\n      @Override\n      public void onClick(View v) {\n        toggle();\n      }\n    });\n\n    addView(mAddButton, super.generateDefaultLayoutParams());\n    mButtonsCount++;\n  }\n\n  public void addButton(FloatingActionButton button) {\n    addView(button, mButtonsCount - 1);\n    mButtonsCount++;\n\n    if (mLabelsStyle != 0) {\n      createLabels();\n    }\n  }\n\n  public void removeButton(FloatingActionButton button) {\n    removeView(button.getLabelView());\n    removeView(button);\n    button.setTag(R.id.fab_label, null);\n    mButtonsCount--;\n  }\n\n  private int getColor(@ColorRes int id) {\n    return getResources().getColor(id);\n  }\n\n  @Override\n  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n    measureChildren(widthMeasureSpec, heightMeasureSpec);\n\n    int width = 0;\n    int height = 0;\n\n    mMaxButtonWidth = 0;\n    mMaxButtonHeight = 0;\n    int maxLabelWidth = 0;\n\n    for (int i = 0; i < mButtonsCount; i++) {\n      View child = getChildAt(i);\n\n      if (child.getVisibility() == GONE) {\n        continue;\n      }\n\n      switch (mExpandDirection) {\n      case EXPAND_UP:\n      case EXPAND_DOWN:\n        mMaxButtonWidth = Math.max(mMaxButtonWidth, child.getMeasuredWidth());\n        height += child.getMeasuredHeight();\n        break;\n      case EXPAND_LEFT:\n      case EXPAND_RIGHT:\n        width += child.getMeasuredWidth();\n        mMaxButtonHeight = Math.max(mMaxButtonHeight, child.getMeasuredHeight());\n        break;\n      }\n\n      if (!expandsHorizontally()) {\n        TextView label = (TextView) child.getTag(R.id.fab_label);\n        if (label != null) {\n          maxLabelWidth = Math.max(maxLabelWidth, label.getMeasuredWidth());\n        }\n      }\n    }\n\n    if (!expandsHorizontally()) {\n      width = mMaxButtonWidth + (maxLabelWidth > 0 ? maxLabelWidth + mLabelsMargin : 0);\n    } else {\n      height = mMaxButtonHeight;\n    }\n\n    switch (mExpandDirection) {\n    case EXPAND_UP:\n    case EXPAND_DOWN:\n      height += mButtonSpacing * (mButtonsCount - 1);\n      height = adjustForOvershoot(height);\n      break;\n    case EXPAND_LEFT:\n    case EXPAND_RIGHT:\n      width += mButtonSpacing * (mButtonsCount - 1);\n      width = adjustForOvershoot(width);\n      break;\n    }\n\n    setMeasuredDimension(width, height);\n  }\n\n  private int adjustForOvershoot(int dimension) {\n    return dimension * 12 / 10;\n  }\n\n  @Override\n  protected void onLayout(boolean changed, int l, int t, int r, int b) {\n    switch (mExpandDirection) {\n    case EXPAND_UP:\n    case EXPAND_DOWN:\n      boolean expandUp = mExpandDirection == EXPAND_UP;\n\n      if (changed) {\n        mTouchDelegateGroup.clearTouchDelegates();\n      }\n\n      int addButtonY = expandUp ? b - t - mAddButton.getMeasuredHeight() : 0;\n      // Ensure mAddButton is centered on the line where the buttons should be\n      int buttonsHorizontalCenter = mLabelsPosition == LABELS_ON_LEFT_SIDE\n          ? r - l - mMaxButtonWidth / 2\n          : mMaxButtonWidth / 2;\n      int addButtonLeft = buttonsHorizontalCenter - mAddButton.getMeasuredWidth() / 2;\n      mAddButton.layout(addButtonLeft, addButtonY, addButtonLeft + mAddButton.getMeasuredWidth(), addButtonY + mAddButton.getMeasuredHeight());\n\n      int labelsOffset = mMaxButtonWidth / 2 + mLabelsMargin;\n      int labelsXNearButton = mLabelsPosition == LABELS_ON_LEFT_SIDE\n          ? buttonsHorizontalCenter - labelsOffset\n          : buttonsHorizontalCenter + labelsOffset;\n\n      int nextY = expandUp ?\n          addButtonY - mButtonSpacing :\n          addButtonY + mAddButton.getMeasuredHeight() + mButtonSpacing;\n\n      for (int i = mButtonsCount - 1; i >= 0; i--) {\n        final View child = getChildAt(i);\n\n        if (child == mAddButton || child.getVisibility() == GONE) continue;\n\n        int childX = buttonsHorizontalCenter - child.getMeasuredWidth() / 2;\n        int childY = expandUp ? nextY - child.getMeasuredHeight() : nextY;\n        child.layout(childX, childY, childX + child.getMeasuredWidth(), childY + child.getMeasuredHeight());\n\n        float collapsedTranslation = addButtonY - childY;\n        float expandedTranslation = 0f;\n\n        child.setTranslationY(mExpanded ? expandedTranslation : collapsedTranslation);\n        child.setAlpha(mExpanded ? 1f : 0f);\n\n        LayoutParams params = (LayoutParams) child.getLayoutParams();\n        params.mCollapseDir.setFloatValues(expandedTranslation, collapsedTranslation);\n        params.mExpandDir.setFloatValues(collapsedTranslation, expandedTranslation);\n        params.setAnimationsTarget(child);\n\n        View label = (View) child.getTag(R.id.fab_label);\n        if (label != null) {\n          int labelXAwayFromButton = mLabelsPosition == LABELS_ON_LEFT_SIDE\n              ? labelsXNearButton - label.getMeasuredWidth()\n              : labelsXNearButton + label.getMeasuredWidth();\n\n          int labelLeft = mLabelsPosition == LABELS_ON_LEFT_SIDE\n              ? labelXAwayFromButton\n              : labelsXNearButton;\n\n          int labelRight = mLabelsPosition == LABELS_ON_LEFT_SIDE\n              ? labelsXNearButton\n              : labelXAwayFromButton;\n\n          int labelTop = childY - mLabelsVerticalOffset + (child.getMeasuredHeight() - label.getMeasuredHeight()) / 2;\n\n          label.layout(labelLeft, labelTop, labelRight, labelTop + label.getMeasuredHeight());\n\n          Rect touchArea = new Rect(\n              Math.min(childX, labelLeft),\n              childY - mButtonSpacing / 2,\n              Math.max(childX + child.getMeasuredWidth(), labelRight),\n              childY + child.getMeasuredHeight() + mButtonSpacing / 2);\n          mTouchDelegateGroup.addTouchDelegate(new TouchDelegate(touchArea, child));\n\n          label.setTranslationY(mExpanded ? expandedTranslation : collapsedTranslation);\n          label.setAlpha(mExpanded ? 1f : 0f);\n\n          LayoutParams labelParams = (LayoutParams) label.getLayoutParams();\n          labelParams.mCollapseDir.setFloatValues(expandedTranslation, collapsedTranslation);\n          labelParams.mExpandDir.setFloatValues(collapsedTranslation, expandedTranslation);\n          labelParams.setAnimationsTarget(label);\n        }\n\n        nextY = expandUp ?\n            childY - mButtonSpacing :\n            childY + child.getMeasuredHeight() + mButtonSpacing;\n      }\n      break;\n\n    case EXPAND_LEFT:\n    case EXPAND_RIGHT:\n      boolean expandLeft = mExpandDirection == EXPAND_LEFT;\n\n      int addButtonX = expandLeft ? r - l - mAddButton.getMeasuredWidth() : 0;\n      // Ensure mAddButton is centered on the line where the buttons should be\n      int addButtonTop = b - t - mMaxButtonHeight + (mMaxButtonHeight - mAddButton.getMeasuredHeight()) / 2;\n      mAddButton.layout(addButtonX, addButtonTop, addButtonX + mAddButton.getMeasuredWidth(), addButtonTop + mAddButton.getMeasuredHeight());\n\n      int nextX = expandLeft ?\n          addButtonX - mButtonSpacing :\n          addButtonX + mAddButton.getMeasuredWidth() + mButtonSpacing;\n\n      for (int i = mButtonsCount - 1; i >= 0; i--) {\n        final View child = getChildAt(i);\n\n        if (child == mAddButton || child.getVisibility() == GONE) continue;\n\n        int childX = expandLeft ? nextX - child.getMeasuredWidth() : nextX;\n        int childY = addButtonTop + (mAddButton.getMeasuredHeight() - child.getMeasuredHeight()) / 2;\n        child.layout(childX, childY, childX + child.getMeasuredWidth(), childY + child.getMeasuredHeight());\n\n        float collapsedTranslation = addButtonX - childX;\n        float expandedTranslation = 0f;\n\n        child.setTranslationX(mExpanded ? expandedTranslation : collapsedTranslation);\n        child.setAlpha(mExpanded ? 1f : 0f);\n\n        LayoutParams params = (LayoutParams) child.getLayoutParams();\n        params.mCollapseDir.setFloatValues(expandedTranslation, collapsedTranslation);\n        params.mExpandDir.setFloatValues(collapsedTranslation, expandedTranslation);\n        params.setAnimationsTarget(child);\n\n        nextX = expandLeft ?\n            childX - mButtonSpacing :\n            childX + child.getMeasuredWidth() + mButtonSpacing;\n      }\n\n      break;\n    }\n  }\n\n  @Override\n  protected ViewGroup.LayoutParams generateDefaultLayoutParams() {\n    return new LayoutParams(super.generateDefaultLayoutParams());\n  }\n\n  @Override\n  public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) {\n    return new LayoutParams(super.generateLayoutParams(attrs));\n  }\n\n  @Override\n  protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {\n    return new LayoutParams(super.generateLayoutParams(p));\n  }\n\n  @Override\n  protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {\n    return super.checkLayoutParams(p);\n  }\n\n  private static Interpolator sExpandInterpolator = new OvershootInterpolator();\n  private static Interpolator sCollapseInterpolator = new DecelerateInterpolator(3f);\n  private static Interpolator sAlphaExpandInterpolator = new DecelerateInterpolator();\n\n  private class LayoutParams extends ViewGroup.LayoutParams {\n\n    private ObjectAnimator mExpandDir = new ObjectAnimator();\n    private ObjectAnimator mExpandAlpha = new ObjectAnimator();\n    private ObjectAnimator mCollapseDir = new ObjectAnimator();\n    private ObjectAnimator mCollapseAlpha = new ObjectAnimator();\n    private boolean animationsSetToPlay;\n\n    public LayoutParams(ViewGroup.LayoutParams source) {\n      super(source);\n\n      mExpandDir.setInterpolator(sExpandInterpolator);\n      mExpandAlpha.setInterpolator(sAlphaExpandInterpolator);\n      mCollapseDir.setInterpolator(sCollapseInterpolator);\n      mCollapseAlpha.setInterpolator(sCollapseInterpolator);\n\n      mCollapseAlpha.setProperty(View.ALPHA);\n      mCollapseAlpha.setFloatValues(1f, 0f);\n\n      mExpandAlpha.setProperty(View.ALPHA);\n      mExpandAlpha.setFloatValues(0f, 1f);\n\n      switch (mExpandDirection) {\n      case EXPAND_UP:\n      case EXPAND_DOWN:\n        mCollapseDir.setProperty(View.TRANSLATION_Y);\n        mExpandDir.setProperty(View.TRANSLATION_Y);\n        break;\n      case EXPAND_LEFT:\n      case EXPAND_RIGHT:\n        mCollapseDir.setProperty(View.TRANSLATION_X);\n        mExpandDir.setProperty(View.TRANSLATION_X);\n        break;\n      }\n    }\n\n    public void setAnimationsTarget(View view) {\n      mCollapseAlpha.setTarget(view);\n      mCollapseDir.setTarget(view);\n      mExpandAlpha.setTarget(view);\n      mExpandDir.setTarget(view);\n\n      // Now that the animations have targets, set them to be played\n      if (!animationsSetToPlay) {\n        addLayerTypeListener(mExpandDir, view);\n        addLayerTypeListener(mCollapseDir, view);\n\n        mCollapseAnimation.play(mCollapseAlpha);\n        mCollapseAnimation.play(mCollapseDir);\n        mExpandAnimation.play(mExpandAlpha);\n        mExpandAnimation.play(mExpandDir);\n        animationsSetToPlay = true;\n      }\n    }\n\n    private void addLayerTypeListener(Animator animator, final View view) {\n      animator.addListener(new AnimatorListenerAdapter() {\n        @Override\n        public void onAnimationEnd(Animator animation) {\n          view.setLayerType(LAYER_TYPE_NONE, null);\n        }\n\n        @Override\n        public void onAnimationStart(Animator animation) {\n          view.setLayerType(LAYER_TYPE_HARDWARE, null);\n        }\n      });\n    }\n  }\n\n  @Override\n  protected void onFinishInflate() {\n    super.onFinishInflate();\n\n    bringChildToFront(mAddButton);\n    mButtonsCount = getChildCount();\n\n    if (mLabelsStyle != 0) {\n      createLabels();\n    }\n  }\n\n  private void createLabels() {\n    Context context = new ContextThemeWrapper(getContext(), mLabelsStyle);\n\n    for (int i = 0; i < mButtonsCount; i++) {\n      FloatingActionButton button = (FloatingActionButton) getChildAt(i);\n      String title = button.getTitle();\n\n      if (button == mAddButton || title == null ||\n          button.getTag(R.id.fab_label) != null) continue;\n\n      TextView label = new TextView(context);\n      label.setTextAppearance(getContext(), mLabelsStyle);\n      label.setText(button.getTitle());\n      addView(label);\n\n      button.setTag(R.id.fab_label, label);\n    }\n  }\n\n  public void collapse() {\n    collapse(false);\n  }\n\n  public void collapseImmediately() {\n    collapse(true);\n  }\n\n  private void collapse(boolean immediately) {\n    if (mExpanded) {\n      mExpanded = false;\n      mTouchDelegateGroup.setEnabled(false);\n      mCollapseAnimation.setDuration(immediately ? 0 : ANIMATION_DURATION);\n      mCollapseAnimation.start();\n      mExpandAnimation.cancel();\n\n      if (mListener != null) {\n        mListener.onMenuCollapsed();\n      }\n    }\n  }\n\n  public void toggle() {\n    if (mExpanded) {\n      collapse();\n    } else {\n      expand();\n    }\n  }\n\n  public void expand() {\n    if (!mExpanded) {\n      mExpanded = true;\n      mTouchDelegateGroup.setEnabled(true);\n      mCollapseAnimation.cancel();\n      mExpandAnimation.start();\n\n      if (mListener != null) {\n        mListener.onMenuExpanded();\n      }\n    }\n  }\n\n  public boolean isExpanded() {\n    return mExpanded;\n  }\n\n  @Override\n  public void setEnabled(boolean enabled) {\n    super.setEnabled(enabled);\n\n    mAddButton.setEnabled(enabled);\n  }\n\n  @Override\n  public Parcelable onSaveInstanceState() {\n    Parcelable superState = super.onSaveInstanceState();\n    SavedState savedState = new SavedState(superState);\n    savedState.mExpanded = mExpanded;\n\n    return savedState;\n  }\n\n  @Override\n  public void onRestoreInstanceState(Parcelable state) {\n    if (state instanceof SavedState) {\n      SavedState savedState = (SavedState) state;\n      mExpanded = savedState.mExpanded;\n      mTouchDelegateGroup.setEnabled(mExpanded);\n\n      if (mRotatingDrawable != null) {\n        mRotatingDrawable.setRotation(mExpanded ? EXPANDED_PLUS_ROTATION : COLLAPSED_PLUS_ROTATION);\n      }\n\n      super.onRestoreInstanceState(savedState.getSuperState());\n    } else {\n      super.onRestoreInstanceState(state);\n    }\n  }\n\n  public static class SavedState extends BaseSavedState {\n    public boolean mExpanded;\n\n    public SavedState(Parcelable parcel) {\n      super(parcel);\n    }\n\n    private SavedState(Parcel in) {\n      super(in);\n      mExpanded = in.readInt() == 1;\n    }\n\n    @Override\n    public void writeToParcel(@NonNull Parcel out, int flags) {\n      super.writeToParcel(out, flags);\n      out.writeInt(mExpanded ? 1 : 0);\n    }\n\n    public static final Creator<SavedState> CREATOR = new Creator<SavedState>() {\n\n      @Override\n      public SavedState createFromParcel(Parcel in) {\n        return new SavedState(in);\n      }\n\n      @Override\n      public SavedState[] newArray(int size) {\n        return new SavedState[size];\n      }\n    };\n  }\n\n  public void attachToListView(@NonNull AbsListView listView,\n                               ScrollDirectionListener scrollDirectionListener,\n                               AbsListView.OnScrollListener onScrollListener) {\n    AbsListViewScrollDetectorImpl scrollDetector = new AbsListViewScrollDetectorImpl();\n    scrollDetector.setScrollDirectionListener(scrollDirectionListener);\n    scrollDetector.setOnScrollListener(onScrollListener);\n    scrollDetector.setListView(listView);\n    scrollDetector.setScrollThreshold(mScrollThreshold);\n    listView.setOnScrollListener(scrollDetector);\n  }\n\n  private class AbsListViewScrollDetectorImpl extends AbsListViewScrollDetector {\n    private ScrollDirectionListener mScrollDirectionListener;\n    private AbsListView.OnScrollListener mOnScrollListener;\n\n    private void setScrollDirectionListener(ScrollDirectionListener scrollDirectionListener) {\n      mScrollDirectionListener = scrollDirectionListener;\n    }\n\n    public void setOnScrollListener(AbsListView.OnScrollListener onScrollListener) {\n      mOnScrollListener = onScrollListener;\n    }\n\n    @Override\n    public void onScrollDown() {\n      show();\n      if (mScrollDirectionListener != null) {\n        mScrollDirectionListener.onScrollDown();\n      }\n    }\n\n    @Override\n    public void onScrollUp() {\n      hide();\n      if (mScrollDirectionListener != null) {\n        mScrollDirectionListener.onScrollUp();\n      }\n    }\n\n    @Override\n    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,\n                         int totalItemCount) {\n      if (mOnScrollListener != null) {\n        mOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);\n      }\n\n      super.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);\n    }\n\n    @Override\n    public void onScrollStateChanged(AbsListView view, int scrollState) {\n      if (mOnScrollListener != null) {\n        mOnScrollListener.onScrollStateChanged(view, scrollState);\n      }\n\n      super.onScrollStateChanged(view, scrollState);\n    }\n  }\n  public void show() {\n    show(true);\n  }\n\n  public void hide() {\n    hide(true);\n  }\n  public void show(boolean animate) {\n    toggle(true, animate, false);\n  }\n\n  public void hide(boolean animate) {\n    toggle(false, animate, false);\n  }\n  private void toggle(final boolean visible, final boolean animate, boolean force) {\n    if (mVisible != visible || force) {\n      mVisible = visible;\n      int height = getHeight();\n      if (height == 0 && !force) {\n        ViewTreeObserver vto = getViewTreeObserver();\n        if (vto.isAlive()) {\n          vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {\n            @Override\n            public boolean onPreDraw() {\n              ViewTreeObserver currentVto = getViewTreeObserver();\n              if (currentVto.isAlive()) {\n                currentVto.removeOnPreDrawListener(this);\n              }\n              toggle(visible, animate, true);\n              return true;\n            }\n          });\n          return;\n        }\n      }\n      int translationY = visible ? 0 : height + getMarginBottom();\n      if (animate) {\n        ViewPropertyAnimator.animate(this).setInterpolator(mInterpolator)\n                .setDuration(TRANSLATE_DURATION_MILLIS)\n                .translationY(translationY);\n      } else {\n        ViewHelper.setTranslationY(this, translationY);\n      }\n\n      // On pre-Honeycomb a translated view is still clickable, so we need to disable clicks manually\n      if (!hasHoneycombApi()) {\n        setClickable(visible);\n      }\n    }\n  }\n  private int getMarginBottom() {\n    int marginBottom = 0;\n    final ViewGroup.LayoutParams layoutParams = getLayoutParams();\n    if (layoutParams instanceof ViewGroup.MarginLayoutParams) {\n      marginBottom = ((ViewGroup.MarginLayoutParams) layoutParams).bottomMargin;\n    }\n    return marginBottom;\n  }\n  private boolean hasHoneycombApi() {\n    return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;\n  }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionsMenuHidable.java",
    "content": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.content.Context;\nimport android.support.annotation.NonNull;\nimport android.util.AttributeSet;\nimport android.view.ViewGroup;\nimport android.widget.AbsListView;\n\npublic class FloatingActionsMenuHidable extends FloatingActionsMenu {\n\n    private boolean isShown = true;\n    private int ANIM_DURATION = 200;\n    private boolean mVisible = false;\n\n\n\n    public FloatingActionsMenuHidable(Context context) {\n        super(context);\n\n    }\n\n    public FloatingActionsMenuHidable(Context context, AttributeSet attrs) {\n        super(context, attrs);\n\n    }\n\n    public FloatingActionsMenuHidable(Context context, AttributeSet attrs, int defStyle) {\n        super(context, attrs, defStyle);\n\n    }\n\n\n    public void show(boolean isVisible) {\n        mVisible = isVisible;\n        int translationX = isVisible ? 0 : (getWidth()/2) + getMarginRight();\n        this.animate().translationX(translationX).setDuration(ANIM_DURATION).start();\n    }\n\n    public boolean isShown() {\n        return isShown;\n    }\n\n    private int getMarginRight() {\n        int marginBottom = 0;\n        final ViewGroup.LayoutParams layoutParams = getLayoutParams();\n        if (layoutParams instanceof ViewGroup.MarginLayoutParams) {\n            marginBottom = ((MarginLayoutParams) layoutParams).rightMargin;\n        }\n        return marginBottom;\n    }\n\n    public boolean getVisible(){\n        return mVisible;\n    }\n\n\n}"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/TouchDelegateGroup.java",
    "content": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.graphics.Rect;\nimport android.support.annotation.NonNull;\nimport android.view.MotionEvent;\nimport android.view.TouchDelegate;\nimport android.view.View;\n\nimport java.util.ArrayList;\n\npublic class TouchDelegateGroup extends TouchDelegate {\n  private static final Rect USELESS_HACKY_RECT = new Rect();\n  private final ArrayList<TouchDelegate> mTouchDelegates = new ArrayList<TouchDelegate>();\n  private TouchDelegate mCurrentTouchDelegate;\n  private boolean mEnabled;\n\n  public TouchDelegateGroup(View uselessHackyView) {\n    super(USELESS_HACKY_RECT, uselessHackyView);\n  }\n\n  public void addTouchDelegate(@NonNull TouchDelegate touchDelegate) {\n    mTouchDelegates.add(touchDelegate);\n  }\n\n  public void removeTouchDelegate(TouchDelegate touchDelegate) {\n    mTouchDelegates.remove(touchDelegate);\n    if (mCurrentTouchDelegate == touchDelegate) {\n      mCurrentTouchDelegate = null;\n    }\n  }\n\n  public void clearTouchDelegates() {\n    mTouchDelegates.clear();\n    mCurrentTouchDelegate = null;\n  }\n\n  @Override\n  public boolean onTouchEvent(@NonNull MotionEvent event) {\n    if (!mEnabled) return false;\n\n    TouchDelegate delegate = null;\n\n    switch (event.getAction()) {\n    case MotionEvent.ACTION_DOWN:\n      for (int i = 0; i < mTouchDelegates.size(); i++) {\n        TouchDelegate touchDelegate = mTouchDelegates.get(i);\n        if (touchDelegate.onTouchEvent(event)) {\n          mCurrentTouchDelegate = touchDelegate;\n          return true;\n        }\n      }\n      break;\n\n    case MotionEvent.ACTION_MOVE:\n      delegate = mCurrentTouchDelegate;\n      break;\n\n    case MotionEvent.ACTION_CANCEL:\n    case MotionEvent.ACTION_UP:\n      delegate = mCurrentTouchDelegate;\n      mCurrentTouchDelegate = null;\n      break;\n    }\n\n    return delegate != null && delegate.onTouchEvent(event);\n  }\n\n  public void setEnabled(boolean enabled) {\n    mEnabled = enabled;\n  }\n}"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/IPullToZoom.java",
    "content": "package com.hankkin.compustrading.view;\n\n/**\n * Author:    ZhuWenWu\n * Version    V1.0\n * Date:      2014/11/7  14:21.\n * Description:\n * Modification  History:\n * Date         \tAuthor        \t\tVersion        \tDescription\n * -----------------------------------------------------------------------------------\n * 2014/11/7        ZhuWenWu            1.0                    1.0\n * Why & What is modified:\n */\n\nimport android.content.res.TypedArray;\nimport android.view.View;\n\npublic interface IPullToZoom<T extends View> {\n    /**\n     * Get the Wrapped Zoom View. Anything returned here has already been\n     * added to the content view.\n     *\n     * @return The View which is currently wrapped\n     */\n    public View getZoomView();\n\n    public View getHeaderView();\n\n    /**\n     * Get the Wrapped root View.\n     *\n     * @return The View which is currently wrapped\n     */\n    public T getPullRootView();\n\n    /**\n     * Whether Pull-to-Refresh is enabled\n     *\n     * @return enabled\n     */\n    public boolean isPullToZoomEnabled();\n\n    /**\n     * Returns whether the Widget is currently in the Zooming state\n     *\n     * @return true if the Widget is currently zooming\n     */\n    public boolean isZooming();\n\n    /**\n     * Returns whether the Widget is currently in the Zooming anim type\n     *\n     * @return true if the anim is parallax\n     */\n    public boolean isParallax();\n\n    public boolean isHideHeader();\n\n    public void handleStyledAttributes(TypedArray a);\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/PullToZoomBase.java",
    "content": "package com.hankkin.compustrading.view;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.support.annotation.NonNull;\nimport android.util.AttributeSet;\nimport android.util.DisplayMetrics;\nimport android.view.Gravity;\nimport android.view.LayoutInflater;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewConfiguration;\nimport android.view.ViewGroup;\nimport android.widget.LinearLayout;\n\nimport com.hankkin.compustrading.R;\n\n/**\n * Author:    ZhuWenWu\n * Version    V1.0\n * Date:      2014/11/7  14:18.\n * Description:\n * Modification  History:\n * Date         \tAuthor        \t\tVersion        \tDescription\n * -----------------------------------------------------------------------------------\n * 2014/11/7        ZhuWenWu            1.0                    1.0\n * Why & What is modified:\n */\npublic abstract class PullToZoomBase<T extends View> extends LinearLayout implements IPullToZoom<T> {\n    private static final float FRICTION = 2.0f;\n    protected T mRootView;\n    protected View mHeaderView;//头部View\n    protected View mZoomView;//缩放拉伸View\n\n    protected int mScreenHeight;\n    protected int mScreenWidth;\n\n    private boolean isZoomEnabled = true;\n    private boolean isParallax = true;\n    private boolean isZooming = false;\n    private boolean isHideHeader = false;\n\n    private int mTouchSlop;\n    private boolean mIsBeingDragged = false;\n    private float mLastMotionY;\n    private float mLastMotionX;\n    private float mInitialMotionY;\n    private float mInitialMotionX;\n    private OnPullZoomListener onPullZoomListener;\n\n    public PullToZoomBase(Context context) {\n        this(context, null);\n    }\n\n    public PullToZoomBase(Context context, AttributeSet attrs) {\n        super(context, attrs);\n\n        init(context, attrs);\n    }\n\n    private void init(Context context, AttributeSet attrs) {\n        setGravity(Gravity.CENTER);\n\n        ViewConfiguration config = ViewConfiguration.get(context);\n        mTouchSlop = config.getScaledTouchSlop();\n\n        DisplayMetrics localDisplayMetrics = new DisplayMetrics();\n        ((Activity) getContext()).getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);\n        mScreenHeight = localDisplayMetrics.heightPixels;\n        mScreenWidth = localDisplayMetrics.widthPixels;\n\n        // Refreshable View\n        // By passing the attrs, we can add ListView/GridView params via XML\n        mRootView = createRootView(context, attrs);\n\n        if (attrs != null) {\n            LayoutInflater mLayoutInflater = LayoutInflater.from(getContext());\n            //初始化状态View\n            TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.PullToZoomView);\n\n            int zoomViewResId = a.getResourceId(R.styleable.PullToZoomView_zoomView, 0);\n            if (zoomViewResId > 0) {\n                mZoomView = mLayoutInflater.inflate(zoomViewResId, null, false);\n            }\n\n            int headerViewResId = a.getResourceId(R.styleable.PullToZoomView_headerView, 0);\n            if (headerViewResId > 0) {\n                mHeaderView = mLayoutInflater.inflate(headerViewResId, null, false);\n            }\n\n            isParallax = a.getBoolean(R.styleable.PullToZoomView_isHeaderParallax, true);\n\n            // Let the derivative classes have a go at handling attributes, then\n            // recycle them...\n            handleStyledAttributes(a);\n            a.recycle();\n        }\n        addView(mRootView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);\n    }\n\n    public void setOnPullZoomListener(OnPullZoomListener onPullZoomListener) {\n        this.onPullZoomListener = onPullZoomListener;\n    }\n\n    @Override\n    public T getPullRootView() {\n        return mRootView;\n    }\n\n    @Override\n    public View getZoomView() {\n        return mZoomView;\n    }\n\n    @Override\n    public View getHeaderView() {\n        return mHeaderView;\n    }\n\n    @Override\n    public boolean isPullToZoomEnabled() {\n        return isZoomEnabled;\n    }\n\n    @Override\n    public boolean isZooming() {\n        return isZooming;\n    }\n\n    @Override\n    public boolean isParallax() {\n        return isParallax;\n    }\n\n    @Override\n    public boolean isHideHeader() {\n        return isHideHeader;\n    }\n\n    public void setZoomEnabled(boolean isZoomEnabled) {\n        this.isZoomEnabled = isZoomEnabled;\n    }\n\n    public void setParallax(boolean isParallax) {\n        this.isParallax = isParallax;\n    }\n\n    public void setHideHeader(boolean isHideHeader) {//header显示才能Zoom\n        this.isHideHeader = isHideHeader;\n    }\n\n    @Override\n    public boolean onInterceptTouchEvent(MotionEvent event) {\n        if (!isPullToZoomEnabled() || isHideHeader()) {\n            return false;\n        }\n\n        final int action = event.getAction();\n\n        if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {\n            mIsBeingDragged = false;\n            return false;\n        }\n\n        if (action != MotionEvent.ACTION_DOWN && mIsBeingDragged) {\n            return true;\n        }\n        switch (action) {\n            case MotionEvent.ACTION_MOVE: {\n                if (isReadyForPullStart()) {\n                    final float y = event.getY(), x = event.getX();\n                    final float diff, oppositeDiff, absDiff;\n\n                    // We need to use the correct values, based on scroll\n                    // direction\n                    diff = y - mLastMotionY;\n                    oppositeDiff = x - mLastMotionX;\n                    absDiff = Math.abs(diff);\n\n                    if (absDiff > mTouchSlop && absDiff > Math.abs(oppositeDiff)) {\n                        if (diff >= 1f && isReadyForPullStart()) {\n                            mLastMotionY = y;\n                            mLastMotionX = x;\n                            mIsBeingDragged = true;\n                        }\n                    }\n                }\n                break;\n            }\n            case MotionEvent.ACTION_DOWN: {\n                if (isReadyForPullStart()) {\n                    mLastMotionY = mInitialMotionY = event.getY();\n                    mLastMotionX = mInitialMotionX = event.getX();\n                    mIsBeingDragged = false;\n                }\n                break;\n            }\n        }\n\n        return mIsBeingDragged;\n    }\n\n    @Override\n    public boolean onTouchEvent(@NonNull MotionEvent event) {\n        if (!isPullToZoomEnabled() || isHideHeader()) {\n            return false;\n        }\n\n        if (event.getAction() == MotionEvent.ACTION_DOWN && event.getEdgeFlags() != 0) {\n            return false;\n        }\n\n        switch (event.getAction()) {\n            case MotionEvent.ACTION_MOVE: {\n                if (mIsBeingDragged) {\n                    mLastMotionY = event.getY();\n                    mLastMotionX = event.getX();\n                    pullEvent();\n                    isZooming = true;\n                    return true;\n                }\n                break;\n            }\n\n            case MotionEvent.ACTION_DOWN: {\n                if (isReadyForPullStart()) {\n                    mLastMotionY = mInitialMotionY = event.getY();\n                    mLastMotionX = mInitialMotionX = event.getX();\n                    return true;\n                }\n                break;\n            }\n\n            case MotionEvent.ACTION_CANCEL:\n            case MotionEvent.ACTION_UP: {\n                if (mIsBeingDragged) {\n                    mIsBeingDragged = false;\n                    // If we're already refreshing, just scroll back to the top\n                    if (isZooming()) {\n                        smoothScrollToTop();\n                        if (onPullZoomListener != null) {\n                            onPullZoomListener.onPullZoomEnd();\n                        }\n                        isZooming = false;\n                        return true;\n                    }\n                    return true;\n                }\n                break;\n            }\n        }\n        return false;\n    }\n\n    private void pullEvent() {\n        final int newScrollValue;\n        final float initialMotionValue, lastMotionValue;\n\n        initialMotionValue = mInitialMotionY;\n        lastMotionValue = mLastMotionY;\n\n        newScrollValue = Math.round(Math.min(initialMotionValue - lastMotionValue, 0) / FRICTION);\n\n        pullHeaderToZoom(newScrollValue);\n        if (onPullZoomListener != null) {\n            onPullZoomListener.onPullZooming(newScrollValue);\n        }\n    }\n\n    protected abstract void pullHeaderToZoom(int newScrollValue);\n\n    public abstract void setHeaderView(View headerView);\n\n    public abstract void setZoomView(View zoomView);\n\n    protected abstract T createRootView(Context context, AttributeSet attrs);\n\n    protected abstract void smoothScrollToTop();\n\n    protected abstract boolean isReadyForPullStart();\n\n    public interface OnPullZoomListener {\n        public void onPullZooming(int newScrollValue);\n\n        public void onPullZoomEnd();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/PullToZoomScrollViewEx.java",
    "content": "package com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.os.SystemClock;\nimport android.util.AttributeSet;\nimport android.util.Log;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.animation.Interpolator;\nimport android.widget.FrameLayout;\nimport android.widget.LinearLayout;\nimport android.widget.ScrollView;\n\nimport com.hankkin.compustrading.R;\n\n/**\n * Author:    ZhuWenWu\n * Version    V1.0\n * Date:      2014/11/10  14:25.\n * Description:\n * Modification  History:\n * Date         \tAuthor        \t\tVersion        \tDescription\n * -----------------------------------------------------------------------------------\n * 2014/11/10        ZhuWenWu            1.0                    1.0\n * Why & What is modified:\n */\npublic class PullToZoomScrollViewEx extends PullToZoomBase<ScrollView> {\n    private static final String TAG = PullToZoomScrollViewEx.class.getSimpleName();\n    private boolean isCustomHeaderHeight = false;\n    private FrameLayout mHeaderContainer;\n    private LinearLayout mRootContainer;\n    private View mContentView;\n    private int mHeaderHeight;\n    private ScalingRunnable mScalingRunnable;\n\n    private static final Interpolator sInterpolator = new Interpolator() {\n        public float getInterpolation(float paramAnonymousFloat) {\n            float f = paramAnonymousFloat - 1.0F;\n            return 1.0F + f * (f * (f * (f * f)));\n        }\n    };\n\n    public PullToZoomScrollViewEx(Context context) {\n        this(context, null);\n    }\n\n    public PullToZoomScrollViewEx(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        mScalingRunnable = new ScalingRunnable();\n        ((InternalScrollView) mRootView).setOnScrollViewChangedListener(new OnScrollViewChangedListener() {\n            @Override\n            public void onInternalScrollChanged(int left, int top, int oldLeft, int oldTop) {\n                if (isPullToZoomEnabled() && isParallax()) {\n                    Log.d(TAG, \"onScrollChanged --> getScrollY() = \" + mRootView.getScrollY());\n                    float f = mHeaderHeight - mHeaderContainer.getBottom() + mRootView.getScrollY();\n                    Log.d(TAG, \"onScrollChanged --> f = \" + f);\n                    if ((f > 0.0F) && (f < mHeaderHeight)) {\n                        int i = (int) (0.65D * f);\n                        mHeaderContainer.scrollTo(0, -i);\n                    } else if (mHeaderContainer.getScrollY() != 0) {\n                        mHeaderContainer.scrollTo(0, 0);\n                    }\n                }\n            }\n        });\n    }\n\n    @Override\n    protected void pullHeaderToZoom(int newScrollValue) {\n        Log.d(TAG, \"pullHeaderToZoom --> newScrollValue = \" + newScrollValue);\n        Log.d(TAG, \"pullHeaderToZoom --> mHeaderHeight = \" + mHeaderHeight);\n        if (mScalingRunnable != null && !mScalingRunnable.isFinished()) {\n            mScalingRunnable.abortAnimation();\n        }\n\n        ViewGroup.LayoutParams localLayoutParams = mHeaderContainer.getLayoutParams();\n        localLayoutParams.height = Math.abs(newScrollValue) + mHeaderHeight;\n        mHeaderContainer.setLayoutParams(localLayoutParams);\n\n        if (isCustomHeaderHeight) {\n            ViewGroup.LayoutParams zoomLayoutParams = mZoomView.getLayoutParams();\n            zoomLayoutParams.height = Math.abs(newScrollValue) + mHeaderHeight;\n            mZoomView.setLayoutParams(zoomLayoutParams);\n        }\n    }\n\n    /**\n     * 是否显示headerView\n     *\n     * @param isHideHeader true: show false: hide\n     */\n    @Override\n    public void setHideHeader(boolean isHideHeader) {\n        if (isHideHeader != isHideHeader() && mHeaderContainer != null) {\n            super.setHideHeader(isHideHeader);\n            if (isHideHeader) {\n                mHeaderContainer.setVisibility(GONE);\n            } else {\n                mHeaderContainer.setVisibility(VISIBLE);\n            }\n        }\n    }\n\n    @Override\n    public void setHeaderView(View headerView) {\n        if (headerView != null) {\n            mHeaderView = headerView;\n            updateHeaderView();\n        }\n    }\n\n    @Override\n    public void setZoomView(View zoomView) {\n        if (zoomView != null) {\n            mZoomView = zoomView;\n            updateHeaderView();\n        }\n    }\n\n    private void updateHeaderView() {\n        if (mHeaderContainer != null) {\n            mHeaderContainer.removeAllViews();\n\n            if (mZoomView != null) {\n                mHeaderContainer.addView(mZoomView);\n            }\n\n            if (mHeaderView != null) {\n                mHeaderContainer.addView(mHeaderView);\n            }\n        }\n    }\n\n    public void setScrollContentView(View contentView) {\n        if (contentView != null) {\n            if (mContentView != null) {\n                mRootContainer.removeView(mContentView);\n            }\n            mContentView = contentView;\n            mRootContainer.addView(mContentView);\n        }\n    }\n\n    @Override\n    protected ScrollView createRootView(Context context, AttributeSet attrs) {\n        ScrollView scrollView = new InternalScrollView(context, attrs);\n        scrollView.setId(R.id.scrollview);\n        return scrollView;\n    }\n\n    @Override\n    protected void smoothScrollToTop() {\n        Log.d(TAG, \"smoothScrollToTop --> \");\n        mScalingRunnable.startAnimation(200L);\n    }\n\n    @Override\n    protected boolean isReadyForPullStart() {\n        return mRootView.getScrollY() == 0;\n    }\n\n    @Override\n    public void handleStyledAttributes(TypedArray a) {\n        mRootContainer = new LinearLayout(getContext());\n        mRootContainer.setOrientation(LinearLayout.VERTICAL);\n        mHeaderContainer = new FrameLayout(getContext());\n\n        if (mZoomView != null) {\n            mHeaderContainer.addView(mZoomView);\n        }\n        if (mHeaderView != null) {\n            mHeaderContainer.addView(mHeaderView);\n        }\n        int contentViewResId = a.getResourceId(R.styleable.PullToZoomView_contentView, 0);\n        if (contentViewResId > 0) {\n            LayoutInflater mLayoutInflater = LayoutInflater.from(getContext());\n            mContentView = mLayoutInflater.inflate(contentViewResId, null, false);\n        }\n\n        mRootContainer.addView(mHeaderContainer);\n        if (mContentView != null) {\n            mRootContainer.addView(mContentView);\n        }\n\n        mRootContainer.setClipChildren(false);\n        mHeaderContainer.setClipChildren(false);\n\n        mRootView.addView(mRootContainer);\n    }\n\n    /**\n     * 设置HeaderView高度\n     *\n     * @param width\n     * @param height\n     */\n    public void setHeaderViewSize(int width, int height) {\n        if (mHeaderContainer != null) {\n            Object localObject = mHeaderContainer.getLayoutParams();\n            if (localObject == null) {\n                localObject = new ViewGroup.LayoutParams(width, height);\n            }\n            ((ViewGroup.LayoutParams) localObject).width = width;\n            ((ViewGroup.LayoutParams) localObject).height = height;\n            mHeaderContainer.setLayoutParams((ViewGroup.LayoutParams) localObject);\n            mHeaderHeight = height;\n            isCustomHeaderHeight = true;\n        }\n    }\n\n    /**\n     * 设置HeaderView LayoutParams\n     *\n     * @param layoutParams LayoutParams\n     */\n    public void setHeaderLayoutParams(LinearLayout.LayoutParams layoutParams) {\n        if (mHeaderContainer != null) {\n            mHeaderContainer.setLayoutParams(layoutParams);\n            mHeaderHeight = layoutParams.height;\n            isCustomHeaderHeight = true;\n        }\n    }\n\n    protected void onLayout(boolean paramBoolean, int paramInt1, int paramInt2,\n                            int paramInt3, int paramInt4) {\n        super.onLayout(paramBoolean, paramInt1, paramInt2, paramInt3, paramInt4);\n        Log.d(TAG, \"onLayout --> \");\n        if (mHeaderHeight == 0 && mZoomView != null) {\n            mHeaderHeight = mHeaderContainer.getHeight();\n        }\n    }\n\n    class ScalingRunnable implements Runnable {\n        protected long mDuration;\n        protected boolean mIsFinished = true;\n        protected float mScale;\n        protected long mStartTime;\n\n        ScalingRunnable() {\n        }\n\n        public void abortAnimation() {\n            mIsFinished = true;\n        }\n\n        public boolean isFinished() {\n            return mIsFinished;\n        }\n\n        public void run() {\n            if (mZoomView != null) {\n                float f2;\n                ViewGroup.LayoutParams localLayoutParams;\n                if ((!mIsFinished) && (mScale > 1.0D)) {\n                    float f1 = ((float) SystemClock.currentThreadTimeMillis() - (float) mStartTime) / (float) mDuration;\n                    f2 = mScale - (mScale - 1.0F) * PullToZoomScrollViewEx.sInterpolator.getInterpolation(f1);\n                    localLayoutParams = mHeaderContainer.getLayoutParams();\n                    Log.d(TAG, \"ScalingRunnable --> f2 = \" + f2);\n                    if (f2 > 1.0F) {\n                        localLayoutParams.height = ((int) (f2 * mHeaderHeight));\n                        mHeaderContainer.setLayoutParams(localLayoutParams);\n                        if (isCustomHeaderHeight) {\n                            ViewGroup.LayoutParams zoomLayoutParams;\n                            zoomLayoutParams = mZoomView.getLayoutParams();\n                            zoomLayoutParams.height = ((int) (f2 * mHeaderHeight));\n                            mZoomView.setLayoutParams(zoomLayoutParams);\n                        }\n                        post(this);\n                        return;\n                    }\n                    mIsFinished = true;\n                }\n            }\n        }\n\n        public void startAnimation(long paramLong) {\n            if (mZoomView != null) {\n                mStartTime = SystemClock.currentThreadTimeMillis();\n                mDuration = paramLong;\n                mScale = ((float) (mHeaderContainer.getBottom()) / mHeaderHeight);\n                mIsFinished = false;\n                post(this);\n            }\n        }\n    }\n\n    protected class InternalScrollView extends ScrollView {\n        private OnScrollViewChangedListener onScrollViewChangedListener;\n\n        public InternalScrollView(Context context) {\n            this(context, null);\n        }\n\n        public InternalScrollView(Context context, AttributeSet attrs) {\n            super(context, attrs);\n        }\n\n        public void setOnScrollViewChangedListener(OnScrollViewChangedListener onScrollViewChangedListener) {\n            this.onScrollViewChangedListener = onScrollViewChangedListener;\n        }\n\n        @Override\n        protected void onScrollChanged(int l, int t, int oldl, int oldt) {\n            super.onScrollChanged(l, t, oldl, oldt);\n            if (onScrollViewChangedListener != null) {\n                onScrollViewChangedListener.onInternalScrollChanged(l, t, oldl, oldt);\n            }\n        }\n    }\n\n    protected interface OnScrollViewChangedListener {\n        public void onInternalScrollChanged(int left, int top, int oldLeft, int oldTop);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/refreshload/MetaballView.java",
    "content": "package com.hankkin.compustrading.view.refreshload;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.graphics.Path;\nimport android.graphics.RectF;\nimport android.util.AttributeSet;\nimport android.view.View;\nimport android.view.animation.AccelerateDecelerateInterpolator;\nimport android.view.animation.Animation;\nimport android.view.animation.Transformation;\n\nimport com.hankkin.compustrading.R;\n\nimport java.util.ArrayList;\n\n/**\n * Created by rxp on 15/10/23.\n */\npublic class MetaballView extends View {\n\n    private Paint paint = new Paint();\n    private float handle_len_rate = 2f;\n    private float radius = 30;\n    private final int ITEM_COUNT = 6;\n    private final int ITEM_DIVIDER = 60;\n    private final float SCALE_RATE = 0.3f;\n    private float maxLength;\n    private ArrayList<Circle> circlePaths = new ArrayList<>();\n    private float mInterpolatedTime;\n    private MoveAnimation wa;\n    private Circle circle;\n\n    public MetaballView(Context context) {\n        super(context);\n        init();\n    }\n\n    public MetaballView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        init();\n    }\n\n    public MetaballView(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        init();\n\n    }\n\n    private class Circle {\n        float[] center;\n        float radius;\n    }\n\n    public void setPaintMode(int mode) {\n        paint.setStyle(mode == 0 ? Paint.Style.STROKE : Paint.Style.FILL);\n        invalidate();\n    }\n\n    private void init() {\n        paint.setColor(getResources().getColor(R.color.theme_color));\n//        paint.setColor(0xff4db9ff);\n\n        paint.setStyle(Paint.Style.FILL);\n        paint.setAntiAlias(true);\n        Circle circlePath = new Circle();\n        circlePath.center = new float[]{(radius + ITEM_DIVIDER), radius * (1f + SCALE_RATE)};\n        circlePath.radius = radius / 4 * 3;\n        circlePaths.add(circlePath);\n\n        for (int i = 1; i < ITEM_COUNT; i++) {\n            circlePath = new Circle();\n            circlePath.center = new float[]{(radius * 2 + ITEM_DIVIDER) * i, radius * (1f + SCALE_RATE)};\n            circlePath.radius = radius;\n            circlePaths.add(circlePath);\n        }\n        maxLength = (radius * 2 + ITEM_DIVIDER) * ITEM_COUNT;\n    }\n\n    private float[] getVector(float radians, float length) {\n        float x = (float) (Math.cos(radians) * length);\n        float y = (float) (Math.sin(radians) * length);\n        return new float[]{\n                x, y\n        };\n    }\n\n    private class MoveAnimation extends Animation {\n\n        @Override\n        protected void applyTransformation(float interpolatedTime, Transformation t) {\n            super.applyTransformation(interpolatedTime, t);\n            mInterpolatedTime = interpolatedTime;\n            invalidate();\n        }\n    }\n\n    /**\n     * @param canvas          画布\n     * @param j\n     * @param i\n     * @param v               控制两个圆连接时候长度，间接控制连接线的粗细，该值为1的时候连接线为直线\n     * @param handle_len_rate\n     * @param maxDistance\n     */\n    private void metaball(Canvas canvas, int j, int i, float v, float handle_len_rate, float maxDistance) {\n        final Circle circle1 = circlePaths.get(i);\n        final Circle circle2 = circlePaths.get(j);\n\n        RectF ball1 = new RectF();\n        ball1.left = circle1.center[0] - circle1.radius;\n        ball1.top = circle1.center[1] - circle1.radius;\n        ball1.right = ball1.left + circle1.radius * 2;\n        ball1.bottom = ball1.top + circle1.radius * 2;\n\n        RectF ball2 = new RectF();\n        ball2.left = circle2.center[0] - circle2.radius;\n        ball2.top = circle2.center[1] - circle2.radius;\n        ball2.right = ball2.left + circle2.radius * 2;\n        ball2.bottom = ball2.top + circle2.radius * 2;\n\n        float[] center1 = new float[]{\n                ball1.centerX(),\n                ball1.centerY()\n        };\n        float[] center2 = new float[]{\n                ball2.centerX(),\n                ball2.centerY()\n        };\n        float d = getDistance(center1, center2);\n\n        float radius1 = ball1.width() / 2;\n        float radius2 = ball2.width() / 2;\n        float pi2 = (float) (Math.PI / 2);\n        float u1, u2;\n\n\n        if (d > maxDistance) {\n//            canvas.drawCircle(ball1.centerX(), ball1.centerY(), circle1.radius, paint);\n            canvas.drawCircle(ball2.centerX(), ball2.centerY(), circle2.radius, paint);\n        } else {\n            float scale2 = 1 + SCALE_RATE * (1 - d / maxDistance);\n            float scale1 = 1 - SCALE_RATE * (1 - d / maxDistance);\n            radius2 *= scale2;\n//            radius1 *= scale1;\n//            canvas.drawCircle(ball1.centerX(), ball1.centerY(), radius1, paint);\n            canvas.drawCircle(ball2.centerX(), ball2.centerY(), radius2, paint);\n\n        }\n\n//        Log.d(\"Metaball_radius\", \"radius1:\" + radius1 + \",radius2:\" + radius2);\n        if (radius1 == 0 || radius2 == 0) {\n            return;\n        }\n\n        if (d > maxDistance || d <= Math.abs(radius1 - radius2)) {\n            return;\n        } else if (d < radius1 + radius2) {\n            u1 = (float) Math.acos((radius1 * radius1 + d * d - radius2 * radius2) /\n                    (2 * radius1 * d));\n            u2 = (float) Math.acos((radius2 * radius2 + d * d - radius1 * radius1) /\n                    (2 * radius2 * d));\n        } else {\n            u1 = 0;\n            u2 = 0;\n        }\n//        Log.d(\"Metaball\", \"center2:\" + Arrays.toString(center2) + \",center1:\" + Arrays.toString(center1));\n        float[] centermin = new float[]{center2[0] - center1[0], center2[1] - center1[1]};\n\n        float angle1 = (float) Math.atan2(centermin[1], centermin[0]);\n        float angle2 = (float) Math.acos((radius1 - radius2) / d);\n        float angle1a = angle1 + u1 + (angle2 - u1) * v;\n        float angle1b = angle1 - u1 - (angle2 - u1) * v;\n        float angle2a = (float) (angle1 + Math.PI - u2 - (Math.PI - u2 - angle2) * v);\n        float angle2b = (float) (angle1 - Math.PI + u2 + (Math.PI - u2 - angle2) * v);\n\n//        Log.d(\"Metaball\", \"angle1:\" + angle1 + \",angle2:\" + angle2 + \",angle1a:\" + angle1a + \",angle1b:\" + angle1b + \",angle2a:\" + angle2a + \",angle2b:\" + angle2b);\n\n\n        float[] p1a1 = getVector(angle1a, radius1);\n        float[] p1b1 = getVector(angle1b, radius1);\n        float[] p2a1 = getVector(angle2a, radius2);\n        float[] p2b1 = getVector(angle2b, radius2);\n\n        float[] p1a = new float[]{p1a1[0] + center1[0], p1a1[1] + center1[1]};\n        float[] p1b = new float[]{p1b1[0] + center1[0], p1b1[1] + center1[1]};\n        float[] p2a = new float[]{p2a1[0] + center2[0], p2a1[1] + center2[1]};\n        float[] p2b = new float[]{p2b1[0] + center2[0], p2b1[1] + center2[1]};\n\n\n//        Log.d(\"Metaball\", \"p1a:\" + Arrays.toString(p1a) + \",p1b:\" + Arrays.toString(p1b) + \",p2a:\" + Arrays.toString(p2a) + \",p2b:\" + Arrays.toString(p2b));\n\n        float[] p1_p2 = new float[]{p1a[0] - p2a[0], p1a[1] - p2a[1]};\n\n        float totalRadius = (radius1 + radius2);\n        float d2 = Math.min(v * handle_len_rate, getLength(p1_p2) / totalRadius);\n        d2 *= Math.min(1, d * 2 / (radius1 + radius2));\n//        Log.d(\"Metaball\", \"d2:\" + d2);\n        radius1 *= d2;\n        radius2 *= d2;\n\n        float[] sp1 = getVector(angle1a - pi2, radius1);\n        float[] sp2 = getVector(angle2a + pi2, radius2);\n        float[] sp3 = getVector(angle2b - pi2, radius2);\n        float[] sp4 = getVector(angle1b + pi2, radius1);\n//        Log.d(\"Metaball\", \"sp1:\" + Arrays.toString(sp1) + \",sp2:\" + Arrays.toString(sp2) + \",sp3:\" + Arrays.toString(sp3) + \",sp4:\" + Arrays.toString(sp4));\n\n\n        Path path1 = new Path();\n        path1.moveTo(p1a[0], p1a[1]);\n        path1.cubicTo(p1a[0] + sp1[0], p1a[1] + sp1[1], p2a[0] + sp2[0], p2a[1] + sp2[1], p2a[0], p2a[1]);\n        path1.lineTo(p2b[0], p2b[1]);\n        path1.cubicTo(p2b[0] + sp3[0], p2b[1] + sp3[1], p1b[0] + sp4[0], p1b[1] + sp4[1], p1b[0], p1b[1]);\n        path1.lineTo(p1a[0], p1a[1]);\n        path1.close();\n        canvas.drawPath(path1, paint);\n\n    }\n\n    private float getLength(float[] b) {\n        return (float) Math.sqrt(b[0] * b[0] + b[1] * b[1]);\n    }\n\n    private float getDistance(float[] b1, float[] b2) {\n        float x = b1[0] - b2[0];\n        float y = b1[1] - b2[1];\n        float d = x * x + y * y;\n        return (float) Math.sqrt(d);\n    }\n\n\n    //测试用\n//    @Override\n//    public boolean onTouchEvent(MotionEvent event) {\n//        switch (event.getAction()) {\n//            case MotionEvent.ACTION_DOWN:\n//                break;\n//            case MotionEvent.ACTION_MOVE:\n//                Circle circle = circlePaths.get(0);\n//                circle.center[0] = event.getX();\n//                circle.center[1] = event.getY();\n//                invalidate();\n//                break;\n//            case MotionEvent.ACTION_UP:\n//                break;\n//        }\n//\n//        return true;\n//    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        super.onDraw(canvas);\n        circle = circlePaths.get(0);\n        circle.center[0] = maxLength * mInterpolatedTime;\n\n        RectF ball1 = new RectF();\n        ball1.left = circle.center[0] - circle.radius;\n        ball1.top = circle.center[1] - circle.radius;\n        ball1.right = ball1.left + circle.radius * 2;\n        ball1.bottom = ball1.top + circle.radius * 2;\n        canvas.drawCircle(ball1.centerX(), ball1.centerY(), circle.radius, paint);\n\n\n        for (int i = 1, l = circlePaths.size(); i < l; i++) {\n            metaball(canvas, i, 0, 0.6f, handle_len_rate, radius * 4f);\n        }\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        setMeasuredDimension(resolveSizeAndState((int) (ITEM_COUNT * (radius * 2 + ITEM_DIVIDER)), widthMeasureSpec, 0),\n                resolveSizeAndState((int) (2 * radius * 1.4f), heightMeasureSpec, 0));\n    }\n\n\n    private void stopAnimation() {\n        this.clearAnimation();\n        postInvalidate();\n    }\n\n    private void startAnimation() {\n        wa = new MoveAnimation();\n        wa.setDuration(2500);\n        wa.setInterpolator(new AccelerateDecelerateInterpolator());\n        wa.setRepeatCount(Animation.INFINITE);\n        wa.setRepeatMode(Animation.REVERSE);\n        startAnimation(wa);\n    }\n\n    @Override\n    protected void onVisibilityChanged(View changedView, int visibility) {\n        super.onVisibilityChanged(changedView, visibility);\n\n        if (visibility == GONE || visibility == INVISIBLE) {\n            stopAnimation();\n        } else {\n            startAnimation();\n        }\n    }\n\n    @Override\n    protected void onAttachedToWindow() {\n        super.onAttachedToWindow();\n        startAnimation();\n    }\n\n    @Override\n    protected void onDetachedFromWindow() {\n        stopAnimation();\n        super.onDetachedFromWindow();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/refreshload/RefreshLayout.java",
    "content": "package com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.support.v4.widget.SwipeRefreshLayout;\nimport android.util.AttributeSet;\nimport android.view.Gravity;\nimport android.view.MotionEvent;\nimport android.widget.LinearLayout;\nimport android.widget.ListView;\n\nimport com.hankkin.compustrading.view.refreshload.MetaballView;\n\npublic class RefreshLayout extends SwipeRefreshLayout {\n\n    private final int mTouchSlop;\n    private ListView mListView;\n    private OnLoadListener mOnLoadListener;\n\n    private float firstTouchY;\n    private float lastTouchY;\n\n    private boolean isLoading = false;\n\n    private MetaballView footerView;\n    private LinearLayout footerHolder;\n    public RefreshLayout(Context context) {\n        this(context, null);\n    }\n\n    public RefreshLayout(Context context, AttributeSet attrs) {\n        super(context, attrs);\n//        mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();\n        mTouchSlop = 200;\n        footerView = new MetaballView(context,attrs);\n//        footerView.setPaintMode(0);\n        footerHolder = new LinearLayout(context);\n        footerHolder.setGravity(Gravity.CENTER);\n        footerHolder.addView(footerView);\n\n\n        footerView.setVisibility(GONE);\n\n    }\n\n    //set the child view of RefreshLayout,ListView\n    public void setChildView(ListView mListView) {\n        this.mListView = mListView;\n\n        mListView.addFooterView(footerHolder);\n    }\n\n    @Override\n    public boolean dispatchTouchEvent(MotionEvent event) {\n        final int action = event.getAction();\n        switch (action) {\n            case MotionEvent.ACTION_DOWN:\n                firstTouchY = event.getRawY();\n                break;\n\n            case MotionEvent.ACTION_UP:\n                lastTouchY = event.getRawY();\n                if (canLoadMore()) {\n                    loadData();\n                }\n\n\n//                Log.d(\"movvvvvvve\", firstTouchY - lastTouchY + \"\");\n//\n//                Log.d(\"movvve\",mTouchSlop +\"\");\n                break;\n            default:\n                break;\n        }\n\n        return super.dispatchTouchEvent(event);\n    }\n\n    private boolean canLoadMore() {\n        return isBottom() && !isLoading && isPullingUp();\n    }\n\n    private boolean isBottom() {\n        if (mListView.getCount() > 0) {\n            if (mListView.getLastVisiblePosition() == mListView.getAdapter().getCount() - 1 &&\n                    mListView.getChildAt(mListView.getChildCount() - 1).getBottom() <= mListView.getHeight()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private boolean isPullingUp() {\n        return (firstTouchY - lastTouchY) >= mTouchSlop;\n    }\n\n    private void loadData() {\n        if (mOnLoadListener != null) {\n            setLoading(true);\n        }\n    }\n\n    public void setLoading(boolean loading) {\n        if (mListView == null) return;\n        isLoading = loading;\n        if (loading) {\n            if (isRefreshing()) {\n                setRefreshing(false);\n            }\n\n            footerView.setVisibility(VISIBLE);\n\n            mListView.setSelection(mListView.getAdapter().getCount() - 1);\n            mOnLoadListener.onLoad();\n        } else {\n            footerView.setVisibility(GONE);\n            firstTouchY = 0;\n            lastTouchY = 0;\n        }\n    }\n\n\n\n    public void setOnLoadListener(OnLoadListener loadListener) {\n        mOnLoadListener = loadListener;\n    }\n\n    public interface OnLoadListener {\n        public void onLoad();\n    }\n}"
  },
  {
    "path": "app/src/main/res/anim/anim.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:interpolator=\"@android:anim/accelerate_interpolator\"\n    android:shareInterpolator=\"true\">\n    <alpha\n        android:duration=\"150\"\n        android:fromAlpha=\"0.0\"\n        android:toAlpha=\"1.0\" />\n</set>"
  },
  {
    "path": "app/src/main/res/anim/list_anim.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layoutAnimation xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:delay=\"2\"\n    android:animationOrder=\"normal\"\n    android:animation=\"@anim/anim\"/>"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_cancel_bg_focused.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <corners android:radius=\"6dp\" />\n    <stroke android:color=\"#ff7900\" android:width=\"3dp\" />\n    <gradient android:startColor=\"#dcdcdc\" android:endColor=\"#fbfbfb\" android:angle=\"90\"/>\n</shape>\n"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_cancel_bg_normal.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"rectangle\">\n    <corners android:radius=\"6dp\" />\n    <stroke android:color=\"#bababa\" android:width=\"1dp\" />\n    <gradient android:startColor=\"#dcdcdc\" android:endColor=\"#fbfbfb\" android:angle=\"90\"/>\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_cancel_bg_selector.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=\"false\"\n        android:state_focused=\"false\"\n        android:drawable=\"@drawable/bmob_update_button_cancel_bg_normal\" />\n    <item android:state_pressed=\"true\"\n        android:drawable=\"@drawable/bmob_update_button_cancel_bg_tap\" />\n\t<item android:state_focused=\"true\"\n\t    android:drawable=\"@drawable/bmob_update_button_cancel_bg_focused\" />\n</selector>\n"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_cancel_bg_tap.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"rectangle\">\n    <corners android:radius=\"6dp\" />\n    <stroke android:color=\"#bababa\" android:width=\"1dp\" />\n    <solid  android:color=\"#ededed\"/>\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_check_selector.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item android:state_checked=\"true\" android:state_window_focused=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/bmob_update_btn_check_on_holo_light\" />\n    <item android:state_checked=\"false\" android:state_window_focused=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/bmob_update_btn_check_off_holo_light\" />\n\n    <item android:state_checked=\"true\" android:state_pressed=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/bmob_update_btn_check_on_pressed_holo_light\" />\n    <item android:state_checked=\"false\" android:state_pressed=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/bmob_update_btn_check_off_pressed_holo_light\" />\n\n    <item android:state_checked=\"true\" android:state_focused=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/bmob_update_btn_check_on_focused_holo_light\" />\n    <item android:state_checked=\"false\" android:state_focused=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/bmob_update_btn_check_off_focused_holo_light\" />\n\n    <item android:state_checked=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/bmob_update_btn_check_off_holo_light\" />\n    <item android:state_checked=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/bmob_update_btn_check_on_holo_light\" />\n</selector>\n"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_close_bg_selector.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\t<item android:state_pressed=\"false\"\n\t\t  android:state_focused=\"false\"\n\t\t  android:drawable=\"@drawable/bmob_update_close_bg_normal\" />\n\t<item android:state_pressed=\"true\"\n\t\t  android:drawable=\"@drawable/bmob_update_close_bg_tap\" />\n\t<item android:state_focused=\"true\"\n\t\t  android:drawable=\"@drawable/bmob_update_close_bg_tap\" />\n</selector>\n"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_ok_bg_focused.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <corners android:radius=\"6dp\" />\n    <stroke android:color=\"#ff7900\" android:width=\"3dp\" />\n    <gradient android:startColor=\"#079fff\" android:endColor=\"#6bc9ff\" android:angle=\"90\"/>\n</shape>\n"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_ok_bg_normal.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"rectangle\">\n    <corners android:radius=\"6dp\" />\n    <stroke android:color=\"#2097e3\" android:width=\"1dp\" />\n    <gradient android:startColor=\"#079fff\" android:endColor=\"#6bc9ff\" android:angle=\"90\"/>\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_ok_bg_selector.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=\"false\"\n        android:state_focused=\"false\"\n        android:drawable=\"@drawable/bmob_update_button_ok_bg_normal\" />\n    <item android:state_pressed=\"true\"\n        android:drawable=\"@drawable/bmob_update_button_ok_bg_tap\" />\n    <item android:state_focused=\"true\"\n        android:drawable=\"@drawable/bmob_update_button_ok_bg_focused\" />\n</selector>\n"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_ok_bg_tap.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"rectangle\">\n    <corners android:radius=\"6dp\" />\n    <stroke android:color=\"#2097e3\" android:width=\"1dp\" />\n    <solid  android:color=\"#128cf3\"/>\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_dialog_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"rectangle\">\n    <corners android:radius=\"8dp\" />\n    <solid  android:color=\"#FFFFFF\"/>\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/btn_login_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\">\n    <!-- 填充的颜色：这里设置背景透明 -->\n    <solid android:color=\"@color/theme_color\" />\n    <!-- 边框的颜色 ：不能和窗口背景色一样-->\n    <stroke\n        android:width=\"1dp\"\n        android:color=\"@color/theme_color\" />\n    <!-- 设置按钮的四个角为弧形 -->\n    <!-- android:radius 弧形的半径 -->\n    <corners android:radius=\"5dip\" />\n\n    <!-- padding：Button里面的文字与Button边界的间隔 -->\n\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/fab_label_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <solid android:color=\"@color/black_semi_transparent\"/>\n    <padding\n        android:left=\"16dp\"\n        android:top=\"4dp\"\n        android:right=\"16dp\"\n        android:bottom=\"4dp\"/>\n    <corners\n        android:radius=\"2dp\"/>\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/login_et_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\">\n    <!-- 填充的颜色：这里设置背景透明 -->\n    <solid android:color=\"@color/light_white\" />\n    <!-- 边框的颜色 ：不能和窗口背景色一样-->\n    <stroke\n        android:width=\"1dp\"\n        android:color=\"@color/light_white\" />\n    <!-- 设置按钮的四个角为弧形 -->\n    <!-- android:radius 弧形的半径 -->\n    <corners android:radius=\"5dip\" />\n\n    <!-- padding：Button里面的文字与Button边界的间隔 -->\n\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/normal_white_bg.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:shape=\"rectangle\">\n    <!-- 填充的颜色：这里设置背景透明 -->\n    <solid android:color=\"@color/white\" />\n    <!-- 边框的颜色 ：不能和窗口背景色一样-->\n    <stroke\n        android:width=\"1dp\"\n        android:color=\"@color/white\" />\n    <!-- 设置按钮的四个角为弧形 -->\n    <!-- android:radius 弧形的半径 -->\n    <corners android:radius=\"3dip\" />\n\n    <!-- padding：Button里面的文字与Button边界的间隔 -->\n\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/shadow.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\n    <gradient\n        android:endColor=\"#44000000\"\n        android:centerColor=\"#11000000\"\n        android:startColor=\"#00000000\" />\n\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/tab_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" android:exitFadeDuration=\"@android:integer/config_shortAnimTime\">\n    <item android:state_pressed=\"true\" android:drawable=\"@color/transparent\" />\n    <item android:state_focused=\"true\" android:drawable=\"@color/transparent\"/>\n    <item android:drawable=\"@android:color/transparent\"/>\n</selector>"
  },
  {
    "path": "app/src/main/res/layout/activity_login.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    xmlns:wheel=\"http://schemas.android.com/apk/res-auto\"\n    android:orientation=\"vertical\"\n    android:background=\"@color/gray\"\n    tools:context=\"com.hankkin.compustrading.activity.LoginActivity\">\n\n    <RelativeLayout\n        android:id=\"@+id/rl_title\"\n        android:background=\"@color/theme_color\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"50dp\">\n        <TextView\n            android:id=\"@+id/tv_back\"\n            android:gravity=\"center_vertical\"\n            android:textColor=\"@color/white\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:layout_centerVertical=\"true\"\n            android:text=\"@string/back\"\n            android:drawableLeft=\"@drawable/back\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n        <TextView\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:textColor=\"@color/white\"\n            style=\"@style/NewProText\"\n            android:layout_centerInParent=\"true\"\n            android:text=\"@string/login\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n        <TextView\n            android:layout_marginRight=\"@dimen/middle_space\"\n            android:layout_alignParentRight=\"true\"\n            android:id=\"@+id/tv_register\"\n            android:gravity=\"center_vertical\"\n            android:textColor=\"@color/white\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:layout_centerVertical=\"true\"\n            android:text=\"@string/register\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n    </RelativeLayout>\n    <android.support.design.widget.TextInputLayout\n        android:id=\"@+id/tl_name\"\n        android:layout_below=\"@+id/rl_title\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n        <EditText\n            android:id=\"@+id/et_login_name\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/hint_user\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:hint=\"@string/hint_username\" />\n    </android.support.design.widget.TextInputLayout>\n\n    <android.support.design.widget.TextInputLayout\n        android:id=\"@+id/tl_pwd\"\n        android:layout_below=\"@+id/tl_name\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n        <EditText\n            android:id=\"@+id/et_login_pwd\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/pwd_hint\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:hint=\"@string/et_pwd_hint\" />\n    </android.support.design.widget.TextInputLayout>\n\n    <Button\n        android:layout_below=\"@+id/tl_pwd\"\n        android:id=\"@+id/btn_login\"\n        android:background=\"@drawable/btn_login_background\"\n        android:textSize=\"@dimen/normal_textSize\"\n        android:textColor=\"@color/white\"\n        android:text=\"@string/login\"\n        android:layout_margin=\"@dimen/middle_space\"\n        android:padding=\"@dimen/middle_space\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\" />\n    <com.pnikosis.materialishprogress.ProgressWheel\n        android:id=\"@+id/pw_loading\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_centerVertical=\"true\"\n        wheel:matProg_barColor=\"@color/theme_color\"\n        wheel:matProg_progressIndeterminate=\"true\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"80dp\" />\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.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=\"match_parent\"\n    android:orientation=\"vertical\"\n    android:gravity=\"center\"\n    android:background=\"@color/white\"\n     tools:context=\".MainActivity\">\n\n\n\n    <TextView\n        android:textColor=\"@color/white\"\n        android:textSize=\"@dimen/superBig_textSize\"\n        android:text=\"@string/main_title\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" />\n    <TextView\n        android:layout_marginTop=\"@dimen/middle_space\"\n        android:textColor=\"@color/white\"\n        android:textSize=\"@dimen/big_textSize\"\n        android:text=\"@string/main_title_fu\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" />\n\n    <LinearLayout\n        android:layout_marginTop=\"@dimen/biger_space\"\n        android:background=\"@drawable/login_et_background\"\n        android:orientation=\"vertical\"\n        android:layout_width=\"280dp\"\n        android:layout_height=\"100dp\">\n\n        <EditText\n            android:paddingLeft=\"@dimen/small_space\"\n            android:layout_weight=\"1\"\n            android:background=\"@null\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/login\"\n            android:hint=\"@string/et_tel_hint\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\" />\n\n        <TextView\n            android:layout_gravity=\"center_vertical\"\n            android:background=\"@color/white\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"1dp\" />\n\n        <EditText\n            android:paddingLeft=\"@dimen/small_space\"\n            android:background=\"@null\"\n            android:layout_weight=\"1\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/pwd\"\n            android:hint=\"@string/et_pwd_hint\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\" />\n    </LinearLayout>\n\n\n    <LinearLayout\n        android:layout_marginTop=\"@dimen/biger_space\"\n        android:background=\"@drawable/btn_login_background\"\n        android:layout_gravity=\"center\"\n        android:gravity=\"center\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"280dp\"\n        android:layout_height=\"wrap_content\">\n\n\n        <Button\n            android:onClick=\"btnLoginClick\"\n            android:background=\"@color/transparent\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:textColor=\"@color/white\"\n            android:id=\"@+id/btn_login\"\n            android:text=\"@string/login\"\n            android:layout_weight=\"1\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\" />\n\n        <TextView\n            android:background=\"@color/light_white\"\n            android:layout_width=\"1dp\"\n            android:layout_height=\"match_parent\" />\n\n        <Button\n            android:layout_weight=\"1\"\n            android:background=\"@color/transparent\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:textColor=\"@color/white\"\n            android:id=\"@+id/btn_register\"\n            android:text=\"@string/register\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\" />\n\n    </LinearLayout>\n\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main_show.xml",
    "content": "<android.support.v4.widget.DrawerLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    xmlns:ripple=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/drawerlayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/gray\"\n    xmlns:fab=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    tools:context=\"com.hankkin.myapplication.activity.MainShowActivity\">\n\n\n\n\n<RelativeLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n    <com.hankkin.compustrading.view.PagerSlidingTabStrip\n        android:layout_below=\"@+id/rl_title\"\n        android:id=\"@+id/tab\"\n        app:pstsShouldExpand=\"false\"\n        app:pstsUnderlineHeight=\"1dp\"\n        app:pstsIndicatorHeight=\"1dp\"\n        app:pstsIndicatorColor=\"@color/theme_color\"\n        app:selectedTabTextColor=\"@color/theme_color\"\n        app:pstsDividerColor=\"@android:color/transparent\"\n        app:pstsTabBackground=\"@drawable/tab_background\"\n        android:background=\"@color/white\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\"/>\n\n    <android.support.v4.view.ViewPager\n        android:layout_below=\"@+id/tab\"\n        android:layout_marginTop=\"@dimen/small_space\"\n        android:id=\"@+id/pager\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/>\n    <com.hankkin.compustrading.view.floatbutton.FloatingActionsMenu\n        android:id=\"@+id/multiple_actions\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentRight=\"true\"\n        android:layout_alignParentEnd=\"true\"\n        fab:fab_addButtonColorNormal=\"@color/origle\"\n        fab:fab_addButtonColorPressed=\"@color/origle_tab\"\n        fab:fab_addButtonPlusIconColor=\"@color/white\"\n        fab:fab_labelStyle=\"@style/menu_labels_style\"\n        android:layout_marginBottom=\"@dimen/smaller_space\"\n        android:layout_marginRight=\"@dimen/smaller_space\"\n        android:layout_marginEnd=\"@dimen/smaller_space\">\n\n        <com.hankkin.compustrading.view.floatbutton.FloatingActionButton\n            android:id=\"@+id/fb_update\"\n            android:src=\"@drawable/update\"\n            fab:fab_labelStyle=\"@style/menu_labels_style\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            fab:fab_colorNormal=\"@color/theme_color\"\n            fab:fab_colorPressed=\"@color/theme_color_tab\"/>\n\n        <com.hankkin.compustrading.view.floatbutton.FloatingActionButton\n            android:id=\"@+id/fb_new\"\n            fab:paddingEnd=\"@dimen/small_space\"\n            android:src=\"@drawable/edit\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            fab:fab_colorNormal=\"@color/theme_color\"\n            fab:fab_colorPressed=\"@color/theme_color_tab\"/>\n        <com.hankkin.compustrading.view.floatbutton.FloatingActionButton\n            android:id=\"@+id/fb_person\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:src=\"@drawable/title_person\"\n            fab:fab_colorNormal=\"@color/theme_color\"\n            fab:fab_colorPressed=\"@color/theme_color_tab\"/>\n\n    </com.hankkin.compustrading.view.floatbutton.FloatingActionsMenu>\n\n</RelativeLayout>\n\n\n    <LinearLayout\n        android:background=\"@color/white\"\n        android:layout_gravity=\"start\"\n        android:orientation=\"vertical\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\">\n        <LinearLayout\n            android:orientation=\"vertical\"\n            android:gravity=\"center\"\n            android:background=\"@color/theme_color\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"150dp\">\n            <com.hankkin.compustrading.view.RoundedImageView\n                android:id=\"@+id/rv_usericon\"\n                android:scaleType=\"fitCenter\"\n                android:src=\"@drawable/defaut\"\n                android:layout_width=\"60dp\"\n                android:layout_height=\"60dp\" />\n            <TextView\n                android:layout_marginTop=\"@dimen/small_space\"\n                android:textColor=\"@color/white\"\n                style=\"@style/NewProText\"\n                android:id=\"@+id/tv_username\"\n                android:text=\"Hankkin\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\" />\n\n        </LinearLayout>\n\n\n        <com.hankkin.compustrading.view.RippleView\n            android:id=\"@+id/rv_logreg\"\n            ripple:rv_zoom=\"true\"\n            ripple:rv_type=\"rectangle\"\n            android:padding=\"@dimen/small_space\"\n            android:gravity=\"center_vertical\"\n            android:orientation=\"horizontal\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"80dp\">\n\n            <ImageView\n                android:layout_centerVertical=\"true\"\n                android:id=\"@+id/iv_icon\"\n                android:src=\"@drawable/login_register\"\n                android:layout_width=\"30dp\"\n                android:layout_height=\"30dp\" />\n\n            <TextView\n                android:id=\"@+id/tv_person\"\n                android:layout_centerVertical=\"true\"\n                android:layout_toRightOf=\"@+id/iv_icon\"\n                android:layout_marginLeft=\"@dimen/biger_space\"\n                android:textColor=\"@color/normal_text_color\"\n                android:textSize=\"@dimen/normal_title_btn_textSize\"\n                android:text=\"@string/login_register\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\" />\n        </com.hankkin.compustrading.view.RippleView>\n        <TextView\n            android:background=\"@color/gray\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"1dp\" />\n\n        <LinearLayout\n            android:orientation=\"vertical\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\">\n            <TextView\n                android:id=\"@+id/tv_show\"\n                android:enabled=\"false\"\n                android:gravity=\"center_vertical\"\n                android:layout_marginLeft=\"@dimen/middle_space\"\n                android:textColor=\"@color/deep_gray\"\n                android:textSize=\"@dimen/normal_title_btn_textSize\"\n                android:text=\"@string/others\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"50dp\" />\n            <com.hankkin.compustrading.view.RippleView\n                android:id=\"@+id/rv_qq\"\n                ripple:rv_zoom=\"true\"\n                ripple:rv_type=\"rectangle\"\n                android:padding=\"@dimen/small_space\"\n                android:gravity=\"center_vertical\"\n                android:orientation=\"horizontal\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"50dp\">\n\n                <ImageView\n                    android:layout_centerVertical=\"true\"\n                    android:id=\"@+id/iv_icon1\"\n                    android:src=\"@drawable/qq\"\n                    android:layout_width=\"30dp\"\n                    android:layout_height=\"30dp\" />\n\n                <TextView\n                    android:id=\"@+id/tv_qq\"\n                    android:layout_centerVertical=\"true\"\n                    android:layout_toRightOf=\"@+id/iv_icon1\"\n                    android:layout_marginLeft=\"@dimen/biger_space\"\n                    android:textColor=\"@color/normal_text_color\"\n                    android:textSize=\"@dimen/normal_title_btn_textSize\"\n                    android:text=\"@string/qq_login\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" />\n            </com.hankkin.compustrading.view.RippleView>\n\n            <com.hankkin.compustrading.view.RippleView\n                android:id=\"@+id/rv_sina\"\n                ripple:rv_zoom=\"true\"\n                ripple:rv_type=\"rectangle\"\n                android:padding=\"@dimen/small_space\"\n                android:gravity=\"center_vertical\"\n                android:orientation=\"horizontal\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"50dp\">\n\n                <ImageView\n                    android:layout_centerVertical=\"true\"\n                    android:id=\"@+id/iv_icon2\"\n                    android:src=\"@drawable/sina\"\n                    android:layout_width=\"30dp\"\n                    android:layout_height=\"30dp\" />\n\n                <TextView\n                    android:id=\"@+id/tv_sina\"\n                    android:layout_centerVertical=\"true\"\n                    android:layout_toRightOf=\"@+id/iv_icon2\"\n                    android:layout_marginLeft=\"@dimen/biger_space\"\n                    android:textColor=\"@color/normal_text_color\"\n                    android:textSize=\"@dimen/normal_title_btn_textSize\"\n                    android:text=\"@string/weibo_login\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" />\n            </com.hankkin.compustrading.view.RippleView>\n            <TextView\n                android:background=\"@color/gray\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"1dp\" />\n            <com.hankkin.compustrading.view.RippleView\n                android:id=\"@+id/rv_buy\"\n                android:visibility=\"gone\"\n                ripple:rv_zoom=\"true\"\n                ripple:rv_type=\"rectangle\"\n                android:padding=\"@dimen/small_space\"\n                android:gravity=\"center_vertical\"\n                android:orientation=\"horizontal\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"50dp\">\n\n                <ImageView\n                    android:layout_centerVertical=\"true\"\n                    android:id=\"@+id/iv_buy\"\n                    android:src=\"@drawable/buy\"\n                    android:layout_width=\"30dp\"\n                    android:layout_height=\"30dp\" />\n\n                <TextView\n                    android:id=\"@+id/tv_buy\"\n                    android:layout_centerVertical=\"true\"\n                    android:layout_toRightOf=\"@+id/iv_buy\"\n                    android:layout_marginLeft=\"@dimen/biger_space\"\n                    android:textColor=\"@color/normal_text_color\"\n                    android:textSize=\"@dimen/normal_title_btn_textSize\"\n                    android:text=\"@string/buy\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" />\n            </com.hankkin.compustrading.view.RippleView>\n            <com.hankkin.compustrading.view.RippleView\n                android:id=\"@+id/rv_sale\"\n                android:visibility=\"gone\"\n                ripple:rv_zoom=\"true\"\n                ripple:rv_type=\"rectangle\"\n                android:padding=\"@dimen/small_space\"\n                android:gravity=\"center_vertical\"\n                android:orientation=\"horizontal\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"50dp\">\n\n                <ImageView\n                    android:layout_centerVertical=\"true\"\n                    android:id=\"@+id/iv_sale\"\n                    android:src=\"@drawable/sale\"\n                    android:layout_width=\"30dp\"\n                    android:layout_height=\"30dp\" />\n\n                <TextView\n                    android:id=\"@+id/tv_sale\"\n                    android:layout_centerVertical=\"true\"\n                    android:layout_toRightOf=\"@+id/iv_sale\"\n                    android:layout_marginLeft=\"@dimen/biger_space\"\n                    android:textColor=\"@color/normal_text_color\"\n                    android:textSize=\"@dimen/normal_title_btn_textSize\"\n                    android:text=\"@string/sale\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" />\n            </com.hankkin.compustrading.view.RippleView>\n        </LinearLayout>\n\n        <TextView\n            android:layout_weight=\"1\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"1dp\" />\n        <TextView\n            android:background=\"@color/gray\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"1dp\" />\n        <com.hankkin.compustrading.view.RippleView\n            ripple:rv_zoom=\"true\"\n            ripple:rv_type=\"rectangle\"\n            android:padding=\"@dimen/small_space\"\n            android:gravity=\"center_vertical\"\n            android:orientation=\"horizontal\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\">\n\n            <ImageView\n                android:layout_centerVertical=\"true\"\n                android:id=\"@+id/iv_icon3\"\n                android:src=\"@drawable/setting\"\n                android:layout_width=\"30dp\"\n                android:layout_height=\"30dp\" />\n\n            <TextView\n                android:layout_centerVertical=\"true\"\n                android:layout_toRightOf=\"@+id/iv_icon3\"\n                android:layout_marginLeft=\"@dimen/biger_space\"\n                android:textColor=\"@color/normal_text_color\"\n                android:textSize=\"@dimen/normal_title_btn_textSize\"\n                android:text=\"@string/setting\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\" />\n        </com.hankkin.compustrading.view.RippleView>\n        <TextView\n            android:background=\"@color/gray\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"1dp\" />\n    </LinearLayout>\n\n</android.support.v4.widget.DrawerLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_new_product.xml",
    "content": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:orientation=\"vertical\"\n    android:background=\"@color/white\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\"com.hankkin.compustrading.activity.NewProductActivity\">\n\n\n    <RelativeLayout\n        android:background=\"@color/theme_color\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"50dp\">\n        <TextView\n            android:id=\"@+id/tv_back\"\n            android:gravity=\"center_vertical\"\n            android:textColor=\"@color/white\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:layout_centerVertical=\"true\"\n            android:text=\"@string/back\"\n            android:drawableLeft=\"@drawable/back\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n        <TextView\n            android:layout_centerInParent=\"true\"\n            android:textColor=\"@color/white\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:text=\"@string/new_pro\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n\n    </RelativeLayout>\n\n    <ScrollView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\">\n\n\n\n\n        <LinearLayout\n            android:orientation=\"vertical\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\">\n\n            <ImageView\n                android:layout_margin=\"@dimen/middle_space\"\n                android:layout_gravity=\"center\"\n                android:id=\"@+id/iv_add_pro\"\n                android:src=\"@drawable/add_pro\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"150dp\" />\n            <View\n                android:background=\"@color/gray\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"1dp\"/>\n            <android.support.design.widget.TextInputLayout\n                android:layout_margin=\"@dimen/small_space\"\n                android:id=\"@+id/tl_tel\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\">\n\n                <EditText\n                    android:inputType=\"number\"\n                    android:layout_marginLeft=\"@dimen/middle_space\"\n                    android:background=\"@null\"\n                    android:id=\"@+id/et_tel\"\n                    style=\"@style/NewProText\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:hint=\"@string/pro_user_tel_hint\" />\n            </android.support.design.widget.TextInputLayout>\n            <View\n                android:background=\"@color/gray\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"1dp\"/>\n            <android.support.design.widget.TextInputLayout\n                android:id=\"@+id/tl_name\"\n                android:layout_margin=\"@dimen/small_space\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\">\n\n                <EditText\n                    android:layout_marginLeft=\"@dimen/middle_space\"\n                    android:background=\"@null\"\n                    android:id=\"@+id/et_name\"\n                    style=\"@style/NewProText\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:hint=\"@string/pro_name_hint\" />\n            </android.support.design.widget.TextInputLayout>\n            <View\n                android:background=\"@color/gray\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"1dp\"/>\n            <android.support.design.widget.TextInputLayout\n                android:layout_margin=\"@dimen/middle_space\"\n                android:id=\"@+id/tl_price\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\">\n\n                <EditText\n                    android:layout_marginLeft=\"@dimen/small_space\"\n                    android:background=\"@null\"\n                    android:id=\"@+id/et_price\"\n                    style=\"@style/NewProText\"\n                    android:inputType=\"number\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:hint=\"@string/pro_price_hint\" />\n            </android.support.design.widget.TextInputLayout>\n\n            <View\n                android:background=\"@color/gray\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"1dp\"/>\n            <com.weiwangcn.betterspinner.library.BetterSpinner\n                android:background=\"@color/white\"\n                android:layout_margin=\"@dimen/middle_space\"\n                android:layout_below=\"@+id/tl_price\"\n                android:id=\"@+id/spinner_school\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginBottom=\"@dimen/activity_vertical_margin\"\n                android:hint=\"@string/pro_school_hint\" />\n            <View\n                android:background=\"@color/gray\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"1dp\"/>\n            <TextView\n                android:id=\"@+id/tv_cate\"\n                android:padding=\"@dimen/middle_space\"\n                style=\"@style/NewProText\"\n                android:layout_below=\"@+id/spinner_school\"\n                android:text=\"@string/pro_cate_hint\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\" />\n            <View\n                android:background=\"@color/gray\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"1dp\"/>\n\n            <Button\n                android:id=\"@+id/btn_fabu\"\n                android:textColor=\"@color/white\"\n                android:textSize=\"@dimen/normal_textSize\"\n                android:text=\"@string/fabu\"\n                style=\"@style/NewProText\"\n                android:layout_margin=\"@dimen/middle_space\"\n                android:background=\"@drawable/btn_login_background\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\" />\n\n        </LinearLayout>\n\n    </ScrollView>\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_person.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=\"match_parent\"\n    android:orientation=\"vertical\"\n    tools:context=\"com.hankkin.compustrading.activity.PersonActivity\">\n\n\n    <RelativeLayout\n        android:background=\"@color/theme_color\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"50dp\">\n        <TextView\n            android:clipToPadding=\"true\"\n            android:fitsSystemWindows=\"true\"\n            android:id=\"@+id/tv_back\"\n            android:gravity=\"center_vertical\"\n            android:textColor=\"@color/white\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:layout_centerVertical=\"true\"\n            android:text=\"@string/back\"\n            android:drawableLeft=\"@drawable/back\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n        <TextView\n            android:textColor=\"@color/white\"\n            style=\"@style/NewProText\"\n            android:layout_centerInParent=\"true\"\n            android:text=\"@string/personinfo\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n    </RelativeLayout>\n\n    <com.hankkin.compustrading.view.PullToZoomScrollViewEx\n\n        android:id=\"@+id/my_pull_scoll\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"fill_parent\"></com.hankkin.compustrading.view.PullToZoomScrollViewEx>\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_prodect_detail.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<android.support.design.widget.CoordinatorLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/main_content\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/theme_color\"\n    android:clipToPadding=\"true\"\n    android:fitsSystemWindows=\"true\">\n\n    <android.support.design.widget.AppBarLayout\n\n        android:id=\"@+id/appbar\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"200dp\"\n        android:theme=\"@style/ThemeOverlay.AppCompat.Dark.ActionBar\">\n\n        <android.support.design.widget.CollapsingToolbarLayout\n            android:id=\"@+id/collapsing_toolbar\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            app:contentScrim=\"@color/theme_color\"\n            app:layout_scrollFlags=\"scroll|exitUntilCollapsed\">\n\n            <android.support.v7.widget.Toolbar\n                android:id=\"@+id/toolbar\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"?attr/actionBarSize\"\n                app:layout_collapseMode=\"pin\"\n                app:popupTheme=\"@style/ThemeOverlay.AppCompat.Light\" />\n\n            <com.hankkin.compustrading.view.CollapsingAvatarToolbar\n                android:id=\"@+id/stuff_container\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"?attr/actionBarSize\"\n                android:orientation=\"vertical\">\n\n                <com.hankkin.compustrading.view.RoundedImageView\n                    android:id=\"@+id/usericon\"\n                    android:layout_width=\"40dp\"\n                    android:layout_height=\"40dp\"\n                    android:layout_gravity=\"center_vertical\"\n                    android:src=\"@drawable/defaut\" />\n\n                <TextView\n                    android:id=\"@+id/username\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_gravity=\"center_vertical\"\n                    android:fontFamily=\"sans-serif-medium\"\n                    android:text=\"Hankkin\"\n                    android:textColor=\"@android:color/white\"\n                    android:textSize=\"18dp\" />\n\n                <!--<LinearLayout android:layout_width=\"wrap_content\"-->\n                <!--android:layout_height=\"wrap_content\"-->\n                <!--android:layout_gravity=\"center_vertical\"-->\n                <!--android:layout_marginLeft=\"16dp\"-->\n                <!--android:orientation=\"vertical\">-->\n\n                <!-- -->\n\n                <!--<TextView android:id=\"@+id/subtitle\"-->\n                <!--android:layout_width=\"wrap_content\"-->\n                <!--android:layout_height=\"wrap_content\"-->\n                <!--android:text=\"Subtitle\"-->\n                <!--android:textColor=\"#80ffffff\"-->\n                <!--android:textSize=\"15dp\" />-->\n                <!--</LinearLayout>-->\n            </com.hankkin.compustrading.view.CollapsingAvatarToolbar>\n\n        </android.support.design.widget.CollapsingToolbarLayout>\n\n    </android.support.design.widget.AppBarLayout>\n\n    <android.support.v4.widget.NestedScrollView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:background=\"@color/gray\"\n        app:layout_behavior=\"@string/appbar_scrolling_view_behavior\">\n\n        <LinearLayout\n            android:padding=\"@dimen/small_space\"\n            android:orientation=\"vertical\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\">\n            <LinearLayout\n                android:gravity=\"center_vertical\"\n                android:padding=\"@dimen/small_space\"\n                android:orientation=\"horizontal\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\">\n                <com.hankkin.compustrading.view.RoundedImageView\n                    android:id=\"@+id/iv_user_head\"\n                    android:src=\"@drawable/defaut\"\n                    android:layout_width=\"35dp\"\n                    android:layout_height=\"35dp\" />\n                <TextView\n                    android:layout_marginLeft=\"@dimen/small_space\"\n                    android:textSize=\"@dimen/normal_textSize\"\n                    android:text=\"Hankkin\"\n                    android:textColor=\"@color/black\"\n                    android:layout_weight=\"1\"\n                    android:id=\"@+id/tv_username\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" />\n                <TextView\n                    android:textColor=\"@color/deep_gray\"\n                    android:textSize=\"@dimen/small_textSize\"\n                    android:text=\"asdas\"\n                    android:id=\"@+id/tv_time\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" />\n            </LinearLayout>\n\n            <TextView\n                android:layout_marginLeft=\"@dimen/small_space\"\n                android:textColor=\"@color/black\"\n                android:textSize=\"@dimen/normal_textSize\"\n                android:id=\"@+id/tv_pro_name\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"二手\" />\n\n            <TextView\n                android:layout_marginLeft=\"@dimen/small_space\"\n                android:textColor=\"@color/black\"\n                android:textSize=\"@dimen/normal_textSize\"\n                android:id=\"@+id/tv_pro_desc\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\" />\n\n            <ImageView\n                android:scaleType=\"fitXY\"\n                android:id=\"@+id/iv_product\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"300dp\"\n                android:background=\"@color/gray\" />\n            <LinearLayout\n                android:paddingBottom=\"@dimen/small_space\"\n                android:orientation=\"horizontal\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\">\n\n                <TextView\n                    android:drawablePadding=\"@dimen/tiny_space\"\n                    android:drawableLeft=\"@drawable/location\"\n                    android:textSize=\"@dimen/small_textSize\"\n                    android:layout_marginTop=\"@dimen/small_space\"\n                    android:layout_marginLeft=\"@dimen/middle_space\"\n                    android:text=\"天津理工大学\"\n                    android:id=\"@+id/tv_school\"\n                    android:layout_weight=\"1\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" />\n                <TextView\n                    android:textSize=\"@dimen/small_textSize\"\n                    android:textColor=\"@color/theme_color\"\n                    android:layout_marginRight=\"@dimen/middle_space\"\n                    android:layout_marginTop=\"@dimen/small_space\"\n                    android:text=\"￥\"\n                    android:id=\"@+id/tv_price\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\" />\n\n            </LinearLayout>\n\n            <LinearLayout\n                android:layout_marginTop=\"@dimen/middle_space\"\n                android:orientation=\"horizontal\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"64dp\">\n\n                <LinearLayout\n                    android:gravity=\"center\"\n                    android:layout_weight=\"1\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"match_parent\">\n                    <ImageView\n                        android:src=\"@drawable/telephone\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"match_parent\" />\n\n                </LinearLayout>\n                <LinearLayout\n                    android:gravity=\"center\"\n                    android:layout_weight=\"1\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"match_parent\">\n                    <ImageView\n                        android:src=\"@drawable/sms\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"match_parent\" />\n\n                </LinearLayout>\n                <LinearLayout\n                    android:gravity=\"center\"\n                    android:layout_weight=\"1\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"match_parent\">\n                    <ImageView\n                        android:src=\"@drawable/collect\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"match_parent\" />\n\n                </LinearLayout>\n\n            </LinearLayout>\n        </LinearLayout>\n\n\n\n    </android.support.v4.widget.NestedScrollView>\n\n\n</android.support.design.widget.CoordinatorLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_product_detail.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\" android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\" android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    tools:context=\"com.hankkin.compustrading.activity.ProductDetailActivity\">\n\n    <TextView android:text=\"@string/hello_world\" android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" />\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_register.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\n    xmlns:wheel=\"http://schemas.android.com/apk/res-auto\"\n    tools:context=\"com.hankkin.compustrading.activity.RegisterActivity\">\n\n\n    <RelativeLayout\n        android:id=\"@+id/rl_title\"\n        android:background=\"@color/theme_color\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"50dp\">\n        <TextView\n            android:id=\"@+id/tv_back\"\n            android:gravity=\"center_vertical\"\n            android:textColor=\"@color/white\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:layout_centerVertical=\"true\"\n            android:text=\"@string/back\"\n            android:drawableLeft=\"@drawable/back\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n        <TextView\n            android:textColor=\"@color/white\"\n            style=\"@style/NewProText\"\n            android:layout_centerInParent=\"true\"\n            android:text=\"@string/register\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n    </RelativeLayout>\n\n    <android.support.design.widget.TextInputLayout\n        android:id=\"@+id/tl_login\"\n        android:layout_below=\"@+id/rl_title\"\n        android:layout_marginTop=\"@dimen/middle_space\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n        <EditText\n            android:inputType=\"number\"\n            android:id=\"@+id/et_login_name\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/hint_user\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:hint=\"@string/hint_username\" />\n    </android.support.design.widget.TextInputLayout>\n\n\n\n    <android.support.design.widget.TextInputLayout\n        android:id=\"@+id/tl_pwd\"\n        android:layout_below=\"@+id/tl_login\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n        <EditText\n            android:id=\"@+id/et_login_pwd\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/pwd_hint\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:hint=\"@string/et_pwd_hint\" />\n\n\n    </android.support.design.widget.TextInputLayout>\n\n\n    <Button\n        android:layout_below=\"@+id/tl_pwd\"\n        android:id=\"@+id/btn_register\"\n        android:textSize=\"@dimen/normal_textSize\"\n        android:layout_margin=\"@dimen/middle_space\"\n        android:background=\"@drawable/btn_login_background\"\n        android:text=\"@string/register\"\n        android:textColor=\"@color/white\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\" />\n\n    <com.pnikosis.materialishprogress.ProgressWheel\n        android:id=\"@+id/pw_loading\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_centerVertical=\"true\"\n        wheel:matProg_barColor=\"@color/theme_color\"\n        wheel:matProg_progressIndeterminate=\"true\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"80dp\" />\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_search_pro.xml",
    "content": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\" android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\"com.hankkin.compustrading.activity.SearchProActivity\">\n\n    <RelativeLayout\n        android:background=\"@color/theme_color\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"50dp\">\n        <TextView\n            android:id=\"@+id/tv_back\"\n            android:gravity=\"center_vertical\"\n            android:textColor=\"@color/white\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:layout_centerVertical=\"true\"\n            android:text=\"@string/back\"\n            android:drawableLeft=\"@drawable/back\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n        <TextView\n            android:textColor=\"@color/white\"\n            style=\"@style/NewProText\"\n            android:text=\"@string/search_pro\"\n            android:layout_centerInParent=\"true\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n    </RelativeLayout>\n\n\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_splas.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/splash\"\n    android:clipToPadding=\"true\"\n    android:fitsSystemWindows=\"true\"\n    tools:context=\"com.hankkin.compustrading.activity.SplasActivity\">\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/bmob_update_dialog.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    android:background=\"#99232323\" >\n\n    <LinearLayout\n        android:layout_width=\"280dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:background=\"@drawable/bmob_update_dialog_bg\"\n        android:orientation=\"vertical\" >\n\n        <!-- Title -->\n\n        <RelativeLayout\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"40dp\" >\n\n            <ImageView\n                android:id=\"@+id/bmob_update_wifi_indicator\"\n                android:layout_width=\"30dp\"\n                android:layout_height=\"30dp\"\n                android:layout_centerVertical=\"true\"\n                android:layout_marginLeft=\"10dp\"\n                android:contentDescription=\"@string/BMGprsCondition\"\n                android:src=\"@drawable/bmob_update_wifi_disable\" />\n\n            <TextView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_centerInParent=\"true\"\n                android:text=\"@string/BMUpdateTitle\"\n                android:textAppearance=\"?android:attr/textAppearanceLarge\"\n                android:textColor=\"#63C2FF\" />\n            \n            <Button\n                android:id=\"@+id/bmob_update_id_close\"\n\t\t\t\tandroid:layout_width=\"wrap_content\"\n\t\t\t\tandroid:layout_height=\"wrap_content\"\n\t\t\t\tandroid:layout_alignParentRight=\"true\"\n\t\t\t\tandroid:layout_centerVertical=\"true\"\n\t\t\t\tandroid:layout_marginRight=\"10dp\"\n\t\t\t\tandroid:focusable=\"true\"\n\t\t\t\tandroid:visibility=\"gone\"\n\t\t\t\tandroid:background=\"@drawable/bmob_update_button_close_bg_selector\"/>\n            \n        </RelativeLayout>\n\n        <!-- split -->\n\n        <View\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"2dp\"\n            android:layout_marginLeft=\"10dp\"\n            android:layout_marginRight=\"10dp\"\n            android:background=\"#2AACFF\" />\n        <!-- Content -->\n\n        <ScrollView\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"0dp\"\n            android:layout_weight=\"1\"\n            android:padding=\"10dp\" >\n\n            <LinearLayout\n                android:layout_width=\"fill_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"vertical\" >\n\n                <TextView\n                    android:id=\"@+id/bmob_update_content\"\n                    android:layout_width=\"fill_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_marginLeft=\"5dp\"\n                    android:layout_marginRight=\"5dp\"\n                    android:layout_marginTop=\"10dp\"\n                    android:focusable=\"true\"\n                    android:textColor=\"#AAABAF\" />\n            </LinearLayout>\n        </ScrollView>\n        \n        <!-- Ignore CheckBox -->\n\n\t\t<CheckBox\n\t\t    android:id=\"@+id/bmob_update_id_check\"\n\t        android:layout_width=\"fill_parent\"\n\t        android:layout_height=\"32dp\"\n\t        android:visibility=\"gone\"\n\t        android:text=\"@string/BMIgnore\"\n\t        android:button=\"@drawable/bmob_update_button_check_selector\"\n\t        android:textColor=\"#AAABAF\" />\n\n        <!-- OK&Cancel Button -->\n\n        <LinearLayout\n            android:layout_width=\"fill_parent\"\n            android:layout_height=\"wrap_content\" >\n\n            <Button\n                android:id=\"@+id/bmob_update_id_ok\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                android:layout_margin=\"5dp\"\n                android:layout_weight=\"1\"\n                android:background=\"@drawable/bmob_update_button_ok_bg_selector\"\n                android:gravity=\"center\"\n                android:padding=\"12dp\"\n                android:text=\"@string/BMUpdateNow\"\n\t\t\t\tandroid:focusable=\"true\"\n                android:textColor=\"#FFFFFF\" />\n\n            <Button\n                android:id=\"@+id/bmob_update_id_cancel\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                android:layout_margin=\"5dp\"\n                android:layout_weight=\"1\"\n                android:background=\"@drawable/bmob_update_button_cancel_bg_selector\"\n                android:gravity=\"center\"\n                android:padding=\"12dp\"\n                android:text=\"@string/BMNotNow\"\n\t\t\t\tandroid:focusable=\"true\"\n                android:textColor=\"#AAABAF\" />\n\n            <Button\n                android:id=\"@+id/bmob_update_id_ignore\"\n\t\t\t\tandroid:visibility=\"gone\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                android:layout_margin=\"5dp\"\n                android:layout_weight=\"1\"\n                android:background=\"@drawable/bmob_update_button_cancel_bg_selector\"\n                android:gravity=\"center\"\n                android:padding=\"12dp\"\n                android:text=\"@string/BMIgnore\"\n\t\t\t\tandroid:focusable=\"true\"\n                android:textColor=\"#AAABAF\" />\n        </LinearLayout>\n    </LinearLayout>\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/fragment_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.hankkin.compustrading.view.RefreshLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/swipeRefreshLayout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n\n    <ListView\n        android:layoutAnimation=\"@anim/list_anim\"\n        android:id=\"@+id/lv_product\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:footerDividersEnabled=\"false\" />\n\n</com.hankkin.compustrading.view.RefreshLayout>"
  },
  {
    "path": "app/src/main/res/layout/listview_footer.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"@color/light_white\"\n    android:gravity=\"center\"\n    android:paddingBottom=\"8dip\"\n    android:paddingTop=\"5dip\" >\n\n    <ProgressBar\n        android:id=\"@+id/pull_to_refresh_load_progress\"\n        style=\"@android:style/Widget.ProgressBar.Small.Inverse\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerVertical=\"true\"\n        android:layout_centerHorizontal=\"true\"\n        android:paddingRight=\"100dp\"\n        android:indeterminate=\"true\" />\n\n    <TextView\n        android:id=\"@+id/pull_to_refresh_loadmore_text\"\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\n        android:gravity=\"center\"\n        android:paddingTop=\"5dip\"\n        android:text=\"@string/load\"\n        android:textAppearance=\"?android:attr/textAppearanceMedium\"\n        android:textColor=\"@android:color/darker_gray\"\n        android:textSize=\"14sp\"\n        android:textStyle=\"bold\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/listview_personinfo.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:ripple=\"http://schemas.android.com/tools\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <com.hankkin.compustrading.view.RippleView\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"50dp\">\n\n\n        <TextView\n            android:id=\"@+id/tv_title\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"@dimen/small_space\"\n            android:textColor=\"@color/normal_text_color\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:text=\"@string/weibo_login\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n        <TextView\n            android:layout_marginRight=\"@dimen/small_space\"\n            android:id=\"@+id/tv_content\"\n            android:layout_centerVertical=\"true\"\n            android:layout_toLeftOf=\"@+id/iv_right\"\n            android:layout_marginLeft=\"@dimen/biger_space\"\n            android:textColor=\"@color/normal_text_color\"\n            android:textSize=\"@dimen/normal_title_btn_textSize\"\n            android:text=\"@string/weibo_login\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n        <ImageView\n            android:id=\"@+id/iv_right\"\n            android:src=\"@drawable/right\"\n            android:layout_centerVertical=\"true\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/loading.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:wheel=\"http://schemas.android.com/apk/res-auto\"\n    android:orientation=\"vertical\"\n    android:gravity=\"center\"\n    android:id=\"@+id/ll_loading\"\n    android:background=\"@color/transparent\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n    <com.pnikosis.materialishprogress.ProgressWheel\n        android:id=\"@+id/pw_loading\"\n        android:background=\"@color/transparent\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_centerVertical=\"true\"\n        wheel:matProg_barColor=\"@color/theme_color\"\n        wheel:matProg_progressIndeterminate=\"true\"\n        wheel:matProg_rimColor=\"@color/gray\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"80dp\" />\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/lv_product_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n\n    <LinearLayout\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n        <com.hankkin.compustrading.view.RoundedImageView\n            android:id=\"@+id/riv_usericon\"\n            android:layout_width=\"40dp\"\n            android:layout_height=\"40dp\"\n            android:src=\"@drawable/defaut\"/>\n        <TextView\n            style=\"@style/NewProText\"\n            android:layout_marginLeft=\"@dimen/middle_space\"\n            android:text=\"黄\"\n            android:id=\"@+id/tv_name\"\n            android:layout_weight=\"1\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n        <TextView\n            android:id=\"@+id/tv_pub_time\"\n            android:text=\"2015\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n    </LinearLayout>\n    <LinearLayout\n        android:paddingRight=\"@dimen/small_space\"\n        android:paddingBottom=\"@dimen/small_space\"\n        android:paddingLeft=\"@dimen/small_space\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n\n        <ImageView\n            android:scaleType=\"fitXY\"\n            android:id=\"@+id/iv_product\"\n            android:background=\"@color/gray\"\n            android:layout_width=\"130dp\"\n            android:layout_height=\"100dp\" />\n        <LinearLayout\n            android:layout_marginLeft=\"@dimen/small_space\"\n            android:layout_weight=\"1\"\n            android:orientation=\"vertical\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"100dp\">\n            <TextView\n                style=\"@style/NewProText\"\n                android:layout_marginRight=\"@dimen/middle_space\"\n                android:text=\"asdlkajfljadsklfjksd;lfja;lskdjf;l\"\n                android:id=\"@+id/tv_content\"\n                android:layout_weight=\"1\"\n                android:maxLength=\"30\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"0dp\" />\n\n            <TextView\n                android:gravity=\"center\"\n                android:textSize=\"@dimen/small_textSize\"\n                android:textColor=\"@color/theme_color\"\n                android:text=\"￥\"\n                android:id=\"@+id/tv_price\"\n                android:layout_weight=\"1\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"0dp\" />\n            <TextView\n                android:gravity=\"center\"\n                android:drawablePadding=\"@dimen/tiny_space\"\n                android:drawableLeft=\"@drawable/location\"\n                android:textSize=\"@dimen/small_textSize\"\n                android:text=\"天津理工大学\"\n                android:id=\"@+id/tv_school\"\n                android:layout_weight=\"1\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"0dp\" />\n        </LinearLayout>\n\n    </LinearLayout>\n\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/profile_contect_view.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    xmlns:ripple=\"http://schemas.android.com/tools\"\n    android:background=\"#ffffff\"\n    android:orientation=\"vertical\">\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n        <TextView\n            android:textColor=\"@color/deep_gray\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:paddingLeft=\"@dimen/biger_space\"\n            android:gravity=\"center_vertical\"\n            style=\"@style/NewProText\"\n            android:text=\"@string/pro\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\" />\n    </LinearLayout>\n    <TextView\n        android:id=\"@+id/tv_test1\"\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <com.hankkin.compustrading.view.RippleView\n        android:id=\"@+id/rv_buy\"\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n    <TextView\n        style=\"@style/NewProText\"\n        android:paddingLeft=\"@dimen/middle_space\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:gravity=\"center_vertical\"\n        android:drawablePadding=\"@dimen/middle_space\"\n        android:drawableLeft=\"@drawable/buy\"\n        android:text=\"我要买\"\n         />\n        <ImageView\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:src=\"@drawable/right\"\n            android:layout_width=\"20dp\"\n            android:layout_height=\"20dp\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n\n    <com.hankkin.compustrading.view.RippleView\n        android:id=\"@+id/rv_sale\"\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n        <TextView\n            style=\"@style/NewProText\"\n            android:paddingLeft=\"@dimen/middle_space\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center_vertical\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/sale\"\n            android:text=\"我要卖\"\n            />\n        <ImageView\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:src=\"@drawable/right\"\n            android:layout_width=\"20dp\"\n            android:layout_height=\"20dp\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <com.hankkin.compustrading.view.RippleView\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n        <TextView\n            android:paddingLeft=\"@dimen/middle_space\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center_vertical\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/search\"\n            android:text=\"搜索商品\"\n            style=\"@style/NewProText\" />\n        <ImageView\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:src=\"@drawable/right\"\n            android:layout_width=\"20dp\"\n            android:layout_height=\"20dp\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <com.hankkin.compustrading.view.RippleView\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n        <TextView\n            android:paddingLeft=\"@dimen/middle_space\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center_vertical\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/shopping_cart\"\n            android:text=\"购物车\"\n            style=\"@style/NewProText\" />\n        <ImageView\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:src=\"@drawable/right\"\n            android:layout_width=\"20dp\"\n            android:layout_height=\"20dp\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n        <TextView\n            android:paddingLeft=\"@dimen/biger_space\"\n            android:gravity=\"center_vertical\"\n            android:text=\"@string/about\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\" />\n    </LinearLayout>\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <com.hankkin.compustrading.view.RippleView\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n        <TextView\n            android:paddingLeft=\"@dimen/middle_space\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center_vertical\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/person_outline\"\n            android:text=\"个人信息\"\n            style=\"@style/NewProText\" />\n        <ImageView\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:src=\"@drawable/right\"\n            android:layout_width=\"20dp\"\n            android:layout_height=\"20dp\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <com.hankkin.compustrading.view.RippleView\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n        <TextView\n            android:paddingLeft=\"@dimen/middle_space\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center_vertical\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/heart\"\n            android:text=\"我的收藏\"\n            style=\"@style/NewProText\" />\n        <ImageView\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:src=\"@drawable/right\"\n            android:layout_width=\"20dp\"\n            android:layout_height=\"20dp\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <com.hankkin.compustrading.view.RippleView\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:padding=\"@dimen/small_space\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"55dp\">\n        <TextView\n            android:paddingLeft=\"@dimen/middle_space\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:gravity=\"center_vertical\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:drawableLeft=\"@drawable/set_person\"\n            android:text=\"设置\"\n            style=\"@style/NewProText\" />\n        <ImageView\n            android:layout_alignParentRight=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:src=\"@drawable/right\"\n            android:layout_width=\"20dp\"\n            android:layout_height=\"20dp\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"30dp\"></LinearLayout>\n    <TextView\n        android:background=\"@color/gray\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"1dp\" />\n    <com.hankkin.compustrading.view.RippleView\n        android:id=\"@+id/rv_logout\"\n        android:layout_marginLeft=\"@dimen/middle_space\"\n        android:layout_marginRight=\"@dimen/middle_space\"\n        android:layout_marginBottom=\"@dimen/biggest_space\"\n        ripple:rv_zoom=\"true\"\n        ripple:rv_type=\"rectangle\"\n        android:gravity=\"center_vertical\"\n        android:orientation=\"horizontal\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\">\n\n        <TextView\n            android:id=\"@+id/tv_logout\"\n            android:gravity=\"center\"\n            android:textColor=\"@color/white\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:text=\"退出帐号\"\n            android:background=\"@color/theme_color\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"50dp\" />\n    </com.hankkin.compustrading.view.RippleView>\n\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/profile_head_view.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/layout_view\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:layout_gravity=\"bottom\"\n    android:gravity=\"bottom\">\n\n    <com.hankkin.compustrading.view.RoundedImageView\n        android:scaleType=\"fitXY\"\n        android:id=\"@+id/iv_user_head\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"80dp\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"50dp\"\n        android:src=\"@drawable/defaut\"\n        android:contentDescription=\"@string/app_name\" />\n\n    <TextView\n        android:id=\"@+id/tv_user_name\"\n        android:textSize=\"@dimen/normal_textSize\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"8dp\"\n        android:layout_below=\"@id/iv_user_head\"\n        android:layout_centerHorizontal=\"true\"\n        android:text=\"Hankkin\"\n        android:textColor=\"@color/white\" />\n\n    <LinearLayout\n        android:id=\"@+id/ll_action_button\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"#66000000\"\n        android:divider=\"@drawable/ic_img_line_v\"\n        android:showDividers=\"middle\"\n        android:dividerPadding=\"16dp\"\n        android:layout_alignParentBottom=\"true\">\n\n        <TextView\n            android:id=\"@+id/tv_register\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:padding=\"20dp\"\n            android:text=\"注册\"\n            android:layout_weight=\"1\"\n            android:textSize=\"18sp\"\n            android:gravity=\"center\"\n            android:layout_gravity=\"center\"\n            android:textColor=\"#ffffff\" />\n\n        <TextView\n            android:id=\"@+id/tv_login\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:padding=\"20dp\"\n            android:text=\"登录\"\n            android:layout_weight=\"1\"\n            android:textSize=\"18sp\"\n            android:gravity=\"center\"\n            android:layout_gravity=\"center\"\n            android:textColor=\"#ffffff\" />\n    </LinearLayout>\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/profile_zoom_view.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ImageView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/iv_zoom\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:src=\"@drawable/person_bg\"\n    android:scaleType=\"centerCrop\"\n    android:layout_gravity=\"center_horizontal\"\n    android:contentDescription=\"@string/app_name\" />\n"
  },
  {
    "path": "app/src/main/res/layout/slidingmenumain.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.hankkin.compustrading.slidingmenu.SlidingMenu\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/slidingmenumain\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\" />"
  },
  {
    "path": "app/src/main/res/layout/view_select_img.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:padding=\"@dimen/small_space\"\n    android:layout_gravity=\"center\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\">\n\n    <LinearLayout\n        android:layout_gravity=\"center\"\n        android:background=\"@drawable/normal_white_bg\"\n        android:orientation=\"vertical\"\n        android:layout_width=\"200dp\"\n        android:layout_height=\"wrap_content\">\n\n\n        <TextView\n            android:id=\"@+id/tv_gallery\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:textColor=\"@color/normal_text_color\"\n            android:layout_marginTop=\"@dimen/small_space\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:gravity=\"center_vertical\"\n            android:layout_weight=\"1\"\n            android:drawableLeft=\"@drawable/gallery\"\n            android:text=\"@string/select_pic_gallery\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\" />\n        <TextView\n            android:id=\"@+id/tv_camera\"\n            android:textSize=\"@dimen/normal_textSize\"\n            android:textColor=\"@color/normal_text_color\"\n            android:drawablePadding=\"@dimen/middle_space\"\n            android:gravity=\"center_vertical\"\n            android:layout_weight=\"1\"\n            android:drawableLeft=\"@drawable/camera\"\n            android:text=\"@string/select_pic_camera\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"40dp\" />\n\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/menu/menu_login.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.hankkin.compustrading.activity.LoginActivity\">\n    <item android:id=\"@+id/action_settings\" android:title=\"@string/action_settings\"\n        android:orderInCategory=\"100\" app:showAsAction=\"never\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/menu_main.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\" tools:context=\".MainActivity\">\n    <item\n        android:id=\"@+id/action_person\"\n        android:icon=\"@drawable/title_person\"\n        android:title=\"\"\n        app:showAsAction=\"ifRoom\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/menu_new_product.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.hankkin.compustrading.activity.NewProductActivity\">\n    <item android:id=\"@+id/action_settings\" android:title=\"@string/action_settings\"\n        android:orderInCategory=\"100\" app:showAsAction=\"never\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/menu_person.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.hankkin.compustrading.activity.PersonActivity\">\n    <item android:id=\"@+id/action_settings\" android:title=\"@string/action_settings\"\n        android:orderInCategory=\"100\" app:showAsAction=\"never\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/menu_prodect_detail.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.sloydev.collapsingavatartoolbar.sample.AvatarToolbarSample\">\n    <item\n        android:id=\"@+id/action_share\"\n        android:icon=\"@drawable/ic_action_share\"\n        android:title=\"\"\n        app:showAsAction=\"ifRoom\" />\n\n    <item\n        android:id=\"@+id/action_settings\"\n        android:title=\"举报\"\n        app:showAsAction=\"never\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/menu_register.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.hankkin.compustrading.activity.RegisterActivity\">\n    <item android:id=\"@+id/action_settings\" android:title=\"@string/action_settings\"\n        android:orderInCategory=\"100\" app:showAsAction=\"never\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/menu_search.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.hankkin.compustrading.activity.SearchProActivity\">\n    <item android:id=\"@+id/action_settings\" android:title=\"@string/action_settings\"\n        android:orderInCategory=\"100\" app:showAsAction=\"never\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/menu/menu_splas.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.hankkin.compustrading.activity.SplasActivity\">\n    <item android:id=\"@+id/action_settings\" android:title=\"@string/action_settings\"\n        android:orderInCategory=\"100\" app:showAsAction=\"never\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/values/arrays.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string-array name=\"school\">\n        <item>南开大学</item>\n        <item>天津大学</item>\n        <item>天津财经大学</item>\n        <item>中国民航大学</item>\n        <item>天津工业大学</item>\n        <item>河北工业大学</item>\n        <item>天津理工大学</item>\n        <item>天津师范大学</item>\n        <item>天津科技大学</item>\n        <item>天津城建大学</item>\n        <item>天津农学院</item>\n        <item>天津商业大学</item>\n        <item>天津中医药大学</item>\n        <item>南开大学滨海学院</item>\n        <item>天津职业大学</item>\n        <item>天津医科大学临床医学院</item>\n        <item>天津财经大学珠江学院</item>\n        <item>天津美术学院</item>\n    </string-array>\n\n    <string-array name=\"cate\">\n        <item>手机数码</item>\n        <item>书籍类</item>\n        <item>运动</item>\n        <item>生活</item>\n        <item>傻子</item>\n    </string-array>\n</resources>"
  },
  {
    "path": "app/src/main/res/values/attrs.xml",
    "content": "<!--\n  Copyright 2011 The Android Open Source Project\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-->\n\n<resources>\n\n    <declare-styleable name=\"SlidingMenu\">\n        <attr name=\"mode\">\n            <enum name=\"left\" value=\"0\" />\n            <enum name=\"right\" value=\"1\" />\n        </attr>\n        <attr name=\"viewAbove\" format=\"reference\" />\n        <attr name=\"viewBehind\" format=\"reference\" />\n        <attr name=\"behindOffset\" format=\"dimension\" />\n        <attr name=\"behindWidth\" format=\"dimension\" />\n        <attr name=\"behindScrollScale\" format=\"float\" />\n        <attr name=\"touchModeAbove\">\n            <enum name=\"margin\" value=\"0\" />\n            <enum name=\"fullscreen\" value=\"1\" />\n        </attr>\n        <attr name=\"touchModeBehind\">\n            <enum name=\"margin\" value=\"0\" />\n            <enum name=\"fullscreen\" value=\"1\" />\n        </attr>\n        <attr name=\"shadowDrawable\" format=\"reference\" />\n        <attr name=\"shadowWidth\" format=\"dimension\" />\n        <attr name=\"fadeEnabled\" format=\"boolean\" />\n        <attr name=\"fadeDegree\" format=\"float\" />\n        <attr name=\"selectorEnabled\" format=\"boolean\" />\n        <attr name=\"selectorDrawable\" format=\"reference\" />\n    </declare-styleable>\n\n    <declare-styleable name=\"PagerSlidingTabStrip\">\n        <attr name=\"pstsIndicatorColor\" format=\"color\" />\n        <attr name=\"pstsUnderlineColor\" format=\"color\" />\n        <attr name=\"pstsDividerColor\" format=\"color\" />\n        <attr name=\"pstsIndicatorHeight\" format=\"dimension\" />\n        <attr name=\"pstsUnderlineHeight\" format=\"dimension\" />\n        <attr name=\"pstsDividerPadding\" format=\"dimension\" />\n        <attr name=\"pstsTabPaddingLeftRight\" format=\"dimension\" />\n        <attr name=\"pstsScrollOffset\" format=\"dimension\" />\n        <attr name=\"pstsTabBackground\" format=\"reference\" />\n        <attr name=\"pstsShouldExpand\" format=\"boolean\" />\n        <attr name=\"pstsTextAllCaps\" format=\"boolean\" />\n        <attr name=\"selectedTabTextColor\" format=\"color\" />\n    </declare-styleable>\n\n    <!-- Attributes for RoundedImageView -->\n    <declare-styleable name=\"RoundImageView\">\n        <attr name=\"roundImageView_hasRound\" format=\"boolean\" />\n        <attr name=\"roundImageView_roundColor\" format=\"color\" />\n    </declare-styleable>\n\n    <declare-styleable name=\"RippleView\">\n        <attr name=\"rv_alpha\" format=\"integer\" />\n        <attr name=\"rv_framerate\" format=\"integer\"/>\n        <attr name=\"rv_rippleDuration\" format=\"integer\"/>\n        <attr name=\"rv_zoomDuration\" format=\"integer\" />\n        <attr name=\"rv_color\" format=\"color\" />\n        <attr name=\"rv_centered\" format=\"boolean\" />\n        <attr name=\"rv_type\" format=\"enum\">\n            <enum name=\"simpleRipple\" value=\"0\"/>\n            <enum name=\"doubleRipple\" value=\"1\"/>\n            <enum name=\"rectangle\" value=\"2\" />\n        </attr>\n        <attr name=\"rv_ripplePadding\" format=\"dimension\" />\n        <attr name=\"rv_zoom\" format=\"boolean\" />\n        <attr name=\"rv_zoomScale\" format=\"float\" />\n\n    </declare-styleable>\n\n    <declare-styleable name=\"PullToZoomView\">\n        <attr name=\"headerView\" format=\"reference\" />\n        <attr name=\"contentView\" format=\"reference\" />\n        <attr name=\"zoomView\" format=\"reference\" />\n        <attr name=\"isHeaderParallax\" format=\"boolean\" />\n    </declare-styleable>\n\n\n    <declare-styleable name=\"CollapsingAvatarToolbar\">\n        <attr name=\"collapsedPadding\" format=\"dimension\"/>\n        <attr name=\"expandedPadding\" format=\"dimension\"/>\n\n        <attr name=\"collapsedImageSize\" format=\"dimension\"/>\n        <attr name=\"expandedImageSize\" format=\"dimension\"/>\n\n        <attr name=\"collapsedTextSize\" format=\"dimension\"/>\n        <attr name=\"expandedTextSize\" format=\"dimension\"/>\n        <attr name=\"width\" format=\"dimension\"/>\n    </declare-styleable>\n\n    <declare-styleable name=\"FloatingActionButton\">\n        <attr name=\"fab_colorPressed\" format=\"color\"/>\n        <attr name=\"fab_colorDisabled\" format=\"color\"/>\n        <attr name=\"fab_colorNormal\" format=\"color\"/>\n        <attr name=\"fab_icon\" format=\"reference\"/>\n        <attr name=\"fab_size\" format=\"enum\">\n            <enum name=\"normal\" value=\"0\"/>\n            <enum name=\"mini\" value=\"1\"/>\n        </attr>\n        <attr name=\"fab_title\" format=\"string\"/>\n        <attr name=\"fab_stroke_visible\" format=\"boolean\"/>\n    </declare-styleable>\n    <declare-styleable name=\"AddFloatingActionButton\">\n        <attr name=\"fab_plusIconColor\" format=\"color\"/>\n    </declare-styleable>\n    <declare-styleable name=\"FloatingActionsMenu\">\n        <attr name=\"fab_addButtonColorPressed\" format=\"color\"/>\n        <attr name=\"fab_addButtonColorNormal\" format=\"color\"/>\n        <attr name=\"fab_addButtonSize\" format=\"enum\">\n            <enum name=\"normal\" value=\"0\"/>\n            <enum name=\"mini\" value=\"1\"/>\n        </attr>\n        <attr name=\"fab_addButtonPlusIconColor\" format=\"color\"/>\n        <attr name=\"fab_addButtonStrokeVisible\" format=\"boolean\"/>\n        <attr name=\"fab_labelStyle\" format=\"reference\"/>\n        <attr name=\"fab_labelsPosition\" format=\"enum\">\n            <enum name=\"left\" value=\"0\"/>\n            <enum name=\"right\" value=\"1\"/>\n        </attr>\n        <attr name=\"fab_expandDirection\" format=\"enum\">\n            <enum name=\"up\" value=\"0\"/>\n            <enum name=\"down\" value=\"1\"/>\n            <enum name=\"left\" value=\"2\"/>\n            <enum name=\"right\" value=\"3\"/>\n        </attr>\n    </declare-styleable>\n\n\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values/bmob_common_strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\t<string name=\"bmob_common_action_info_exist\">正在下载中.</string>\n\t<string name=\"bmob_common_info_interrupt\">下载出错啦，请检查网络后继续。</string>\n\t<string name=\"bmob_common_action_pause\">暂停</string>\n\t<string name=\"bmob_common_action_continue\">继续</string>\n\t<string name=\"bmob_common_action_cancel\">取消</string>\n\t<string name=\"bmob_common_download_notification_prefix\">正在下载: </string>\n\t<string name=\"bmob_common_pause_notification_prefix\">暂停: </string>\n\t<string name=\"bmob_common_start_download_notification\">正在下载应用</string>\n\t<string name=\"bmob_common_start_patch_notification\">正在更新安装包</string>\n    <string name=\"bmob_common_network_break_alert\">请连接网络后再尝试！</string>\n\t<string name=\"bmob_common_download_failed\">下载失败</string>\n\t<string name=\"bmob_common_download_finish\">下载完成，请点击安装</string>\n\t<string name=\"bmob_common_patch_finish\">更新完成，请点击安装</string>\n\t<string name=\"bmob_common_silent_download_finish\">新版本已经准备好，请点击安装</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/bmob_update_string.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\t<string name=\"BMBreak_Network\">未联网</string>\n\t<string name=\"BMUpdateTitle\">发现新版本</string>\n\t<string name=\"BMNewVersion\">最新版本: </string>\n\t<string name=\"BMUpdateContent\">更新内容</string>\n\t<string name=\"BMUpdateSize\">仅需要下载:</string>\n\t<string name=\"BMTargetSize\">新版本大小:</string>\n\t<string name=\"BMGprsCondition\">（提示：非WIFI环境）</string>\n\t<string name=\"BMUpdateNow\">立即更新</string>\n\t<string name=\"BMAppUpdate\">应用更新</string>\n\t<string name=\"BMNotNow\">以后再说</string>\n\t<string name=\"BMIgnore\">忽略该版</string>\n\t<string name=\"BMToast_IsUpdating\">正在更新中....</string>\n\t<string name=\"BMDialog_InstallAPK\">最新版本已下载，是否安装？</string>\n\t<string name=\"BMUpdateCheck\">v3.1.4Beta</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/color.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"theme_color\">#2B98f0</color>\n    <color name=\"theme_color_tab\">#2b89f0</color>\n\n    <!--白-->\n    <color name=\"white\">#FFFFFF</color>\n    <color name=\"light_white\">#fddbdbdb</color>\n    <!--黑-->\n    <color name=\"black\">#000000</color>\n    <color name=\"deep_black\">#ff000000</color>\n    <!--灰-->\n    <drawable name=\"light_gray\">#F8F8FF</drawable>\n    <color name=\"transparent_gray\">#ee373737</color>\n    <color name=\"gray\">#f5f5f5</color>\n    <color name=\"gray_bg\">#ebeced</color>\n    <color name=\"deep_gray\">#707070</color>\n    <color name=\"gray_text\">#959595</color>\n    <color name=\"normal_text_color\">#424242</color>\n    <!--透明-->\n    <color name=\"transparent\">#00000000</color>\n    <color name=\"translucent\">#dd000000</color>\n    <color name=\"half_transparent\">#40000000</color>\n    <color name=\"ripple\">#B0C4DE</color>\n\n    <color name=\"black_semi_transparent\">#B2000000</color>\n    <color name=\"background\">#e5e5e5</color>\n    <color name=\"half_black\">#808080</color>\n    <color name=\"white_pressed\">#f1f1f1</color>\n    <color name=\"pink\">#e91e63</color>\n    <color name=\"pink_pressed\">#ec407a</color>\n    <color name=\"blue_semi_transparent\">#805677fc</color>\n    <color name=\"blue_semi_transparent_pressed\">#80738ffe</color>\n\n\n    <color name=\"primary\">#3F51B5</color>\n    <color name=\"primary_dark\">#303F9F</color>\n    <color name=\"accent\">#FF4081</color>\n    <color name=\"origle\">#FF8C00</color>\n    <color name=\"origle_tab\">#FF7F24</color>\n    FF7F24\n</resources>"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\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\n    <!-- 大间隔36 ~ 38px -->\n    <dimen name=\"biger_space\">24dp</dimen>\n    <dimen name=\"biggest_space\">30dp</dimen>\n    <!-- 大间隔30 ~ 32px -->\n    <dimen name=\"big_space\">18dp</dimen>\n    <!-- 中间隔20 ~ 24px -->\n    <dimen name=\"middle_space\">14dp</dimen>\n    <dimen name=\"middlerr_space\">12dp</dimen>\n    <dimen name=\"middler_space\">10dp</dimen>\n    <!-- 小间隔14 ~ 18px -->\n    <dimen name=\"small_space\">8dp</dimen>\n    <dimen name=\"smaller_space\">6dp</dimen>\n    <!-- 更小的间隔 -->\n    <dimen name=\"tiny_space\">4dp</dimen>\n    <dimen name=\"tinyest_space\">2dp</dimen>\n\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"slidingmenu_offset\">80dp</dimen>\n    <dimen name=\"shadow_width\">15dp</dimen>\n\n\n    <dimen name=\"default_collapsed_padding\">72dp</dimen>\n    <dimen name=\"default_expanded_padding\">16dp</dimen>\n    <dimen name=\"default_collapsed_image_size\">40dp</dimen>\n    <dimen name=\"default_expanded_image_size\">60dp</dimen>\n    <dimen name=\"default_collapsed_text_size\">18sp</dimen>\n    <dimen name=\"default_expanded_text_size\">19sp</dimen>\n\n    <dimen name=\"fab_size_normal\">56dp</dimen>\n    <dimen name=\"fab_size_mini\">40dp</dimen>\n\n    <dimen name=\"fab_icon_size\">24dp</dimen>\n\n    <dimen name=\"fab_plus_icon_size\">14dp</dimen>\n    <dimen name=\"fab_plus_icon_stroke\">2dp</dimen>\n\n    <dimen name=\"fab_shadow_offset\">3dp</dimen>\n    <dimen name=\"fab_shadow_radius\">9dp</dimen>\n\n    <dimen name=\"fab_stroke_width\">1dp</dimen>\n\n    <dimen name=\"fab_actions_spacing\">16dp</dimen>\n    <dimen name=\"fab_labels_margin\">8dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/ids.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <item name=\"selected_view\" type=\"id\"/>\n    <item type=\"id\" name=\"scrollview\"/>\n    <item name=\"usericon\" type=\"id\"></item>\n    <item name=\"username\" type=\"id\"></item>\n\n    <item name=\"fab_expand_menu_button\" type=\"id\"/>\n    <item name=\"fab_label\" type=\"id\"/>\n</resources>"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">淘School</string>\n\n    <string name=\"hello_world\">Hello world!</string>\n    <string name=\"action_settings\">Settings</string>\n\n\n    <string name=\"login\">登录</string>\n    <string name=\"register\">注册</string>\n    <string name=\"login_register\">登录或注册</string>\n    <string name=\"et_tel_hint\">请输入手机号</string>\n    <string name=\"code\">发送验证码</string>\n    <string name=\"et_pwd_hint\">请输入密码</string>\n    <string name=\"et_code_hint\">请输入验证码</string>\n    <string name=\"main_title\">School淘</string>\n    <string name=\"main_title_fu\">赶快来，你值得拥有</string>\n    <string name=\"main_show_title\">校园二手</string>\n    <string name=\"load\">正在加载</string>\n    <string name=\"qq_login\">QQ登录</string>\n    <string name=\"weibo_login\">微博登录</string>\n    <string name=\"others\">其他帐号登录</string>\n    <string name=\"setting\">设置</string>\n    <string name=\"back\">返回</string>\n    <string name=\"new_pro\">发布商品</string>\n    <string name=\"ok\">确定</string>\n    <string name=\"select_pic\">选择图片</string>\n    <string name=\"select_pic_gallery\">从相册选择</string>\n    <string name=\"select_pic_camera\">拍照</string>\n    <string name=\"action_title\">School淘</string>\n    <string name=\"title_activity_product_detail\">ProductDetailActivity</string>\n\n<!-- TODO: Remove or change this placeholder text -->\n    <string name=\"hello_blank_fragment\">Hello blank fragment</string>\n    <string name=\"title_activity_person\">PersonActivity</string>\n    <string name=\"title_activity_prodect_detail\">ProdectDetailActivity</string>\n\n    <string name=\"hint_username\">请输入手机号</string>\n    <string name=\"hint_pwd\">请输入密码</string>\n    <string name=\"title_activity_login\">LoginActivity</string>\n    <string name=\"title_activity_register\">RegisterActivity</string>\n    <string name=\"title_activity_new_product\">NewProductActivity</string>\n\n\n    <string name=\"pro_name\">商品名称</string>\n    <string name=\"pro_name_hint\">请输入商品名称</string>\n    <string name=\"pro_price\">商品价格</string>\n    <string name=\"pro_price_hint\">请输入商品价格</string>\n    <string name=\"pro_school\">学校</string>\n    <string name=\"pro_school_hint\">请选择学校</string>\n    <string name=\"pro_cate\">分类</string>\n    <string name=\"pro_cate_hint\">请选择分类</string>\n    <string name=\"pro_user_tel\">联系方式</string>\n    <string name=\"pro_user_tel_hint\">请输入联系方式</string>\n    <string name=\"fabu\">发布</string>\n    <string name=\"pro\">商品</string>\n    <string name=\"about\">关于我的</string>\n    <string name=\"search_pro\">搜索商品</string>\n    <string name=\"title_activity_search_pro\">SearchProActivity</string>\n    <string name=\"buy\">我要买</string>\n    <string name=\"sale\">我要卖</string>\n    <string name=\"personinfo\">个人中心</string>\n    <string name=\"title_activity_splas\">SplasActivity</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n\n    <style name=\"menu_labels_style\">\n        <item name=\"android:background\">@drawable/fab_label_background</item>\n        <item name=\"android:textColor\">@color/white</item>\n    </style>\n\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">#2196F3</item>\n        <item name=\"colorPrimaryDark\">#1565C0</item>\n        <item name=\"colorAccent\">#E91E63</item>\n    </style>\n\n    <style name=\"AppTheme.WithoutActionBar\">\n        <item name=\"windowActionBar\">false</item>\n        <item name=\"windowNoTitle\">true</item>\n    </style>\n    <style name=\"Theme.Sample\" parent=\"Base.Theme.Sample\"></style>\n\n    <style name=\"Base.Theme.Sample\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n        <item name=\"colorPrimary\">@color/primary</item>\n        <item name=\"colorPrimaryDark\">@color/primary_dark</item>\n        <item name=\"colorAccent\">@color/accent</item>\n        <item name=\"android:windowBackground\">@color/window_background</item>\n    </style>\n\n    <style name=\"TextAppearance.Row\" parent=\"TextAppearance.AppCompat.Medium\">\n        <item name=\"android:textColor\">?android:attr/textColorPrimary</item>\n    </style>\n\n    <style name=\"NewProText\">\n        <item name=\"android:textColor\">@color/normal_text_color</item>\n        <item name=\"android:textSize\">@dimen/normal_title_btn_textSize</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/texsize.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- 应用字体大小 -->\n<resources>\n    <!-- 38px -->\n    <dimen name=\"biggest_textSize\">24sp</dimen>\n    <!-- 35px -->\n    <dimen name=\"bigger_textSize\">22sp</dimen>\n    <!-- 32px -->\n    <dimen name=\"big_textSize\">20sp</dimen>\n    <!-- 29px -->\n    <dimen name=\"normal_textSize\">16sp</dimen>\n    <dimen name=\"normal_title_btn_textSize\">18sp</dimen>\n    <!-- 50px -->\n    <dimen name=\"superBig_textSize\">30sp</dimen>\n    <dimen name=\"middleBig_textSize\">24sp</dimen>\n    <!-- 26px -->\n    <dimen name=\"small_textSize\">14sp</dimen>\n    <!-- 22px -->\n    <dimen name=\"smaller_textSize\">12sp</dimen>\n    <!-- 19px -->\n    <dimen name=\"smallest_textSize\">12sp</dimen>\n    <!-- 15px -->\n    <dimen name=\"tiny_textSize\">10sp</dimen>\n    <dimen name=\"tinyest_textSize\">8sp</dimen>\n</resources>"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/test/java/com/hankkin/compustrading/ExampleUnitTest.java",
    "content": "package com.hankkin.compustrading;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit tests, switch the Test Artifact in the Build Variants view.\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:2.3.0'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n        maven { url \"https://raw.github.com/bmob/bmob-android-sdk/master\" }\n    }\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sat Nov 28 23:32:22 CST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-3.3-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]