Full Code of Hankkin/TaoSchool for AI

master d52c81de284a cached
131 files
444.7 KB
113.7k tokens
859 symbols
1 requests
Download .txt
Showing preview only (497K chars total). Download the full file or copy to clipboard to get everything.
Repository: Hankkin/TaoSchool
Branch: master
Commit: d52c81de284a
Files: 131
Total size: 444.7 KB

Directory structure:
gitextract__kczv6ja/

├── .gitignore
├── .idea/
│   ├── compiler.xml
│   ├── copyright/
│   │   └── profiles_settings.xml
│   ├── encodings.xml
│   ├── gradle.xml
│   ├── misc.xml
│   ├── modules.xml
│   ├── runConfigurations.xml
│   └── vcs.xml
├── README.md
├── app/
│   ├── .gitignore
│   ├── app.iml
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── hankkin/
│       │               └── compustrading/
│       │                   └── ApplicationTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── hankkin/
│       │   │           └── compustrading/
│       │   │               ├── Application/
│       │   │               │   └── MyApplication.java
│       │   │               ├── MainActivity.java
│       │   │               ├── User/
│       │   │               │   └── UserBean.java
│       │   │               ├── Utils/
│       │   │               │   ├── BitmapUtils.java
│       │   │               │   └── HankkinUtils.java
│       │   │               ├── activity/
│       │   │               │   ├── BaseActivity.java
│       │   │               │   ├── LoginActivity.java
│       │   │               │   ├── MainShowActivity.java
│       │   │               │   ├── NewProductActivity.java
│       │   │               │   ├── PersonActivity.java
│       │   │               │   ├── ProdectDetailActivity.java
│       │   │               │   ├── RegisterActivity.java
│       │   │               │   ├── SearchProActivity.java
│       │   │               │   └── SplasActivity.java
│       │   │               ├── adapter/
│       │   │               │   ├── CategoryFragmentAdapter.java
│       │   │               │   ├── PersonInfoAdapter.java
│       │   │               │   └── ProductAdapter.java
│       │   │               ├── fragment/
│       │   │               │   └── CateDetailFragment.java
│       │   │               ├── interface/
│       │   │               │   ├── FileUploadListener.java
│       │   │               │   └── ScrollDirectionListener.java
│       │   │               ├── model/
│       │   │               │   ├── Category.java
│       │   │               │   ├── Person.java
│       │   │               │   ├── PersonShow.java
│       │   │               │   └── Product.java
│       │   │               ├── sharepreference/
│       │   │               │   └── MySP.java
│       │   │               ├── slidingmenu/
│       │   │               │   ├── CustomViewAbove.java
│       │   │               │   ├── CustomViewBehind.java
│       │   │               │   ├── SlidingActivityBase.java
│       │   │               │   ├── SlidingActivityHelper.java
│       │   │               │   ├── SlidingMenu.java
│       │   │               │   └── SlidingPreferenceActivity.java
│       │   │               └── view/
│       │   │                   ├── CollapsingAvatarToolbar.java
│       │   │                   ├── PagerSlidingTabStrip.java
│       │   │                   ├── RippleView.java
│       │   │                   ├── RoundedImageView.java
│       │   │                   ├── floatbutton/
│       │   │                   │   ├── AbsListViewScrollDetector.java
│       │   │                   │   ├── AddFloatingActionButton.java
│       │   │                   │   ├── FloatingActionButton.java
│       │   │                   │   ├── FloatingActionsMenu.java
│       │   │                   │   ├── FloatingActionsMenuHidable.java
│       │   │                   │   └── TouchDelegateGroup.java
│       │   │                   ├── ipulltozoom/
│       │   │                   │   ├── IPullToZoom.java
│       │   │                   │   ├── PullToZoomBase.java
│       │   │                   │   └── PullToZoomScrollViewEx.java
│       │   │                   └── refreshload/
│       │   │                       ├── MetaballView.java
│       │   │                       └── RefreshLayout.java
│       │   └── res/
│       │       ├── anim/
│       │       │   ├── anim.xml
│       │       │   └── list_anim.xml
│       │       ├── drawable/
│       │       │   ├── bmob_update_button_cancel_bg_focused.xml
│       │       │   ├── bmob_update_button_cancel_bg_normal.xml
│       │       │   ├── bmob_update_button_cancel_bg_selector.xml
│       │       │   ├── bmob_update_button_cancel_bg_tap.xml
│       │       │   ├── bmob_update_button_check_selector.xml
│       │       │   ├── bmob_update_button_close_bg_selector.xml
│       │       │   ├── bmob_update_button_ok_bg_focused.xml
│       │       │   ├── bmob_update_button_ok_bg_normal.xml
│       │       │   ├── bmob_update_button_ok_bg_selector.xml
│       │       │   ├── bmob_update_button_ok_bg_tap.xml
│       │       │   ├── bmob_update_dialog_bg.xml
│       │       │   ├── btn_login_background.xml
│       │       │   ├── fab_label_background.xml
│       │       │   ├── login_et_background.xml
│       │       │   ├── normal_white_bg.xml
│       │       │   ├── shadow.xml
│       │       │   └── tab_background.xml
│       │       ├── layout/
│       │       │   ├── activity_login.xml
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_main_show.xml
│       │       │   ├── activity_new_product.xml
│       │       │   ├── activity_person.xml
│       │       │   ├── activity_prodect_detail.xml
│       │       │   ├── activity_product_detail.xml
│       │       │   ├── activity_register.xml
│       │       │   ├── activity_search_pro.xml
│       │       │   ├── activity_splas.xml
│       │       │   ├── bmob_update_dialog.xml
│       │       │   ├── fragment_item.xml
│       │       │   ├── listview_footer.xml
│       │       │   ├── listview_personinfo.xml
│       │       │   ├── loading.xml
│       │       │   ├── lv_product_item.xml
│       │       │   ├── profile_contect_view.xml
│       │       │   ├── profile_head_view.xml
│       │       │   ├── profile_zoom_view.xml
│       │       │   ├── slidingmenumain.xml
│       │       │   └── view_select_img.xml
│       │       ├── menu/
│       │       │   ├── menu_login.xml
│       │       │   ├── menu_main.xml
│       │       │   ├── menu_new_product.xml
│       │       │   ├── menu_person.xml
│       │       │   ├── menu_prodect_detail.xml
│       │       │   ├── menu_register.xml
│       │       │   ├── menu_search.xml
│       │       │   └── menu_splas.xml
│       │       ├── values/
│       │       │   ├── arrays.xml
│       │       │   ├── attrs.xml
│       │       │   ├── bmob_common_strings.xml
│       │       │   ├── bmob_update_string.xml
│       │       │   ├── color.xml
│       │       │   ├── dimens.xml
│       │       │   ├── ids.xml
│       │       │   ├── strings.xml
│       │       │   ├── styles.xml
│       │       │   └── texsize.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── hankkin/
│                       └── compustrading/
│                           └── ExampleUnitTest.java
├── app-release.apk
├── build.gradle
├── compaus.jks
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures


================================================
FILE: .idea/compiler.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CompilerConfiguration">
    <option name="DEFAULT_COMPILER" value="Javac" />
    <resourceExtensions />
    <wildcardResourcePatterns>
      <entry name="!?*.java" />
      <entry name="!?*.form" />
      <entry name="!?*.class" />
      <entry name="!?*.groovy" />
      <entry name="!?*.scala" />
      <entry name="!?*.flex" />
      <entry name="!?*.kt" />
      <entry name="!?*.clj" />
    </wildcardResourcePatterns>
    <annotationProcessing>
      <profile default="true" name="Default" enabled="false">
        <processorPath useClasspath="true" />
      </profile>
    </annotationProcessing>
  </component>
</project>

================================================
FILE: .idea/copyright/profiles_settings.xml
================================================
<component name="CopyrightManager">
  <settings default="" />
</component>

================================================
FILE: .idea/encodings.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="Encoding">
    <file url="PROJECT" charset="UTF-8" />
  </component>
</project>

================================================
FILE: .idea/gradle.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="GradleSettings">
    <option name="linkedExternalProjectsSettings">
      <GradleProjectSettings>
        <option name="distributionType" value="DEFAULT_WRAPPED" />
        <option name="externalProjectPath" value="$PROJECT_DIR$" />
        <option name="gradleJvm" value="1.8" />
        <option name="modules">
          <set>
            <option value="$PROJECT_DIR$" />
            <option value="$PROJECT_DIR$/app" />
          </set>
        </option>
        <option name="resolveModulePerSourceSet" value="false" />
      </GradleProjectSettings>
    </option>
  </component>
</project>

================================================
FILE: .idea/misc.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="EntryPointsManager">
    <entry_points version="2.0" />
  </component>
  <component name="NullableNotNullManager">
    <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
    <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
    <option name="myNullables">
      <value>
        <list size="4">
          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
        </list>
      </value>
    </option>
    <option name="myNotNulls">
      <value>
        <list size="4">
          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
        </list>
      </value>
    </option>
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="0" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <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">
    <output url="file://$PROJECT_DIR$/build/classes" />
  </component>
  <component name="ProjectType">
    <option name="id" value="Android" />
  </component>
</project>

================================================
FILE: .idea/modules.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/TaoSchool-master.iml" filepath="$PROJECT_DIR$/TaoSchool-master.iml" />
      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
    </modules>
  </component>
</project>

================================================
FILE: .idea/runConfigurations.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="RunConfigurationProducerService">
    <option name="ignoredProducers">
      <set>
        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
      </set>
    </option>
  </component>
</project>

================================================
FILE: .idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="VcsDirectoryMappings">
    <mapping directory="$PROJECT_DIR$" vcs="Git" />
  </component>
</project>

================================================
FILE: README.md
================================================
**该APP已经不再维护了,如果您需要的话 请看 https://github.com/Hankkin/Reading** 
*Reading是一款基于WanAndroid OpenApi开发的阅读类工具,如果你是一个热衷于Android开发者,那么这款软件能帮助你阅读精品Android文章。 同时Reading中还包含"英文单词"、"账号本子"、"天气"、"查单词"、"快递查询"等小工具。项目基于"Kotlin+MVP"架构开发,风格大概也许属于Material Desgin原质化风格,包含主题颜色切换、百变Logo、 等功能。在此感谢WanAndroid的OpenApi,以及其它开源项目的贡献。
*
# TaoSchool
一款基于Material Desgin设计的APP

###look at the screenshot:

<img src="http://img.blog.csdn.net/20160101143739659" width = "320" height = "640" alt="高仿微信群聊头像" align=center />

<img src="http://img.blog.csdn.net/20151229160604230" width = "200" height = "200" alt="高仿微信群聊头像" align=center />
###download:
网站: 
http://hankkin.bmob.cn 

PRE: 
http://pre.im/x9nH 

360开发者平台: 
http://zhushou.360.cn/detail/index/soft_id/3181637?recrefer=SE_D_%E6%B7%98School 

百度开发平台 
http://shouji.baidu.com/soft/item?docid=8561791&from=&f=search_app_淘School%40list_1_title%401%40header_all_input 

###tech:
1.Android Support Desgin

CollapsingAvatarToolbar 头像随ListView滚动缩回到ActionBar特效 
TextInputLayout带动画的输入框

2.ActionBarDrawerToggle、DrawerLayout、ActionBar 结合

3.RippleEffect水波纹效果

4.PagerSlidingTabStrip+viewpager实现选项卡左右滑动

5.FloatActiconButton悬浮按钮实现仿钉钉悬浮按钮

6.PullToZoomScrollView实现下拉自动放大头部View

7.materialdialog实现的对话框

8.MaterialSpinner实现的带效果的spinner

9.butterknife注解框架

CSDN博客地址:http://blog.csdn.net/lyhhj/article/details/50413625

微信:huang1019283569




================================================
FILE: app/.gitignore
================================================
/build


================================================
FILE: app/app.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <component name="FacetManager">
    <facet type="android-gradle" name="Android-Gradle">
      <configuration>
        <option name="GRADLE_PROJECT_PATH" value=":app" />
      </configuration>
    </facet>
    <facet type="android" name="Android">
      <configuration>
        <option name="SELECTED_BUILD_VARIANT" value="debug" />
        <option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
        <option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
        <afterSyncTasks>
          <task>generateDebugSources</task>
        </afterSyncTasks>
        <option name="ALLOW_USER_CONFIGURATION" value="false" />
        <option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
        <option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
        <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
        <option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
    <output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
    <output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
      <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
      <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
    </content>
    <orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" exported="" name="butterknife-7.0.1" level="project" />
    <orderEntry type="library" exported="" name="design-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="transition-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="library-1.2.8" level="project" />
    <orderEntry type="library" exported="" name="support-core-ui-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="library-1.1.0" level="project" />
    <orderEntry type="library" exported="" name="fadingactionbar-3.1.2" level="project" />
    <orderEntry type="library" exported="" name="glide-3.7.0" level="project" />
    <orderEntry type="library" exported="" name="support-core-utils-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="support-fragment-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="library-2.4.0" level="project" />
    <orderEntry type="library" exported="" name="fadingactionbar-abc-3.1.2" level="project" />
    <orderEntry type="library" exported="" name="universal-image-loader-1.9.5" level="project" />
    <orderEntry type="library" exported="" name="support-v4-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="support-compat-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="materialish-progress-1.7" level="project" />
    <orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
    <orderEntry type="library" exported="" name="support-media-compat-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="bmob-sdk-3.5.5" level="project" />
    <orderEntry type="library" exported="" name="http-legacy-1.0" level="project" />
    <orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
    <orderEntry type="library" exported="" name="appcompat-v7-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="recyclerview-v7-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="support-annotations-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="support-vector-drawable-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="animated-vector-drawable-25.2.0" level="project" />
    <orderEntry type="library" exported="" name="org.apache.http.legacy-android-25" level="project" />
  </component>
</module>

================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.hankkin.compustrading"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 3
        versionName "1.1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'cn.bmob.android:bmob-sdk:3.5.5'
    compile 'cn.bmob.android:http-legacy:1.0'
    compile 'com.android.support:support-v4:25.2.0'
    compile 'com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2'
    compile 'com.pnikosis:materialish-progress:1.7'
    compile 'me.drakeet.materialdialog:library:1.2.8'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.weiwangcn.betterspinner:library:1.1.0'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.android.support:design:25.2.0'
}


================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/Hankkin/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
-optimizationpasses 5          # 指定代码的压缩级别
-dontusemixedcaseclassnames   # 是否使用大小写混合
-dontpreverify           # 混淆时是否做预校验
-verbose                # 混淆时是否记录日志

-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*  # 混淆时所采用的算法

-keep public class * extends android.app.Activity      # 保持哪些类不被混淆
-keep public class * extends android.app.Application   # 保持哪些类不被混淆
-keep public class * extends android.app.Service       # 保持哪些类不被混淆
-keep public class * extends android.content.BroadcastReceiver  # 保持哪些类不被混淆
-keep public class * extends android.content.ContentProvider    # 保持哪些类不被混淆
-keep public class * extends android.app.backup.BackupAgentHelper # 保持哪些类不被混淆
-keep public class * extends android.preference.Preference        # 保持哪些类不被混淆
-keep public class com.android.vending.licensing.ILicensingService    # 保持哪些类不被混淆

-keepclasseswithmembernames class * {  # 保持 native 方法不被混淆
    native <methods>;
}
-keepclasseswithmembers class * {   # 保持自定义控件类不被混淆
    public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {# 保持自定义控件类不被混淆
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity { # 保持自定义控件类不被混淆
    public void *(android.view.View);
}
-keepclassmembers enum * {     # 保持枚举 enum 类不被混淆
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable { # 保持 Parcelable 不被混淆
    public static final android.os.Parcelable$Creator *;
}

================================================
FILE: app/src/androidTest/java/com/hankkin/compustrading/ApplicationTest.java
================================================
package com.hankkin.compustrading;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}

================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hankkin.compustrading" >

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.CALL_PHONE"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
    <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
    <uses-permission android:name="android.permission.READ_CONTACTS"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>

    <uses-feature android:name="android.hardware.Camera"/>
    <uses-feature android:name="android.hardware.camera.autofocus"/>

    <uses-permission android:name="android.permission.READ_LOGS"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.CAMERA"/>


    <!-- BmobSDK权限 -->
    <!--允许联网 -->
    <uses-permission android:name="android.permission.INTERNET" />
    <!--获取GSM(2g)、WCDMA(联通3g)等网络状态的信息  -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!--获取wifi网络状态的信息 -->
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <!--保持CPU 运转,屏幕和键盘灯有可能是关闭的,用于文件上传和下载 -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <!--获取sd卡写的权限,用于文件上传和下载-->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!--推送权限-->
    <!--允许读取手机状态 -->
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <!--允许接收屏幕解锁广播 -->
    <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
    <!--允许接收开机广播 -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <!-- 其他权限 -->
    <uses-permission android:name="android.permission.VIBRATE" />

    <meta-data android:value="Channel ID" android:name="BMOB_CHANNEL"/>
    <!-- 往SDCard写入数据权限 -->
    <application
        android:name=".Application.MyApplication"
        android:allowBackup="true"
        android:icon="@drawable/logo"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.WithoutActionBar" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name=".activity.MainShowActivity"
            android:theme="@style/AppTheme" >
        </activity>
        <activity
            android:name=".activity.PersonActivity"
            android:label="@string/title_activity_person" >
        </activity>
        <activity
            android:name=".activity.ProdectDetailActivity"
            android:label="@string/title_activity_prodect_detail" >
        </activity>
        <activity
            android:name=".activity.LoginActivity"
            android:label="@string/title_activity_login" >
        </activity>
        <activity
            android:name=".activity.RegisterActivity"
            android:label="@string/title_activity_register" >
        </activity>
        <activity
            android:name=".activity.NewProductActivity"
            android:label="@string/title_activity_new_product" >
        </activity>
        <activity
            android:name=".activity.SearchProActivity"
            android:label="@string/title_activity_search_pro" >
        </activity>
        <activity
            android:name=".activity.SplasActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="cn.bmob.v3.update.UpdateDialogActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        </activity>
    </application>

</manifest>


================================================
FILE: app/src/main/java/com/hankkin/compustrading/Application/MyApplication.java
================================================
package com.hankkin.compustrading.Application;

import android.app.Application;
import android.graphics.Bitmap;
import android.os.Environment;
import android.os.Handler;

import com.hankkin.compustrading.R;
import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;
import com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameGenerator;
import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
import com.nostra13.universalimageloader.core.decode.BaseImageDecoder;
import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;

import java.io.File;

import cn.bmob.v3.Bmob;

/**
 * Created by Hankkin on 15/11/28.
 */
public class MyApplication extends Application {

    private static String DB_PATH = null;
    private MyApplication instance;


    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        //初始化Bmob Key
        Bmob.initialize(this,"b493c51d9d5c205dde89e4f4dedc10cd");

        initImageloader();
    }

    /**
     * 初始化imageloader
     * by Hankkin at:2015-12-23 19:29:57
     */
    public void initImageloader(){
        DisplayImageOptions options = new DisplayImageOptions.Builder()
                .showImageOnLoading(R.drawable.ic_download)
                .showImageOnFail(R.drawable.ic_download)
                .resetViewBeforeLoading(false)  // default
                .delayBeforeLoading(0)
                .cacheInMemory(true) // default
                .cacheOnDisk(true) // default
                .considerExifParams(true) // default
                .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) // default
                .bitmapConfig(Bitmap.Config.ARGB_8888) // default
                .displayer(new SimpleBitmapDisplayer()) // default
                .handler(new Handler()) // default
                .build();

        // This configuration tuning is custom. You can tune every option, you may tune some of them,
        // or you can create default configuration by
        // ImageLoaderConfiguration.createDefault(this);
        // method.
//        File cacheDir = StorageUtils.getCacheDirectory(context);
        File file = new File(Environment.getExternalStorageDirectory().getPath() + "/compustrading");
        if (!file.exists()) {
            file.mkdir();
        }
        String path = file.getAbsolutePath() + "/files";
        File fileSD = new File(path);
        if (!fileSD.exists()) {
            fileSD.mkdir();
        }
        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
                .memoryCacheExtraOptions(480, 800) // default = device screen dimensions
                .diskCacheExtraOptions(480, 800, null)
                .threadPoolSize(3) // default
                .threadPriority(Thread.NORM_PRIORITY - 1) // default
                .tasksProcessingOrder(QueueProcessingType.FIFO) // default
                .denyCacheImageMultipleSizesInMemory()
                .memoryCache(new LruMemoryCache(2 * 1024 * 1024))
                .memoryCacheSize(2 * 1024 * 1024)
                .memoryCacheSizePercentage(13) // default
                .diskCache(new UnlimitedDiskCache(file)) // default
                .diskCacheSize(50 * 1024 * 1024)
                .diskCacheFileCount(1000)
                .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
                .imageDownloader(new BaseImageDownloader(getApplicationContext())) // default
                .imageDecoder(new BaseImageDecoder(true)) // default
                .defaultDisplayImageOptions(options) // default
                .writeDebugLogs()
                .build();
        // Initialize ImageLoader with configuration.
        ImageLoader.getInstance().init(config);
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/MainActivity.java
================================================
package com.hankkin.compustrading;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.hankkin.compustrading.activity.MainShowActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class MainActivity extends AppCompatActivity {

    @Bind(R.id.btn_login)
    Button btnLogin;



    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        init();
    }

    private void init() {
        ButterKnife.bind(this);
//        Product product = new Product(0,"九成新Iphone6",4000,"")
    }

    @OnClick(R.id.btn_login)
    public void btnLoginClick() {
        Intent intent = new Intent(MainActivity.this, MainShowActivity.class);
        startActivity(intent);
        finish();
    }

}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/User/UserBean.java
================================================
package com.hankkin.myapplication.User;

import cn.bmob.v3.BmobObject;

/**
 * Created by Hankkin on 15/11/28.
 */
public class UserBean extends BmobObject {
    private String name;
    private String tel;
    private String icon_url;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getIcon_url() {
        return icon_url;
    }

    public void setIcon_url(String icon_url) {
        this.icon_url = icon_url;
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/Utils/BitmapUtils.java
================================================
package com.hankkin.compustrading.Utils;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
import android.net.Uri;
import android.os.Environment;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by Hankkin on 15/12/24.
 */
public class BitmapUtils {

    public static Bitmap getCompressedBitmap(Activity act, String filepath) {
        Bitmap tempBitmap = null;
        float width = act.getResources().getDisplayMetrics().widthPixels;
        float height = act.getResources().getDisplayMetrics().heightPixels;
        try {
            if (width > 640) {
                tempBitmap = getSuitableBitmap(act, Uri.fromFile(new java.io.File(filepath)), 640, (640 / width) * height);
            } else {
                tempBitmap = getSuitableBitmap(act, Uri.fromFile(new java.io.File(filepath)), (int) width, (int) height);
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

        return tempBitmap;
    }

    /**
     * 说明:请调用getSuitableBitmap()方法并传入图像路径,返回Bitmap
     * <p/>
     * 修改宽高压缩比例
     * by:Hankkin at:2015-2-14
     */
    public static Bitmap getSuitableBitmap(Activity act, Uri uri, float ww, float hh)
            throws FileNotFoundException {
        BitmapFactory.Options newOpts = new BitmapFactory.Options();
        newOpts.inJustDecodeBounds = true;//只读边,不读内容
        Bitmap bitmap = null;
        bitmap = BitmapFactory.decodeStream(act.getContentResolver().openInputStream(uri), null, newOpts);

        newOpts.inJustDecodeBounds = false;
        float w = newOpts.outWidth;
        float h = newOpts.outHeight;

        float wwh = 640f;//
        float hhh = (wwh / w) * h;//
        int be = 1;
        if (w > h && w > wwh) {
            be = (int) (newOpts.outWidth / wwh);
        } else if (w < h && h > hhh) {
            be = (int) (newOpts.outHeight / hhh);
            be += 1;
        }
        if (be <= 0)
            be = 1;
        newOpts.inSampleSize = be;//设置采样率

        newOpts.inPreferredConfig = Bitmap.Config.ARGB_8888;//该模式是默认的,可不设
        newOpts.inPurgeable = true;// 同时设置才会有效
        newOpts.inInputShareable = true;//。当系统内存不够时候图片自动被回收

        bitmap = BitmapFactory.decodeStream(act.getContentResolver().openInputStream(uri), null, newOpts);
//      return compressBmpFromBmp(bitmap);//原来的方法调用了这个方法企图进行二次压缩
        //其实是无效的,大家尽管尝试
        return bitmap;

    }

    /**
     * 质量压缩
     * by:Hankkin at:2015-2-14
     *
     * @param image
     * @return
     */
    public static ByteArrayOutputStream compressImage(Bitmap image) {

        int options = 100;
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        image.compress(Bitmap.CompressFormat.JPEG, options, baos);//质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中

        while (baos.size() / 1024 > 30 && options > 40) {  //循环判断如果压缩后图片是否大于100kb,大于继续压缩
            baos.reset();
            options -= 10;//每次都减少10
            image.compress(Bitmap.CompressFormat.JPEG, options, baos);//这里压缩options%,把压缩后的数据存放到baos中
        }
        return baos;
    }

    /**
     * bitmap临时转为文件等待上传
     * by Hankkin at:2015-4-24
     *
     * @param bitmap
     * @param path
     * @return
     */
    public static String saveBitmap(Bitmap bitmap, String path) {
        String filePath = null;
        String updatePath = Environment.getExternalStorageDirectory().getPath() + "/compustrading/tempUploadPic";
        File fileSD = new File(updatePath);
        if (!fileSD.exists()) {
            fileSD.mkdir();
        }
        try {
            filePath = updatePath + "/" + path;
            FileOutputStream out = new FileOutputStream(filePath);
            bitmap.compress(Bitmap.CompressFormat.JPEG, 30, out);
            out.flush();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return filePath.trim();
    }


    /**
     * 读取照片exif信息中的旋转角度
     *
     * @param path 照片路径
     * @return角度
     */
    public static int readPictureDegree(String path) {
        int degree = 0;
        try {
            ExifInterface exifInterface = new ExifInterface(path);
            int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
            switch (orientation) {
                case ExifInterface.ORIENTATION_ROTATE_90:
                    degree = 90;
                    break;
                case ExifInterface.ORIENTATION_ROTATE_180:
                    degree = 180;
                    break;
                case ExifInterface.ORIENTATION_ROTATE_270:
                    degree = 270;
                    break;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return degree;
    }

    /**
     * 旋转照片
     * by Hankkin at:2015年10月8日 11:17:04
     * @param img
     * @return
     */
    public static Bitmap toturn(Bitmap img){
        Matrix matrix = new Matrix();
        matrix.postRotate(+90); /*翻转90度*/
        int width = img.getWidth();
        int height =img.getHeight();
        img = Bitmap.createBitmap(img, 0, 0, width, height, matrix, true);
        return img;
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/Utils/HankkinUtils.java
================================================
/**
 * YUtils.java[V1.0.0]
 * classes : com.wadiankeji.creditsmanager.util.YUtils
 *
 * @author Hankkin Create at 2014年11月27日 下午7:48:31
 */
package com.hankkin.compustrading.Utils;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.*;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Rect;
import android.media.ExifInterface;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;

import java.io.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * by 李斐 at 2014年11月27日 下午7:48:31
 * 增加getPath相关方法
 * by:李斐 at:2015-06-18 10:51:16
 */
public class HankkinUtils {
    private static final String TAG = "YUtils";

    // 记录屏幕的高度、宽度、密度等信息。
    public static int screenH;
    public static int screenW;
    public static float screenDensity; // 屏幕密度(0.75 / 1.0 / 1.5)
    public static int screenDensityDpi; // 屏幕密度DPI(120 / 160 / 240)
    public static int statusBarHeight; // 状态栏高度

    @SuppressLint("SimpleDateFormat")
    public static String longtimeToDate(long time) {
        Date now = new Date(time * 1000);
        SimpleDateFormat dateFormat = new SimpleDateFormat(
                "yyyy-MM-dd HH:mm:ss");// 可以方便地修改日期格式
        dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+8"));
        String dateStr = dateFormat.format(now);
        return dateStr;
    }

    /**
     * 修改时间戳转化时间
     * by黄海杰 at:2015年7月27日 15:44:16
     *
     * @param time
     * @return
     */
    @SuppressLint("SimpleDateFormat")
    public static String longtimeToDayDate(long time) {
        SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd HH:mm");// 可以方便地修改日期格式
        String dateStr = dateFormat.format(new Date(time));
        return dateStr;
    }

    public static String getCurrentTime(String format) {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
        sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
        String currentTime = sdf.format(date);
        return currentTime;
    }


    @SuppressLint("SimpleDateFormat")
    public static String longtimeToDateYMD(long time) {
        Date now = new Date(time);
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");// 可以方便地修改日期格式
        dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+8"));
        String dateStr = dateFormat.format(now);
        return dateStr;
    }


    /**
     * 根据yyyy-MM-dd HH:mm:ss格式时间字符串转为long型时间戳
     *
     * @param dateStr
     * @return date long
     * by:Hankkin at:2015年6月25日 17:38:25 修改时区设置
     */
    public static long stringDateToLong(String dateStr) {

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
        Date date = null;
        try {
            date = sdf.parse(dateStr);
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return date.getTime();
    }

    public static String getCurrentTime() {
        return getCurrentTime("yyyy-MM-dd  HH:mm:ss");
    }


    /**
     * 将时间戳转为代表"距现在多久之前"的字符串
     * 修改为向下取整
     * by黄海杰 at:2015年7月1日 17:08:55
     *
     * @param dateTime 时间戳
     * @return
     */
    public static String getStandardDate(long dateTime) {

        StringBuffer sb = new StringBuffer();
//		long t = Long.parseLong(timeStr);
//		long time = System.currentTimeMillis() - (t*1000);
        long time = System.currentTimeMillis() - (dateTime);
        long mill = (long) Math.floor(time / 1000);//秒前

        long minute = (long) Math.floor(time / 60 / 1000.0f);// 分钟前

        long hour = (long) Math.floor(time / 60 / 60 / 1000.0f);// 小时

        long day = (long) Math.floor(time / 24 / 60 / 60 / 1000.0f);// 天前

        if (day - 1 > 0) {
            sb.append(day + "天");
        } else if (hour - 1 > 0) {
            if (hour >= 24) {
                sb.append("1天");
            } else {
                sb.append(hour + "小时");
            }
        } else if (minute - 1 > 0) {
            if (minute == 60) {
                sb.append("1小时");
            } else {
                sb.append(minute + "分钟");
            }
        } else if (mill - 1 > 0) {
            if (mill == 60) {
                sb.append("1分钟");
            } else {
                sb.append(mill + "秒");
            }
        } else {
            sb.append("刚刚");
        }
        if (!sb.toString().equals("刚刚")) {
            sb.append("前");
        }
        return sb.toString();
    }

    /**
     * 根据时间戳的差获取时间差
     * by黄海杰 at:2015年7月13日 11:24:25
     * 修改超过一天的显示时间
     * by黄海杰 at:2015年7月27日 15:44:32
     *
     * @param dateTime
     * @return
     */
    public static String getDateAgo(long dateTime) {

        String days = null;
//		long t = Long.parseLong(timeStr);
//		long time = System.currentTimeMillis() - (t*1000);
        long timeInterval = (System.currentTimeMillis() - (dateTime)) / 1000;


        if (timeInterval < 60) {
            days = "1分钟前";
        } else if (timeInterval < 3600) {
            days = "" + (int) Math.round(timeInterval / 60) + "分钟内";
        } else if (timeInterval < 86400) {
            if (timeInterval % 3600 > 1800) {
                days = "" + (int) Math.round((timeInterval / 3600) + 1) + "小时内";
            } else {
                days = "" + (int) Math.round((timeInterval / 3600)) + "小时内";
            }
        }
//		else if (timeInterval<2592000){
//			days = ""+(int)Math.floor(timeInterval/86400)+"天前";
//		}
//		else if (timeInterval<31536000){
//			days = ""+(int)Math.floor(timeInterval/2592000)+"个月前";
//		}
//		else {
//			days = ""+(int)Math.floor(timeInterval/31536000)+"年前";
//		}
        else {
            days = longtimeToDayDate(dateTime);
        }
        return days;
    }

    /**
     * 升级检测
     *
     * @param locVersionName
     * @param lastVersion
     * @return 是否升级
     */
    public static boolean checkUpdate(String locVersionName, String lastVersion) {
        boolean hasUpdate = false;
        String[] locVersionS = locVersionName.split("\\.");
        String[] lastVersionS = lastVersion.split("\\.");

        if (!locVersionName.equals(lastVersion)) {
            if (locVersionS != null && lastVersion != null) {
                int localLenth = locVersionS.length;
                int lastVerLenth = lastVersionS.length;

                // int netLenth = lastVersion.length();
                for (int i = 0; i < lastVerLenth; i++) {
                    if (localLenth < lastVerLenth && i == localLenth) {
                        hasUpdate = true;
                        return hasUpdate;
                    }

                    if (Integer.valueOf(lastVersionS[i]) > Integer
                            .valueOf(locVersionS[i])) {
                        hasUpdate = true;
                        return hasUpdate;
                    } else if (Integer.valueOf(lastVersionS[i]) < Integer
                            .valueOf(locVersionS[i])) {
                        hasUpdate = false;
                        return hasUpdate;
                    }
                }
            }
        } else {
            hasUpdate = false;
        }
        return hasUpdate;
    }

    /**
     * bitmap转byte数组
     *
     * @param bmp
     * @param needRecycle
     * @return
     */
    public static byte[] bmpToByteArray(final Bitmap bmp,
                                        final boolean needRecycle) {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        bmp.compress(CompressFormat.PNG, 100, output);
        if (needRecycle) {
            bmp.recycle();
        }

        byte[] result = output.toByteArray();
        try {
            output.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

        return result;
    }

    /**
     * 实现文本复制功能 add by lif
     *
     * @param content
     */
    public static void copy(String content, Context context) {
        // 得到剪贴板管理器
        ClipboardManager cmb = (ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);
        cmb.setText(content.trim());
        HankkinUtils.showToast(context, "内容已复制");
    }

    /**
     * 实现粘贴功能 add by lif
     *
     * @param context
     * @return
     */
    public static String paste(Context context) {
        // 得到剪贴板管理器
        ClipboardManager cmb = (ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);
        return cmb.getText().toString().trim();
    }

    /**
     * 隐藏软键盘
     */
    public static void hideSoftInputMethod(Activity act) {
        View view = act.getWindow().peekDecorView();
        if (view != null) {
            // 隐藏虚拟键盘
            InputMethodManager inputmanger = (InputMethodManager) act
                    .getSystemService(act.INPUT_METHOD_SERVICE);
            inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0);
        }
    }

    /**
     * 切换软件盘 显示隐藏
     */
    public static void switchSoftInputMethod(Activity act) {
        // 方法一(如果输入法在窗口上已经显示,则隐藏,反之则显示)
        InputMethodManager iMM = (InputMethodManager) act
                .getSystemService(Context.INPUT_METHOD_SERVICE);
        iMM.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
    }




    /**
     * 验证是否手机号码
     *
     * @param mobiles
     * @return
     */
    public static boolean isMobileNO(String mobiles) {
        String telRegex = "[1][358]\\d{9}";//"[1]"代表第1位为数字1,"[358]"代表第二位可以为3、5、8中的一个,"\\d{9}"代表后面是可以是0~9的数字,有9位。
        if (TextUtils.isEmpty(mobiles)) return false;
        else return mobiles.matches(telRegex);
    }

    /**
     * 中文识别
     */
    public static boolean hasChinese(String source) {
        String reg_charset = "([\\u4E00-\\u9FA5]*+)";
        Pattern p = Pattern.compile(reg_charset);
        Matcher m = p.matcher(source);
        boolean hasChinese = false;
        while (m.find()) {
            if (!"".equals(m.group(1))) {
                hasChinese = true;
            }
        }
        return hasChinese;
    }

    /**
     * 用户名规则判断
     *
     * @param uname
     * @return
     */
    public static boolean isAccountStandard(String uname) {
        Pattern p = Pattern.compile("[A-Za-z0-9_]+");
        Matcher m = p.matcher(uname);
        return m.matches();
    }

    // java 合并两个byte数组
    public static byte[] byteMerger(byte[] byte_1, byte[] byte_2) {
        byte[] byte_3 = new byte[byte_1.length + byte_2.length];
        System.arraycopy(byte_1, 0, byte_3, 0, byte_1.length);
        System.arraycopy(byte_2, 0, byte_3, byte_1.length, byte_2.length);
        return byte_3;
    }

    /**
     * 删除文件夹下所有文件
     * Hankkin at:2015年4月21日 20:05:01
     *
     * @param file
     */
    public static void delete(File file) {
        if (file.isFile()) {
            file.delete();
            return;
        }
        if (file.isDirectory()) {
            File[] childFiles = file.listFiles();
            if (childFiles == null || childFiles.length == 0) {
                file.delete();
                return;
            }
            for (int i = 0; i < childFiles.length; i++) {
                delete(childFiles[i]);
            }
//			file.delete();
        }
    }


    /**
     * 取得系统版本号
     * by: Hankkin at: 2015-04-13
     *
     * @param context
     * @return version 当前项目版本号
     */
    public static String GetVersion(Context context) {
        try {
            PackageInfo manager = context.getPackageManager().getPackageInfo(
                    context.getPackageName(), 0);
            return manager.versionName;
        } catch (PackageManager.NameNotFoundException e) {
            return "Unknown";
        }
    }





    public static boolean isExternalStorageDocument(Uri uri) {
        return "com.android.externalstorage.documents".equals(uri
                .getAuthority());
    }


    public static boolean isDownloadsDocument(Uri uri) {
        return "com.android.providers.downloads.documents".equals(uri
                .getAuthority());
    }

    public static boolean isMediaDocument(Uri uri) {
        return "com.android.providers.media.documents".equals(uri
                .getAuthority());
    }

    public static boolean isGooglePhotosUri(Uri uri) {
        return "com.google.android.apps.photos.content".equals(uri
                .getAuthority());
    }

//	public static String getDateAgo(int timeline){
//		long curTimeline = System.currentTimeMillis();
//		int timeInterval = timeline - curTimeline;
//		if (timeInterval<60){
//			return "1分钟内";
//		}
//		else if (timeInterval<3600){
//			return ""+Math.floor(timeInterval/60)+"分钟前";
//		}
//		else if (timeInterval<86400){
//			return ""+Math.floor(timeInterval/3600)+"小时前";
//		}
//		else if (timeInterval<2592000){
//			return ""+Math.floor(timeInterval/86400)+"天前";
//		}
//		else if (timeInterval<31536000){
//			return ""+Math.floor(timeInterval/2592000)+"个月前";
//		}
//		else {
//			return ""+Math.floor(timeInterval/31536000)+"年前";
//		}
//	}


    /**
     * 创建视频临时帧图片
     * by Hankkin at:2015年8月18日 11:21:03
     *
     * @param filePath
     * @return
     */
    public static Bitmap getVideoThumbnail(String filePath) {
        Bitmap bitmap = null;
        MediaMetadataRetriever retriever = new MediaMetadataRetriever();
        try {
            retriever.setDataSource(filePath);
            bitmap = retriever.getFrameAtTime();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (RuntimeException e) {
            e.printStackTrace();
        } finally {
            try {
                retriever.release();
            } catch (RuntimeException e) {
                e.printStackTrace();
            }
        }
        return bitmap;
    }


    public static boolean isDebug = true;// 是否需要打印bug,可以在application的onCreate函数里面初始化
    /**
     * 记录上次点击时间
     */
    private static long lastClickTime;

    /**
     * 是否快速双击点击
     *
     * @return isFastDoubleClick
     */
    public static boolean isFastDoubleClick() {
        long time = System.currentTimeMillis();
        if (time - lastClickTime < 600) {
            return true;
        } else {
            lastClickTime = time;
            return false;
        }
    }

/*-----------------------toast start-----------------------*/

    /**
     * 提示字符串
     * short Toast
     *
     * @param context
     * @param text
     */
    public static void showToast(Context context, String text) {
        Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }

    /**
     * 提示字符串
     * short Toast
     *
     * @param context
     * @param text
     */
    public static void showLToast(Context context, String text) {
        Toast toast = Toast.makeText(context, text, Toast.LENGTH_LONG);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }

    /**
     * 提示根据ResId关联字符串
     * short Toast
     * by:Hankkin at:2015年4月30日 14:39:41
     *
     * @param context
     * @param resId
     */
    public static void showToast(Context context, int resId) {
        Toast toast = Toast.makeText(context, resId, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }

    /**
     * 提示根据ResId关联字符串
     * 时常long	Toast
     * by:Hankkin at:2015年4月30日 14:39:41
     *
     * @param context
     * @param resId
     */
    public static void showLToast(Context context, int resId) {
        Toast toast = Toast.makeText(context, resId, Toast.LENGTH_LONG);
        ;
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }
    /*-----------------------toast end-----------------------*/
    /*获得屏幕相关的辅助类*/
    /*-----------------------screen start-----------------------*/

    /**
     * 获得屏幕高度
     *
     * @param context
     * @return
     */
    public static int getScreenWidth(Context context) {
        WindowManager wm = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics outMetrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(outMetrics);
        return outMetrics.widthPixels;
    }

    /**
     * 获得屏幕宽度
     *
     * @param context
     * @return
     */
    public static int getScreenHeight(Context context) {
        WindowManager wm = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics outMetrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(outMetrics);
        return outMetrics.heightPixels;
    }

    /**
     * 获取屏幕密度
     *
     * @param context
     * @return
     */
    public static float getScreenDensity(Context context) {
        return context.getResources().getDisplayMetrics().density;
    }

    /**
     * dip转px像素
     *
     * @param context
     * @param px
     * @return
     */
    public static int dip2px(Context context, float px) {
        final float scale = getScreenDensity(context);
        return (int) (px * scale + 0.5);
    }

    /**
     * 获得状态栏的高度
     *
     * @param context
     * @return
     */
    public static int getStatusHeight(Context context) {

        int statusHeight = -1;
        try {
            Class<?> clazz = Class.forName("com.android.internal.R$dimen");
            Object object = clazz.newInstance();
            int height = Integer.parseInt(clazz.getField("status_bar_height")
                    .get(object).toString());
            statusHeight = context.getResources().getDimensionPixelSize(height);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return statusHeight;
    }

    /**
     * 获取当前屏幕截图,包含状态栏
     *
     * @param activity
     * @return
     */
    public static Bitmap snapShotWithStatusBar(Activity activity) {
        View view = activity.getWindow().getDecorView();
        view.setDrawingCacheEnabled(true);
        view.buildDrawingCache();
        Bitmap bmp = view.getDrawingCache();
        int width = getScreenWidth(activity);
        int height = getScreenHeight(activity);
        Bitmap bp = null;
        bp = Bitmap.createBitmap(bmp, 0, 0, width, height);
        view.destroyDrawingCache();
        return bp;

    }

    /**
     * 获取当前屏幕截图,不包含状态栏
     *
     * @param activity
     * @return
     */
    public static Bitmap snapShotWithoutStatusBar(Activity activity) {
        View view = activity.getWindow().getDecorView();
        view.setDrawingCacheEnabled(true);
        view.buildDrawingCache();
        Bitmap bmp = view.getDrawingCache();
        Rect frame = new Rect();
        activity.getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
        int statusBarHeight = frame.top;

        int width = getScreenWidth(activity);
        int height = getScreenHeight(activity);
        Bitmap bp = null;
        bp = Bitmap.createBitmap(bmp, 0, statusBarHeight, width, height
                - statusBarHeight);
        view.destroyDrawingCache();
        return bp;

    }


    /**
     * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
     */
    public static int px2dip(Context context, float pxValue) {
        final float scale = context.getResources().getDisplayMetrics().density;
        return (int) (pxValue / scale + 0.5f);
    }


    /**
     * 读取照片exif信息中的旋转角度
     *
     * @param path 照片路径
     * @return角度
     */
    public static int readPictureDegree(String path) {
        int degree = 0;
        try {
            ExifInterface exifInterface = new ExifInterface(path);
            int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
            switch (orientation) {
                case ExifInterface.ORIENTATION_ROTATE_90:
                    degree = 90;
                    break;
                case ExifInterface.ORIENTATION_ROTATE_180:
                    degree = 180;
                    break;
                case ExifInterface.ORIENTATION_ROTATE_270:
                    degree = 270;
                    break;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return degree;
    }



    /*-----------------------screen end-----------------------*/
    /*日志打印*/
    /*-----------------------log start-----------------------*/
    // 下面四个是默认tag的函数
    public static void i(String msg) {
        if (isDebug)
            Log.i(TAG, msg);
    }

    public static void d(String msg) {
        if (isDebug)
            Log.d(TAG, msg);
    }

    public static void e(String msg) {
        if (isDebug)
            Log.e(TAG, msg);
    }

    public static void v(String msg) {
        if (isDebug)
            Log.v(TAG, msg);
    }

    // 下面是传入自定义tag的函数
    public static void i(String tag, String msg) {
        if (isDebug)
            Log.i(tag, msg);
    }

    public static void d(String tag, String msg) {
        if (isDebug)
            Log.i(tag, msg);
    }

    public static void e(String tag, String msg) {
        if (isDebug)
            Log.i(tag, msg);
    }

    public static void v(String tag, String msg) {
        if (isDebug)
            Log.i(tag, msg);
    }
    /*-----------------------log end-----------------------*/

    /**
     * 字符串转MD5
     * by黄海杰 at:2015-10-29 16:15:32
     *
     * @param string
     * @return
     */
    public static String md5(String string) {

        byte[] hash;

        try {

            hash = MessageDigest.getInstance("MD5").digest(string.getBytes("UTF-8"));

        } catch (NoSuchAlgorithmException e) {

            throw new RuntimeException("Huh, MD5 should be supported?", e);

        } catch (UnsupportedEncodingException e) {

            throw new RuntimeException("Huh, UTF-8 should be supported?", e);

        }


        StringBuilder hex = new StringBuilder(hash.length * 2);

        for (byte b : hash) {

            if ((b & 0xFF) < 0x10) hex.append("0");

            hex.append(Integer.toHexString(b & 0xFF));

        }

        return hex.toString();

    }


    /**
     * 获取手机号
     * by Hankkin
     * @param context
     * @return
     */
    public static String getPhoneNumber(Context context){
        TelephonyManager mTelephonyMgr;
        mTelephonyMgr = (TelephonyManager)  context.getSystemService(Context.TELEPHONY_SERVICE);
        return mTelephonyMgr.getLine1Number();
    }




}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/BaseActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.ContentUris;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.PersistableBundle;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import com.hankkin.compustrading.FileUploadListener;
import com.hankkin.compustrading.R;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.model.Person;
import com.pnikosis.materialishprogress.ProgressWheel;

import java.io.File;

import cn.bmob.v3.datatype.BmobFile;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.UploadFileListener;
import me.drakeet.materialdialog.MaterialDialog;

/**
 * Created by Hankkin on 15/12/20.
 */
public class BaseActivity extends AppCompatActivity {

    /*请求相机Code*/
    public static final int REQUST_CODE_CAMERA = 0;
    /*请求相册Code*/
    public static final int REQUEST_CODE_GALLERY = 1;
    /*发布商品Code*/
    public static final int REQUEST_CODE_FABU = 2;

    public MaterialDialog loadDialog;

    @Override
    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
    }


    public Person getCurrentPerson(Context context){
        Person person = Person.getCurrentUser(Person.class);
        return person;
    }

    /**
     * 调用相册
     * by Hankkin at:2015-12-20 23:00:16
     * @param act
     */
    public  void getImageFromGallery(Activity act) {
        Intent intent = new Intent(Intent.ACTION_PICK);
        intent.setType("image/*");
        // 开启一个带有返回值的Activity,请求码为PHOTO_REQUEST_GALLERY
        act.startActivityForResult(intent, REQUEST_CODE_GALLERY);
    }

    /**
     * 上传图片
     * by Hankkin at:2015-12-20 23:00:34
     */

    public void uploadImg(final String filepath, Context context, final FileUploadListener listener){
        final BmobFile file = new BmobFile(new File(filepath));
        file.upload(new UploadFileListener() {
            @Override
            public void done(BmobException e) {
                if (e == null){
                    listener.success(file.getFileUrl());
                }
                else {
                    listener.fail();
                }
            }
        });

    }


    public void showLoadingDialog(){
        loadDialog = new MaterialDialog(this);
        View view = LayoutInflater.from(this).inflate(R.layout.loading,null,false);
        ProgressWheel wheel = (ProgressWheel) view.findViewById(R.id.pw_loading);
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(80,80);
        params.height = HankkinUtils.dip2px(this,80);
        params.width = HankkinUtils.dip2px(this,80);
        wheel.setLayoutParams(params);
        wheel.setBackgroundColor(getResources().getColor(R.color.light_white));
        loadDialog.setView(view);
        loadDialog.setBackgroundResource(getResources().getColor(R.color.transparent));
        loadDialog.show();
    }

    public void dimissDialog(){
        if (loadDialog!=null){
            loadDialog.dismiss();
        }
    }

    /**
     * 初始化图片路径
     *
     * @return
     */
    public static String iniFilePath(Activity act) {
        String filepath = null;
        String path = null;
        File fileSD = null;

        // 准备存储位置
        boolean sdExist = Environment.getExternalStorageState()
                .equals(android.os.Environment.MEDIA_MOUNTED);
        if (!sdExist) {
            HankkinUtils.showLToast(act, "没有找到SD存储卡");
            return null;

        } else {
            //TODO 内容提示完善
            path = Environment.getExternalStorageDirectory().getPath() + "/compustrading/Camera";
            fileSD = new File(path);
            if (fileSD.exists()) {
                filepath = path + "/" + System.currentTimeMillis() + ".jpg";
            } else {
                fileSD.mkdir();
                filepath = fileSD.getAbsolutePath() + "/" + System.currentTimeMillis() + ".jpg";
            }
            return filepath;
        }
    }

    /**
     * 调用相机
     *
     * @param act
     */
    public static void goCamera(Activity act, String filepath) {
        File file = new File(filepath);
        // 启动Camera
        Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
        act.startActivityForResult(intent, REQUST_CODE_CAMERA);
    }


    /**
     * 从URI获取本地路径
     *
     * @param selectedVideoUri
     * @param contentResolver
     * @return
     */
    public static  String getAbsoluteImagePath(Activity activity, Uri contentUri) {

        //如果是对媒体文件,在android开机的时候回去扫描,然后把路径添加到数据库中。
        //由打印的contentUri可以看到:2种结构。正常的是:content://那么这种就要去数据库读取path。
        //另外一种是Uri是 file:///那么这种是 Uri.fromFile(File file);得到的
        System.out.println(contentUri);

        String[] projection = { MediaStore.Images.Media.DATA };
        String urlpath;
        CursorLoader loader = new CursorLoader(activity,contentUri, projection, null, null, null);
        Cursor cursor = loader.loadInBackground();
        try
        {
            int column_index = cursor.getColumnIndex(MediaStore.Images.Media.DATA);
            cursor.moveToFirst();
            urlpath =cursor.getString(column_index);
            //如果是正常的查询到数据库。然后返回结构
            return urlpath;
        }
        catch (Exception e)
        {

            e.printStackTrace();
            // TODO: handle exception
        }finally{
            if(cursor != null){
                cursor.close();
            }
        }

        //如果是文件。Uri.fromFile(File file)生成的uri。那么下面这个方法可以得到结果
        urlpath = contentUri.getPath();
        return urlpath;
    }

    /**
     * android系统版本选择图库图片解决方法---获取图片路径
     * by Hankkin at:2015-3-10
     *
     * @param context
     * @param uri
     * @return
     */
    @TargetApi(Build.VERSION_CODES.KITKAT)
    public static String getPath(final Context context, final Uri uri) {
        final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
        // DocumentProvider
        if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
            // ExternalStorageProvider
            if (isExternalStorageDocument(uri)) {
                final String docId = DocumentsContract.getDocumentId(uri);
                final String[] split = docId.split(":");
                final String type = split[0];
                if ("primary".equalsIgnoreCase(type)) {
                    return Environment.getExternalStorageDirectory() + "/"
                            + split[1];
                }
                // TODO handle non-primary volumes
            }
            // DownloadsProvider
            else if (isDownloadsDocument(uri)) {
                final String id = DocumentsContract.getDocumentId(uri);
                final Uri contentUri = ContentUris.withAppendedId(
                        Uri.parse("content://downloads/public_downloads"),
                        Long.valueOf(id));
                return getDataColumn(context, contentUri, null, null);
            }
            // MediaProvider
            else if (isMediaDocument(uri)) {
                final String docId = DocumentsContract.getDocumentId(uri);
                final String[] split = docId.split(":");
                final String type = split[0];
                Uri contentUri = null;
                if ("image".equals(type)) {
                    contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
                } else if ("video".equals(type)) {
                    contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
                } else if ("audio".equals(type)) {
                    contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
                }
                final String selection = MediaStore.MediaColumns._ID + "=?";
                final String[] selectionArgs = new String[]{split[1]};
                return getDataColumn(context, contentUri, selection,
                        selectionArgs);
            }
        }
        // MediaStore (and general)
        else if ("content".equalsIgnoreCase(uri.getScheme())) {
            // Return the remote address
            if (isGooglePhotosUri(uri))
                return uri.getLastPathSegment();
            return getDataColumn(context, uri, null, null);
        }
        // File
        else if ("file".equalsIgnoreCase(uri.getScheme())) {
            return uri.getPath();
        }
        return null;
    }
    /**
     * android系统版本选择图库图片解决方法--获取数据
     * by Hankkin at:2015-3-10
     *
     * @param context
     * @param uri
     * @param selection
     * @param selectionArgs
     * @return
     */
    public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
        Cursor cursor = null;
        final String column = MediaStore.MediaColumns.DATA;
        final String[] projection = {column};
        try {
            cursor = context.getContentResolver().query(uri, projection,
                    selection, selectionArgs, null);
            if (cursor != null && cursor.moveToFirst()) {
                final int index = cursor.getColumnIndexOrThrow(column);
                return cursor.getString(index);
            }
        } finally {
            if (cursor != null)
                cursor.close();
        }
        return null;
    }

    public static boolean isExternalStorageDocument(Uri uri) {
        return "com.android.externalstorage.documents".equals(uri
                .getAuthority());
    }


    public static boolean isDownloadsDocument(Uri uri) {
        return "com.android.providers.downloads.documents".equals(uri
                .getAuthority());
    }

    public static boolean isMediaDocument(Uri uri) {
        return "com.android.providers.media.documents".equals(uri
                .getAuthority());
    }

    public static boolean isGooglePhotosUri(Uri uri) {
        return "com.google.android.apps.photos.content".equals(uri
                .getAuthority());
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/LoginActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.hankkin.compustrading.R;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.model.Person;
import com.hankkin.compustrading.sharepreference.MySP;
import com.pnikosis.materialishprogress.ProgressWheel;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.LogInListener;

public class LoginActivity extends AppCompatActivity {

    @Bind(R.id.btn_login)
    Button btnLogin;
    @Bind(R.id.tv_back)
    TextView tvBack;
    @Bind(R.id.tv_register)
    TextView tvRegister;
    @Bind(R.id.et_login_name)
    EditText etName;
    @Bind(R.id.et_login_pwd)
    EditText etPwd;
    @Bind(R.id.pw_loading)
    ProgressWheel wheel;

    public static LoginActivity instance;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        instance = this;
        setContentView(R.layout.activity_login);

        ButterKnife.bind(this);
        initViews();
    }


    private void initViews() {
        wheel.stopSpinning();
    }

    @OnClick(R.id.tv_register)
    public void register() {
        Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);
        startActivity(intent);
    }

    @OnClick(R.id.tv_back)
    public void back() {
        finish();
    }

    @OnClick(R.id.btn_login)
    public void login() {
        wheel.spin();
        final String name = etName.getText().toString().trim();
        final String pwd = etPwd.getText().toString().trim();
        if (TextUtils.isEmpty(name)) {
            HankkinUtils.showToast(LoginActivity.this, "用户名不能为空");
            return;
        }
        if (TextUtils.isEmpty(pwd)) {
            HankkinUtils.showToast(LoginActivity.this, "密码不能为空");
            return;
        }
        Person.loginByAccount(name, pwd, new LogInListener<Person>() {
            @Override
            public void done(Person person, BmobException e) {
                MySP.setPASSWoRD(LoginActivity.this, pwd);
                MySP.setUSERNAME(LoginActivity.this, name);
                wheel.stopSpinning();
                HankkinUtils.showToast(LoginActivity.this, "登录成功");
                Intent intent = new Intent(LoginActivity.this, MainShowActivity.class);
                startActivity(intent);
                finish();
                if (LoginActivity.instance != null) {
                    LoginActivity.instance.finish();
                }
                if (PersonActivity.instance != null) {
                    PersonActivity.instance.finish();
                }
                if (MainShowActivity.instance!=null){
                    MainShowActivity.instance.finish();
                }
            }
        });
    }



}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/MainShowActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;

import com.hankkin.compustrading.R;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.adapter.CategoryFragmentAdapter;
import com.hankkin.compustrading.fragment.CateDetailFragment;
import com.hankkin.compustrading.model.Category;
import com.hankkin.compustrading.model.Person;
import com.hankkin.compustrading.model.Product;
import com.hankkin.compustrading.view.PagerSlidingTabStrip;
import com.hankkin.compustrading.view.RippleView;
import com.hankkin.compustrading.view.RoundedImageView;
import com.hankkin.compustrading.view.floatbutton.FloatingActionButton;
import com.hankkin.compustrading.view.floatbutton.FloatingActionsMenu;
import com.nostra13.universalimageloader.core.ImageLoader;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;
import cn.bmob.v3.update.BmobUpdateAgent;


public class MainShowActivity extends BaseActivity {


    /**
     * 分类滑动选项卡
     */
    private PagerSlidingTabStrip pagerTab;
    /**
     * 滑动组件
     */
    private ViewPager pager;
    /**
     * 选项fragment界面
     */
    private ArrayList<CateDetailFragment> fragments;

    /**
     * 分类数组
     */
    private ArrayList<Category> categories = new ArrayList<>();
    /**
     * 分类界面适配器
     */
    private CategoryFragmentAdapter adapter;

    DrawerLayout drawerLayout;
    ActionBarDrawerToggle drawerToggle;
    @Bind(R.id.rv_usericon)
    RoundedImageView rvUser;
    @Bind(R.id.tv_person)
    TextView tvPerson;
    @Bind(R.id.rv_logreg)
    RippleView rvLogReg;
    @Bind(R.id.tv_username)
    TextView tvName;
    @Bind(R.id.rv_buy)
    RippleView rvBuy;
    @Bind(R.id.rv_sale)
    RippleView rvSale;
    @Bind(R.id.rv_sina)
    RippleView rvSina;
    @Bind(R.id.rv_qq)
    RippleView rvQQ;
    @Bind(R.id.tv_qq)
    TextView tvQQ;
    @Bind(R.id.tv_sina)
    TextView tvSina;
    @Bind(R.id.tv_buy)
    TextView tvBuy;
    @Bind(R.id.tv_sale)
    TextView tvSale;
    @Bind(R.id.tv_show)
    TextView tvShow;

    private Handler handler;
    private Person person;

    @Bind(R.id.multiple_actions)
    FloatingActionsMenu floatingActionsMenu;
    public static MainShowActivity instance;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        instance = this;
        setContentView(R.layout.activity_main_show);
        BmobUpdateAgent.update(this);
        ButterKnife.bind(this);
        init();

        handler = new Handler() {
            @Override
            public void handleMessage(Message msg) {
                super.handleMessage(msg);
                if (msg.what == 0) {
                    for (int i = 0; i < categories.size(); i++) {
                        CateDetailFragment fragment = new CateDetailFragment();
                        fragment.setFab(floatingActionsMenu);
                        Bundle bundle = new Bundle();
                        bundle.putInt("cid", categories.get(i).getId());
                        bundle.putSerializable("products", (Serializable) msg.obj);
                        fragment.setArguments(bundle);
                        fragments.add(fragment);
                    }

                    adapter = new CategoryFragmentAdapter(getSupportFragmentManager(), fragments, categories);
                    pager.setAdapter(adapter);
                    pagerTab.setViewPager(pager);
                    dimissDialog();
                }
            }
        };

    }

    /**
     * 初始化数据
     * by Hankkin at:2015-11-29 19:29:52
     */
    private void init() {


        drawerLayout = (DrawerLayout) findViewById(R.id.drawerlayout);
        drawerToggle = new ActionBarDrawerToggle(MainShowActivity.this, drawerLayout, R.string.hello_world, R.string.hello_world);
        drawerLayout.setDrawerListener(drawerToggle);

        //设定左上角突变可点击
        getSupportActionBar().setHomeButtonEnabled(true);
        // 给左上角图标的左边加上一个返回的图标 。对应ActionBar.DISPLAY_HOME_AS_UP
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        //设置标题
        getSupportActionBar().setTitle(getResources().getString(R.string.action_title));

        pager = (ViewPager) findViewById(R.id.pager);
        pagerTab = (PagerSlidingTabStrip) findViewById(R.id.tab);
        pager.setOffscreenPageLimit(4);


        fragments = new ArrayList<>();


        /**
         * 更新按钮点击事件
         * by Hankkin at:2015-12-23 17:29:52
         */
        FloatingActionButton fbUpdate = (FloatingActionButton) findViewById(R.id.fb_update);
        fbUpdate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                fragments.get(pager.getCurrentItem()).hideFab();
                fragments.get(pager.getCurrentItem()).updatePeo();

            }
        });
        /**
         * 新建按钮点击事件
         * by Hankkin at:2015-12-23 17:30:17
         */
        FloatingActionButton fbWrite = (FloatingActionButton) findViewById(R.id.fb_new);
        fbWrite.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Person person = BmobUser.getCurrentUser(Person.class);
                if (person != null) {
                    fragments.get(pager.getCurrentItem()).hideFab();
                    Intent intent = new Intent(MainShowActivity.this, NewProductActivity.class);
                    startActivity(intent);
                } else {
                    fragments.get(pager.getCurrentItem()).hideFab();
                    Intent intent = new Intent(MainShowActivity.this, LoginActivity.class);
                    startActivity(intent);
                    HankkinUtils.showToast(MainShowActivity.this, "请先登录");
                }
            }
        });

        FloatingActionButton fbMy = (FloatingActionButton) findViewById(R.id.fb_person);
        fbMy.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                fragments.get(pager.getCurrentItem()).hideFab();
                Intent intent = new Intent(MainShowActivity.this, PersonActivity.class);
                startActivity(intent);
            }
        });

        person = getCurrentPerson(MainShowActivity.this);
        if (person != null) {
            rvBuy.setVisibility(View.VISIBLE);
            rvSale.setVisibility(View.VISIBLE);
            rvQQ.setVisibility(View.GONE);
            rvSina.setVisibility(View.GONE);
            if (!TextUtils.isEmpty(person.getUser_icon())) {
                ImageLoader.getInstance().displayImage(person.getUser_icon(), rvUser);
            }
            tvPerson.setText("个人中心");
            if (!TextUtils.isEmpty(person.getNickname())) {
                tvName.setText(person.getNickname());
            } else {
                tvName.setText("用户" + person.getUsername().substring(0, 3));
            }
            tvShow.setText("我的");
        } else {
            rvUser.setBackground(getResources().getDrawable(R.drawable.defaut));
            tvPerson.setText("登录或注册");
            tvName.setText("");
            rvBuy.setVisibility(View.GONE);
            rvSale.setVisibility(View.GONE);
            rvQQ.setVisibility(View.VISIBLE);
            rvSina.setVisibility(View.VISIBLE);
            tvShow.setText("其他登录方式");
        }


        rvLogReg.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
            @Override
            public void onComplete(RippleView rippleView) {
                if (person != null) {
                    Intent intent = new Intent(MainShowActivity.this, PersonActivity.class);
                    startActivity(intent);
                } else {
                    Intent intent = new Intent(MainShowActivity.this, LoginActivity.class);
                    startActivity(intent);
                }
            }
        });
        rvBuy.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
            @Override
            public void onComplete(RippleView rippleView) {
                drawerLayout.closeDrawers();
            }
        });
        rvSale.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
            @Override
            public void onComplete(RippleView rippleView) {
                Intent intent = new Intent(MainShowActivity.this, NewProductActivity.class);
                startActivity(intent);
                drawerLayout.closeDrawers();
            }
        });


        ArrayList<Category> categoryList = new ArrayList<>();
        categoryList = (ArrayList<Category>) getIntent().getSerializableExtra("categories");
        if (categoryList!=null){
            if (categoryList.size()>0){
                categories.addAll(categoryList);
                queryProductsHttp();
            }
            else {
                queryCategory();
            }
        }
        else {
            queryCategory();
        }
    }




    private void queryProductsHttp() {
        BmobQuery<Product> productBmobQuery = new BmobQuery<>();
        productBmobQuery.order("-createdAt");
        productBmobQuery.findObjects(new FindListener<Product>() {
            @Override
            public void done(List<Product> list, BmobException e) {
                if (e == null){
                    if (list != null && list.size() > 0) {
                        List<Product> data = new ArrayList<Product>();
                        for (Product p : list) {
                            data.add(p);
                        }
                        Message msg = new Message();
                        msg.what = 0;
                        msg.obj = data;
                        handler.sendMessage(msg);
                    }
                }
            }
        });

    }

    @Override
    public void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        //该方法会自动和actionBar关联, 将开关的图片显示在了action上,如果不设置,也可以有抽屉的效果,不过是默认的图标
        drawerToggle.syncState();
    }

    /** 设备配置改变时 */
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        drawerToggle.onConfigurationChanged(newConfig);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (drawerToggle.onOptionsItemSelected(item))
            return true;

        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_person) {
            Intent intent = new Intent(MainShowActivity.this, PersonActivity.class);
            startActivity(intent);
        }

        return super.onOptionsItemSelected(item);
    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            if (floatingActionsMenu.isExpanded()) {
                floatingActionsMenu.collapse();
                return true;
            }
        }
        return super.onKeyDown(keyCode, event);
    }

    /**
     * Bmob查询分类数据显示选项卡
     * by Hankkin at:2015-11-29 19:39:45
     */
    private void queryCategory() {
        showLoadingDialog();
        BmobQuery<Category> categoryBmobQuery = new BmobQuery<>();
        categoryBmobQuery.order("createdAt");// 按照时间降序
        categoryBmobQuery.findObjects(new FindListener<Category>() {
            @Override
            public void done(List<Category> list, BmobException e) {
                if (e == null){
                    if (list != null && list.size() > 0) {
                        categories = new ArrayList<Category>();
                        categories.addAll(list);
                        queryProductsHttp();
                    }
                }
                else {
                    HankkinUtils.showToast(MainShowActivity.this, e.getMessage());
                }
            }
        });
    }

}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/NewProductActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.hankkin.compustrading.FileUploadListener;
import com.hankkin.compustrading.R;
import com.hankkin.compustrading.Utils.BitmapUtils;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.model.Product;
import com.weiwangcn.betterspinner.library.BetterSpinner;

import java.util.Date;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;
import me.drakeet.materialdialog.MaterialDialog;

public class NewProductActivity extends BaseActivity {

    @Bind(R.id.et_tel)
    EditText etTel;
    @Bind(R.id.et_name)
    EditText etName;
    @Bind(R.id.et_price)
    EditText etPrice;
    @Bind(R.id.spinner_school)
    BetterSpinner spinnerSchool;
    @Bind(R.id.tv_cate)
    TextView tvCate;
    @Bind(R.id.btn_fabu)
    Button btnFabu;
    @Bind(R.id.iv_add_pro)
    ImageView ivAddPro;
    @Bind(R.id.tv_back)
    TextView tvBack;

    private String[] schools;
    private String filePath = "";
    private int cid=0;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_product);
        ButterKnife.bind(this);

        init();

    }

    private void init(){
        schools = getResources().getStringArray(R.array.school);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_dropdown_item_1line, schools);
        spinnerSchool.setAdapter(adapter);
//        String tel = HankkinUtils.getPhoneNumber(NewProductActivity.this);
//        if (!TextUtils.isEmpty(tel)){
//            etTel.setText(tel);
//        }

        tvBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    /**
     * 选择分类对话框
     * by Hankkin at:2015-12-24 17:39:17
     */
    @OnClick(R.id.tv_cate)
    void showCate(){
        final ArrayAdapter<String> arrayAdapter
                = new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1);
        final String[] cates = getResources().getStringArray(R.array.cate);
        for (int j = 0; j < cates.length; j++) {
            arrayAdapter.add(cates[j]);
        }

        ListView listView = new ListView(this);
        listView.setLayoutParams(new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
        float scale = getResources().getDisplayMetrics().density;
        listView.setDividerHeight(1);
        listView.setAdapter(arrayAdapter);
        final MaterialDialog alert = new MaterialDialog(this).setTitle(
                "请选择分类").setContentView(listView);

        alert.show();
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                String cate = cates[position];
                tvCate.setText(cate);
                cid = position;
                alert.dismiss();
            }
        });
    }


    /**
     * 选择图片对话框
     * by Hankkin at:2015-12-20 23:25:37
     */
    @OnClick(R.id.iv_add_pro)
    void showMDdialog() {
        View view = LayoutInflater.from(NewProductActivity.this).inflate(R.layout.view_select_img, null, false);
        final MaterialDialog dialog = new MaterialDialog(this).setView(view);
        dialog.show();
        TextView tvGallery = (TextView) view.findViewById(R.id.tv_gallery);
        tvGallery.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                getImageFromGallery(NewProductActivity.this);
            }
        });
        TextView tvCamera = (TextView) view.findViewById(R.id.tv_camera);
        tvCamera.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                filePath = iniFilePath(NewProductActivity.this);
                goCamera(NewProductActivity.this, filePath);
            }
        });
    }

    /**
     * 接受选择照片的结果显示
     * by Hankkin at:2015-12-24 17:41:49
     * @param requestCode
     * @param resultCode
     * @param data
     */
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if (requestCode == REQUEST_CODE_GALLERY) {
            if(data == null){
                return;
            }
            filePath = getAbsoluteImagePath(NewProductActivity.this, data.getData());
            if (!TextUtils.isEmpty(filePath)) {
                ivAddPro.setImageBitmap(BitmapUtils.getCompressedBitmap(NewProductActivity.this, filePath));
            }
        } else if (requestCode == REQUST_CODE_CAMERA) {
            if (!TextUtils.isEmpty(filePath)) {
              Bitmap  temp  =  BitmapUtils.getCompressedBitmap(NewProductActivity.this, filePath);
                if(temp==null){
                    return;
                }
                ivAddPro.setImageBitmap(temp);
            }
        }
    }

    /**
     * 发布按钮点击事件
     * 上传图片, 创建新商品
     * by Hankkin at:2015-12-24 18:33:15
     */
    @OnClick(R.id.btn_fabu)
    void addNewPro(){
        if (!HankkinUtils.isMobileNO(etTel.getText().toString().trim())){
            HankkinUtils.showToast(NewProductActivity.this,"请输入正确的手机号");
            return;
        }
        if (TextUtils.isEmpty(etPrice.getText().toString().trim())||
                TextUtils.isEmpty(etTel.getText().toString().trim())||
                TextUtils.isEmpty(etName.getText().toString().trim())){
            HankkinUtils.showToast(NewProductActivity.this,"请完善信息");
            return;
        }
        if (TextUtils.isEmpty(tvCate.getText())||TextUtils.isEmpty(spinnerSchool.getText().toString())){
            HankkinUtils.showToast(NewProductActivity.this,"请完善信息");
            return;
        }
        if (!TextUtils.isEmpty(filePath)){
            showLoadingDialog();
            Bitmap tempBitmap = BitmapUtils.getCompressedBitmap(NewProductActivity.this, filePath);
            if (BitmapUtils.readPictureDegree(filePath) == 90) {
                tempBitmap = BitmapUtils.toturn(tempBitmap);
            }
            filePath = BitmapUtils.saveBitmap(tempBitmap,new Date().getTime() + "");

            uploadImg(filePath, NewProductActivity.this, new FileUploadListener() {
                @Override
                public void success(String url) {
                    Product product = new Product();
                    product.setName(etName.getText().toString());
                    product.setCid(cid);
                    product.setUsername(getCurrentPerson(NewProductActivity.this).getNickname());
                    product.setPrice(etPrice.getText().toString());
                    product.setSchool(spinnerSchool.getText().toString());
                    product.setProduct_url(url);
                    product.setUser_tel(etTel.getText().toString());
                    product.setUser_icon_url(getCurrentPerson(NewProductActivity.this).getUser_icon());
                    addProHttp(product);
                }

                @Override
                public void fail() {
                    dimissDialog();
                    HankkinUtils.showToast(NewProductActivity.this, "发布失败");
                }
            });
        }
    }

    /**
     * 保存新商品
     * by Hankkin at:2015-12-24 18:32:38
     * @param product
     */
    private void addProHttp(final Product product){
        product.save(new SaveListener<String>() {
            @Override
            public void done(String s, BmobException e) {
                if (e == null){
                    dimissDialog();
                    HankkinUtils.showToast(NewProductActivity.this, "发布成功");
                    finish();
                }
                else {
                    dimissDialog();
                    HankkinUtils.showToast(NewProductActivity.this,"发布失败");
                }
            }
        });
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/PersonActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hankkin.compustrading.FileUploadListener;
import com.hankkin.compustrading.R;
import com.hankkin.compustrading.Utils.BitmapUtils;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.model.Person;
import com.hankkin.compustrading.model.PersonShow;
import com.hankkin.compustrading.view.PullToZoomScrollViewEx;
import com.hankkin.compustrading.view.RippleView;
import com.hankkin.compustrading.view.RoundedImageView;
import com.nostra13.universalimageloader.core.ImageLoader;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import butterknife.Bind;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.UpdateListener;
import me.drakeet.materialdialog.MaterialDialog;

public class PersonActivity extends BaseActivity {
    @Bind(R.id.tv_back)
    TextView tvBack;
    private PullToZoomScrollViewEx scrollView;
    private List<PersonShow> data = new ArrayList<>();

    private TextView tvLogin, tvRegister;
    private RoundedImageView ivUserIcon;

    View headView;
    View zoomView;
    View contentView;

    public static PersonActivity instance;
    private String filePath = "";
    private RippleView rvLogout;
    private RippleView rvBuy;
    private RippleView rvSale;
    private TextView tvLogout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        instance = this;
        setContentView(R.layout.activity_person);
        initViews();
        initData();
    }

    private void initViews() {
        tvBack = (TextView) findViewById(R.id.tv_back);
        scrollView = (PullToZoomScrollViewEx) findViewById(R.id.my_pull_scoll);
        loadViewForCode();

        scrollView.getPullRootView().findViewById(R.id.tv_test1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
            }
        });


        DisplayMetrics localDisplayMetrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
        int mScreenHeight = localDisplayMetrics.heightPixels;
        int mScreenWidth = localDisplayMetrics.widthPixels;
        LinearLayout.LayoutParams localObject = new LinearLayout.LayoutParams(mScreenWidth, (int) (9.0F * (mScreenWidth / 16.0F)));
        scrollView.setHeaderLayoutParams(localObject);

        tvBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    private void initData() {

        Person person = Person.getCurrentUser(Person.class);
        if (person != null) {
            ImageLoader.getInstance().displayImage(person.getUser_icon(), ivUserIcon);
            tvLogin.setVisibility(View.GONE);
            tvRegister.setVisibility(View.GONE);
            tvLogout.setText("退出账号");
        } else {
            tvLogin.setVisibility(View.VISIBLE);
            tvRegister.setVisibility(View.VISIBLE);
            ivUserIcon.setImageDrawable(getResources().getDrawable(R.drawable.defaut));
            tvLogout.setText("登录");
        }

    }

    private void loadViewForCode() {
        PullToZoomScrollViewEx scrollView = (PullToZoomScrollViewEx) findViewById(R.id.my_pull_scoll);
        headView = LayoutInflater.from(this).inflate(R.layout.profile_head_view, null, false);
        zoomView = LayoutInflater.from(this).inflate(R.layout.profile_zoom_view, null, false);
        contentView = LayoutInflater.from(this).inflate(R.layout.profile_contect_view, null, false);
        scrollView.setHeaderView(headView);
        scrollView.setZoomView(zoomView);
        scrollView.setScrollContentView(contentView);

        tvLogin = (TextView) headView.findViewById(R.id.tv_login);
        tvRegister = (TextView) headView.findViewById(R.id.tv_register);
        ivUserIcon = (RoundedImageView) headView.findViewById(R.id.iv_user_head);
        rvLogout = (RippleView) contentView.findViewById(R.id.rv_logout);
        tvLogout = (TextView) contentView.findViewById(R.id.tv_logout);
        rvLogout.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
            @Override
            public void onComplete(RippleView rippleView) {
                Person.logOut();
                HankkinUtils.showToast(PersonActivity.this, "已注销");
                initData();
                finish();
            }
        });

        rvBuy = (RippleView) contentView.findViewById(R.id.rv_buy);
        rvBuy.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
            @Override
            public void onComplete(RippleView rippleView) {
                finish();
            }
        });

        rvSale = (RippleView) contentView.findViewById(R.id.rv_sale);
        rvSale.setOnRippleCompleteListener(new RippleView.OnRippleCompleteListener() {
            @Override
            public void onComplete(RippleView rippleView) {
                Intent intent = new Intent(PersonActivity.this,NewProductActivity.class);
                startActivity(intent);
                finish();
            }
        });

        tvLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(PersonActivity.this, LoginActivity.class);
                startActivity(intent);
            }
        });

        tvRegister.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(PersonActivity.this, RegisterActivity.class);
                startActivity(intent);
            }
        });
        ivUserIcon.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (getCurrentPerson(PersonActivity.this)!=null){
                    showMDdialog();
                }
            }
        });
    }

    /**
     * 选择图片对话框
     * by Hankkin at:2015-12-20 23:25:37
     */
    private void showMDdialog() {
        View view = LayoutInflater.from(PersonActivity.this).inflate(R.layout.view_select_img, null, false);
        final MaterialDialog dialog = new MaterialDialog(this).setView(view);
        dialog.show();
        TextView tvGallery = (TextView) view.findViewById(R.id.tv_gallery);
        tvGallery.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                getImageFromGallery(PersonActivity.this);
            }
        });
        TextView tvCamera = (TextView) view.findViewById(R.id.tv_camera);
        tvCamera.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                filePath = iniFilePath(PersonActivity.this);
                goCamera(PersonActivity.this, filePath);
            }
        });
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == REQUEST_CODE_GALLERY) {
            showLoadingDialog();
            filePath = getPath(PersonActivity.this, data.getData());
            if (!TextUtils.isEmpty(filePath)) {
                uploadImg(filePath, PersonActivity.this, new FileUploadListener() {

                    @Override
                    public void success(final String url) {
                        Person person = Person.getCurrentUser( Person.class);
                        person.setUser_icon(url);
                        ImageLoader.getInstance().displayImage(url, ivUserIcon);
                        updateUser(person);
                    }

                    @Override
                    public void fail() {
                        dimissDialog();
                        HankkinUtils.showToast(PersonActivity.this, "上传失败");
                    }
                });
            }
        } else if (requestCode == REQUST_CODE_CAMERA) {
            showLoadingDialog();
            if (!TextUtils.isEmpty(filePath)) {
                Bitmap tempBitmap = BitmapUtils.getCompressedBitmap(PersonActivity.this, filePath);
                if (BitmapUtils.readPictureDegree(filePath) == 90) {
                    tempBitmap = BitmapUtils.toturn(tempBitmap);
                }
                filePath = BitmapUtils.saveBitmap(tempBitmap,new Date().getTime() + "");
                uploadImg(filePath, PersonActivity.this, new FileUploadListener() {

                    @Override
                    public void success(String url) {
                        Person person = Person.getCurrentUser(Person.class);
                        person.setUser_icon(url);
//                        MyImageLoader.getInstance().displayImage(PersonActivity.this,url, ivUserIcon);
                        ImageLoader.getInstance().displayImage(url, ivUserIcon);
                        updateUser(person);
                    }

                    @Override
                    public void fail() {
                        dimissDialog();
                        HankkinUtils.showToast(PersonActivity.this, "上传失败");
                    }
                });
            }
        }
    }

    /**
     * 更新个人用户信息
     * by Hankkin at:2015-12-23 19:34:17
     *
     * @param person
     */
    private void updateUser(Person person) {
        person.update(person.getObjectId(), new UpdateListener() {
            @Override
            public void done(BmobException e) {
                if (e == null){
                    dimissDialog();
                    HankkinUtils.showToast(PersonActivity.this, "上传成功");
                }
            }
        });
    }

}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/ProdectDetailActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

import com.hankkin.compustrading.R;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.model.Product;
import com.nostra13.universalimageloader.core.ImageLoader;

public class ProdectDetailActivity extends AppCompatActivity {

    private Product product;
    private TextView tvDesc,tvProName,tvTime,tvSchool,tvPrice;
    private ImageView ivPro;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_prodect_detail);

        product = (Product) getIntent().getSerializableExtra("product");

        tvDesc = (TextView) findViewById(R.id.tv_pro_desc);
        tvProName = (TextView) findViewById(R.id.tv_pro_name);
        ivPro = (ImageView) findViewById(R.id.iv_product);
        tvTime = (TextView) findViewById(R.id.tv_time);
        tvSchool = (TextView) findViewById(R.id.tv_school);
        tvPrice = (TextView) findViewById(R.id.tv_price);

        //透明状态栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        //透明导航栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        toolbar.setNavigationIcon(android.support.v7.appcompat.R.drawable.abc_ic_ab_back_material);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        toolbar.inflateMenu(R.menu.menu_prodect_detail);
        toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                switch (item.getItemId()) {
                    case R.id.action_share:
                        HankkinUtils.showToast(ProdectDetailActivity.this, "分享");
                        break;
                    case R.id.action_settings:
                        HankkinUtils.showToast(ProdectDetailActivity.this, "举报");
                        break;
                }
                return false;
            }
        });

        CollapsingToolbarLayout collapsingAvatarToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
        collapsingAvatarToolbar.setBackgroundColor(getResources().getColor(R.color.theme_color));
        collapsingAvatarToolbar.setExpandedTitleGravity(Gravity.CENTER_VERTICAL);
        collapsingAvatarToolbar.setExpandedTitleColor(getResources().getColor(R.color.theme_color));
        TextView tv = (TextView) findViewById(R.id.username);
        tv.setText(product.getUsername());


        tvProName.setText(product.getName());
        tvDesc.setText(product.getDesc());
        ImageLoader.getInstance().displayImage(product.getProduct_url(),ivPro);
        tvPrice.setText("¥" + product.getPrice());
        tvSchool.setText(product.getSchool());
        tvTime.setText(product.getCreatedAt());

    }

}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/RegisterActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.hankkin.compustrading.R;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.model.Person;
import com.hankkin.compustrading.sharepreference.MySP;
import com.pnikosis.materialishprogress.ProgressWheel;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.LogInListener;
import cn.bmob.v3.listener.SaveListener;

public class RegisterActivity extends AppCompatActivity {

    @Bind(R.id.btn_register)
    Button btnRegister;
    @Bind(R.id.et_login_name)
    EditText etName;
    @Bind(R.id.et_login_pwd)
    EditText etPwd;
    @Bind(R.id.tv_back)
    TextView tvBack;
    @Bind(R.id.pw_loading)
    ProgressWheel wheel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);

        ButterKnife.bind(this);

        initViews();
    }

    private void initViews(){
        wheel.stopSpinning();
    }

    /**
     * 注册用户
     * by Hankkin at:2015-12-20 21:13:02
     */
    @OnClick(R.id.btn_register)
    public void register(View view){
        wheel.spin();
        final String name = etName.getText().toString().trim();
        final String pwd = etPwd.getText().toString().trim();
        if (TextUtils.isEmpty(name)){
            HankkinUtils.showToast(RegisterActivity.this,"用户名不能为空");
            return;
        }
        if (TextUtils.isEmpty(pwd)){
            HankkinUtils.showToast(RegisterActivity.this,"密码不能为空");
            return;
        }
        if (!HankkinUtils.isMobileNO(name)){
            HankkinUtils.showToast(RegisterActivity.this,"请输入正确的手机号");
            return;
        }
        Person person = new Person();
        person.setUsername(name);
        person.setPassword(pwd);
        person.signUp(new SaveListener<Object>() {
            @Override
            public void done(Object o, BmobException e) {
                if (e == null){
                    MySP.setPASSWoRD(RegisterActivity.this,pwd);
                    MySP.setUSERNAME(RegisterActivity.this, name);
                    wheel.stopSpinning();
                    HankkinUtils.showToast(RegisterActivity.this, "注册成功");
                    Intent intent = new Intent(RegisterActivity.this,MainShowActivity.class);
                    startActivity(intent);
                    finish();
                    if (LoginActivity.instance!=null){
                        LoginActivity.instance.finish();
                    }
                    if (PersonActivity.instance!=null){
                        PersonActivity.instance.finish();
                    }
                    if (MainShowActivity.instance!=null){
                        MainShowActivity.instance.finish();
                    }
                    BmobUser.loginByAccount("username", "用户密码", new LogInListener<Person>() {
                        @Override
                        public void done(Person person, BmobException e) {
                            if (e == null){

                            }
                        }
                    });
                }
                else {
                    wheel.stopSpinning();
                    HankkinUtils.showToast(RegisterActivity.this, "注册失败");
                }
            }
        });
    }

    @OnClick(R.id.tv_back)
    void back(){
        finish();
    }


}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/SearchProActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.hankkin.compustrading.R;

public class SearchProActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search_pro);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_search, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/activity/SplasActivity.java
================================================
package com.hankkin.compustrading.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.view.Menu;
import android.view.MenuItem;
import android.view.WindowManager;

import com.hankkin.compustrading.R;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.model.Category;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;

public class SplasActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splas);
        //透明状态栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        //透明导航栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        long size = new File(Environment.getExternalStorageDirectory().getPath() + File.separator + "compustrading" +"/app-release.apk").length();
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(2000);
                    queryCategory();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_splas, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    /**
     * Bmob查询分类数据显示选项卡
     * by Hankkin at:2015-11-29 19:39:45
     */
    private void queryCategory() {
        BmobQuery<Category> categoryBmobQuery = new BmobQuery<>();
        categoryBmobQuery.order("createdAt");// 按照时间降序
        categoryBmobQuery.findObjects(new FindListener<Category>() {
            @Override
            public void done(List<Category> list, BmobException e) {
                if (e == null){
                    if (list != null && list.size() > 0) {
                        ArrayList<Category> categories = new ArrayList<Category>();
                        categories.addAll(list);
                        Intent intent = new Intent(SplasActivity.this,MainShowActivity.class);
                        Bundle bundle = new Bundle();
                        bundle.putSerializable("categories", (Serializable) categories);
                        intent.putExtras(bundle);
                        startActivity(intent);
                        finish();
                    }
                }
                else {
                    HankkinUtils.showToast(SplasActivity.this, e.getMessage());
                }
            }

        });
    }

}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/adapter/CategoryFragmentAdapter.java
================================================
package com.hankkin.compustrading.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.hankkin.compustrading.fragment.CateDetailFragment;
import com.hankkin.compustrading.model.Category;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Hankkin on 15/11/29.
 */
public class CategoryFragmentAdapter extends FragmentPagerAdapter {

    private List<CateDetailFragment> fragments;
    private ArrayList<Category> categories;

    public CategoryFragmentAdapter(FragmentManager fm, List<CateDetailFragment> fragments,ArrayList<Category> categories) {
        super(fm);
        this.fragments = fragments;
        this.categories = categories;
    }

    public CategoryFragmentAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return categories.size();
    }

    public String getPageTitle(int i){
        return categories.get(i).getName();
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/adapter/PersonInfoAdapter.java
================================================
package com.hankkin.compustrading.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.hankkin.compustrading.R;
import com.hankkin.compustrading.model.PersonShow;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Created by Hankkin on 15/12/6.
 */
public class PersonInfoAdapter extends BaseAdapter {
    private List<PersonShow> data = new ArrayList<>();
    private Context context;
    private LayoutInflater inflater;

    public PersonInfoAdapter(List<PersonShow> data, Context context) {
        this.data = data;
        this.context = context;
        this.inflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return data.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null){
            holder = new ViewHolder();
            convertView = inflater.inflate(R.layout.listview_personinfo,null);
            holder.tvTitle = (TextView) convertView.findViewById(R.id.tv_title);
            holder.tvContent = (TextView) convertView.findViewById(R.id.tv_content);
            convertView.setTag(holder);
        }
        else {
            holder = (ViewHolder) convertView.getTag();
        }
        holder.tvTitle.setText(data.get(position).getTitle());
        holder.tvContent.setText(data.get(position).getContent());
        return convertView;
    }

    class ViewHolder{
        TextView tvTitle,tvContent;
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/adapter/ProductAdapter.java
================================================
package com.hankkin.compustrading.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.hankkin.compustrading.R;
import com.hankkin.compustrading.model.Product;
import com.hankkin.compustrading.view.RoundedImageView;
import com.nostra13.universalimageloader.core.ImageLoader;

import java.util.List;

/**
 * Created by Hankkin on 15/11/29.
 */
public class ProductAdapter extends BaseAdapter {

    private List<Product> data;
    private LayoutInflater inflater;
    private Context context;

    public ProductAdapter(List<Product> data, Context context) {
        this.data = data;
        this.context = context;
        inflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return data.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null){
            holder = new ViewHolder();
            convertView = inflater.inflate(R.layout.lv_product_item,null);
            holder.ivProduct = (ImageView) convertView.findViewById(R.id.iv_product);
            holder.rivUserIcon = (RoundedImageView) convertView.findViewById(R.id.riv_usericon);
            holder.tvName = (TextView) convertView.findViewById(R.id.tv_name);
            holder.tvPrice = (TextView) convertView.findViewById(R.id.tv_price);
            holder.tvPubTime = (TextView) convertView.findViewById(R.id.tv_pub_time);
            holder.tvSchool = (TextView) convertView.findViewById(R.id.tv_school);
            holder.tvContent = (TextView) convertView.findViewById(R.id.tv_content);
            convertView.setTag(holder);
        }
        else {
            holder = (ViewHolder) convertView.getTag();
        }
        Product product = data.get(position);
        holder.tvSchool.setText(product.getSchool());
        holder.tvPubTime.setText(product.getCreatedAt());
        if (!TextUtils.isEmpty(product.getUsername())){
            holder.tvName.setText(product.getUsername());
        }
        else {
            holder.tvName.setText(product.getUser_tel());
        }
        if (!TextUtils.isEmpty(product.getUser_icon_url())){
            ImageLoader.getInstance().displayImage(product.getUser_icon_url(),holder.rivUserIcon);
        }
        else {
            holder.rivUserIcon.setImageDrawable(context.getResources().getDrawable(R.drawable.defaut));
        }
        holder.tvPrice.setText("¥"+product.getPrice());
        holder.tvContent.setText(product.getName());
        ImageLoader.getInstance().displayImage(product.getProduct_url(),holder.ivProduct);
        return convertView;
    }

    class ViewHolder{
        TextView tvPrice,tvPubTime,tvName,tvSchool,tvContent;
        ImageView ivProduct;
        RoundedImageView rivUserIcon;
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/fragment/CateDetailFragment.java
================================================
package com.hankkin.compustrading.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ListView;

import com.hankkin.compustrading.R;
import com.hankkin.compustrading.ScrollDirectionListener;
import com.hankkin.compustrading.Utils.HankkinUtils;
import com.hankkin.compustrading.activity.ProdectDetailActivity;
import com.hankkin.compustrading.adapter.ProductAdapter;
import com.hankkin.compustrading.model.Product;
import com.hankkin.compustrading.view.RefreshLayout;
import com.hankkin.compustrading.view.floatbutton.FloatingActionsMenu;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.datatype.BmobDate;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;

/**
 * Created by Hankkin on 15/11/29.
 */
public class CateDetailFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener,RefreshLayout.OnLoadListener{
    private RefreshLayout swipeRefreshLayout;
    private ListView lvProduct;
    private List<Product> productList = new ArrayList<>();

    private int cid = 0;
    private ProductAdapter adapter;
    private FloatingActionsMenu fab;


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            cid = getArguments().getInt("cid");
            List<Product> data = (List<Product>) getArguments().getSerializable("products");
            productList.clear();
            for (int i = 0; i < data.size(); i++) {
                if (data.get(i).getCid() == cid) {
                    productList.add(data.get(i));
                }
            }
        }
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_item, container, false);
        initViews(view);

        return view;
    }


    private void initViews(View view) {
        lvProduct = (ListView) view.findViewById(R.id.lv_product);
        swipeRefreshLayout = (RefreshLayout) view.findViewById(R.id.swipeRefreshLayout);
        swipeRefreshLayout.setChildView(lvProduct);
        //设置卷内的颜色
        swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright,
                android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
        swipeRefreshLayout.setOnLoadListener(this);
        swipeRefreshLayout.setOnRefreshListener(this);



        adapter = new ProductAdapter(productList, getActivity());
        lvProduct.setAdapter(adapter);

    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        lvProduct.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent = new Intent(getActivity(), ProdectDetailActivity.class);
                Bundle bundle = new Bundle();
                bundle.putSerializable("product", (Serializable) adapter.getItem(position));
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });

        if (fab!=null){
            fab.attachToListView(lvProduct, new ScrollDirectionListener() {
                @Override
                public void onScrollDown() {
                    Log.d("ListViewFragment", "onScrollDown()");
                }

                @Override
                public void onScrollUp() {
                    Log.d("ListViewFragment", "onScrollUp()");
                }
            }, new AbsListView.OnScrollListener() {
                @Override
                public void onScrollStateChanged(AbsListView view, int scrollState) {
                    Log.d("ListViewFragment", "onScrollStateChanged()");
                }

                @Override
                public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
                    Log.d("ListViewFragment", "onScroll()");
                }
            });
        }
    }

    /**
     * 根据商品Id查询商品
     * by Hankkin at:2015-12-19 23:19:41
     * @param cid
     */
    private void queryProductsByIdHttp(int cid) {
        BmobQuery<Product> productBmobQuery = new BmobQuery<>();
        productBmobQuery.order("-createdAt");
        productBmobQuery.setLimit(10);
        productBmobQuery.addWhereEqualTo("cid", cid);
        productBmobQuery.findObjects(new FindListener<Product>() {
            @Override
            public void done(List<Product> list, BmobException e) {
                if (e == null){
                    if (list != null && list.size() > 0) {
                        productList.clear();
                        productList.addAll(list);
                        adapter = new ProductAdapter(productList, getActivity());
                        lvProduct.setAdapter(adapter);
                        swipeRefreshLayout.setRefreshing(false);
                    }
                }
                else {
                    HankkinUtils.showLToast(getActivity(),e.getMessage());
                }
            }


        });
    }

    private void queryProductsByIdHttp1(int cid) {
        BmobQuery<Product> productBmobQuery = new BmobQuery<>();
        Product product = (Product) adapter.getItem(adapter.getCount() - 1);
        String time = product.getCreatedAt();
        SimpleDateFormat sdf = new SimpleDateFormat(time);
        try {
            Date date = sdf.parse(time);
            productBmobQuery.addWhereLessThan("createdAt",new BmobDate(date));
        } catch (ParseException e) {
            e.printStackTrace();
        }
        productBmobQuery.order("-createdAt");
        productBmobQuery.setLimit(10);
        productBmobQuery.addWhereEqualTo("cid", cid);
        productBmobQuery.findObjects(new FindListener<Product>() {
            @Override
            public void done(List<Product> list, BmobException e) {
                if (e == null){
                    if (list != null && list.size() > 0) {
                        productList.addAll(list);
                        adapter.notifyDataSetChanged();
                        swipeRefreshLayout.setLoading(false);
                    } else {
                        HankkinUtils.showToast(getActivity().getApplicationContext(), "暂无新数据");
                        swipeRefreshLayout.setLoading(false);
                    }
                }else {
                    HankkinUtils.showLToast(getActivity(),e.getMessage());
                }
            }
        });
    }

    public void updatePeo() {
        swipeRefreshLayout.setRefreshing(true);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                queryProductsByIdHttp(cid);
            }
        }, 2000);
    }

    @Override
    public void onLoad() {
        swipeRefreshLayout.postDelayed(new Runnable() {
            @Override
            public void run() {
                queryProductsByIdHttp1(cid);
            }
        }, 2000);
    }

    @Override
    public void onRefresh() {
        swipeRefreshLayout.postDelayed(new Runnable() {
            @Override
            public void run() {
                queryProductsByIdHttp(cid);
            }
        }, 2000);
    }

    public ListView getLvProduct(){
        return lvProduct;
    }

    public void  setFab(FloatingActionsMenu fab){
        this.fab = fab;
    }

    public void hideFab(){
        fab.toggle();
    }

}




================================================
FILE: app/src/main/java/com/hankkin/compustrading/interface/FileUploadListener.java
================================================
package com.hankkin.compustrading;

/**
 * Created by Hankkin on 15/12/20.
 */
public interface FileUploadListener  {
    void success(String url);
    void fail();
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/interface/ScrollDirectionListener.java
================================================
package com.hankkin.compustrading;

public interface ScrollDirectionListener {
    void onScrollDown();

    void onScrollUp();
}

================================================
FILE: app/src/main/java/com/hankkin/compustrading/model/Category.java
================================================
package com.hankkin.compustrading.model;


import cn.bmob.v3.BmobObject;

/**
 * Created by Hankkin on 15/11/29.
 */
public class Category extends BmobObject{
    private Integer id;
    private String name;
    private String desc;
    private int pid;

    public Category(Integer id,String name, String desc, int pid) {
        this.id = id;
        this.name = name;
        this.desc = desc;
        this.pid = pid;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }



}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/model/Person.java
================================================
package com.hankkin.compustrading.model;

import cn.bmob.v3.BmobObject;
import cn.bmob.v3.BmobUser;

/**
 * Created by Hankkin on 15/12/6.
 */
public class Person extends BmobUser {
    private String name;
    private String tel;
    private String user_icon;
    private String nickname;
    private String sex;
    private String birth;




    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getUser_icon() {
        return user_icon;
    }

    public void setUser_icon(String user_icon) {
        this.user_icon = user_icon;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getBirth() {
        return birth;
    }

    public void setBirth(String birth) {
        this.birth = birth;
    }

}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/model/PersonShow.java
================================================
package com.hankkin.compustrading.model;

/**
 * Created by Hankkin on 15/12/6.
 */
public class PersonShow {
    private String title;
    private String content;


    public PersonShow(String title, String content) {
        this.title = title;
        this.content = content;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/model/Product.java
================================================
package com.hankkin.compustrading.model;

import cn.bmob.v3.BmobObject;

/**
 * Created by Hankkin on 15/11/29.
 */
public class Product extends BmobObject {
    private int id;
    private String name;
    private String price;
    private String desc;
    private String user_tel;
    private int cid;
    private String product_url;
    private String school;
    private String username;
    private String user_icon_url;


    public Product() {
    }

    public Product(int id,String name,String price,String desc,String user_tel,int category_id){
        this.id=id;
        this.name = name;
        this.price=price;
        this.desc=desc;
        this.user_tel=user_tel;
        this.cid=category_id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getUser_tel() {
        return user_tel;
    }

    public void setUser_tel(String user_tel) {
        this.user_tel = user_tel;
    }

    public int getCid() {
        return cid;
    }

    public void setCid(int cid) {
        this.cid = cid;
    }

    public String getProduct_url() {
        return product_url;
    }

    public void setProduct_url(String product_url) {
        this.product_url = product_url;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUser_icon_url() {
        return user_icon_url;
    }

    public void setUser_icon_url(String user_icon_url) {
        this.user_icon_url = user_icon_url;
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/sharepreference/MySP.java
================================================
package com.hankkin.compustrading.sharepreference;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Hankkin on 15/12/20.
 */
public class MySP {

    private static final String PREFERENCE_NAME = "SYSTEM";
    static SharedPreferences mSP = null;

    public static String USERNAME = "username";
    public static String PASSWORD = "password";

    public static String getUSERNAME(Context context) {
        return getStringData(context,PASSWORD);
    }

    public static void setUSERNAME(Context context,String username) {
        saveData(context,USERNAME,username);
    }

    public static String getPASSWoRD(Context context) {
        return getStringData(context,PASSWORD);
    }

    public static void setPASSWoRD(Context context,String password) {
       saveData(context,PASSWORD,password);
    }


    static boolean saveData(Context context, String key, Object value) {
        if (context == null || key == null || value == null) {
            return false;
        }
        if (mSP == null) {
            mSP = context.getSharedPreferences(PREFERENCE_NAME,
                    Context.MODE_PRIVATE);
        }
        SharedPreferences.Editor editor = mSP.edit();

        if (value instanceof Boolean) {
            editor.putBoolean(key, (Boolean) value);
        } else if (value instanceof Float) {
            editor.putFloat(key, (Float) value);
        } else if (value instanceof Integer) {
            editor.putInt(key, (Integer) value);
        } else if (value instanceof Long) {
            editor.putLong(key, (Long) value);
        } else if (value instanceof String) {
            editor.putString(key, (String) value);
        } else {
            return false;
        }
        return editor.commit();
    }

    static String getStringData(Context context, String key) {
        String value = null;
        if (context == null || key == null) {
            return value;
        }
        if (mSP == null) {
            mSP = context.getSharedPreferences(PREFERENCE_NAME,
                    Context.MODE_PRIVATE);
        }
        value = mSP.getString(key, null);
        return value;

    }

    static boolean getBooleanData(Context context, String key) {
        boolean value = false;
        if (context == null || key == null) {
            return value;
        }
        if (mSP == null) {
            mSP = context.getSharedPreferences(PREFERENCE_NAME,
                    Context.MODE_PRIVATE);
        }
        value = mSP.getBoolean(key, false);
        return value;

    }

    static int getIntData(Context context, String key) {
        int value = 0;
        if (context == null || key == null) {
            return value;
        }
        if (mSP == null) {
            mSP = context.getSharedPreferences(PREFERENCE_NAME,
                    Context.MODE_PRIVATE);
        }
        value = mSP.getInt(key, 0);
        return value;

    }

    static long getLongData(Context context, String key) {
        long value = -1;
        if (context == null || key == null) {
            return value;
        }
        if (mSP == null) {
            mSP = context.getSharedPreferences(PREFERENCE_NAME,
                    Context.MODE_PRIVATE);
        }
        value = mSP.getLong(key, 0);
        return value;

    }

    static boolean deleteKey(Context context, String key) {
        if (context == null || key == null) {
            return false;
        }
        if (mSP == null) {
            mSP = context.getSharedPreferences(PREFERENCE_NAME,
                    Context.MODE_PRIVATE);
        }
        SharedPreferences.Editor editor = mSP.edit();
        editor.remove(key);
        return editor.commit();
    }

    static boolean deleteKeys(Context context, String... keys) {
        if (context == null || keys == null) {
            return false;
        }
        if (mSP == null) {
            mSP = context.getSharedPreferences(PREFERENCE_NAME,
                    Context.MODE_PRIVATE);
        }
        SharedPreferences.Editor editor = mSP.edit();
        for (int i = 0; i < keys.length; i++) {
            editor.remove(keys[i]);
        }
        return editor.commit();
    }
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/CustomViewAbove.java
================================================
package com.hankkin.compustrading.slidingmenu;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Build;
import android.support.v4.view.KeyEventCompat;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.VelocityTrackerCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewConfigurationCompat;
import android.util.AttributeSet;
import android.util.FloatMath;
import android.util.Log;
import android.view.FocusFinder;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SoundEffectConstants;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.Interpolator;
import android.widget.Scroller;



public class CustomViewAbove extends ViewGroup {

	private static final String TAG = "CustomViewAbove";
	private static final boolean DEBUG = false;

	//是否使用缓存
	private static final boolean USE_CACHE = false;

	//最大持续的时间
	private static final int MAX_SETTLE_DURATION = 600; // ms
	
	//最小滑动的距离
	private static final int MIN_DISTANCE_FOR_FLING = 25; // dips

	/**
	 * 定义一个修饰动画的效果类
	 * Interpolator被用来修饰动画效果,定义动画的变化率,可以使存在的动画效果可以 accelerated(加速),decelerated(减速),repeated(重复),bounced(弹跳)等。
	 */
	private static final Interpolator sInterpolator = new Interpolator() {
		public float getInterpolation(float t) {
			t -= 1.0f;
			return t * t * t * t * t + 1.0f;
		}
	};

	//定义内容视图
	private View mContent;

	//当前的选项
	private int mCurItem;
	
	//滚动滑轮
	private Scroller mScroller;

	//是否能够使用滑动缓存
	private boolean mScrollingCacheEnabled;

	//是否正在滑动
	private boolean mScrolling;

	//是否正在拖动
	private boolean mIsBeingDragged;
	
	//是否能够拖动
	private boolean mIsUnableToDrag;
	
	//定义触摸溢出的值
	private int mTouchSlop;
	
	//初始化触摸屏幕X轴的值
	private float mInitialMotionX;
	
	//最后移动到的X、Y的坐标
	private float mLastMotionX,mLastMotionY;
	
	/**
	 * 定义一个活动指针,在多点触摸的时候调用
	 */
	protected int mActivePointerId = INVALID_POINTER;
	
	/**
	 * 为当前的活动指针赋值
	 */
	private static final int INVALID_POINTER = -1;

	/**
	 * 触摸滚动期间的绝对速度
	 */
	protected VelocityTracker mVelocityTracker;
	
	//最小滑动速度值
	private int mMinimumVelocity;
	
	//最大滑动速度值
	protected int mMaximumVelocity;
	
	//滑动的距离
	private int mFlingDistance;

	//定义下方视图对象
	private CustomViewBehind mViewBehind;

	//是否能够使用
	private boolean mEnabled = true;

	//页面改变监听器
	private OnPageChangeListener mOnPageChangeListener;
	
	//内部页面改变监听器
	private OnPageChangeListener mInternalPageChangeListener;

	//关闭监听器
	private SlidingMenu.OnClosedListener mClosedListener;
	
	//打开监听器
	private SlidingMenu.OnOpenedListener mOpenedListener;

	//存放被忽略的视图组件列表
	private List<View> mIgnoredViews = new ArrayList<View>();

	/**
	 * 调用此接口去响应改变选中页面的状态
	 */
	public interface OnPageChangeListener {

		/**
		 * This method will be invoked when the current page is scrolled, either as part
		 * of a programmatically initiated smooth scroll or a user initiated touch scroll.
		 *
		 * @param position Position index of the first page currently being displayed.
		 *                 Page position+1 will be visible if positionOffset is nonzero.
		 * @param positionOffset Value from [0, 1) indicating the offset from the page at position.
		 * @param positionOffsetPixels Value in pixels indicating the offset from position.
		 */
		public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels);

		/**
		 * This method will be invoked when a new page becomes selected. Animation is not
		 * necessarily complete.
		 *
		 * @param position Position index of the new selected page.
		 */
		public void onPageSelected(int position);

	}

	/**
	 * Simple implementation of the {@link OnPageChangeListener} interface with stub
	 * implementations of each method. Extend this if you do not intend to override
	 * every method of {@link OnPageChangeListener}.
	 */
	public static class SimpleOnPageChangeListener implements OnPageChangeListener {

		public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
			// This space for rent
		}

		public void onPageSelected(int position) {
			// This space for rent
		}

		public void onPageScrollStateChanged(int state) {
			// This space for rent
		}

	}

	public CustomViewAbove(Context context) {
		this(context, null);
	}

	public CustomViewAbove(Context context, AttributeSet attrs) {
		super(context, attrs);
		initCustomViewAbove();
	}

	/**
	 * 初始化最上方视图
	 */
	void initCustomViewAbove() {
		//设置是否能够调用自定义的布局,false是可以
		setWillNotDraw(false);
		//优先其子类控件而获取到焦点
		setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
		//设置是否能够获取焦点
		setFocusable(true);
		
		//得到上下文
		final Context context = getContext();
		
		//实例化滚动器
		mScroller = new Scroller(context, sInterpolator);
		
		final ViewConfiguration configuration = ViewConfiguration.get(context);
		
		//获得能够进行手势滑动的距离,表示滑动的时候,手的移动要大于这个距离才开始移动控件
		mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
		
		//获得允许执行一个fling手势动作的最小速度值
		mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
		
		//获得允许执行一个fling手势动作的最大速度值
		mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
		
		setInternalPageChangeListener(new SimpleOnPageChangeListener() {
			public void onPageSelected(int position) {
				if (mViewBehind != null) {
					switch (position) {
					case 0:
					case 2:
						mViewBehind.setChildrenEnabled(true);
						break;
					case 1:
						mViewBehind.setChildrenEnabled(false);
						break;
					}
				}
			}
		});
		//获得该手机设备的屏幕密度值
		final float density = context.getResources().getDisplayMetrics().density;
		//滑动的距离
		mFlingDistance = (int) (MIN_DISTANCE_FOR_FLING * density);
	}

	/**
	 * 设置当前选中的项
	 */
	public void setCurrentItem(int item) {
		setCurrentItemInternal(item, true, false);
	}

	/**
	 * 设置当前选中的项,是否平滑的过渡到选中项的页面
	 */
	public void setCurrentItem(int item, boolean smoothScroll) {
		setCurrentItemInternal(item, smoothScroll, false);
	}

	/**
	 * 得到当前选中的项
	 */
	public int getCurrentItem() {
		return mCurItem;
	}

	/**
	 * 设置当前内部选中的项
	 */
	void setCurrentItemInternal(int item, boolean smoothScroll, boolean always) {
		setCurrentItemInternal(item, smoothScroll, always, 0);
	}

	/**
	 * 设置当前内部选中的项
	 */
	void setCurrentItemInternal(int item, boolean smoothScroll, boolean always, int velocity) {
		if (!always && mCurItem == item) {
			setScrollingCacheEnabled(false);
			return;
		}

		item = mViewBehind.getMenuPage(item);

		final boolean dispatchSelected = mCurItem != item;
		mCurItem = item;
		final int destX = getDestScrollX(mCurItem);
		if (dispatchSelected && mOnPageChangeListener != null) {
			mOnPageChangeListener.onPageSelected(item);
		}
		if (dispatchSelected && mInternalPageChangeListener != null) {
			mInternalPageChangeListener.onPageSelected(item);
		}
		if (smoothScroll) {
			smoothScrollTo(destX, 0, velocity);
		} else {
			completeScroll();
			scrollTo(destX, 0);
		}
	}

	/**
	 * 设置一个监听事件当页面改变或者加速滚动的时候调用
	 */
	public void setOnPageChangeListener(OnPageChangeListener listener) {
		mOnPageChangeListener = listener;
	}

	/**
	 * 设置打开监听事件
	 */
	public void setOnOpenedListener(SlidingMenu.OnOpenedListener l) {
		mOpenedListener = l;
	}

	/**
	 * 设置关闭监听事件
	 */
	public void setOnClosedListener(SlidingMenu.OnClosedListener l) {
		mClosedListener = l;
	}

	/**
	 * Set a separate OnPageChangeListener for internal use by the support library.
	 *
	 * @param listener Listener to set
	 * @return The old listener that was set, if any.
	 */
	OnPageChangeListener setInternalPageChangeListener(OnPageChangeListener listener) {
		OnPageChangeListener oldListener = mInternalPageChangeListener;
		mInternalPageChangeListener = listener;
		return oldListener;
	}

	/**
	 * 添加被忽略的组件
	 */
	public void addIgnoredView(View v) {
		if (!mIgnoredViews.contains(v)) {
			mIgnoredViews.add(v);
		}
	}

	/**
	 * 移除被忽略的组件
	 */
	public void removeIgnoredView(View v) {
		mIgnoredViews.remove(v);
	}

	/**
	 * 清空被忽略的组件
	 */
	public void clearIgnoredViews() {
		mIgnoredViews.clear();
	}

	// We want the duration of the page snap animation to be influenced by the distance that
	// the screen has to travel, however, we don't want this duration to be effected in a
	// purely linear fashion. Instead, we use this method to moderate the effect that the distance
	// of travel has on the overall snap duration.
	float distanceInfluenceForSnapDuration(float f) {
		f -= 0.5f; // center the values about 0.
		f *= 0.3f * Math.PI / 2.0f;
		return (float) Math.sin(f);
	}

	/**
	 * 得到滑动到的X轴的坐标
	 */
	public int getDestScrollX(int page) {
		switch (page) {
		case 0:
		case 2:
			return mViewBehind.getMenuLeft(mContent, page);
		case 1:
			return mContent.getLeft();
		}
		return 0;
	}

	/**
	 * 得到左边框
	 */
	private int getLeftBound() {
		return mViewBehind.getAbsLeftBound(mContent);
	}

	/**
	 * 得到右边框
	 */
	private int getRightBound() {
		return mViewBehind.getAbsRightBound(mContent);
	}

	public int getContentLeft() {
		return mContent.getLeft() + mContent.getPaddingLeft();
	}

	/**
	 * 得到滑动菜单是否打开
	 */
	public boolean isMenuOpen() {
		return mCurItem == 0 || mCurItem == 2;
	}

	/**
	 * 是否忽略视图
	 */
	private boolean isInIgnoredView(MotionEvent ev) {
		Rect rect = new Rect();
		for (View v : mIgnoredViews) {
			v.getHitRect(rect);
			if (rect.contains((int)ev.getX(), (int)ev.getY())) return true;
		}
		return false;
	}

	/**
	 * 得到下方视图的宽度
	 */
	public int getBehindWidth() {
		if (mViewBehind == null) {
			return 0;
		} else {
			return mViewBehind.getBehindWidth();
		}
	}

	/**
	 * 得到子控件的宽度
	 */
	public int getChildWidth(int i) {
		switch (i) {
		case 0:
			return getBehindWidth();
		case 1:
			return mContent.getWidth();
		default:
			return 0;
		}
	}

	/**
	 * 得到是否能够滑动
	 */
	public boolean isSlidingEnabled() {
		return mEnabled;
	}

	/**
	 * 设置是否能够滑动
	 */
	public void setSlidingEnabled(boolean b) {
		mEnabled = b;
	}

	/**
	 * 平滑的滑动到指定的位置
	 */
	void smoothScrollTo(int x, int y) {
		smoothScrollTo(x, y, 0);
	}

	/**
	 * 通过设置速度来平滑的滑动到指定的位置
	 */
	void smoothScrollTo(int x, int y, int velocity) {
		if (getChildCount() == 0) {
			// Nothing to do.
			setScrollingCacheEnabled(false);
			return;
		}
		//获得当前View显示部分的左边到第一个View的左边的距离
		int sx = getScrollX();
		int sy = getScrollY();
		
		int dx = x - sx;
		int dy = y - sy;
		
		//如果都等于0,说明正好是滑动了一个屏幕的距离
		if (dx == 0 && dy == 0) {
			completeScroll();
			if (isMenuOpen()) {
				if (mOpenedListener != null)
					mOpenedListener.onOpened();
			} else {
				if (mClosedListener != null)
					mClosedListener.onClosed();
			}
			return;
		}

		setScrollingCacheEnabled(true);
		mScrolling = true;

		//获得下方视图的宽度
		final int width = getBehindWidth();
		
		final int halfWidth = width / 2;
		
		//取两数中最小的值赋给滑动距离与下方视图宽度的比值
		final float distanceRatio = Math.min(1f, 1.0f * Math.abs(dx) / width);
		
		//获得当前滑动的距离
		final float distance = halfWidth + halfWidth * distanceInfluenceForSnapDuration(distanceRatio);

		//初始化持续的时间
		int duration = 0;
		
		//获得速度的绝对值
		velocity = Math.abs(velocity);
		
		if (velocity > 0) {
			//Math.round()四舍五入
			duration = 4 * Math.round(1000 * Math.abs(distance / velocity));
		} else {
			final float pageDelta = (float) Math.abs(dx) / width;
			duration = (int) ((pageDelta + 1) * 100);
			duration = MAX_SETTLE_DURATION;
		}
		//取两数中最小的一个值赋给持续的时间
		duration = Math.min(duration, MAX_SETTLE_DURATION);

		//开始滑动
		mScroller.startScroll(sx, sy, dx, dy, duration);
		
		//刷新界面
		invalidate();
	}

	/**
	 * 设置内容视图
	 */
	public void setContent(View v) {
		if (mContent != null) 
			this.removeView(mContent);
		mContent = v;
		addView(mContent);
	}

	/**
	 * 得到内容视图
	 */
	public View getContent() {
		return mContent;
	}

	/**
	 * 设置下方视图
	 */
	public void setCustomViewBehind(CustomViewBehind cvb) {
		mViewBehind = cvb;
	}

	/**
	 * 在父元素正要放置该控件时调用。它会问一个问题,“你想要用多大地方啊?”,然后传入两个参数——widthMeasureSpec和heightMeasureSpec。
	 */
	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		int width = getDefaultSize(0, widthMeasureSpec);
		int height = getDefaultSize(0, heightMeasureSpec);
		setMeasuredDimension(width, height);

		final int contentWidth = getChildMeasureSpec(widthMeasureSpec, 0, width);
		final int contentHeight = getChildMeasureSpec(heightMeasureSpec, 0, height);
		mContent.measure(contentWidth, contentHeight);
	}

	/**
	 * 当视图尺寸改变的时候调用
	 */
	@Override
	protected void onSizeChanged(int w, int h, int oldw, int oldh) {
		super.onSizeChanged(w, h, oldw, oldh);
		// Make sure scroll position is set correctly.
		if (w != oldw) {
			// [ChrisJ] - This fixes the onConfiguration change for orientation issue..
			// maybe worth having a look why the recomputeScroll pos is screwing
			// up?
			completeScroll();
			scrollTo(getDestScrollX(mCurItem), getScrollY());
		}
	}
	
	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {
		final int width = r - l;
		final int height = b - t;
		mContent.layout(0, 0, width, height);
	}

	/**
	 * 设置上方视图的偏移量
	 */
	public void setAboveOffset(int i) {		
		mContent.setPadding(i, mContent.getPaddingTop(), mContent.getPaddingRight(), mContent.getPaddingBottom());
	}


	@Override
	public void computeScroll() {
		if (!mScroller.isFinished()) {
			if (mScroller.computeScrollOffset()) {
				int oldX = getScrollX();
				int oldY = getScrollY();
				int x = mScroller.getCurrX();
				int y = mScroller.getCurrY();

				if (oldX != x || oldY != y) {
					scrollTo(x, y);
					pageScrolled(x);
				}

				// Keep on drawing until the animation has finished.
				invalidate();
				return;
			}
		}

		//完成滑动,清除状态
		completeScroll();
	}

	/**
	 * 页面滚动
	 */
	private void pageScrolled(int xpos) {
		final int widthWithMargin = getWidth();
		final int position = xpos / widthWithMargin;
		final int offsetPixels = xpos % widthWithMargin;
		final float offset = (float) offsetPixels / widthWithMargin;

		onPageScrolled(position, offset, offsetPixels);
	}

	/**
	 * 页面滚动
	 *
	 * @param position Position index of the first page currently being displayed.
	 *                 Page position+1 will be visible if positionOffset is nonzero.
	 * @param offset Value from [0, 1) indicating the offset from the page at position.
	 * @param offsetPixels Value in pixels indicating the offset from position.
	 */
	protected void onPageScrolled(int position, float offset, int offsetPixels) {
		if (mOnPageChangeListener != null) {
			mOnPageChangeListener.onPageScrolled(position, offset, offsetPixels);
		}
		if (mInternalPageChangeListener != null) {
			mInternalPageChangeListener.onPageScrolled(position, offset, offsetPixels);
		}
	}

	/**
	 * 完成滑动
	 */
	private void completeScroll() {
		//是否需要移动
		boolean needPopulate = mScrolling;
		
		if (needPopulate) {
			// Done with scroll, no longer want to cache view drawing.
			setScrollingCacheEnabled(false);
			//终止动画效果
			mScroller.abortAnimation();
			
			//获得滚动条初始的坐标
			int oldX = getScrollX();
			int oldY = getScrollY();
			
			//获得滚动条当前的坐标
			int x = mScroller.getCurrX();
			int y = mScroller.getCurrY();
			
			//如果滚动条初始的坐标和当前的坐标不等则滑动
			if (oldX != x || oldY != y) {
				scrollTo(x, y);
			}
			if (isMenuOpen()) {
				if (mOpenedListener != null)
					mOpenedListener.onOpened();
			} else {
				if (mClosedListener != null)
					mClosedListener.onClosed();
			}
		}
		//将滑动的状态设置为false
		mScrolling = false;
	}

	//获得触摸模式的值
	protected int mTouchMode = SlidingMenu.TOUCHMODE_MARGIN;

	/**
	 * 设置触摸的模式
	 */
	public void setTouchMode(int i) {
		mTouchMode = i;
	}

	/**
	 * 得到触摸的模式
	 */
	public int getTouchMode() {
		return mTouchMode;
	}

	/**
	 * 判断是否允许触摸打开滑动菜单
	 */
	private boolean thisTouchAllowed(MotionEvent ev) {
		int x = (int) (ev.getX() + mScrollX);
		if (isMenuOpen()) {
			return mViewBehind.menuOpenTouchAllowed(mContent, mCurItem, x);
		} else {
			switch (mTouchMode) {
			case SlidingMenu.TOUCHMODE_FULLSCREEN:
				return !isInIgnoredView(ev);
			case SlidingMenu.TOUCHMODE_NONE:
				return false;
			case SlidingMenu.TOUCHMODE_MARGIN:
				return mViewBehind.marginTouchAllowed(mContent, x);
			}
		}
		return false;
	}

	/**
	 * 判断是否允许滑动
	 */
	private boolean thisSlideAllowed(float dx) {
		boolean allowed = false;
		if (isMenuOpen()) {
			allowed = mViewBehind.menuOpenSlideAllowed(dx);
		} else {
			allowed = mViewBehind.menuClosedSlideAllowed(dx);
		}
		if (DEBUG)
			Log.v(TAG, "this slide allowed " + allowed + " dx: " + dx);
		return allowed;
	}

	/**
	 * 得到指针的索引值
	 */
	private int getPointerIndex(MotionEvent ev, int id) {
		int activePointerIndex = MotionEventCompat.findPointerIndex(ev, id);
		if (activePointerIndex == -1)
			mActivePointerId = INVALID_POINTER;
		return activePointerIndex;
	}

	private boolean mQuickReturn = false;

	@Override
	public boolean onInterceptTouchEvent(MotionEvent ev) {

		if (!mEnabled)
			return false;

		final int action = ev.getAction() & MotionEventCompat.ACTION_MASK;

		if (DEBUG)
			if (action == MotionEvent.ACTION_DOWN)
				Log.v(TAG, "Received ACTION_DOWN");

		if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP
				|| (action != MotionEvent.ACTION_DOWN && mIsUnableToDrag)) {
			endDrag();
			return false;
		}

		switch (action) {
		case MotionEvent.ACTION_MOVE:
			determineDrag(ev);
			break;
		case MotionEvent.ACTION_DOWN:
			int index = MotionEventCompat.getActionIndex(ev);
			mActivePointerId = MotionEventCompat.getPointerId(ev, index);
			if (mActivePointerId == INVALID_POINTER)
				break;
			mLastMotionX = mInitialMotionX = MotionEventCompat.getX(ev, index);
			mLastMotionY = MotionEventCompat.getY(ev, index);
			if (thisTouchAllowed(ev)) {
				mIsBeingDragged = false;
				mIsUnableToDrag = false;
				if (isMenuOpen() && mViewBehind.menuTouchInQuickReturn(mContent, mCurItem, ev.getX() + mScrollX)) {
					mQuickReturn = true;
				}
			} else {
				mIsUnableToDrag = true;
			}
			break;
		case MotionEventCompat.ACTION_POINTER_UP:
			onSecondaryPointerUp(ev);
			break;
		}

		if (!mIsBeingDragged) {
			if (mVelocityTracker == null) {
				mVelocityTracker = VelocityTracker.obtain();
			}
			mVelocityTracker.addMovement(ev);
		}
		return mIsBeingDragged || mQuickReturn;
	}


	@Override
	public boolean onTouchEvent(MotionEvent ev) {

		if (!mEnabled)
			return false;

		if (!mIsBeingDragged && !thisTouchAllowed(ev))
			return false;

		//		if (!mIsBeingDragged && !mQuickReturn)
		//			return false;

		final int action = ev.getAction();

		if (mVelocityTracker == null) {
			mVelocityTracker = VelocityTracker.obtain();
		}
		mVelocityTracker.addMovement(ev);

		switch (action & MotionEventCompat.ACTION_MASK) {
		case MotionEvent.ACTION_DOWN:
			/*
			 * If being flinged and user touches, stop the fling. isFinished
			 * will be false if being flinged.
			 */
			completeScroll();

			// Remember where the motion event started
			int index = MotionEventCompat.getActionIndex(ev);
			mActivePointerId = MotionEventCompat.getPointerId(ev, index);
			mLastMotionX = mInitialMotionX = ev.getX();
			break;
		case MotionEvent.ACTION_MOVE:
			if (!mIsBeingDragged) {	
				determineDrag(ev);
				if (mIsUnableToDrag)
					return false;
			}
			if (mIsBeingDragged) {
				// Scroll to follow the motion event
				final int activePointerIndex = getPointerIndex(ev, mActivePointerId);
				if (mActivePointerId == INVALID_POINTER)
					break;
				final float x = MotionEventCompat.getX(ev, activePointerIndex);
				final float deltaX = mLastMotionX - x;
				mLastMotionX = x;
				float oldScrollX = getScrollX();
				float scrollX = oldScrollX + deltaX;
				final float leftBound = getLeftBound();
				final float rightBound = getRightBound();
				if (scrollX < leftBound) {
					scrollX = leftBound;
				} else if (scrollX > rightBound) {
					scrollX = rightBound;
				}
				// Don't lose the rounded component
				mLastMotionX += scrollX - (int) scrollX;
				scrollTo((int) scrollX, getScrollY());
				pageScrolled((int) scrollX);
			}
			break;
		case MotionEvent.ACTION_UP:
			if (mIsBeingDragged) {
				final VelocityTracker velocityTracker = mVelocityTracker;
				velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
				int initialVelocity = (int) VelocityTrackerCompat.getXVelocity(
						velocityTracker, mActivePointerId);
				final int scrollX = getScrollX();
				//				final int widthWithMargin = getWidth();
				//				final float pageOffset = (float) (scrollX % widthWithMargin) / widthWithMargin;
				// TODO test this. should get better flinging behavior
				final float pageOffset = (float) (scrollX - getDestScrollX(mCurItem)) / getBehindWidth();
				final int activePointerIndex = getPointerIndex(ev, mActivePointerId);
				if (mActivePointerId != INVALID_POINTER) {
					final float x = MotionEventCompat.getX(ev, activePointerIndex);
					final int totalDelta = (int) (x - mInitialMotionX);
					int nextPage = determineTargetPage(pageOffset, initialVelocity, totalDelta);
					setCurrentItemInternal(nextPage, true, true, initialVelocity);
				} else {	
					setCurrentItemInternal(mCurItem, true, true, initialVelocity);
				}
				mActivePointerId = INVALID_POINTER;
				endDrag();
			} else if (mQuickReturn && mViewBehind.menuTouchInQuickReturn(mContent, mCurItem, ev.getX() + mScrollX)) {
				// close the menu
				setCurrentItem(1);
				endDrag();
			}
			break;
		case MotionEvent.ACTION_CANCEL:
			if (mIsBeingDragged) {
				setCurrentItemInternal(mCurItem, true, true);
				mActivePointerId = INVALID_POINTER;
				endDrag();
			}
			break;
		case MotionEventCompat.ACTION_POINTER_DOWN: {
			final int indexx = MotionEventCompat.getActionIndex(ev);
			mLastMotionX = MotionEventCompat.getX(ev, indexx);
			mActivePointerId = MotionEventCompat.getPointerId(ev, indexx);
			break;
		}
		case MotionEventCompat.ACTION_POINTER_UP:
			onSecondaryPointerUp(ev);
			int pointerIndex = getPointerIndex(ev, mActivePointerId);
			if (mActivePointerId == INVALID_POINTER)
				break;
			mLastMotionX = MotionEventCompat.getX(ev, pointerIndex);
			break;
		}
		return true;
	}
	
	private void determineDrag(MotionEvent ev) {
		final int activePointerId = mActivePointerId;
		final int pointerIndex = getPointerIndex(ev, activePointerId);
		if (activePointerId == INVALID_POINTER)
			return;
		final float x = MotionEventCompat.getX(ev, pointerIndex);
		final float dx = x - mLastMotionX;
		final float xDiff = Math.abs(dx);
		final float y = MotionEventCompat.getY(ev, pointerIndex);
		final float dy = y - mLastMotionY;
		final float yDiff = Math.abs(dy);
		if (xDiff > (isMenuOpen()?mTouchSlop/2:mTouchSlop) && xDiff > yDiff && thisSlideAllowed(dx)) {		
			startDrag();
			mLastMotionX = x;
			mLastMotionY = y;
			setScrollingCacheEnabled(true);
			// TODO add back in touch slop check
		} else if (xDiff > mTouchSlop) {
			mIsUnableToDrag = true;
		}
	}

	@Override
	public void scrollTo(int x, int y) {
		super.scrollTo(x, y);
		mScrollX = x;
		mViewBehind.scrollBehindTo(mContent, x, y);	
		((SlidingMenu)getParent()).manageLayers(getPercentOpen());
	}

	private int determineTargetPage(float pageOffset, int velocity, int deltaX) {
		int targetPage = mCurItem;
		if (Math.abs(deltaX) > mFlingDistance && Math.abs(velocity) > mMinimumVelocity) {
			if (velocity > 0 && deltaX > 0) {
				targetPage -= 1;
			} else if (velocity < 0 && deltaX < 0){
				targetPage += 1;
			}
		} else {
			targetPage = (int) Math.round(mCurItem + pageOffset);
		}
		return targetPage;
	}

	protected float getPercentOpen() {
		return Math.abs(mScrollX-mContent.getLeft()) / getBehindWidth();
	}

	@Override
	protected void dispatchDraw(Canvas canvas) {
		super.dispatchDraw(canvas);
		// Draw the margin drawable if needed.
		mViewBehind.drawShadow(mContent, canvas);
		mViewBehind.drawFade(mContent, canvas, getPercentOpen());
		mViewBehind.drawSelector(mContent, canvas, getPercentOpen());
	}

	// variables for drawing
	private float mScrollX = 0.0f;

	private void onSecondaryPointerUp(MotionEvent ev) {
		if (DEBUG) Log.v(TAG, "onSecondaryPointerUp called");
		final int pointerIndex = MotionEventCompat.getActionIndex(ev);
		final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);
		if (pointerId == mActivePointerId) {
			// This was our active pointer going up. Choose a new
			// active pointer and adjust accordingly.
			final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
			mLastMotionX = MotionEventCompat.getX(ev, newPointerIndex);
			mActivePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex);
			if (mVelocityTracker != null) {
				mVelocityTracker.clear();
			}
		}
	}

	/**
	 * 开始拖动
	 */
	private void startDrag() {
		mIsBeingDragged = true;
		mQuickReturn = false;
	}

	/**
	 * 结束拖动
	 */
	private void endDrag() {
		mQuickReturn = false;
		mIsBeingDragged = false;
		mIsUnableToDrag = false;
		mActivePointerId = INVALID_POINTER;

		if (mVelocityTracker != null) {
			mVelocityTracker.recycle();
			mVelocityTracker = null;
		}
	}

	/**
	 * 设置能否使用滑动缓存
	 */
	private void setScrollingCacheEnabled(boolean enabled) {
		if (mScrollingCacheEnabled != enabled) {
			mScrollingCacheEnabled = enabled;
			if (USE_CACHE) {
				final int size = getChildCount();
				for (int i = 0; i < size; ++i) {
					final View child = getChildAt(i);
					if (child.getVisibility() != GONE) {
						child.setDrawingCacheEnabled(enabled);
					}
				}
			}
		}
	}

	/**
	 * Tests scrollability within child views of v given a delta of dx.
	 *
	 * @param v View to test for horizontal scrollability
	 * @param checkV Whether the view v passed should itself be checked for scrollability (true),
	 *               or just its children (false).
	 * @param dx Delta scrolled in pixels
	 * @param x X coordinate of the active touch point
	 * @param y Y coordinate of the active touch point
	 * @return true if child views of v can be scrolled by delta of dx.
	 */
	protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
		if (v instanceof ViewGroup) {
			final ViewGroup group = (ViewGroup) v;
			final int scrollX = v.getScrollX();
			final int scrollY = v.getScrollY();
			final int count = group.getChildCount();
			// Count backwards - let topmost views consume scroll distance first.
			for (int i = count - 1; i >= 0; i--) {
				final View child = group.getChildAt(i);
				if (x + scrollX >= child.getLeft() && x + scrollX < child.getRight() &&
						y + scrollY >= child.getTop() && y + scrollY < child.getBottom() &&
						canScroll(child, true, dx, x + scrollX - child.getLeft(),
								y + scrollY - child.getTop())) {
					return true;
				}
			}
		}

		return checkV && ViewCompat.canScrollHorizontally(v, -dx);
	}


	@Override
	public boolean dispatchKeyEvent(KeyEvent event) {
		// Let the focused view and/or our descendants get the key first
		return super.dispatchKeyEvent(event) || executeKeyEvent(event);
	}

	/**
	 * 执行按键响应事件
	 */
	public boolean executeKeyEvent(KeyEvent event) {
		boolean handled = false;
		if (event.getAction() == KeyEvent.ACTION_DOWN) {
			switch (event.getKeyCode()) {
			case KeyEvent.KEYCODE_DPAD_LEFT:
				handled = arrowScroll(FOCUS_LEFT);
				break;
			case KeyEvent.KEYCODE_DPAD_RIGHT:
				handled = arrowScroll(FOCUS_RIGHT);
				break;
			case KeyEvent.KEYCODE_TAB:
				if (Build.VERSION.SDK_INT >= 11) {
					// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
					// before Android 3.0. Ignore the tab key on those devices.
					if (KeyEventCompat.hasNoModifiers(event)) {
						handled = arrowScroll(FOCUS_FORWARD);
					} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
						handled = arrowScroll(FOCUS_BACKWARD);
					}
				}
				break;
			}
		}
		return handled;
	}

	/**
	 * 获得滑动的方向
	 */
	public boolean arrowScroll(int direction) {
		View currentFocused = findFocus();
		if (currentFocused == this) currentFocused = null;

		boolean handled = false;

		View nextFocused = FocusFinder.getInstance().findNextFocus(this, currentFocused,
				direction);
		if (nextFocused != null && nextFocused != currentFocused) {
			if (direction == View.FOCUS_LEFT) {
				handled = nextFocused.requestFocus();
			} else if (direction == View.FOCUS_RIGHT) {
				// If there is nothing to the right, or this is causing us to
				// jump to the left, then what we really want to do is page right.
				if (currentFocused != null && nextFocused.getLeft() <= currentFocused.getLeft()) {
					handled = pageRight();
				} else {
					handled = nextFocused.requestFocus();
				}
			}
		} else if (direction == FOCUS_LEFT || direction == FOCUS_BACKWARD) {
			// Trying to move left and nothing there; try to page.
			handled = pageLeft();
		} else if (direction == FOCUS_RIGHT || direction == FOCUS_FORWARD) {
			// Trying to move right and nothing there; try to page.
			handled = pageRight();
		}
		if (handled) {
			playSoundEffect(SoundEffectConstants.getContantForFocusDirection(direction));
		}
		return handled;
	}

	/**
	 * 页面是否向左移动
	 */
	boolean pageLeft() {
		if (mCurItem > 0) {
			setCurrentItem(mCurItem-1, true);
			return true;
		}
		return false;
	}

	/**
	 * 页面是否向右移动
	 */
	boolean pageRight() {
		if (mCurItem < 1) {
			setCurrentItem(mCurItem+1, true);
			return true;
		}
		return false;
	}

}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/CustomViewBehind.java
================================================
package com.hankkin.compustrading.slidingmenu;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;

import com.hankkin.compustrading.R;


public class CustomViewBehind extends ViewGroup {

	private static final String TAG = "CustomViewBehind";

	//边缘滑动的临界值
	private static final int MARGIN_THRESHOLD = 48; // dips
	
	//初始化触摸的模式
	private int mTouchMode = SlidingMenu.TOUCHMODE_MARGIN;

	//定义上方视图
	private CustomViewAbove mViewAbove;

	//定义内容视图
	private View mContent;
	private View mSecondaryContent;
	
	//定义滑动边缘的临界值
	private int mMarginThreshold;
	
	//宽度的偏移量
	private int mWidthOffset;
	
	private SlidingMenu.CanvasTransformer mTransformer;
	
	//是否能够使用子视图
	private boolean mChildrenEnabled;

	public CustomViewBehind(Context context) {
		this(context, null);
	}

	public CustomViewBehind(Context context, AttributeSet attrs) {
		super(context, attrs);
		mMarginThreshold = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 
				MARGIN_THRESHOLD, getResources().getDisplayMetrics());
	}

	public void setCustomViewAbove(CustomViewAbove customViewAbove) {
		mViewAbove = customViewAbove;
	}

	public void setCanvasTransformer(SlidingMenu.CanvasTransformer t) {
		mTransformer = t;
	}

	/**
	 * 设置宽度的偏移量
	 */
	public void setWidthOffset(int i) {
		mWidthOffset = i;
		requestLayout();
	}
	
	/**
	 * 设置边缘滑动的临界值
	 */
	public void setMarginThreshold(int marginThreshold) {
		mMarginThreshold = marginThreshold;
	}
	
	/**
	 * 得到边缘滑动的临界值
	 */
	public int getMarginThreshold() {
		return mMarginThreshold;
	}

	/**
	 * 得到视图的宽度
	 */
	public int getBehindWidth() {
		return mContent.getWidth();
	}

	/**
	 * 设置视图的内容
	 */
	public void setContent(View v) {
		if (mContent != null)
			removeView(mContent);
		mContent = v;
		addView(mContent);
	}

	/**
	 * 得到视图的内容
	 */
	public View getContent() {
		return mContent;
	}

	/**
	 * 设置右边滑动菜单的内容,当模式设置为LEFT_RIGHT模式时
	 */
	public void setSecondaryContent(View v) {
		if (mSecondaryContent != null)
			removeView(mSecondaryContent);
		mSecondaryContent = v;
		addView(mSecondaryContent);
	}

	/**
	 * 得到右边滑动菜单的内容
	 */
	public View getSecondaryContent() {
		return mSecondaryContent;
	}

	/**
	 * 设置是否能够使用子视图
	 */
	public void setChildrenEnabled(boolean enabled) {
		mChildrenEnabled = enabled;
	}

	@Override
	public void scrollTo(int x, int y) {
		super.scrollTo(x, y);
		if (mTransformer != null)
			invalidate();
	}

	@Override
	public boolean onInterceptTouchEvent(MotionEvent e) {
		return !mChildrenEnabled;
	}

	@Override
	public boolean onTouchEvent(MotionEvent e) {
		return !mChildrenEnabled;
	}

	@Override
	protected void dispatchDraw(Canvas canvas) {
		if (mTransformer != null) {
			canvas.save();
			mTransformer.transformCanvas(canvas, mViewAbove.getPercentOpen());
			super.dispatchDraw(canvas);
			canvas.restore();
		} else
			super.dispatchDraw(canvas);
	}

	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {
		final int width = r - l;
		final int height = b - t;
		mContent.layout(0, 0, width-mWidthOffset, height);
		if (mSecondaryContent != null)
			mSecondaryContent.layout(0, 0, width-mWidthOffset, height);
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		int width = getDefaultSize(0, widthMeasureSpec);
		int height = getDefaultSize(0, heightMeasureSpec);
		setMeasuredDimension(width, height);
		final int contentWidth = getChildMeasureSpec(widthMeasureSpec, 0, width-mWidthOffset);
		final int contentHeight = getChildMeasureSpec(heightMeasureSpec, 0, height);
		mContent.measure(contentWidth, contentHeight);
		if (mSecondaryContent != null)
			mSecondaryContent.measure(contentWidth, contentHeight);
	}

	//定义模式的值
	private int mMode;
	
	//是否能够使用渐入渐出效果
	private boolean mFadeEnabled;
	
	//定义渐入渐出的值
	private float mFadeDegree;
	
	//定义渐入渐出效果画笔
	private final Paint mFadePaint = new Paint();
	
	//定义滑动缩放的值
	private float mScrollScale;
	
	//定义滑动菜单的阴影
	private Drawable mShadowDrawable;
	
	//定义右边滑动菜单的阴影图片
	private Drawable mSecondaryShadowDrawable;
	
	//定义阴影的宽度
	private int mShadowWidth;
	
	/**
	 * 设置模式的值
	 */
	public void setMode(int mode) {
		if (mode == SlidingMenu.LEFT || mode == SlidingMenu.RIGHT) {
			if (mContent != null)
				mContent.setVisibility(View.VISIBLE);
			if (mSecondaryContent != null)
				mSecondaryContent.setVisibility(View.INVISIBLE);
		}
		mMode = mode;
	}

	/**
	 * 得到模式的值
	 */
	public int getMode() {
		return mMode;
	}

	/**
	 * 设置滑动缩放的值
	 */
	public void setScrollScale(float scrollScale) {
		mScrollScale = scrollScale;
	}

	/**
	 * 得到滑动缩放的值
	 */
	public float getScrollScale() {
		return mScrollScale;
	}

	/**
	 * 设置滑动菜单的阴影
	 */
	public void setShadowDrawable(Drawable shadow) {
		mShadowDrawable = shadow;
		invalidate();
	}

	/**
	 * 设置右边滑动菜单的阴影
	 */
	public void setSecondaryShadowDrawable(Drawable shadow) {
		mSecondaryShadowDrawable = shadow;
		invalidate();
	}

	/**
	 * 设置阴影的宽度
	 */
	public void setShadowWidth(int width) {
		mShadowWidth = width;
		invalidate();
	}

	/**
	 * 设置能否使用渐入渐出效果
	 */
	public void setFadeEnabled(boolean b) {
		mFadeEnabled = b;
	}

	/**
	 * 设置渐入渐出的值
	 */
	public void setFadeDegree(float degree) {
		if (degree > 1.0f || degree < 0.0f)
			throw new IllegalStateException("The BehindFadeDegree must be between 0.0f and 1.0f");
		mFadeDegree = degree;
	}

	/**
	 * 得到菜单页面
	 */
	public int getMenuPage(int page) {
		page = (page > 1) ? 2 : ((page < 1) ? 0 : page);
		if (mMode == SlidingMenu.LEFT && page > 1) {
			return 0;
		} else if (mMode == SlidingMenu.RIGHT && page < 1) {
			return 2;
		} else {
			return page;
		}
	}

	/**
	 * 滑动下方视图到达的位置
	 */
	public void scrollBehindTo(View content, int x, int y) {
		int vis = View.VISIBLE;		
		if (mMode == SlidingMenu.LEFT) {
			if (x >= content.getLeft()) vis = View.INVISIBLE;
			scrollTo((int)((x + getBehindWidth())*mScrollScale), y);
		} else if (mMode == SlidingMenu.RIGHT) {
			if (x <= content.getLeft()) vis = View.INVISIBLE;
			scrollTo((int)(getBehindWidth() - getWidth() + 
					(x-getBehindWidth())*mScrollScale), y);
		} else if (mMode == SlidingMenu.LEFT_RIGHT) {
			mContent.setVisibility(x >= content.getLeft() ? View.INVISIBLE : View.VISIBLE);
			mSecondaryContent.setVisibility(x <= content.getLeft() ? View.INVISIBLE : View.VISIBLE);
			vis = x == 0 ? View.INVISIBLE : View.VISIBLE;
			if (x <= content.getLeft()) {
				scrollTo((int)((x + getBehindWidth())*mScrollScale), y);				
			} else {
				scrollTo((int)(getBehindWidth() - getWidth() + 
						(x-getBehindWidth())*mScrollScale), y);				
			}
		}
		if (vis == View.INVISIBLE)
			Log.v(TAG, "behind INVISIBLE");
		setVisibility(vis);
	}

	/**
	 * 得到左边菜单的视图
	 */
	public int getMenuLeft(View content, int page) {
		if (mMode == SlidingMenu.LEFT) {
			switch (page) {
			case 0:
				return content.getLeft() - getBehindWidth();
			case 2:
				return content.getLeft();
			}
		} else if (mMode == SlidingMenu.RIGHT) {
			switch (page) {
			case 0:
				return content.getLeft();
			case 2:
				return content.getLeft() + getBehindWidth();	
			}
		} else if (mMode == SlidingMenu.LEFT_RIGHT) {
			switch (page) {
			case 0:
				return content.getLeft() - getBehindWidth();
			case 2:
				return content.getLeft() + getBehindWidth();
			}
		}
		return content.getLeft();
	}

	/**
	 * 得到左边框视图
	 */
	public int getAbsLeftBound(View content) {
		if (mMode == SlidingMenu.LEFT || mMode == SlidingMenu.LEFT_RIGHT) {
			return content.getLeft() - getBehindWidth();
		} else if (mMode == SlidingMenu.RIGHT) {
			return content.getLeft();
		}
		return 0;
	}

	/**
	 * 得到右边框视图
	 */
	public int getAbsRightBound(View content) {
		if (mMode == SlidingMenu.LEFT) {
			return content.getLeft();
		} else if (mMode == SlidingMenu.RIGHT || mMode == SlidingMenu.LEFT_RIGHT) {
			return content.getLeft() + getBehindWidth();
		}
		return 0;
	}

	/**
	 * 是否允许触摸屏幕的边缘
	 */
	public boolean marginTouchAllowed(View content, int x) {
		int left = content.getLeft();
		int right = content.getRight();
		if (mMode == SlidingMenu.LEFT) {
			return (x >= left && x <= mMarginThreshold + left);
		} else if (mMode == SlidingMenu.RIGHT) {
			return (x <= right && x >= right - mMarginThreshold);
		} else if (mMode == SlidingMenu.LEFT_RIGHT) {
			return (x >= left && x <= mMarginThreshold + left) || 
					(x <= right && x >= right - mMarginThreshold);
		}
		return false;
	}

	/**
	 * 设置触摸模式的值
	 */
	public void setTouchMode(int i) {
		mTouchMode = i;
	}

	/**
	 * 是否允许通过触摸打开滑动菜单
	 */
	public boolean menuOpenTouchAllowed(View content, int currPage, float x) {
		switch (mTouchMode) {
		case SlidingMenu.TOUCHMODE_FULLSCREEN:
			return true;
		case SlidingMenu.TOUCHMODE_MARGIN:
			return menuTouchInQuickReturn(content, currPage, x);
		}
		return false;
	}

	/**
	 * 滑动菜单快速返回
	 */
	public boolean menuTouchInQuickReturn(View content, int currPage, float x) {
		if (mMode == SlidingMenu.LEFT || (mMode == SlidingMenu.LEFT_RIGHT && currPage == 0)) {
			return x >= content.getLeft();
		} else if (mMode == SlidingMenu.RIGHT || (mMode == SlidingMenu.LEFT_RIGHT && currPage == 2)) {
			return x <= content.getRight();
		}
		return false;
	}

	/**
	 * 是否允许关闭滑动菜单
	 */
	public boolean menuClosedSlideAllowed(float dx) {
		if (mMode == SlidingMenu.LEFT) {
			return dx > 0;
		} else if (mMode == SlidingMenu.RIGHT) {
			return dx < 0;
		} else if (mMode == SlidingMenu.LEFT_RIGHT) {
			return true;
		}
		return false;
	}

	/**
	 * 是否允许打开滑动菜单
	 */
	public boolean menuOpenSlideAllowed(float dx) {
		if (mMode == SlidingMenu.LEFT) {
			return dx < 0;
		} else if (mMode == SlidingMenu.RIGHT) {
			return dx > 0;
		} else if (mMode == SlidingMenu.LEFT_RIGHT) {
			return true;
		}
		return false;
	}

	/**
	 * 画滑动菜单的阴影
	 */
	public void drawShadow(View content, Canvas canvas) {
		if (mShadowDrawable == null || mShadowWidth <= 0) return;
		int left = 0;
		if (mMode == SlidingMenu.LEFT) {
			left = content.getLeft() - mShadowWidth;
		} else if (mMode == SlidingMenu.RIGHT) {
			left = content.getRight();
		} else if (mMode == SlidingMenu.LEFT_RIGHT) {
			if (mSecondaryShadowDrawable != null) {
				left = content.getRight();
				mSecondaryShadowDrawable.setBounds(left, 0, left + mShadowWidth, getHeight());
				mSecondaryShadowDrawable.draw(canvas);
			}
			left = content.getLeft() - mShadowWidth;
		}
		mShadowDrawable.setBounds(left, 0, left + mShadowWidth, getHeight());
		mShadowDrawable.draw(canvas);
	}

	/**
	 * 画出渐入渐出效果
	 */
	public void drawFade(View content, Canvas canvas, float openPercent) {
		if (!mFadeEnabled) return;
		final int alpha = (int) (mFadeDegree * 255 * Math.abs(1-openPercent));
		mFadePaint.setColor(Color.argb(alpha, 0, 0, 0));
		int left = 0;
		int right = 0;
		if (mMode == SlidingMenu.LEFT) {
			left = content.getLeft() - getBehindWidth();
			right = content.getLeft();
		} else if (mMode == SlidingMenu.RIGHT) {
			left = content.getRight();
			right = content.getRight() + getBehindWidth();			
		} else if (mMode == SlidingMenu.LEFT_RIGHT) {
			left = content.getLeft() - getBehindWidth();
			right = content.getLeft();
			canvas.drawRect(left, 0, right, getHeight(), mFadePaint);
			left = content.getRight();
			right = content.getRight() + getBehindWidth();			
		}
		canvas.drawRect(left, 0, right, getHeight(), mFadePaint);
	}
	
	private boolean mSelectorEnabled = true;
	private Bitmap mSelectorDrawable;
	private View mSelectedView;
	
	public void drawSelector(View content, Canvas canvas, float openPercent) {
		if (!mSelectorEnabled) return;
		if (mSelectorDrawable != null && mSelectedView != null) {
			String tag = (String) mSelectedView.getTag(R.id.selected_view);
			if (tag.equals(TAG+"SelectedView")) {
				canvas.save();
				int left, right, offset;
				offset = (int) (mSelectorDrawable.getWidth() * openPercent);
				if (mMode == SlidingMenu.LEFT) {
					right = content.getLeft();
					left = right - offset;
					canvas.clipRect(left, 0, right, getHeight());
					canvas.drawBitmap(mSelectorDrawable, left, getSelectorTop(), null);		
				} else if (mMode == SlidingMenu.RIGHT) {
					left = content.getRight();
					right = left + offset;
					canvas.clipRect(left, 0, right, getHeight());
					canvas.drawBitmap(mSelectorDrawable, right - mSelectorDrawable.getWidth(), getSelectorTop(), null);
				}
				canvas.restore();
			}
		}
	}
	
	public void setSelectorEnabled(boolean b) {
		mSelectorEnabled = b;
	}

	public void setSelectedView(View v) {
		if (mSelectedView != null) {
			mSelectedView.setTag(R.id.selected_view, null);
			mSelectedView = null;
		}
		if (v != null && v.getParent() != null) {
			mSelectedView = v;
			mSelectedView.setTag(R.id.selected_view, TAG+"SelectedView");
			invalidate();
		}
	}

	private int getSelectorTop() {
		int y = mSelectedView.getTop();
		y += (mSelectedView.getHeight() - mSelectorDrawable.getHeight()) / 2;
		return y;
	}

	public void setSelectorBitmap(Bitmap b) {
		mSelectorDrawable = b;
		refreshDrawableState();
	}

}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingActivityBase.java
================================================
package com.hankkin.compustrading.slidingmenu;

import android.view.View;
import android.view.ViewGroup.LayoutParams;


public interface SlidingActivityBase {
	
	/**
	 * Set the behind view content to an explicit view. This view is placed directly into the behind view 's view hierarchy.
	 * It can itself be a complex view hierarchy.
	 *
	 * @param view The desired content to display.
	 * @param layoutParams Layout parameters for the view.
	 */
	public void setBehindContentView(View view, LayoutParams layoutParams);

	/**
	 * Set the behind view content to an explicit view. This view is placed directly into the behind view 's view hierarchy.
	 * It can itself be a complex view hierarchy. When calling this method, the layout parameters of the specified
	 * view are ignored. Both the width and the height of the view are set by default to MATCH_PARENT. To use your
	 * own layout parameters, invoke setContentView(android.view.View, android.view.ViewGroup.LayoutParams) instead.
	 *
	 * @param view The desired content to display.
	 */
	public void setBehindContentView(View view);

	/**
	 * Set the behind view content from a layout resource. The resource will be inflated, adding all top-level views
	 * to the behind view.
	 *
	 * @param layoutResID Resource ID to be inflated.
	 */
	public void setBehindContentView(int layoutResID);

	/**
	 * Gets the SlidingMenu associated with this activity.
	 *
	 * @return the SlidingMenu associated with this activity.
	 */
	public SlidingMenu getSlidingMenu();
		
	/**
	 * Toggle the SlidingMenu. If it is open, it will be closed, and vice versa.
	 */
	public void toggle();
	
	/**
	 * Close the SlidingMenu and show the content view.
	 */
	public void showContent();
	
	/**
	 * Open the SlidingMenu and show the menu view.
	 */
	public void showMenu();

	/**
	 * Open the SlidingMenu and show the secondary (right) menu view. Will default to the regular menu
	 * if there is only one.
	 */
	public void showSecondaryMenu();
	
	/**
	 * Controls whether the ActionBar slides along with the above view when the menu is opened,
	 * or if it stays in place.
	 *
	 * @param slidingActionBarEnabled True if you want the ActionBar to slide along with the SlidingMenu,
	 * false if you want the ActionBar to stay in place
	 */
	public void setSlidingActionBarEnabled(boolean slidingActionBarEnabled);
	
}


================================================
FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingActivityHelper.java
================================================
package com.hankkin.compustrading.slidingmenu;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;

import com.hankkin.compustrading.R;


public class SlidingActivityHelper {

	private Activity mActivity;

	private SlidingMenu mSlidingMenu;

	private View mViewAbove;

	private View mViewBehind;

	private boolean mBroadcasting = false;

	private boolean mOnPostCreateCalled = false;

	private boolean mEnableSlide = true;

	/**
	 * Instantiates a new SlidingActivityHelper.
	 *
	 * @param activity the associated activity
	 */
	public SlidingActivityHelper(Activity activity) {
		mActivity = activity;
	}

	/**
	 * Sets mSlidingMenu as a newly inflated SlidingMenu. Should be called within the activitiy's onCreate()
	 *
	 * @param savedInstanceState the saved instance state (unused)
	 */
	public void onCreate(Bundle savedInstanceState) {
		mSlidingMenu = (SlidingMenu) LayoutInflater.from(mActivity).inflate(R.layout.slidingmenumain, null);
	}

	/**
	 * Further SlidingMenu initialization. Should be called within the activitiy's onPostCreate()
	 *
	 * @param savedInstanceState the saved instance state (unused)
	 */
	public void onPostCreate(Bundle savedInstanceState) {
		if (mViewBehind == null || mViewAbove == null) {
			throw new IllegalStateException("Both setBehindContentView must be called " +
					"in onCreate in addition to setContentView.");
		}

		mOnPostCreateCalled = true;

		mSlidingMenu.attachToActivity(mActivity, 
				mEnableSlide ? SlidingMenu.SLIDING_WINDOW : SlidingMenu.SLIDING_CONTENT);
		
		final boolean open;
		final boolean secondary;
		if (savedInstanceState != null) {
			open = savedInstanceState.getBoolean("SlidingActivityHelper.open");
			secondary = savedInstanceState.getBoolean("SlidingActivityHelper.secondary");
		} else {
			open = false;
			secondary = false;
		}
		new Handler().post(new Runnable() {
			public void run() {
				if (open) {
					if (secondary) {
						mSlidingMenu.showSecondaryMenu(false);
					} else {
						mSlidingMenu.showMenu(false);
					}
				} else {
					mSlidingMenu.showContent(false);					
				}
			}
		});
	}

	/**
	 * Controls whether the ActionBar slides along with the above view when the menu is opened,
	 * or if it stays in place.
	 *
	 * @param slidingActionBarEnabled True if you want the ActionBar to slide along with the SlidingMenu,
	 * false if you want the ActionBar to stay in place
	 */
	public void setSlidingActionBarEnabled(boolean slidingActionBarEnabled) {
		if (mOnPostCreateCalled)
			throw new IllegalStateException("enableSlidingActionBar must be called in onCreate.");
		mEnableSlide = slidingActionBarEnabled;
	}

	/**
	 * Finds a view that was identified by the id attribute from the XML that was processed in onCreate(Bundle).
	 * 
	 * @param id the resource id of the desired view
	 * @return The view if found or null otherwise.
	 */
	public View findViewById(int id) {
		View v;
		if (mSlidingMenu != null) {
			v = mSlidingMenu.findViewById(id);
			if (v != null)
				return v;
		}
		return null;
	}

	/**
	 * Called to retrieve per-instance state from an activity before being killed so that the state can be
	 * restored in onCreate(Bundle) or onRestoreInstanceState(Bundle) (the Bundle populated by this method
	 * will be passed to both). 
	 *
	 * @param outState Bundle in which to place your saved state.
	 */
	public void onSaveInstanceState(Bundle outState) {
		outState.putBoolean("SlidingActivityHelper.open", mSlidingMenu.isMenuShowing());
		outState.putBoolean("SlidingActivityHelper.secondary", mSlidingMenu.isSecondaryMenuShowing());
	}

	/**
	 * Register the above content view.
	 *
	 * @param v the above content view to register
	 * @param params LayoutParams for that view (unused)
	 */
	public void registerAboveContentView(View v, LayoutParams params) {
		if (!mBroadcasting)
			mViewAbove = v;
	}

	/**
	 * Set the activity content to an explicit view. This view is placed directly into the activity's view
	 * hierarchy. It can itself be a complex view hierarchy. When calling this method, the layout parameters
	 * of the specified view are ignored. Both the width and the height of the view are set by default to
	 * MATCH_PARENT. To use your own layout parameters, invoke setContentView(android.view.View,
	 * android.view.ViewGroup.LayoutParams) instead.
	 *
	 * @param v The desired content to display.
	 */
	public void setContentView(View v) {
		mBroadcasting = true;
		mActivity.setContentView(v);
	}

	/**
	 * Set the behind view content to an explicit view. This view is placed directly into the behind view 's view hierarchy.
	 * It can itself be a complex view hierarchy.
	 *
	 * @param view The desired content to display.
	 * @param layoutParams Layout parameters for the view. (unused)
	 */
	public void setBehindContentView(View view, LayoutParams layoutParams) {
		mViewBehind = view;
		mSlidingMenu.setMenu(mViewBehind);
	}

	/**
	 * Gets the SlidingMenu associated with this activity.
	 *
	 * @return the SlidingMenu associated with this activity.
	 */
	public SlidingMenu getSlidingMenu() {
		return mSlidingMenu;
	}

	/**
	 * Toggle the SlidingMenu. If it is open, it will be closed, and vice versa.
	 */
	public void toggle() {
		mSlidingMenu.toggle();
	}

	/**
	 * Close the SlidingMenu and show the content view.
	 */
	public void showContent() {
		mSlidingMenu.showContent();
	}

	/**
	 * Open the SlidingMenu and show the menu view.
	 */
	public void showMenu() {
		mSlidingMenu.showMenu();
	}

	/**
	 * Open the SlidingMenu and show the secondary menu view. Will default to the regular menu
	 * if there is only one.
	 */
	public void showSecondaryMenu() {
		mSlidingMenu.showSecondaryMenu();
	}

	/**
	 * On key up.
	 *
	 * @param keyCode the key code
	 * @param event the event
	 * @return true, if successful
	 */
	public boolean onKeyUp(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK && mSlidingMenu.isMenuShowing()) {
			showContent
Download .txt
gitextract__kczv6ja/

├── .gitignore
├── .idea/
│   ├── compiler.xml
│   ├── copyright/
│   │   └── profiles_settings.xml
│   ├── encodings.xml
│   ├── gradle.xml
│   ├── misc.xml
│   ├── modules.xml
│   ├── runConfigurations.xml
│   └── vcs.xml
├── README.md
├── app/
│   ├── .gitignore
│   ├── app.iml
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── hankkin/
│       │               └── compustrading/
│       │                   └── ApplicationTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── hankkin/
│       │   │           └── compustrading/
│       │   │               ├── Application/
│       │   │               │   └── MyApplication.java
│       │   │               ├── MainActivity.java
│       │   │               ├── User/
│       │   │               │   └── UserBean.java
│       │   │               ├── Utils/
│       │   │               │   ├── BitmapUtils.java
│       │   │               │   └── HankkinUtils.java
│       │   │               ├── activity/
│       │   │               │   ├── BaseActivity.java
│       │   │               │   ├── LoginActivity.java
│       │   │               │   ├── MainShowActivity.java
│       │   │               │   ├── NewProductActivity.java
│       │   │               │   ├── PersonActivity.java
│       │   │               │   ├── ProdectDetailActivity.java
│       │   │               │   ├── RegisterActivity.java
│       │   │               │   ├── SearchProActivity.java
│       │   │               │   └── SplasActivity.java
│       │   │               ├── adapter/
│       │   │               │   ├── CategoryFragmentAdapter.java
│       │   │               │   ├── PersonInfoAdapter.java
│       │   │               │   └── ProductAdapter.java
│       │   │               ├── fragment/
│       │   │               │   └── CateDetailFragment.java
│       │   │               ├── interface/
│       │   │               │   ├── FileUploadListener.java
│       │   │               │   └── ScrollDirectionListener.java
│       │   │               ├── model/
│       │   │               │   ├── Category.java
│       │   │               │   ├── Person.java
│       │   │               │   ├── PersonShow.java
│       │   │               │   └── Product.java
│       │   │               ├── sharepreference/
│       │   │               │   └── MySP.java
│       │   │               ├── slidingmenu/
│       │   │               │   ├── CustomViewAbove.java
│       │   │               │   ├── CustomViewBehind.java
│       │   │               │   ├── SlidingActivityBase.java
│       │   │               │   ├── SlidingActivityHelper.java
│       │   │               │   ├── SlidingMenu.java
│       │   │               │   └── SlidingPreferenceActivity.java
│       │   │               └── view/
│       │   │                   ├── CollapsingAvatarToolbar.java
│       │   │                   ├── PagerSlidingTabStrip.java
│       │   │                   ├── RippleView.java
│       │   │                   ├── RoundedImageView.java
│       │   │                   ├── floatbutton/
│       │   │                   │   ├── AbsListViewScrollDetector.java
│       │   │                   │   ├── AddFloatingActionButton.java
│       │   │                   │   ├── FloatingActionButton.java
│       │   │                   │   ├── FloatingActionsMenu.java
│       │   │                   │   ├── FloatingActionsMenuHidable.java
│       │   │                   │   └── TouchDelegateGroup.java
│       │   │                   ├── ipulltozoom/
│       │   │                   │   ├── IPullToZoom.java
│       │   │                   │   ├── PullToZoomBase.java
│       │   │                   │   └── PullToZoomScrollViewEx.java
│       │   │                   └── refreshload/
│       │   │                       ├── MetaballView.java
│       │   │                       └── RefreshLayout.java
│       │   └── res/
│       │       ├── anim/
│       │       │   ├── anim.xml
│       │       │   └── list_anim.xml
│       │       ├── drawable/
│       │       │   ├── bmob_update_button_cancel_bg_focused.xml
│       │       │   ├── bmob_update_button_cancel_bg_normal.xml
│       │       │   ├── bmob_update_button_cancel_bg_selector.xml
│       │       │   ├── bmob_update_button_cancel_bg_tap.xml
│       │       │   ├── bmob_update_button_check_selector.xml
│       │       │   ├── bmob_update_button_close_bg_selector.xml
│       │       │   ├── bmob_update_button_ok_bg_focused.xml
│       │       │   ├── bmob_update_button_ok_bg_normal.xml
│       │       │   ├── bmob_update_button_ok_bg_selector.xml
│       │       │   ├── bmob_update_button_ok_bg_tap.xml
│       │       │   ├── bmob_update_dialog_bg.xml
│       │       │   ├── btn_login_background.xml
│       │       │   ├── fab_label_background.xml
│       │       │   ├── login_et_background.xml
│       │       │   ├── normal_white_bg.xml
│       │       │   ├── shadow.xml
│       │       │   └── tab_background.xml
│       │       ├── layout/
│       │       │   ├── activity_login.xml
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_main_show.xml
│       │       │   ├── activity_new_product.xml
│       │       │   ├── activity_person.xml
│       │       │   ├── activity_prodect_detail.xml
│       │       │   ├── activity_product_detail.xml
│       │       │   ├── activity_register.xml
│       │       │   ├── activity_search_pro.xml
│       │       │   ├── activity_splas.xml
│       │       │   ├── bmob_update_dialog.xml
│       │       │   ├── fragment_item.xml
│       │       │   ├── listview_footer.xml
│       │       │   ├── listview_personinfo.xml
│       │       │   ├── loading.xml
│       │       │   ├── lv_product_item.xml
│       │       │   ├── profile_contect_view.xml
│       │       │   ├── profile_head_view.xml
│       │       │   ├── profile_zoom_view.xml
│       │       │   ├── slidingmenumain.xml
│       │       │   └── view_select_img.xml
│       │       ├── menu/
│       │       │   ├── menu_login.xml
│       │       │   ├── menu_main.xml
│       │       │   ├── menu_new_product.xml
│       │       │   ├── menu_person.xml
│       │       │   ├── menu_prodect_detail.xml
│       │       │   ├── menu_register.xml
│       │       │   ├── menu_search.xml
│       │       │   └── menu_splas.xml
│       │       ├── values/
│       │       │   ├── arrays.xml
│       │       │   ├── attrs.xml
│       │       │   ├── bmob_common_strings.xml
│       │       │   ├── bmob_update_string.xml
│       │       │   ├── color.xml
│       │       │   ├── dimens.xml
│       │       │   ├── ids.xml
│       │       │   ├── strings.xml
│       │       │   ├── styles.xml
│       │       │   └── texsize.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── hankkin/
│                       └── compustrading/
│                           └── ExampleUnitTest.java
├── app-release.apk
├── build.gradle
├── compaus.jks
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
Download .txt
SYMBOL INDEX (859 symbols across 48 files)

FILE: app/src/androidTest/java/com/hankkin/compustrading/ApplicationTest.java
  class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
    method ApplicationTest (line 10) | public ApplicationTest() {

FILE: app/src/main/java/com/hankkin/compustrading/Application/MyApplication.java
  class MyApplication (line 28) | public class MyApplication extends Application {
    method onCreate (line 34) | @Override
    method initImageloader (line 48) | public void initImageloader(){

FILE: app/src/main/java/com/hankkin/compustrading/MainActivity.java
  class MainActivity (line 16) | public class MainActivity extends AppCompatActivity {
    method onCreate (line 23) | protected void onCreate(Bundle savedInstanceState) {
    method init (line 30) | private void init() {
    method btnLoginClick (line 35) | @OnClick(R.id.btn_login)

FILE: app/src/main/java/com/hankkin/compustrading/User/UserBean.java
  class UserBean (line 8) | public class UserBean extends BmobObject {
    method getName (line 14) | public String getName() {
    method setName (line 18) | public void setName(String name) {
    method getTel (line 22) | public String getTel() {
    method setTel (line 26) | public void setTel(String tel) {
    method getIcon_url (line 30) | public String getIcon_url() {
    method setIcon_url (line 34) | public void setIcon_url(String icon_url) {

FILE: app/src/main/java/com/hankkin/compustrading/Utils/BitmapUtils.java
  class BitmapUtils (line 20) | public class BitmapUtils {
    method getCompressedBitmap (line 22) | public static Bitmap getCompressedBitmap(Activity act, String filepath) {
    method getSuitableBitmap (line 46) | public static Bitmap getSuitableBitmap(Activity act, Uri uri, float ww...
    method compressImage (line 88) | public static ByteArrayOutputStream compressImage(Bitmap image) {
    method saveBitmap (line 110) | public static String saveBitmap(Bitmap bitmap, String path) {
    method readPictureDegree (line 136) | public static int readPictureDegree(String path) {
    method toturn (line 164) | public static Bitmap toturn(Bitmap img){

FILE: app/src/main/java/com/hankkin/compustrading/Utils/HankkinUtils.java
  class HankkinUtils (line 51) | public class HankkinUtils {
    method longtimeToDate (line 61) | @SuppressLint("SimpleDateFormat")
    method longtimeToDayDate (line 78) | @SuppressLint("SimpleDateFormat")
    method getCurrentTime (line 85) | public static String getCurrentTime(String format) {
    method longtimeToDateYMD (line 94) | @SuppressLint("SimpleDateFormat")
    method stringDateToLong (line 111) | public static long stringDateToLong(String dateStr) {
    method getCurrentTime (line 125) | public static String getCurrentTime() {
    method getStandardDate (line 138) | public static String getStandardDate(long dateTime) {
    method getDateAgo (line 190) | public static String getDateAgo(long dateTime) {
    method checkUpdate (line 231) | public static boolean checkUpdate(String locVersionName, String lastVe...
    method bmpToByteArray (line 272) | public static byte[] bmpToByteArray(final Bitmap bmp,
    method copy (line 295) | public static void copy(String content, Context context) {
    method paste (line 309) | public static String paste(Context context) {
    method hideSoftInputMethod (line 319) | public static void hideSoftInputMethod(Activity act) {
    method switchSoftInputMethod (line 332) | public static void switchSoftInputMethod(Activity act) {
    method isMobileNO (line 348) | public static boolean isMobileNO(String mobiles) {
    method hasChinese (line 357) | public static boolean hasChinese(String source) {
    method isAccountStandard (line 376) | public static boolean isAccountStandard(String uname) {
    method byteMerger (line 383) | public static byte[] byteMerger(byte[] byte_1, byte[] byte_2) {
    method delete (line 396) | public static void delete(File file) {
    method GetVersion (line 422) | public static String GetVersion(Context context) {
    method isExternalStorageDocument (line 436) | public static boolean isExternalStorageDocument(Uri uri) {
    method isDownloadsDocument (line 442) | public static boolean isDownloadsDocument(Uri uri) {
    method isMediaDocument (line 447) | public static boolean isMediaDocument(Uri uri) {
    method isGooglePhotosUri (line 452) | public static boolean isGooglePhotosUri(Uri uri) {
    method getVideoThumbnail (line 488) | public static Bitmap getVideoThumbnail(String filePath) {
    method isFastDoubleClick (line 520) | public static boolean isFastDoubleClick() {
    method showToast (line 539) | public static void showToast(Context context, String text) {
    method showLToast (line 552) | public static void showLToast(Context context, String text) {
    method showToast (line 566) | public static void showToast(Context context, int resId) {
    method showLToast (line 580) | public static void showLToast(Context context, int resId) {
    method getScreenWidth (line 596) | public static int getScreenWidth(Context context) {
    method getScreenHeight (line 610) | public static int getScreenHeight(Context context) {
    method getScreenDensity (line 624) | public static float getScreenDensity(Context context) {
    method dip2px (line 635) | public static int dip2px(Context context, float px) {
    method getStatusHeight (line 646) | public static int getStatusHeight(Context context) {
    method snapShotWithStatusBar (line 667) | public static Bitmap snapShotWithStatusBar(Activity activity) {
    method snapShotWithoutStatusBar (line 687) | public static Bitmap snapShotWithoutStatusBar(Activity activity) {
    method px2dip (line 710) | public static int px2dip(Context context, float pxValue) {
    method readPictureDegree (line 722) | public static int readPictureDegree(String path) {
    method i (line 750) | public static void i(String msg) {
    method d (line 755) | public static void d(String msg) {
    method e (line 760) | public static void e(String msg) {
    method v (line 765) | public static void v(String msg) {
    method i (line 771) | public static void i(String tag, String msg) {
    method d (line 776) | public static void d(String tag, String msg) {
    method e (line 781) | public static void e(String tag, String msg) {
    method v (line 786) | public static void v(String tag, String msg) {
    method md5 (line 799) | public static String md5(String string) {
    method getPhoneNumber (line 839) | public static String getPhoneNumber(Context context){

FILE: app/src/main/java/com/hankkin/compustrading/activity/BaseActivity.java
  class BaseActivity (line 38) | public class BaseActivity extends AppCompatActivity {
    method onCreate (line 49) | @Override
    method getCurrentPerson (line 55) | public Person getCurrentPerson(Context context){
    method getImageFromGallery (line 65) | public  void getImageFromGallery(Activity act) {
    method uploadImg (line 77) | public void uploadImg(final String filepath, Context context, final Fi...
    method showLoadingDialog (line 94) | public void showLoadingDialog(){
    method dimissDialog (line 108) | public void dimissDialog(){
    method iniFilePath (line 119) | public static String iniFilePath(Activity act) {
    method goCamera (line 150) | public static void goCamera(Activity act, String filepath) {
    method getAbsoluteImagePath (line 166) | public static  String getAbsoluteImagePath(Activity activity, Uri cont...
    method getPath (line 209) | @TargetApi(Build.VERSION_CODES.KITKAT)
    method getDataColumn (line 275) | public static String getDataColumn(Context context, Uri uri, String se...
    method isExternalStorageDocument (line 293) | public static boolean isExternalStorageDocument(Uri uri) {
    method isDownloadsDocument (line 299) | public static boolean isDownloadsDocument(Uri uri) {
    method isMediaDocument (line 304) | public static boolean isMediaDocument(Uri uri) {
    method isGooglePhotosUri (line 309) | public static boolean isGooglePhotosUri(Uri uri) {

FILE: app/src/main/java/com/hankkin/compustrading/activity/LoginActivity.java
  class LoginActivity (line 23) | public class LoginActivity extends AppCompatActivity {
    method onCreate (line 40) | @Override
    method initViews (line 51) | private void initViews() {
    method register (line 55) | @OnClick(R.id.tv_register)
    method back (line 61) | @OnClick(R.id.tv_back)
    method login (line 66) | @OnClick(R.id.btn_login)

FILE: app/src/main/java/com/hankkin/compustrading/activity/MainShowActivity.java
  class MainShowActivity (line 45) | public class MainShowActivity extends BaseActivity {
    method onCreate (line 107) | @Override
    method init (line 145) | private void init() {
    method queryProductsHttp (line 287) | private void queryProductsHttp() {
    method onPostCreate (line 310) | @Override
    method onConfigurationChanged (line 318) | @Override
    method onCreateOptionsMenu (line 324) | @Override
    method onOptionsItemSelected (line 331) | @Override
    method onActivityResult (line 351) | @Override
    method onKeyDown (line 356) | @Override
    method queryCategory (line 371) | private void queryCategory() {

FILE: app/src/main/java/com/hankkin/compustrading/activity/NewProductActivity.java
  class NewProductActivity (line 34) | public class NewProductActivity extends BaseActivity {
    method onCreate (line 58) | @Override
    method init (line 68) | private void init(){
    method showCate (line 90) | @OnClick(R.id.tv_cate)
    method showMDdialog (line 127) | @OnClick(R.id.iv_add_pro)
    method onActivityResult (line 158) | @Override
    method addNewPro (line 186) | @OnClick(R.id.btn_fabu)
    method addProHttp (line 239) | private void addProHttp(final Product product){

FILE: app/src/main/java/com/hankkin/compustrading/activity/PersonActivity.java
  class PersonActivity (line 33) | public class PersonActivity extends BaseActivity {
    method onCreate (line 53) | @Override
    method initViews (line 62) | private void initViews() {
    method initData (line 89) | private void initData() {
    method loadViewForCode (line 106) | private void loadViewForCode() {
    method showMDdialog (line 177) | private void showMDdialog() {
    method onActivityResult (line 200) | @Override
    method updateUser (line 259) | private void updateUser(Person person) {

FILE: app/src/main/java/com/hankkin/compustrading/activity/ProdectDetailActivity.java
  class ProdectDetailActivity (line 19) | public class ProdectDetailActivity extends AppCompatActivity {
    method onCreate (line 25) | @Override

FILE: app/src/main/java/com/hankkin/compustrading/activity/RegisterActivity.java
  class RegisterActivity (line 26) | public class RegisterActivity extends AppCompatActivity {
    method onCreate (line 39) | @Override
    method initViews (line 49) | private void initViews(){
    method register (line 57) | @OnClick(R.id.btn_register)
    method back (line 114) | @OnClick(R.id.tv_back)

FILE: app/src/main/java/com/hankkin/compustrading/activity/SearchProActivity.java
  class SearchProActivity (line 10) | public class SearchProActivity extends AppCompatActivity {
    method onCreate (line 12) | @Override
    method onCreateOptionsMenu (line 18) | @Override
    method onOptionsItemSelected (line 25) | @Override

FILE: app/src/main/java/com/hankkin/compustrading/activity/SplasActivity.java
  class SplasActivity (line 23) | public class SplasActivity extends BaseActivity {
    method onCreate (line 25) | @Override
    method onCreateOptionsMenu (line 47) | @Override
    method onOptionsItemSelected (line 54) | @Override
    method queryCategory (line 73) | private void queryCategory() {

FILE: app/src/main/java/com/hankkin/compustrading/adapter/CategoryFragmentAdapter.java
  class CategoryFragmentAdapter (line 16) | public class CategoryFragmentAdapter extends FragmentPagerAdapter {
    method CategoryFragmentAdapter (line 21) | public CategoryFragmentAdapter(FragmentManager fm, List<CateDetailFrag...
    method CategoryFragmentAdapter (line 27) | public CategoryFragmentAdapter(FragmentManager fm) {
    method getItem (line 31) | @Override
    method getCount (line 36) | @Override
    method getPageTitle (line 41) | public String getPageTitle(int i){

FILE: app/src/main/java/com/hankkin/compustrading/adapter/PersonInfoAdapter.java
  class PersonInfoAdapter (line 20) | public class PersonInfoAdapter extends BaseAdapter {
    method PersonInfoAdapter (line 25) | public PersonInfoAdapter(List<PersonShow> data, Context context) {
    method getCount (line 31) | @Override
    method getItem (line 36) | @Override
    method getItemId (line 41) | @Override
    method getView (line 46) | @Override
    class ViewHolder (line 64) | class ViewHolder{

FILE: app/src/main/java/com/hankkin/compustrading/adapter/ProductAdapter.java
  class ProductAdapter (line 22) | public class ProductAdapter extends BaseAdapter {
    method ProductAdapter (line 28) | public ProductAdapter(List<Product> data, Context context) {
    method getCount (line 34) | @Override
    method getItem (line 39) | @Override
    method getItemId (line 44) | @Override
    method getView (line 49) | @Override
    class ViewHolder (line 88) | class ViewHolder{

FILE: app/src/main/java/com/hankkin/compustrading/fragment/CateDetailFragment.java
  class CateDetailFragment (line 41) | public class CateDetailFragment extends Fragment implements SwipeRefresh...
    method onCreate (line 51) | @Override
    method onCreateView (line 66) | @Nullable
    method initViews (line 76) | private void initViews(View view) {
    method onActivityCreated (line 93) | @Override
    method queryProductsByIdHttp (line 138) | private void queryProductsByIdHttp(int cid) {
    method queryProductsByIdHttp1 (line 164) | private void queryProductsByIdHttp1(int cid) {
    method updatePeo (line 197) | public void updatePeo() {
    method onLoad (line 207) | @Override
    method onRefresh (line 217) | @Override
    method getLvProduct (line 227) | public ListView getLvProduct(){
    method setFab (line 231) | public void  setFab(FloatingActionsMenu fab){
    method hideFab (line 235) | public void hideFab(){

FILE: app/src/main/java/com/hankkin/compustrading/interface/FileUploadListener.java
  type FileUploadListener (line 6) | public interface FileUploadListener  {
    method success (line 7) | void success(String url);
    method fail (line 8) | void fail();

FILE: app/src/main/java/com/hankkin/compustrading/interface/ScrollDirectionListener.java
  type ScrollDirectionListener (line 3) | public interface ScrollDirectionListener {
    method onScrollDown (line 4) | void onScrollDown();
    method onScrollUp (line 6) | void onScrollUp();

FILE: app/src/main/java/com/hankkin/compustrading/model/Category.java
  class Category (line 9) | public class Category extends BmobObject{
    method Category (line 15) | public Category(Integer id,String name, String desc, int pid) {
    method getId (line 22) | public int getId() {
    method setId (line 26) | public void setId(int id) {
    method getName (line 30) | public String getName() {
    method setName (line 34) | public void setName(String name) {
    method getDesc (line 38) | public String getDesc() {
    method setDesc (line 42) | public void setDesc(String desc) {
    method getPid (line 46) | public int getPid() {
    method setPid (line 50) | public void setPid(int pid) {

FILE: app/src/main/java/com/hankkin/compustrading/model/Person.java
  class Person (line 9) | public class Person extends BmobUser {
    method getName (line 20) | public String getName() {
    method setName (line 24) | public void setName(String name) {
    method getTel (line 28) | public String getTel() {
    method setTel (line 32) | public void setTel(String tel) {
    method getUser_icon (line 36) | public String getUser_icon() {
    method setUser_icon (line 40) | public void setUser_icon(String user_icon) {
    method getNickname (line 44) | public String getNickname() {
    method setNickname (line 48) | public void setNickname(String nickname) {
    method getSex (line 52) | public String getSex() {
    method setSex (line 56) | public void setSex(String sex) {
    method getBirth (line 60) | public String getBirth() {
    method setBirth (line 64) | public void setBirth(String birth) {

FILE: app/src/main/java/com/hankkin/compustrading/model/PersonShow.java
  class PersonShow (line 6) | public class PersonShow {
    method PersonShow (line 11) | public PersonShow(String title, String content) {
    method getTitle (line 16) | public String getTitle() {
    method setTitle (line 20) | public void setTitle(String title) {
    method getContent (line 24) | public String getContent() {
    method setContent (line 28) | public void setContent(String content) {

FILE: app/src/main/java/com/hankkin/compustrading/model/Product.java
  class Product (line 8) | public class Product extends BmobObject {
    method Product (line 21) | public Product() {
    method Product (line 24) | public Product(int id,String name,String price,String desc,String user...
    method getId (line 33) | public int getId() {
    method setId (line 37) | public void setId(int id) {
    method getName (line 41) | public String getName() {
    method setName (line 45) | public void setName(String name) {
    method getPrice (line 49) | public String getPrice() {
    method setPrice (line 53) | public void setPrice(String price) {
    method getDesc (line 57) | public String getDesc() {
    method setDesc (line 61) | public void setDesc(String desc) {
    method getUser_tel (line 65) | public String getUser_tel() {
    method setUser_tel (line 69) | public void setUser_tel(String user_tel) {
    method getCid (line 73) | public int getCid() {
    method setCid (line 77) | public void setCid(int cid) {
    method getProduct_url (line 81) | public String getProduct_url() {
    method setProduct_url (line 85) | public void setProduct_url(String product_url) {
    method getSchool (line 89) | public String getSchool() {
    method setSchool (line 93) | public void setSchool(String school) {
    method getUsername (line 97) | public String getUsername() {
    method setUsername (line 101) | public void setUsername(String username) {
    method getUser_icon_url (line 105) | public String getUser_icon_url() {
    method setUser_icon_url (line 109) | public void setUser_icon_url(String user_icon_url) {

FILE: app/src/main/java/com/hankkin/compustrading/sharepreference/MySP.java
  class MySP (line 9) | public class MySP {
    method getUSERNAME (line 17) | public static String getUSERNAME(Context context) {
    method setUSERNAME (line 21) | public static void setUSERNAME(Context context,String username) {
    method getPASSWoRD (line 25) | public static String getPASSWoRD(Context context) {
    method setPASSWoRD (line 29) | public static void setPASSWoRD(Context context,String password) {
    method saveData (line 34) | static boolean saveData(Context context, String key, Object value) {
    method getStringData (line 60) | static String getStringData(Context context, String key) {
    method getBooleanData (line 74) | static boolean getBooleanData(Context context, String key) {
    method getIntData (line 88) | static int getIntData(Context context, String key) {
    method getLongData (line 102) | static long getLongData(Context context, String key) {
    method deleteKey (line 116) | static boolean deleteKey(Context context, String key) {
    method deleteKeys (line 129) | static boolean deleteKeys(Context context, String... keys) {

FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/CustomViewAbove.java
  class CustomViewAbove (line 31) | public class CustomViewAbove extends ViewGroup {
    method getInterpolation (line 50) | public float getInterpolation(float t) {
    type OnPageChangeListener (line 134) | public interface OnPageChangeListener {
      method onPageScrolled (line 145) | public void onPageScrolled(int position, float positionOffset, int p...
      method onPageSelected (line 153) | public void onPageSelected(int position);
    class SimpleOnPageChangeListener (line 162) | public static class SimpleOnPageChangeListener implements OnPageChange...
      method onPageScrolled (line 164) | public void onPageScrolled(int position, float positionOffset, int p...
      method onPageSelected (line 168) | public void onPageSelected(int position) {
      method onPageScrollStateChanged (line 172) | public void onPageScrollStateChanged(int state) {
    method CustomViewAbove (line 178) | public CustomViewAbove(Context context) {
    method CustomViewAbove (line 182) | public CustomViewAbove(Context context, AttributeSet attrs) {
    method initCustomViewAbove (line 190) | void initCustomViewAbove() {
    method setCurrentItem (line 239) | public void setCurrentItem(int item) {
    method setCurrentItem (line 246) | public void setCurrentItem(int item, boolean smoothScroll) {
    method getCurrentItem (line 253) | public int getCurrentItem() {
    method setCurrentItemInternal (line 260) | void setCurrentItemInternal(int item, boolean smoothScroll, boolean al...
    method setCurrentItemInternal (line 267) | void setCurrentItemInternal(int item, boolean smoothScroll, boolean al...
    method setOnPageChangeListener (line 295) | public void setOnPageChangeListener(OnPageChangeListener listener) {
    method setOnOpenedListener (line 302) | public void setOnOpenedListener(SlidingMenu.OnOpenedListener l) {
    method setOnClosedListener (line 309) | public void setOnClosedListener(SlidingMenu.OnClosedListener l) {
    method setInternalPageChangeListener (line 319) | OnPageChangeListener setInternalPageChangeListener(OnPageChangeListene...
    method addIgnoredView (line 328) | public void addIgnoredView(View v) {
    method removeIgnoredView (line 337) | public void removeIgnoredView(View v) {
    method clearIgnoredViews (line 344) | public void clearIgnoredViews() {
    method distanceInfluenceForSnapDuration (line 352) | float distanceInfluenceForSnapDuration(float f) {
    method getDestScrollX (line 361) | public int getDestScrollX(int page) {
    method getLeftBound (line 375) | private int getLeftBound() {
    method getRightBound (line 382) | private int getRightBound() {
    method getContentLeft (line 386) | public int getContentLeft() {
    method isMenuOpen (line 393) | public boolean isMenuOpen() {
    method isInIgnoredView (line 400) | private boolean isInIgnoredView(MotionEvent ev) {
    method getBehindWidth (line 412) | public int getBehindWidth() {
    method getChildWidth (line 423) | public int getChildWidth(int i) {
    method isSlidingEnabled (line 437) | public boolean isSlidingEnabled() {
    method setSlidingEnabled (line 444) | public void setSlidingEnabled(boolean b) {
    method smoothScrollTo (line 451) | void smoothScrollTo(int x, int y) {
    method smoothScrollTo (line 458) | void smoothScrollTo(int x, int y, int velocity) {
    method setContent (line 525) | public void setContent(View v) {
    method getContent (line 535) | public View getContent() {
    method setCustomViewBehind (line 542) | public void setCustomViewBehind(CustomViewBehind cvb) {
    method onMeasure (line 549) | @Override
    method onSizeChanged (line 563) | @Override
    method onLayout (line 576) | @Override
    method setAboveOffset (line 586) | public void setAboveOffset(int i) {
    method computeScroll (line 591) | @Override
    method pageScrolled (line 618) | private void pageScrolled(int xpos) {
    method onPageScrolled (line 635) | protected void onPageScrolled(int position, float offset, int offsetPi...
    method completeScroll (line 647) | private void completeScroll() {
    method setTouchMode (line 687) | public void setTouchMode(int i) {
    method getTouchMode (line 694) | public int getTouchMode() {
    method thisTouchAllowed (line 701) | private boolean thisTouchAllowed(MotionEvent ev) {
    method thisSlideAllowed (line 721) | private boolean thisSlideAllowed(float dx) {
    method getPointerIndex (line 736) | private int getPointerIndex(MotionEvent ev, int id) {
    method onInterceptTouchEvent (line 745) | @Override
    method onTouchEvent (line 799) | @Override
    method determineDrag (line 912) | private void determineDrag(MotionEvent ev) {
    method scrollTo (line 934) | @Override
    method determineTargetPage (line 942) | private int determineTargetPage(float pageOffset, int velocity, int de...
    method getPercentOpen (line 956) | protected float getPercentOpen() {
    method dispatchDraw (line 960) | @Override
    method onSecondaryPointerUp (line 972) | private void onSecondaryPointerUp(MotionEvent ev) {
    method startDrag (line 991) | private void startDrag() {
    method endDrag (line 999) | private void endDrag() {
    method setScrollingCacheEnabled (line 1014) | private void setScrollingCacheEnabled(boolean enabled) {
    method canScroll (line 1040) | protected boolean canScroll(View v, boolean checkV, int dx, int x, int...
    method dispatchKeyEvent (line 1062) | @Override
    method executeKeyEvent (line 1071) | public boolean executeKeyEvent(KeyEvent event) {
    method arrowScroll (line 1100) | public boolean arrowScroll(int direction) {
    method pageLeft (line 1136) | boolean pageLeft() {
    method pageRight (line 1147) | boolean pageRight() {

FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/CustomViewBehind.java
  class CustomViewBehind (line 19) | public class CustomViewBehind extends ViewGroup {
    method CustomViewBehind (line 47) | public CustomViewBehind(Context context) {
    method CustomViewBehind (line 51) | public CustomViewBehind(Context context, AttributeSet attrs) {
    method setCustomViewAbove (line 57) | public void setCustomViewAbove(CustomViewAbove customViewAbove) {
    method setCanvasTransformer (line 61) | public void setCanvasTransformer(SlidingMenu.CanvasTransformer t) {
    method setWidthOffset (line 68) | public void setWidthOffset(int i) {
    method setMarginThreshold (line 76) | public void setMarginThreshold(int marginThreshold) {
    method getMarginThreshold (line 83) | public int getMarginThreshold() {
    method getBehindWidth (line 90) | public int getBehindWidth() {
    method setContent (line 97) | public void setContent(View v) {
    method getContent (line 107) | public View getContent() {
    method setSecondaryContent (line 114) | public void setSecondaryContent(View v) {
    method getSecondaryContent (line 124) | public View getSecondaryContent() {
    method setChildrenEnabled (line 131) | public void setChildrenEnabled(boolean enabled) {
    method scrollTo (line 135) | @Override
    method onInterceptTouchEvent (line 142) | @Override
    method onTouchEvent (line 147) | @Override
    method dispatchDraw (line 152) | @Override
    method onLayout (line 163) | @Override
    method onMeasure (line 172) | @Override
    method setMode (line 211) | public void setMode(int mode) {
    method getMode (line 224) | public int getMode() {
    method setScrollScale (line 231) | public void setScrollScale(float scrollScale) {
    method getScrollScale (line 238) | public float getScrollScale() {
    method setShadowDrawable (line 245) | public void setShadowDrawable(Drawable shadow) {
    method setSecondaryShadowDrawable (line 253) | public void setSecondaryShadowDrawable(Drawable shadow) {
    method setShadowWidth (line 261) | public void setShadowWidth(int width) {
    method setFadeEnabled (line 269) | public void setFadeEnabled(boolean b) {
    method setFadeDegree (line 276) | public void setFadeDegree(float degree) {
    method getMenuPage (line 285) | public int getMenuPage(int page) {
    method scrollBehindTo (line 299) | public void scrollBehindTo(View content, int x, int y) {
    method getMenuLeft (line 327) | public int getMenuLeft(View content, int page) {
    method getAbsLeftBound (line 356) | public int getAbsLeftBound(View content) {
    method getAbsRightBound (line 368) | public int getAbsRightBound(View content) {
    method marginTouchAllowed (line 380) | public boolean marginTouchAllowed(View content, int x) {
    method setTouchMode (line 397) | public void setTouchMode(int i) {
    method menuOpenTouchAllowed (line 404) | public boolean menuOpenTouchAllowed(View content, int currPage, float ...
    method menuTouchInQuickReturn (line 417) | public boolean menuTouchInQuickReturn(View content, int currPage, floa...
    method menuClosedSlideAllowed (line 429) | public boolean menuClosedSlideAllowed(float dx) {
    method menuOpenSlideAllowed (line 443) | public boolean menuOpenSlideAllowed(float dx) {
    method drawShadow (line 457) | public void drawShadow(View content, Canvas canvas) {
    method drawFade (line 479) | public void drawFade(View content, Canvas canvas, float openPercent) {
    method drawSelector (line 505) | public void drawSelector(View content, Canvas canvas, float openPercen...
    method setSelectorEnabled (line 529) | public void setSelectorEnabled(boolean b) {
    method setSelectedView (line 533) | public void setSelectedView(View v) {
    method getSelectorTop (line 545) | private int getSelectorTop() {
    method setSelectorBitmap (line 551) | public void setSelectorBitmap(Bitmap b) {

FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingActivityBase.java
  type SlidingActivityBase (line 7) | public interface SlidingActivityBase {
    method setBehindContentView (line 16) | public void setBehindContentView(View view, LayoutParams layoutParams);
    method setBehindContentView (line 26) | public void setBehindContentView(View view);
    method setBehindContentView (line 34) | public void setBehindContentView(int layoutResID);
    method getSlidingMenu (line 41) | public SlidingMenu getSlidingMenu();
    method toggle (line 46) | public void toggle();
    method showContent (line 51) | public void showContent();
    method showMenu (line 56) | public void showMenu();
    method showSecondaryMenu (line 62) | public void showSecondaryMenu();
    method setSlidingActionBarEnabled (line 71) | public void setSlidingActionBarEnabled(boolean slidingActionBarEnabled);

FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingActivityHelper.java
  class SlidingActivityHelper (line 14) | public class SlidingActivityHelper {
    method SlidingActivityHelper (line 35) | public SlidingActivityHelper(Activity activity) {
    method onCreate (line 44) | public void onCreate(Bundle savedInstanceState) {
    method onPostCreate (line 53) | public void onPostCreate(Bundle savedInstanceState) {
    method setSlidingActionBarEnabled (line 95) | public void setSlidingActionBarEnabled(boolean slidingActionBarEnabled) {
    method findViewById (line 107) | public View findViewById(int id) {
    method onSaveInstanceState (line 124) | public void onSaveInstanceState(Bundle outState) {
    method registerAboveContentView (line 135) | public void registerAboveContentView(View v, LayoutParams params) {
    method setContentView (line 149) | public void setContentView(View v) {
    method setBehindContentView (line 161) | public void setBehindContentView(View view, LayoutParams layoutParams) {
    method getSlidingMenu (line 171) | public SlidingMenu getSlidingMenu() {
    method toggle (line 178) | public void toggle() {
    method showContent (line 185) | public void showContent() {
    method showMenu (line 192) | public void showMenu() {
    method showSecondaryMenu (line 200) | public void showSecondaryMenu() {
    method onKeyUp (line 211) | public boolean onKeyUp(int keyCode, KeyEvent event) {

FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingMenu.java
  class SlidingMenu (line 33) | public class SlidingMenu extends RelativeLayout {
    type OnOpenListener (line 94) | public interface OnOpenListener {
      method onOpen (line 95) | public void onOpen();
    type OnOpenedListener (line 101) | public interface OnOpenedListener {
      method onOpened (line 102) | public void onOpened();
    type OnCloseListener (line 108) | public interface OnCloseListener {
      method onClose (line 109) | public void onClose();
    type OnClosedListener (line 115) | public interface OnClosedListener {
      method onClosed (line 116) | public void onClosed();
    type CanvasTransformer (line 122) | public interface CanvasTransformer {
      method transformCanvas (line 130) | public void transformCanvas(Canvas canvas, float percentOpen);
    method SlidingMenu (line 138) | public SlidingMenu(Context context) {
    method SlidingMenu (line 148) | public SlidingMenu(Activity activity, int slideStyle) {
    method SlidingMenu (line 159) | public SlidingMenu(Context context, AttributeSet attrs) {
    method SlidingMenu (line 170) | public SlidingMenu(Context context, AttributeSet attrs, int defStyle) {
    method attachToActivity (line 256) | public void attachToActivity(Activity activity, int slideStyle) {
    method attachToActivity (line 267) | public void attachToActivity(Activity activity, int slideStyle, boolea...
    method setContent (line 308) | public void setContent(int res) {
    method setContent (line 315) | public void setContent(View view) {
    method getContent (line 323) | public View getContent() {
    method setMenu (line 332) | public void setMenu(int res) {
    method setMenu (line 341) | public void setMenu(View v) {
    method getMenu (line 348) | public View getMenu() {
    method setSecondaryMenu (line 355) | public void setSecondaryMenu(int res) {
    method setSecondaryMenu (line 362) | public void setSecondaryMenu(View v) {
    method getSecondaryMenu (line 369) | public View getSecondaryMenu() {
    method setSlidingEnabled (line 376) | public void setSlidingEnabled(boolean b) {
    method isSlidingEnabled (line 383) | public boolean isSlidingEnabled() {
    method setMode (line 392) | public void setMode(int mode) {
    method getMode (line 404) | public int getMode() {
    method setStatic (line 411) | public void setStatic(boolean b) {
    method showMenu (line 428) | public void showMenu() {
    method showMenu (line 435) | public void showMenu(boolean animate) {
    method showSecondaryMenu (line 442) | public void showSecondaryMenu() {
    method showSecondaryMenu (line 449) | public void showSecondaryMenu(boolean animate) {
    method showContent (line 456) | public void showContent() {
    method showContent (line 463) | public void showContent(boolean animate) {
    method toggle (line 470) | public void toggle() {
    method toggle (line 477) | public void toggle(boolean animate) {
    method isMenuShowing (line 488) | public boolean isMenuShowing() {
    method isSecondaryMenuShowing (line 495) | public boolean isSecondaryMenuShowing() {
    method getBehindOffset (line 502) | public int getBehindOffset() {
    method setBehindOffset (line 511) | public void setBehindOffset(int i) {
    method setBehindOffsetRes (line 521) | public void setBehindOffsetRes(int resID) {
    method setAboveOffset (line 531) | public void setAboveOffset(int i) {
    method setAboveOffsetRes (line 540) | public void setAboveOffsetRes(int resID) {
    method setBehindWidth (line 550) | public void setBehindWidth(int i) {
    method setBehindWidthRes (line 573) | public void setBehindWidthRes(int res) {
    method getBehindScrollScale (line 583) | public float getBehindScrollScale() {
    method setBehindScrollScale (line 593) | public void setBehindScrollScale(float f) {
    method getTouchmodeMarginThreshold (line 602) | public int getTouchmodeMarginThreshold() {
    method setTouchmodeMarginThreshold (line 609) | public void setTouchmodeMarginThreshold(int touchmodeMarginThreshold) {
    method setBehindCanvasTransformer (line 618) | public void setBehindCanvasTransformer(CanvasTransformer t) {
    method getTouchModeAbove (line 625) | public int getTouchModeAbove() {
    method setTouchModeAbove (line 633) | public void setTouchModeAbove(int i) {
    method setTouchModeBehind (line 645) | public void setTouchModeBehind(int i) {
    method setShadowDrawable (line 659) | public void setShadowDrawable(int resId) {
    method setShadowDrawable (line 668) | public void setShadowDrawable(Drawable d) {
    method setSecondaryShadowDrawable (line 677) | public void setSecondaryShadowDrawable(int resId) {
    method setSecondaryShadowDrawable (line 686) | public void setSecondaryShadowDrawable(Drawable d) {
    method setShadowWidthRes (line 695) | public void setShadowWidthRes(int resId) {
    method setShadowWidth (line 704) | public void setShadowWidth(int pixels) {
    method setFadeEnabled (line 711) | public void setFadeEnabled(boolean b) {
    method setFadeDegree (line 720) | public void setFadeDegree(float f) {
    method setSelectorEnabled (line 729) | public void setSelectorEnabled(boolean b) {
    method setSelectedView (line 738) | public void setSelectedView(View v) {
    method setSelectorDrawable (line 747) | public void setSelectorDrawable(int res) {
    method setSelectorBitmap (line 756) | public void setSelectorBitmap(Bitmap b) {
    method addIgnoredView (line 763) | public void addIgnoredView(View v) {
    method removeIgnoredView (line 770) | public void removeIgnoredView(View v) {
    method clearIgnoredViews (line 777) | public void clearIgnoredViews() {
    method setOnOpenListener (line 784) | public void setOnOpenListener(OnOpenListener listener) {
    method setOnCloseListener (line 791) | public void setOnCloseListener(OnCloseListener listener) {
    method setOnOpenedListener (line 799) | public void setOnOpenedListener(OnOpenedListener listener) {
    method setOnClosedListener (line 806) | public void setOnClosedListener(OnClosedListener listener) {
    class SavedState (line 813) | public static class SavedState extends BaseSavedState {
      method SavedState (line 816) | public SavedState(Parcelable superState, int item) {
      method SavedState (line 821) | private SavedState(Parcel in) {
      method getItem (line 826) | public int getItem() {
      method writeToParcel (line 833) | public void writeToParcel(Parcel out, int flags) {
      method createFromParcel (line 840) | public SavedState createFromParcel(Parcel in) {
      method newArray (line 844) | public SavedState[] newArray(int size) {
    method onSaveInstanceState (line 853) | @Override
    method onRestoreInstanceState (line 863) | @Override
    method fitSystemWindows (line 873) | @SuppressLint("NewApi")
    method manageLayers (line 889) | @TargetApi(Build.VERSION_CODES.HONEYCOMB)

FILE: app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingPreferenceActivity.java
  class SlidingPreferenceActivity (line 10) | public class SlidingPreferenceActivity extends PreferenceActivity implem...
    method onCreate (line 17) | @Override
    method onPostCreate (line 27) | @Override
    method findViewById (line 36) | @Override
    method onSaveInstanceState (line 47) | @Override
    method setContentView (line 56) | @Override
    method setContentView (line 64) | @Override
    method setContentView (line 72) | @Override
    method setBehindContentView (line 81) | public void setBehindContentView(int id) {
    method setBehindContentView (line 88) | public void setBehindContentView(View v) {
    method setBehindContentView (line 95) | public void setBehindContentView(View v, LayoutParams params) {
    method getSlidingMenu (line 102) | public SlidingMenu getSlidingMenu() {
    method toggle (line 109) | public void toggle() {
    method showContent (line 116) | public void showContent() {
    method showMenu (line 123) | public void showMenu() {
    method showSecondaryMenu (line 130) | public void showSecondaryMenu() {
    method setSlidingActionBarEnabled (line 137) | public void setSlidingActionBarEnabled(boolean b) {
    method onKeyUp (line 144) | @Override

FILE: app/src/main/java/com/hankkin/compustrading/view/CollapsingAvatarToolbar.java
  class CollapsingAvatarToolbar (line 21) | public class CollapsingAvatarToolbar extends LinearLayout implements App...
    method CollapsingAvatarToolbar (line 45) | public CollapsingAvatarToolbar(Context context) {
    method CollapsingAvatarToolbar (line 50) | public CollapsingAvatarToolbar(Context context, AttributeSet attrs) {
    method init (line 92) | private void init() {
    method findParentAppBarLayout (line 97) | @NonNull
    method onAttachedToWindow (line 109) | protected void onAttachedToWindow() {
    method setExpandedValuesForEditMode (line 119) | private void setExpandedValuesForEditMode() {
    method findViews (line 124) | private void findViews() {
    method findAvatar (line 131) | @NonNull
    method findTitle (line 140) | @NonNull
    method findSiblingToolbar (line 149) | @NonNull
    method onOffsetChanged (line 161) | @Override
    method calculateValues (line 171) | private void calculateValues() {
    method updateViews (line 177) | private void updateViews(float expandedPercentage, int currentOffset) {
    method setContainerOffset (line 194) | private void setContainerOffset(float translation) {
    method setContainerHeight (line 198) | private void setContainerHeight(int currHeight) {
    method setPadding (line 202) | private void setPadding(int currentPadding) {
    method setTextSize (line 206) | private void setTextSize(float currentTextSize) {
    method setText (line 210) | public void setText(String text) {
    method setAvatarSize (line 214) | private void setAvatarSize(int currentImageSize) {

FILE: app/src/main/java/com/hankkin/compustrading/view/PagerSlidingTabStrip.java
  class PagerSlidingTabStrip (line 32) | public class PagerSlidingTabStrip extends HorizontalScrollView {
    type IconTabProvider (line 34) | public interface IconTabProvider {
      method getPageIconResId (line 35) | public int getPageIconResId(int position);
    method PagerSlidingTabStrip (line 87) | public PagerSlidingTabStrip(Context context) {
    method PagerSlidingTabStrip (line 91) | public PagerSlidingTabStrip(Context context, AttributeSet attrs) {
    method PagerSlidingTabStrip (line 95) | public PagerSlidingTabStrip(Context context, AttributeSet attrs, int d...
    method setViewPager (line 163) | public void setViewPager(ViewPager pager) {
    method setOnPageChangeListener (line 175) | public void setOnPageChangeListener(OnPageChangeListener listener) {
    method notifyDataSetChanged (line 179) | public void notifyDataSetChanged() {
    method addTextTab (line 209) | private void addTextTab(final int position, String title) {
    method addIconTab (line 218) | private void addIconTab(final int position, int resId) {
    method addTab (line 227) | private void addTab(final int position, View tab) {
    method updateTabStyles (line 240) | private void updateTabStyles() {
    method scrollToChild (line 272) | private void scrollToChild(int position, int offset) {
    method onDraw (line 291) | @Override
    class PageListener (line 335) | private class PageListener implements OnPageChangeListener {
      method onPageScrolled (line 337) | @Override
      method onPageScrollStateChanged (line 351) | @Override
      method onPageSelected (line 362) | @Override
    method setIndicatorColor (line 373) | public void setIndicatorColor(int indicatorColor) {
    method setIndicatorColorResource (line 379) | public void setIndicatorColorResource(int resId) {
    method getIndicatorColor (line 385) | public int getIndicatorColor() {
    method setIndicatorHeight (line 389) | public void setIndicatorHeight(int indicatorLineHeightPx) {
    method getIndicatorHeight (line 394) | public int getIndicatorHeight() {
    method setUnderlineColor (line 398) | public void setUnderlineColor(int underlineColor) {
    method setUnderlineColorResource (line 403) | public void setUnderlineColorResource(int resId) {
    method getUnderlineColor (line 408) | public int getUnderlineColor() {
    method setDividerColor (line 412) | public void setDividerColor(int dividerColor) {
    method setDividerColorResource (line 417) | public void setDividerColorResource(int resId) {
    method getDividerColor (line 422) | public int getDividerColor() {
    method setUnderlineHeight (line 426) | public void setUnderlineHeight(int underlineHeightPx) {
    method getUnderlineHeight (line 431) | public int getUnderlineHeight() {
    method setDividerPadding (line 435) | public void setDividerPadding(int dividerPaddingPx) {
    method getDividerPadding (line 440) | public int getDividerPadding() {
    method setScrollOffset (line 444) | public void setScrollOffset(int scrollOffsetPx) {
    method getScrollOffset (line 449) | public int getScrollOffset() {
    method setShouldExpand (line 453) | public void setShouldExpand(boolean shouldExpand) {
    method getShouldExpand (line 458) | public boolean getShouldExpand() {
    method isTextAllCaps (line 462) | public boolean isTextAllCaps() {
    method setAllCaps (line 466) | public void setAllCaps(boolean textAllCaps) {
    method setTextSize (line 470) | public void setTextSize(int textSizePx) {
    method getTextSize (line 475) | public int getTextSize() {
    method setTextColor (line 479) | public void setTextColor(int textColor) {
    method setTextColorResource (line 484) | public void setTextColorResource(int resId) {
    method getTextColor (line 489) | public int getTextColor() {
    method setSelectedTextColor (line 493) | public void setSelectedTextColor(int textColor) {
    method setSelectedTextColorResource (line 498) | public void setSelectedTextColorResource(int resId) {
    method getSelectedTextColor (line 503) | public int getSelectedTextColor() {
    method setTypeface (line 507) | public void setTypeface(Typeface typeface, int style) {
    method setTabBackground (line 513) | public void setTabBackground(int resId) {
    method getTabBackground (line 518) | public int getTabBackground() {
    method setTabPaddingLeftRight (line 522) | public void setTabPaddingLeftRight(int paddingPx) {
    method getTabPaddingLeftRight (line 527) | public int getTabPaddingLeftRight() {
    method onRestoreInstanceState (line 531) | @Override
    method onSaveInstanceState (line 539) | @Override
    class SavedState (line 547) | static class SavedState extends BaseSavedState {
      method SavedState (line 550) | public SavedState(Parcelable superState) {
      method SavedState (line 554) | private SavedState(Parcel in) {
      method writeToParcel (line 559) | @Override
      method createFromParcel (line 566) | @Override
      method newArray (line 571) | @Override

FILE: app/src/main/java/com/hankkin/compustrading/view/RippleView.java
  class RippleView (line 20) | public class RippleView extends RelativeLayout {
    method run (line 47) | @Override
    method RippleView (line 55) | public RippleView(Context context) {
    method RippleView (line 59) | public RippleView(Context context, AttributeSet attrs) {
    method RippleView (line 64) | public RippleView(Context context, AttributeSet attrs, int defStyle) {
    method init (line 75) | private void init(final Context context, final AttributeSet attrs) {
    method draw (line 125) | @Override
    method onSizeChanged (line 176) | @Override
    method animateRipple (line 193) | public void animateRipple(MotionEvent event) {
    method animateRipple (line 203) | public void animateRipple(final float x, final float y) {
    method createAnimation (line 213) | private void createAnimation(final float x, final float y) {
    method onTouchEvent (line 242) | @Override
    method onInterceptTouchEvent (line 251) | @Override
    method sendClickEvent (line 262) | private void sendClickEvent(final Boolean isLongClick) {
    method getCircleBitmap (line 282) | private Bitmap getCircleBitmap(final int radius) {
    method setRippleColor (line 304) | public void setRippleColor(int rippleColor) {
    method getRippleColor (line 308) | public int getRippleColor() {
    method getRippleType (line 312) | public RippleType getRippleType()
    method setRippleType (line 322) | public void setRippleType(final RippleType rippleType)
    method isCentered (line 327) | public Boolean isCentered()
    method setCentered (line 337) | public void setCentered(final Boolean isCentered)
    method getRipplePadding (line 342) | public int getRipplePadding()
    method setRipplePadding (line 352) | public void setRipplePadding(int ripplePadding)
    method isZooming (line 357) | public Boolean isZooming()
    method setZooming (line 367) | public void setZooming(Boolean hasToZoom)
    method getZoomScale (line 372) | public float getZoomScale()
    method setZoomScale (line 382) | public void setZoomScale(float zoomScale)
    method getZoomDuration (line 387) | public int getZoomDuration()
    method setZoomDuration (line 397) | public void setZoomDuration(int zoomDuration)
    method getRippleDuration (line 402) | public int getRippleDuration()
    method setRippleDuration (line 412) | public void setRippleDuration(int rippleDuration)
    method getFrameRate (line 417) | public int getFrameRate()
    method setFrameRate (line 427) | public void setFrameRate(int frameRate)
    method getRippleAlpha (line 432) | public int getRippleAlpha()
    method setRippleAlpha (line 442) | public void setRippleAlpha(int rippleAlpha)
    method setOnRippleCompleteListener (line 447) | public void setOnRippleCompleteListener(OnRippleCompleteListener liste...
    type OnRippleCompleteListener (line 454) | public interface OnRippleCompleteListener {
      method onComplete (line 455) | void onComplete(RippleView rippleView);
    type RippleType (line 458) | public enum RippleType {
      method RippleType (line 465) | RippleType(int type)

FILE: app/src/main/java/com/hankkin/compustrading/view/RoundedImageView.java
  class RoundedImageView (line 26) | public class RoundedImageView extends ImageView {
    method RoundedImageView (line 28) | public RoundedImageView(Context context) {
    method RoundedImageView (line 32) | public RoundedImageView(Context context, AttributeSet attrs) {
    method RoundedImageView (line 37) | public RoundedImageView(Context context, AttributeSet attrs, int defSt...
    method init (line 45) | private void init(Context context, AttributeSet attrs) {
    method onDraw (line 57) | @Override
    method getCroppedBitmap (line 100) | public Bitmap getCroppedBitmap(Bitmap bmp, int radius) {
    method pxFromDp (line 143) | public static float pxFromDp(Context context, float dp) {

FILE: app/src/main/java/com/hankkin/compustrading/view/floatbutton/AbsListViewScrollDetector.java
  class AbsListViewScrollDetector (line 7) | abstract class AbsListViewScrollDetector implements AbsListView.OnScroll...
    method onScrollUp (line 13) | abstract void onScrollUp();
    method onScrollDown (line 15) | abstract void onScrollDown();
    method onScrollStateChanged (line 17) | @Override
    method onScroll (line 21) | @Override
    method setScrollThreshold (line 47) | public void setScrollThreshold(int scrollThreshold) {
    method setListView (line 51) | public void setListView(@NonNull AbsListView listView) {
    method isSameRow (line 55) | private boolean isSameRow(int firstVisibleItem) {
    method getTopItemScrollY (line 59) | private int getTopItemScrollY() {

FILE: app/src/main/java/com/hankkin/compustrading/view/floatbutton/AddFloatingActionButton.java
  class AddFloatingActionButton (line 17) | public class AddFloatingActionButton extends FloatingActionButton {
    method AddFloatingActionButton (line 20) | public AddFloatingActionButton(Context context) {
    method AddFloatingActionButton (line 24) | public AddFloatingActionButton(Context context, AttributeSet attrs) {
    method AddFloatingActionButton (line 28) | public AddFloatingActionButton(Context context, AttributeSet attrs, in...
    method init (line 32) | @Override
    method getPlusColor (line 44) | public int getPlusColor() {
    method setPlusColorResId (line 48) | public void setPlusColorResId(@ColorRes int plusColor) {
    method setPlusColor (line 52) | public void setPlusColor(int color) {
    method setIcon (line 59) | @Override
    method getIconDrawable (line 64) | @Override

FILE: app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionButton.java
  class FloatingActionButton (line 37) | public class FloatingActionButton extends ImageButton {
    method FloatingActionButton (line 62) | public FloatingActionButton(Context context) {
    method FloatingActionButton (line 66) | public FloatingActionButton(Context context, AttributeSet attrs) {
    method FloatingActionButton (line 71) | public FloatingActionButton(Context context, AttributeSet attrs, int d...
    method init (line 76) | void init(Context context, AttributeSet attributeSet) {
    method updateDrawableSize (line 95) | private void updateDrawableSize() {
    method updateCircleSize (line 99) | private void updateCircleSize() {
    method setSize (line 103) | public void setSize(@FAB_SIZE int size) {
    method getSize (line 116) | @FAB_SIZE
    method setIcon (line 121) | public void setIcon(@DrawableRes int icon) {
    method setIconDrawable (line 129) | public void setIconDrawable(@NonNull Drawable iconDrawable) {
    method getColorNormal (line 140) | public int getColorNormal() {
    method setColorNormalResId (line 144) | public void setColorNormalResId(@ColorRes int colorNormal) {
    method setColorNormal (line 148) | public void setColorNormal(int color) {
    method getColorPressed (line 158) | public int getColorPressed() {
    method setColorPressedResId (line 162) | public void setColorPressedResId(@ColorRes int colorPressed) {
    method setColorPressed (line 166) | public void setColorPressed(int color) {
    method getColorDisabled (line 176) | public int getColorDisabled() {
    method setColorDisabledResId (line 180) | public void setColorDisabledResId(@ColorRes int colorDisabled) {
    method setColorDisabled (line 184) | public void setColorDisabled(int color) {
    method setStrokeVisible (line 191) | public void setStrokeVisible(boolean visible) {
    method isStrokeVisible (line 198) | public boolean isStrokeVisible() {
    method getColor (line 202) | int getColor(@ColorRes int id) {
    method getDimension (line 206) | float getDimension(@DimenRes int id) {
    method setTitle (line 210) | public void setTitle(String title) {
    method getLabelView (line 218) | TextView getLabelView() {
    method getTitle (line 222) | public String getTitle() {
    method onMeasure (line 226) | @Override
    method updateBackground (line 232) | void updateBackground() {
    method getIconDrawable (line 271) | Drawable getIconDrawable() {
    method createFillDrawable (line 281) | private StateListDrawable createFillDrawable(float strokeWidth) {
    method createCircleDrawable (line 289) | private Drawable createCircleDrawable(int color, float strokeWidth) {
    class TranslucentLayerDrawable (line 314) | private static class TranslucentLayerDrawable extends LayerDrawable {
      method TranslucentLayerDrawable (line 317) | public TranslucentLayerDrawable(int alpha, Drawable... layers) {
      method draw (line 322) | @Override
    method createOuterStrokeDrawable (line 331) | private Drawable createOuterStrokeDrawable(float strokeWidth) {
    method opacityToAlpha (line 344) | private int opacityToAlpha(float opacity) {
    method darkenColor (line 348) | private int darkenColor(int argb) {
    method lightenColor (line 352) | private int lightenColor(int argb) {
    method adjustColorBrightness (line 356) | private int adjustColorBrightness(int argb, float factor) {
    method halfTransparent (line 365) | private int halfTransparent(int argb) {
    method opaque (line 374) | private int opaque(int argb) {
    method createInnerStrokesDrawable (line 382) | private Drawable createInnerStrokesDrawable(final int color, float str...
    method setBackgroundCompat (line 412) | @SuppressWarnings("deprecation")
    method setVisibility (line 422) | @Override

FILE: app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionsMenu.java
  class FloatingActionsMenu (line 36) | public class FloatingActionsMenu extends ViewGroup {
    type OnFloatingActionsMenuUpdateListener (line 82) | public interface OnFloatingActionsMenuUpdateListener {
      method onMenuExpanded (line 83) | void onMenuExpanded();
      method onMenuCollapsed (line 84) | void onMenuCollapsed();
    method FloatingActionsMenu (line 87) | public FloatingActionsMenu(Context context) {
    method FloatingActionsMenu (line 91) | public FloatingActionsMenu(Context context, AttributeSet attrs) {
    method FloatingActionsMenu (line 96) | public FloatingActionsMenu(Context context, AttributeSet attrs, int de...
    method init (line 101) | private void init(Context context, AttributeSet attributeSet) {
    method setOnFloatingActionsMenuUpdateListener (line 130) | public void setOnFloatingActionsMenuUpdateListener(OnFloatingActionsMe...
    method expandsHorizontally (line 134) | private boolean expandsHorizontally() {
    class RotatingDrawable (line 138) | private static class RotatingDrawable extends LayerDrawable {
      method RotatingDrawable (line 139) | public RotatingDrawable(Drawable drawable) {
      method getRotation (line 145) | @SuppressWarnings("UnusedDeclaration")
      method setRotation (line 150) | @SuppressWarnings("UnusedDeclaration")
      method draw (line 156) | @Override
    method createAddButton (line 165) | private void createAddButton(Context context) {
    method addButton (line 209) | public void addButton(FloatingActionButton button) {
    method removeButton (line 218) | public void removeButton(FloatingActionButton button) {
    method getColor (line 225) | private int getColor(@ColorRes int id) {
    method onMeasure (line 229) | @Override
    method adjustForOvershoot (line 290) | private int adjustForOvershoot(int dimension) {
    method onLayout (line 294) | @Override
    method generateDefaultLayoutParams (line 424) | @Override
    method generateLayoutParams (line 429) | @Override
    method generateLayoutParams (line 434) | @Override
    method checkLayoutParams (line 439) | @Override
    class LayoutParams (line 448) | private class LayoutParams extends ViewGroup.LayoutParams {
      method LayoutParams (line 456) | public LayoutParams(ViewGroup.LayoutParams source) {
      method setAnimationsTarget (line 484) | public void setAnimationsTarget(View view) {
      method addLayerTypeListener (line 503) | private void addLayerTypeListener(Animator animator, final View view) {
    method onFinishInflate (line 518) | @Override
    method createLabels (line 530) | private void createLabels() {
    method collapse (line 549) | public void collapse() {
    method collapseImmediately (line 553) | public void collapseImmediately() {
    method collapse (line 557) | private void collapse(boolean immediately) {
    method toggle (line 571) | public void toggle() {
    method expand (line 579) | public void expand() {
    method isExpanded (line 592) | public boolean isExpanded() {
    method setEnabled (line 596) | @Override
    method onSaveInstanceState (line 603) | @Override
    method onRestoreInstanceState (line 612) | @Override
    class SavedState (line 629) | public static class SavedState extends BaseSavedState {
      method SavedState (line 632) | public SavedState(Parcelable parcel) {
      method SavedState (line 636) | private SavedState(Parcel in) {
      method writeToParcel (line 641) | @Override
      method createFromParcel (line 649) | @Override
      method newArray (line 654) | @Override
    method attachToListView (line 661) | public void attachToListView(@NonNull AbsListView listView,
    class AbsListViewScrollDetectorImpl (line 672) | private class AbsListViewScrollDetectorImpl extends AbsListViewScrollD...
      method setScrollDirectionListener (line 676) | private void setScrollDirectionListener(ScrollDirectionListener scro...
      method setOnScrollListener (line 680) | public void setOnScrollListener(AbsListView.OnScrollListener onScrol...
      method onScrollDown (line 684) | @Override
      method onScrollUp (line 692) | @Override
      method onScroll (line 700) | @Override
      method onScrollStateChanged (line 710) | @Override
    method show (line 719) | public void show() {
    method hide (line 723) | public void hide() {
    method show (line 726) | public void show(boolean animate) {
    method hide (line 730) | public void hide(boolean animate) {
    method toggle (line 733) | private void toggle(final boolean visible, final boolean animate, bool...
    method getMarginBottom (line 769) | private int getMarginBottom() {
    method hasHoneycombApi (line 777) | private boolean hasHoneycombApi() {

FILE: app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionsMenuHidable.java
  class FloatingActionsMenuHidable (line 9) | public class FloatingActionsMenuHidable extends FloatingActionsMenu {
    method FloatingActionsMenuHidable (line 17) | public FloatingActionsMenuHidable(Context context) {
    method FloatingActionsMenuHidable (line 22) | public FloatingActionsMenuHidable(Context context, AttributeSet attrs) {
    method FloatingActionsMenuHidable (line 27) | public FloatingActionsMenuHidable(Context context, AttributeSet attrs,...
    method show (line 33) | public void show(boolean isVisible) {
    method isShown (line 39) | public boolean isShown() {
    method getMarginRight (line 43) | private int getMarginRight() {
    method getVisible (line 52) | public boolean getVisible(){

FILE: app/src/main/java/com/hankkin/compustrading/view/floatbutton/TouchDelegateGroup.java
  class TouchDelegateGroup (line 11) | public class TouchDelegateGroup extends TouchDelegate {
    method TouchDelegateGroup (line 17) | public TouchDelegateGroup(View uselessHackyView) {
    method addTouchDelegate (line 21) | public void addTouchDelegate(@NonNull TouchDelegate touchDelegate) {
    method removeTouchDelegate (line 25) | public void removeTouchDelegate(TouchDelegate touchDelegate) {
    method clearTouchDelegates (line 32) | public void clearTouchDelegates() {
    method onTouchEvent (line 37) | @Override
    method setEnabled (line 68) | public void setEnabled(boolean enabled) {

FILE: app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/IPullToZoom.java
  type IPullToZoom (line 18) | public interface IPullToZoom<T extends View> {
    method getZoomView (line 25) | public View getZoomView();
    method getHeaderView (line 27) | public View getHeaderView();
    method getPullRootView (line 34) | public T getPullRootView();
    method isPullToZoomEnabled (line 41) | public boolean isPullToZoomEnabled();
    method isZooming (line 48) | public boolean isZooming();
    method isParallax (line 55) | public boolean isParallax();
    method isHideHeader (line 57) | public boolean isHideHeader();
    method handleStyledAttributes (line 59) | public void handleStyledAttributes(TypedArray a);

FILE: app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/PullToZoomBase.java
  class PullToZoomBase (line 30) | public abstract class PullToZoomBase<T extends View> extends LinearLayou...
    method PullToZoomBase (line 52) | public PullToZoomBase(Context context) {
    method PullToZoomBase (line 56) | public PullToZoomBase(Context context, AttributeSet attrs) {
    method init (line 62) | private void init(Context context, AttributeSet attrs) {
    method setOnPullZoomListener (line 102) | public void setOnPullZoomListener(OnPullZoomListener onPullZoomListene...
    method getPullRootView (line 106) | @Override
    method getZoomView (line 111) | @Override
    method getHeaderView (line 116) | @Override
    method isPullToZoomEnabled (line 121) | @Override
    method isZooming (line 126) | @Override
    method isParallax (line 131) | @Override
    method isHideHeader (line 136) | @Override
    method setZoomEnabled (line 141) | public void setZoomEnabled(boolean isZoomEnabled) {
    method setParallax (line 145) | public void setParallax(boolean isParallax) {
    method setHideHeader (line 149) | public void setHideHeader(boolean isHideHeader) {//header显示才能Zoom
    method onInterceptTouchEvent (line 153) | @Override
    method onTouchEvent (line 204) | @Override
    method pullEvent (line 256) | private void pullEvent() {
    method pullHeaderToZoom (line 271) | protected abstract void pullHeaderToZoom(int newScrollValue);
    method setHeaderView (line 273) | public abstract void setHeaderView(View headerView);
    method setZoomView (line 275) | public abstract void setZoomView(View zoomView);
    method createRootView (line 277) | protected abstract T createRootView(Context context, AttributeSet attrs);
    method smoothScrollToTop (line 279) | protected abstract void smoothScrollToTop();
    method isReadyForPullStart (line 281) | protected abstract boolean isReadyForPullStart();
    type OnPullZoomListener (line 283) | public interface OnPullZoomListener {
      method onPullZooming (line 284) | public void onPullZooming(int newScrollValue);
      method onPullZoomEnd (line 286) | public void onPullZoomEnd();

FILE: app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/PullToZoomScrollViewEx.java
  class PullToZoomScrollViewEx (line 29) | public class PullToZoomScrollViewEx extends PullToZoomBase<ScrollView> {
    method getInterpolation (line 39) | public float getInterpolation(float paramAnonymousFloat) {
    method PullToZoomScrollViewEx (line 45) | public PullToZoomScrollViewEx(Context context) {
    method PullToZoomScrollViewEx (line 49) | public PullToZoomScrollViewEx(Context context, AttributeSet attrs) {
    method pullHeaderToZoom (line 70) | @Override
    method setHideHeader (line 94) | @Override
    method setHeaderView (line 106) | @Override
    method setZoomView (line 114) | @Override
    method updateHeaderView (line 122) | private void updateHeaderView() {
    method setScrollContentView (line 136) | public void setScrollContentView(View contentView) {
    method createRootView (line 146) | @Override
    method smoothScrollToTop (line 153) | @Override
    method isReadyForPullStart (line 159) | @Override
    method handleStyledAttributes (line 164) | @Override
    method setHeaderViewSize (line 199) | public void setHeaderViewSize(int width, int height) {
    method setHeaderLayoutParams (line 218) | public void setHeaderLayoutParams(LinearLayout.LayoutParams layoutPara...
    method onLayout (line 226) | protected void onLayout(boolean paramBoolean, int paramInt1, int param...
    class ScalingRunnable (line 235) | class ScalingRunnable implements Runnable {
      method ScalingRunnable (line 241) | ScalingRunnable() {
      method abortAnimation (line 244) | public void abortAnimation() {
      method isFinished (line 248) | public boolean isFinished() {
      method run (line 252) | public void run() {
      method startAnimation (line 278) | public void startAnimation(long paramLong) {
    class InternalScrollView (line 289) | protected class InternalScrollView extends ScrollView {
      method InternalScrollView (line 292) | public InternalScrollView(Context context) {
      method InternalScrollView (line 296) | public InternalScrollView(Context context, AttributeSet attrs) {
      method setOnScrollViewChangedListener (line 300) | public void setOnScrollViewChangedListener(OnScrollViewChangedListen...
      method onScrollChanged (line 304) | @Override
    type OnScrollViewChangedListener (line 313) | protected interface OnScrollViewChangedListener {
      method onInternalScrollChanged (line 314) | public void onInternalScrollChanged(int left, int top, int oldLeft, ...

FILE: app/src/main/java/com/hankkin/compustrading/view/refreshload/MetaballView.java
  class MetaballView (line 21) | public class MetaballView extends View {
    method MetaballView (line 35) | public MetaballView(Context context) {
    method MetaballView (line 40) | public MetaballView(Context context, AttributeSet attrs) {
    method MetaballView (line 45) | public MetaballView(Context context, AttributeSet attrs, int defStyleA...
    class Circle (line 51) | private class Circle {
    method setPaintMode (line 56) | public void setPaintMode(int mode) {
    method init (line 61) | private void init() {
    method getVector (line 81) | private float[] getVector(float radians, float length) {
    class MoveAnimation (line 89) | private class MoveAnimation extends Animation {
      method applyTransformation (line 91) | @Override
    method metaball (line 107) | private void metaball(Canvas canvas, int j, int i, float v, float hand...
    method getLength (line 221) | private float getLength(float[] b) {
    method getDistance (line 225) | private float getDistance(float[] b1, float[] b2) {
    method onDraw (line 252) | @Override
    method onMeasure (line 271) | @Override
    method stopAnimation (line 278) | private void stopAnimation() {
    method startAnimation (line 283) | private void startAnimation() {
    method onVisibilityChanged (line 292) | @Override
    method onAttachedToWindow (line 303) | @Override
    method onDetachedFromWindow (line 309) | @Override

FILE: app/src/main/java/com/hankkin/compustrading/view/refreshload/RefreshLayout.java
  class RefreshLayout (line 13) | public class RefreshLayout extends SwipeRefreshLayout {
    method RefreshLayout (line 26) | public RefreshLayout(Context context) {
    method RefreshLayout (line 30) | public RefreshLayout(Context context, AttributeSet attrs) {
    method setChildView (line 46) | public void setChildView(ListView mListView) {
    method dispatchTouchEvent (line 52) | @Override
    method canLoadMore (line 78) | private boolean canLoadMore() {
    method isBottom (line 82) | private boolean isBottom() {
    method isPullingUp (line 92) | private boolean isPullingUp() {
    method loadData (line 96) | private void loadData() {
    method setLoading (line 102) | public void setLoading(boolean loading) {
    method setOnLoadListener (line 123) | public void setOnLoadListener(OnLoadListener loadListener) {
    type OnLoadListener (line 127) | public interface OnLoadListener {
      method onLoad (line 128) | public void onLoad();

FILE: app/src/test/java/com/hankkin/compustrading/ExampleUnitTest.java
  class ExampleUnitTest (line 10) | public class ExampleUnitTest {
    method addition_isCorrect (line 11) | @Test
Condensed preview — 131 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (504K chars).
[
  {
    "path": ".gitignore",
    "chars": 91,
    "preview": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n"
  },
  {
    "path": ".idea/compiler.xml",
    "chars": 709,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <option name"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "chars": 74,
    "preview": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/encodings.xml",
    "chars": 159,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"Encoding\">\n    <file url=\"PROJECT\" chars"
  },
  {
    "path": ".idea/gradle.xml",
    "chars": 674,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linke"
  },
  {
    "path": ".idea/misc.xml",
    "chars": 2226,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"EntryPointsManager\">\n    <entry_points v"
  },
  {
    "path": ".idea/modules.xml",
    "chars": 369,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n   "
  },
  {
    "path": ".idea/runConfigurations.xml",
    "chars": 564,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <o"
  },
  {
    "path": ".idea/vcs.xml",
    "chars": 180,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping dire"
  },
  {
    "path": "README.md",
    "chars": 1348,
    "preview": "**该APP已经不再维护了,如果您需要的话 请看 https://github.com/Hankkin/Reading** \n*Reading是一款基于WanAndroid OpenApi开发的阅读类工具,如果你是一个热衷于Android开"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/app.iml",
    "chars": 10974,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":app\" external.linked.project.path=\"$MODULE_D"
  },
  {
    "path": "app/build.gradle",
    "chars": 1274,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 25\n    buildToolsVersion \"25.0.2\"\n    useLibrar"
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 2207,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "app/src/androidTest/java/com/hankkin/compustrading/ApplicationTest.java",
    "chars": 356,
    "preview": "package com.hankkin.compustrading;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a "
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 4819,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/Application/MyApplication.java",
    "chars": 4230,
    "preview": "package com.hankkin.compustrading.Application;\n\nimport android.app.Application;\nimport android.graphics.Bitmap;\nimport a"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/MainActivity.java",
    "chars": 954,
    "preview": "package com.hankkin.compustrading;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v7.a"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/User/UserBean.java",
    "chars": 647,
    "preview": "package com.hankkin.myapplication.User;\n\nimport cn.bmob.v3.BmobObject;\n\n/**\n * Created by Hankkin on 15/11/28.\n */\npubli"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/Utils/BitmapUtils.java",
    "chars": 5387,
    "preview": "package com.hankkin.compustrading.Utils;\n\nimport android.app.Activity;\nimport android.graphics.Bitmap;\nimport android.gr"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/Utils/HankkinUtils.java",
    "chars": 23282,
    "preview": "/**\n * YUtils.java[V1.0.0]\n * classes : com.wadiankeji.creditsmanager.util.YUtils\n *\n * @author Hankkin Create at 2014年1"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/BaseActivity.java",
    "chars": 10496,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport an"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/LoginActivity.java",
    "chars": 3090,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.sup"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/MainShowActivity.java",
    "chars": 13254,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.content.res.Configuration;\nim"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/NewProductActivity.java",
    "chars": 8822,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport andro"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/PersonActivity.java",
    "chars": 10220,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport andro"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/ProdectDetailActivity.java",
    "chars": 3446,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.os.Bundle;\nimport android.support.design.widget.CollapsingTo"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/RegisterActivity.java",
    "chars": 3803,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.sup"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/SearchProActivity.java",
    "chars": 1182,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/activity/SplasActivity.java",
    "chars": 3399,
    "preview": "package com.hankkin.compustrading.activity;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.os."
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/adapter/CategoryFragmentAdapter.java",
    "chars": 1139,
    "preview": "package com.hankkin.compustrading.adapter;\n\nimport android.support.v4.app.Fragment;\nimport android.support.v4.app.Fragme"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/adapter/PersonInfoAdapter.java",
    "chars": 1877,
    "preview": "package com.hankkin.compustrading.adapter;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport a"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/adapter/ProductAdapter.java",
    "chars": 3218,
    "preview": "package com.hankkin.compustrading.adapter;\n\nimport android.content.Context;\nimport android.text.TextUtils;\nimport androi"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/fragment/CateDetailFragment.java",
    "chars": 8206,
    "preview": "package com.hankkin.compustrading.fragment;\n\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.os."
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/interface/FileUploadListener.java",
    "chars": 167,
    "preview": "package com.hankkin.compustrading;\n\n/**\n * Created by Hankkin on 15/12/20.\n */\npublic interface FileUploadListener  {\n  "
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/interface/ScrollDirectionListener.java",
    "chars": 129,
    "preview": "package com.hankkin.compustrading;\n\npublic interface ScrollDirectionListener {\n    void onScrollDown();\n\n    void onScro"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/model/Category.java",
    "chars": 922,
    "preview": "package com.hankkin.compustrading.model;\n\n\nimport cn.bmob.v3.BmobObject;\n\n/**\n * Created by Hankkin on 15/11/29.\n */\npub"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/model/Person.java",
    "chars": 1174,
    "preview": "package com.hankkin.compustrading.model;\n\nimport cn.bmob.v3.BmobObject;\nimport cn.bmob.v3.BmobUser;\n\n/**\n * Created by H"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/model/PersonShow.java",
    "chars": 572,
    "preview": "package com.hankkin.compustrading.model;\n\n/**\n * Created by Hankkin on 15/12/6.\n */\npublic class PersonShow {\n    privat"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/model/Product.java",
    "chars": 2153,
    "preview": "package com.hankkin.compustrading.model;\n\nimport cn.bmob.v3.BmobObject;\n\n/**\n * Created by Hankkin on 15/11/29.\n */\npubl"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/sharepreference/MySP.java",
    "chars": 4212,
    "preview": "package com.hankkin.compustrading.sharepreference;\n\nimport android.content.Context;\nimport android.content.SharedPrefere"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/CustomViewAbove.java",
    "chars": 29146,
    "preview": "package com.hankkin.compustrading.slidingmenu;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport android.conte"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/CustomViewBehind.java",
    "chars": 13157,
    "preview": "package com.hankkin.compustrading.slidingmenu;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport a"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingActivityBase.java",
    "chars": 2350,
    "preview": "package com.hankkin.compustrading.slidingmenu;\n\nimport android.view.View;\nimport android.view.ViewGroup.LayoutParams;\n\n\n"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingActivityHelper.java",
    "chars": 6135,
    "preview": "package com.hankkin.compustrading.slidingmenu;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.os"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingMenu.java",
    "chars": 21769,
    "preview": "package com.hankkin.compustrading.slidingmenu;\n\nimport java.lang.reflect.Method;\n\nimport android.annotation.SuppressLint"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/slidingmenu/SlidingPreferenceActivity.java",
    "chars": 4153,
    "preview": "package com.hankkin.compustrading.slidingmenu;\n\n\nimport android.os.Bundle;\nimport android.preference.PreferenceActivity;"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/CollapsingAvatarToolbar.java",
    "chars": 7623,
    "preview": "package com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport an"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/PagerSlidingTabStrip.java",
    "chars": 16182,
    "preview": "package com.hankkin.compustrading.view;\n\n\nimport java.util.Locale;\n\n\nimport android.content.Context;\nimport android.cont"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/RippleView.java",
    "chars": 14016,
    "preview": "package com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport a"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/RoundedImageView.java",
    "chars": 4307,
    "preview": "/**\n * 圆形控件,显示头像\n * by黄海杰 at:2015-4-7\n */\npackage com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimpor"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/AbsListViewScrollDetector.java",
    "chars": 1989,
    "preview": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.support.annotation.NonNull;\nimport android.view.View"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/AddFloatingActionButton.java",
    "chars": 2779,
    "preview": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.content.Context;\nimport android.content.res.TypedArr"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionButton.java",
    "chars": 12564,
    "preview": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.annotation.SuppressLint;\nimport android.content.Cont"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionsMenu.java",
    "chars": 26159,
    "preview": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.animation.Animator;\nimport android.animation.Animato"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/FloatingActionsMenuHidable.java",
    "chars": 1458,
    "preview": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.content.Context;\nimport android.support.annotation.N"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/floatbutton/TouchDelegateGroup.java",
    "chars": 1940,
    "preview": "package com.hankkin.compustrading.view.floatbutton;\n\nimport android.graphics.Rect;\nimport android.support.annotation.Non"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/IPullToZoom.java",
    "chars": 1485,
    "preview": "package com.hankkin.compustrading.view;\n\n/**\n * Author:    ZhuWenWu\n * Version    V1.0\n * Date:      2014/11/7  14:21.\n "
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/PullToZoomBase.java",
    "chars": 9051,
    "preview": "package com.hankkin.compustrading.view;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.con"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/ipulltozoom/PullToZoomScrollViewEx.java",
    "chars": 11151,
    "preview": "package com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport a"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/refreshload/MetaballView.java",
    "chars": 10921,
    "preview": "package com.hankkin.compustrading.view.refreshload;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimp"
  },
  {
    "path": "app/src/main/java/com/hankkin/compustrading/view/refreshload/RefreshLayout.java",
    "chars": 3532,
    "preview": "package com.hankkin.compustrading.view;\n\nimport android.content.Context;\nimport android.support.v4.widget.SwipeRefreshLa"
  },
  {
    "path": "app/src/main/res/anim/anim.xml",
    "chars": 319,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<set xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:inter"
  },
  {
    "path": "app/src/main/res/anim/list_anim.xml",
    "chars": 209,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layoutAnimation xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    a"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_cancel_bg_focused.xml",
    "chars": 303,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <corners "
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_cancel_bg_normal.xml",
    "chars": 327,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_cancel_bg_selector.xml",
    "chars": 498,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item "
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_cancel_bg_tap.xml",
    "chars": 274,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_check_selector.xml",
    "chars": 1603,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item "
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_close_bg_selector.xml",
    "chars": 451,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\t<item and"
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_ok_bg_focused.xml",
    "chars": 303,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <corners "
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_ok_bg_normal.xml",
    "chars": 327,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_ok_bg_selector.xml",
    "chars": 492,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n    <item "
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_button_ok_bg_tap.xml",
    "chars": 274,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/bmob_update_dialog_bg.xml",
    "chars": 215,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/btn_login_background.xml",
    "chars": 483,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:s"
  },
  {
    "path": "app/src/main/res/drawable/fab_label_background.xml",
    "chars": 344,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <solid and"
  },
  {
    "path": "app/src/main/res/drawable/login_et_background.xml",
    "chars": 483,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:s"
  },
  {
    "path": "app/src/main/res/drawable/normal_white_bg.xml",
    "chars": 471,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:s"
  },
  {
    "path": "app/src/main/res/drawable/shadow.xml",
    "chars": 250,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\n    <gradien"
  },
  {
    "path": "app/src/main/res/drawable/tab_background.xml",
    "chars": 402,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" android:exit"
  },
  {
    "path": "app/src/main/res/layout/activity_login.xml",
    "chars": 3981,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 3630,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/too"
  },
  {
    "path": "app/src/main/res/layout/activity_main_show.xml",
    "chars": 13972,
    "preview": "<android.support.v4.widget.DrawerLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\""
  },
  {
    "path": "app/src/main/res/layout/activity_new_product.xml",
    "chars": 6641,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/too"
  },
  {
    "path": "app/src/main/res/layout/activity_person.xml",
    "chars": 1582,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/too"
  },
  {
    "path": "app/src/main/res/layout/activity_prodect_detail.xml",
    "chars": 9292,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<android.support.design.widget.CoordinatorLayout\n    xmlns:android=\"http://schem"
  },
  {
    "path": "app/src/main/res/layout/activity_product_detail.xml",
    "chars": 668,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/activity_register.xml",
    "chars": 3396,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/activity_search_pro.xml",
    "chars": 1214,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/too"
  },
  {
    "path": "app/src/main/res/layout/activity_splas.xml",
    "chars": 408,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "app/src/main/res/layout/bmob_update_dialog.xml",
    "chars": 5256,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    an"
  },
  {
    "path": "app/src/main/res/layout/fragment_item.xml",
    "chars": 591,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.hankkin.compustrading.view.RefreshLayout xmlns:android=\"http://schemas.andro"
  },
  {
    "path": "app/src/main/res/layout/listview_footer.xml",
    "chars": 1239,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    an"
  },
  {
    "path": "app/src/main/res/layout/listview_personinfo.xml",
    "chars": 1951,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "app/src/main/res/layout/loading.xml",
    "chars": 861,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "app/src/main/res/layout/lv_product_item.xml",
    "chars": 3345,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/profile_contect_view.xml",
    "chars": 10890,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/profile_head_view.xml",
    "chars": 2282,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/layout_view\"\n    android"
  },
  {
    "path": "app/src/main/res/layout/profile_zoom_view.xml",
    "chars": 393,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ImageView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android"
  },
  {
    "path": "app/src/main/res/layout/slidingmenumain.xml",
    "chars": 272,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<com.hankkin.compustrading.slidingmenu.SlidingMenu\n    xmlns:android=\"http://sche"
  },
  {
    "path": "app/src/main/res/layout/view_select_img.xml",
    "chars": 1658,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/menu/menu_login.xml",
    "chars": 400,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/menu/menu_main.xml",
    "chars": 369,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/menu/menu_new_product.xml",
    "chars": 405,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/menu/menu_person.xml",
    "chars": 401,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/menu/menu_prodect_detail.xml",
    "chars": 540,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/menu/menu_register.xml",
    "chars": 403,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/menu/menu_search.xml",
    "chars": 404,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/menu/menu_splas.xml",
    "chars": 400,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/values/arrays.xml",
    "chars": 802,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string-array name=\"school\">\n        <item>南开大学</item>\n        <i"
  },
  {
    "path": "app/src/main/res/values/attrs.xml",
    "chars": 5944,
    "preview": "<!--\n  Copyright 2011 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "app/src/main/res/values/bmob_common_strings.xml",
    "chars": 969,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\t<string name=\"bmob_common_action_info_exist\">正在下载中.</string>\n\t<strin"
  },
  {
    "path": "app/src/main/res/values/bmob_update_string.xml",
    "chars": 714,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\t<string name=\"BMBreak_Network\">未联网</string>\n\t<string name=\"BMUpdateT"
  },
  {
    "path": "app/src/main/res/values/color.xml",
    "chars": 1540,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"theme_color\">#2B98f0</color>\n    <color name=\"theme_"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 1775,
    "preview": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal"
  },
  {
    "path": "app/src/main/res/values/ids.xml",
    "chars": 326,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <item name=\"selected_view\" type=\"id\"/>\n    <item type=\"id\" name=\""
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 2669,
    "preview": "<resources>\n    <string name=\"app_name\">淘School</string>\n\n    <string name=\"hello_world\">Hello world!</string>\n    <stri"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 1428,
    "preview": "<resources>\n\n\n    <style name=\"menu_labels_style\">\n        <item name=\"android:background\">@drawable/fab_label_backgroun"
  },
  {
    "path": "app/src/main/res/values/texsize.xml",
    "chars": 818,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- 应用字体大小 -->\n<resources>\n    <!-- 38px -->\n    <dimen name=\"biggest_textSize\">"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "chars": 358,
    "preview": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as s"
  },
  {
    "path": "app/src/test/java/com/hankkin/compustrading/ExampleUnitTest.java",
    "chars": 318,
    "preview": "package com.hankkin.compustrading;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit te"
  },
  {
    "path": "build.gradle",
    "chars": 512,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    r"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Sat Nov 28 23:32:22 CST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 855,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 5080,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "settings.gradle",
    "chars": 15,
    "preview": "include ':app'\n"
  }
]

// ... and 3 more files (download for full content)

About this extraction

This page contains the full source code of the Hankkin/TaoSchool GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 131 files (444.7 KB), approximately 113.7k tokens, and a symbol index with 859 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!