[
  {
    "path": ".gitignore",
    "content": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n"
  },
  {
    "path": ".idea/.name",
    "content": "AutoHomeRefreshListView"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <resourceExtensions />\n    <wildcardResourcePatterns>\n      <entry name=\"!?*.java\" />\n      <entry name=\"!?*.form\" />\n      <entry name=\"!?*.class\" />\n      <entry name=\"!?*.groovy\" />\n      <entry name=\"!?*.scala\" />\n      <entry name=\"!?*.flex\" />\n      <entry name=\"!?*.kt\" />\n      <entry name=\"!?*.clj\" />\n      <entry name=\"!?*.aj\" />\n    </wildcardResourcePatterns>\n    <annotationProcessing>\n      <profile default=\"true\" name=\"Default\" enabled=\"false\">\n        <processorPath useClasspath=\"true\" />\n      </profile>\n    </annotationProcessing>\n  </component>\n</project>"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "content": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"LOCAL\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleHome\" value=\"$APPLICATION_HOME_DIR$/gradle/gradle-2.4\" />\n        <option name=\"gradleJvm\" value=\"1.7\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"EntryPointsManager\">\n    <entry_points version=\"2.0\" />\n  </component>\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectLevelVcsManager\" settingsEditedManually=\"false\">\n    <OptionsSetting value=\"true\" id=\"Add\" />\n    <OptionsSetting value=\"true\" id=\"Remove\" />\n    <OptionsSetting value=\"true\" id=\"Checkout\" />\n    <OptionsSetting value=\"true\" id=\"Update\" />\n    <OptionsSetting value=\"true\" id=\"Status\" />\n    <OptionsSetting value=\"true\" id=\"Edit\" />\n    <ConfirmationsSetting value=\"0\" id=\"Add\" />\n    <ConfirmationsSetting value=\"0\" id=\"Remove\" />\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" default=\"true\" assert-keyword=\"true\" jdk-15=\"true\" project-jdk-name=\"1.7\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n  <component name=\"masterDetails\">\n    <states>\n      <state key=\"ProjectJDKs.UI\">\n        <settings>\n          <last-edited>Android API 22 Platform</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n    </states>\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/AutoHomeRefreshListView.iml\" filepath=\"$PROJECT_DIR$/AutoHomeRefreshListView.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"\" vcs=\"\" />\n  </component>\n</project>"
  },
  {
    "path": "AutoHomeRefreshListView.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\"AutoHomeRefreshListView\" external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$\" external.system.id=\"GRADLE\" external.system.module.group=\"\" external.system.module.version=\"unspecified\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"java-gradle\" name=\"Java-Gradle\">\n      <configuration>\n        <option name=\"BUILD_FOLDER_PATH\" value=\"$MODULE_DIR$/build\" />\n        <option name=\"BUILDABLE\" value=\"false\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" LANGUAGE_LEVEL=\"JDK_1_7\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <excludeFolder url=\"file://$MODULE_DIR$/.gradle\" />\n    </content>\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n  </component>\n</module>"
  },
  {
    "path": "README.md",
    "content": "# AutoHomeRefreshListView\n仿汽车之家下拉刷新\n![这里写图片描述](http://img.blog.csdn.net/20151101145703270)\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/app.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":app\" external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$/..\" external.system.id=\"GRADLE\" external.system.module.group=\"AutoHomeRefreshListView\" external.system.module.version=\"unspecified\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"android-gradle\" name=\"Android-Gradle\">\n      <configuration>\n        <option name=\"GRADLE_PROJECT_PATH\" value=\":app\" />\n      </configuration>\n    </facet>\n    <facet type=\"android\" name=\"Android\">\n      <configuration>\n        <option name=\"SELECTED_BUILD_VARIANT\" value=\"debug\" />\n        <option name=\"SELECTED_TEST_ARTIFACT\" value=\"_android_test_\" />\n        <option name=\"ASSEMBLE_TASK_NAME\" value=\"assembleDebug\" />\n        <option name=\"COMPILE_JAVA_TASK_NAME\" value=\"compileDebugSources\" />\n        <option name=\"ASSEMBLE_TEST_TASK_NAME\" value=\"assembleDebugAndroidTest\" />\n        <option name=\"COMPILE_JAVA_TEST_TASK_NAME\" value=\"compileDebugAndroidTestSources\" />\n        <afterSyncTasks>\n          <task>generateDebugAndroidTestSources</task>\n          <task>generateDebugSources</task>\n        </afterSyncTasks>\n        <option name=\"ALLOW_USER_CONFIGURATION\" value=\"false\" />\n        <option name=\"MANIFEST_FILE_RELATIVE_PATH\" value=\"/src/main/AndroidManifest.xml\" />\n        <option name=\"RES_FOLDER_RELATIVE_PATH\" value=\"/src/main/res\" />\n        <option name=\"RES_FOLDERS_RELATIVE_PATH\" value=\"file://$MODULE_DIR$/src/main/res\" />\n        <option name=\"ASSETS_FOLDER_RELATIVE_PATH\" value=\"/src/main/assets\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" LANGUAGE_LEVEL=\"JDK_1_7\" inherit-compiler-output=\"false\">\n    <output url=\"file://$MODULE_DIR$/build/intermediates/classes/debug\" />\n    <output-test url=\"file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug\" />\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/r/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/aidl/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/rs/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/resValues/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/r/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/jni\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/jni\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/jni\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/rs\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/assets\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/classes\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/debug\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/dependency-cache\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/dex\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/jars\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.0/jars\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/manifests\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/pre-dexed\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/res\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/rs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/symbols\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/tmp\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/outputs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/tmp\" />\n    </content>\n    <orderEntry type=\"jdk\" jdkName=\"Android API 23 Platform\" jdkType=\"Android SDK\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"appcompat-v7-23.0.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-v4-23.0.0\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-annotations-23.0.0\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.0\"\n\n    defaultConfig {\n        applicationId \"com.zhangqi.autohomerefreshlistview\"\n        minSdkVersion 14\n        targetSdkVersion 23\n        versionCode 1\n        versionName \"1.0\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile 'com.android.support:appcompat-v7:23.0.0'\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/zhangqi/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/androidTest/java/com/zhangqi/autohomerefreshlistview/ApplicationTest.java",
    "content": "package com.zhangqi.autohomerefreshlistview;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n    public ApplicationTest() {\n        super(Application.class);\n    }\n}"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.zhangqi.autohomerefreshlistview\" >\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\".PullToFreshActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "app/src/main/java/com/zhangqi/autohomerefreshlistview/AutoHome.java",
    "content": "package com.zhangqi.autohomerefreshlistview;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Canvas;\nimport android.util.AttributeSet;\nimport android.view.View;\n\n/**\n * Created by zhangqi on 15/10/17.\n */\npublic class AutoHome extends View{\n    private Bitmap backGroundBitmap;\n    public Bitmap pointerBitmap;\n    private int x;\n    private int y;\n    private Bitmap finalBackGroundBitmap;\n    private Bitmap finalPointerBitmap;\n    private float mCurrentProgress;\n\n    public AutoHome(Context context) {\n        super(context);\n        init(context);\n    }\n\n\n    public AutoHome(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        init(context);\n    }\n\n    public AutoHome(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        init(context);\n    }\n\n\n    private void init(Context context) {\n        backGroundBitmap = Bitmap.createBitmap(BitmapFactory.decodeResource(context.getResources(), R.drawable.load_icon_dial2x));\n        pointerBitmap = Bitmap.createBitmap(BitmapFactory.decodeResource(context.getResources(), R.drawable.load_icon_pointer2x));\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec));\n    }\n\n    private int measureWidth(int widthMeasureSpec) {\n        int result = 0;\n        int size = MeasureSpec.getSize(widthMeasureSpec);\n        int mode = MeasureSpec.getMode(widthMeasureSpec);\n        if (mode == MeasureSpec.EXACTLY) {\n            result = size;\n        } else {\n            result = backGroundBitmap.getWidth();\n            if (mode == MeasureSpec.AT_MOST) {\n                result = Math.min(result, size);\n            }\n        }\n        return result;\n    }\n    private int measureHeight(int heightMeasureSpec){\n        int result = 0;\n        int size = MeasureSpec.getSize(heightMeasureSpec);\n        int mode = MeasureSpec.getMode(heightMeasureSpec);\n        if (mode == MeasureSpec.EXACTLY){\n            result = size;\n        }else{\n            result = backGroundBitmap.getHeight();\n            if (mode == MeasureSpec.AT_MOST){\n                result = Math.min(result,size);\n            }\n        }\n        return result;\n\n    }\n\n    @Override\n    protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n        super.onSizeChanged(w, h, oldw, oldh);\n        x = w;\n        y = h;\n        finalBackGroundBitmap = Bitmap.createScaledBitmap(backGroundBitmap, x, y, true);\n        finalPointerBitmap = Bitmap.createScaledBitmap(pointerBitmap, x, y, true);\n\n    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        super.onDraw(canvas);\n\n            canvas.drawBitmap(finalBackGroundBitmap,0,0,null);\n            canvas.rotate(mCurrentProgress*2.7f,x/2,y/2);\n            canvas.drawBitmap(finalPointerBitmap, 0, 0, null);\n    }\n\n\n    public void setCurrentProgress(float progress){\n        mCurrentProgress = progress*100;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/zhangqi/autohomerefreshlistview/AutoHomeListView.java",
    "content": "package com.zhangqi.autohomerefreshlistview;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.LayoutInflater;\nimport android.view.MotionEvent;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.animation.Animation;\nimport android.view.animation.AnimationUtils;\nimport android.widget.AbsListView;\nimport android.widget.FrameLayout;\nimport android.widget.LinearLayout;\nimport android.widget.ListView;\nimport android.widget.TextView;\n\n/**\n * Created by zhangqi on 15/10/18.\n */\npublic class AutoHomeListView extends ListView implements AbsListView.OnScrollListener{\n\tprivate static final int DONE = 0;\n\tprivate static final int PULL_TO_REFRESH = 1;\n\tprivate static final int RELEASE_TO_REFRESH = 2;\n\tprivate static final int REFRESHING = 3;\n\tprivate static final int RATIO = 3;\n\tprivate LinearLayout headerView;\n\tprivate AutoHome mAutoHome;\n\tprivate int headerViewHeight;\n\tprivate float startY;\n\tprivate float offsetY;\n\tprivate TextView tv_pull_to_refresh;\n\tprivate OnAutoHomeRefreshListener mOnRefreshListener;\n\tprivate int state;\n\tprivate int mFirstVisibleItem;\n\tprivate boolean isRecord;\n\tprivate boolean isEnd;\n\tprivate boolean isRefreable;\n\tprivate FrameLayout mAnimContainer;\n\tprivate PointerView mAutoHomeAnim;\n\tprivate Animation animation;\n\n\n\tpublic AutoHomeListView(Context context) {\n\t\tsuper(context);\n\t\tinit(context);\n\t}\n\n\tpublic AutoHomeListView(Context context, AttributeSet attrs) {\n\t\tsuper(context, attrs);\n\t\tinit(context);\n\t}\n\n\tpublic AutoHomeListView(Context context, AttributeSet attrs, int defStyleAttr) {\n\t\tsuper(context, attrs, defStyleAttr);\n\t\tinit(context);\n\t}\n\n\tpublic interface OnAutoHomeRefreshListener{\n\t\tvoid onRefresh();\n\t}\n\tpublic void setOnAutoHomeRefreshListener(OnAutoHomeRefreshListener onRefreshListener){\n\t\tmOnRefreshListener = onRefreshListener;\n\t\tisRefreable = true;\n\t}\n\tpublic void setOnRefreshComplete(){\n\t\tisEnd = true;\n\t\tstate = DONE;\n\t\tchangeHeaderByState(state);\n\t}\n\n\tprivate void init(Context context) {\n\t\tsetOverScrollMode(View.OVER_SCROLL_NEVER);\n\t\tsetOnScrollListener(this);\n\t\t\n\t\theaderView = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.autohome_item, null, false);\n\t\tmAutoHome = (AutoHome) headerView.findViewById(R.id.auto_home);\n\t\ttv_pull_to_refresh = (TextView) headerView.findViewById(R.id.tv_pull_to_refresh);\n\t\tmAnimContainer = (FrameLayout) headerView.findViewById(R.id.anim_container);\n\t\tmAutoHomeAnim = (PointerView) headerView.findViewById(R.id.anim_pointer);\n\t\t\n\t\tanimation = AnimationUtils.loadAnimation(context, R.anim.pointer_rotate);\n\t\t\n\t\tmeasureView(headerView);\n\t\taddHeaderView(headerView);\n\t\theaderViewHeight = headerView.getMeasuredHeight();\n\t\theaderView.setPadding(0, -headerViewHeight, 0, 0);\n\n\t\tstate = DONE;\n\t\tisEnd = true;\n\t\tisRefreable = false;\n\t}\n\n\n\n\t@Override\n\tpublic void onScrollStateChanged(AbsListView absListView, int i) {\n\t}\n\t@Override\n\tpublic void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {\n\t\tmFirstVisibleItem = firstVisibleItem;\n\t}\n\n\t@Override\n\tpublic boolean onTouchEvent(MotionEvent ev) {\n\t\tif (isEnd) {\n\t\t\tif (isRefreable) {\n\t\t\t\tswitch (ev.getAction()){\n\t\t\t\tcase MotionEvent.ACTION_DOWN:\n\t\t\t\t\tif (mFirstVisibleItem == 0 && !isRecord) {\n\t\t\t\t\t\tisRecord = true;\n\t\t\t\t\t\tstartY = ev.getY();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase MotionEvent.ACTION_MOVE:\n\t\t\t\t\tfloat tempY = ev.getY();\n\t\t\t\t\tif (mFirstVisibleItem == 0 && !isRecord) {\n\t\t\t\t\t\tisRecord = true;\n\t\t\t\t\t\tstartY = tempY;\n\t\t\t\t\t}\n\t\t\t\t\tif (state!=REFRESHING && isRecord ) {\n\t\t\t\t\t\toffsetY = tempY - startY;\n\t\t\t\t\t\tfloat currentHeight = (-headerViewHeight+offsetY/RATIO);\n\t\t\t\t\t\tfloat currentProgress = 1+currentHeight/headerViewHeight;\n\t\t\t\t\t\tif (currentProgress>=1) {\n\t\t\t\t\t\t\tcurrentProgress = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (state == RELEASE_TO_REFRESH && isRecord) {\n\t\t\t\t\t\t\tsetSelection(0);\n\t\t\t\t\t\t\tif (-headerViewHeight+offsetY/RATIO<0) {\n\t\t\t\t\t\t\t\tstate = PULL_TO_REFRESH;\n\t\t\t\t\t\t\t\tchangeHeaderByState(state);\n\t\t\t\t\t\t\t}else if (offsetY<=0) {\n\t\t\t\t\t\t\t\tstate = DONE;\n\t\t\t\t\t\t\t\tchangeHeaderByState(state);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (state == PULL_TO_REFRESH && isRecord) {\n\t\t\t\t\t\t\tsetSelection(0);\n\t\t\t\t\t\t\tif (-headerViewHeight+offsetY/RATIO>=0) {\n\t\t\t\t\t\t\t\tstate = RELEASE_TO_REFRESH;\n\t\t\t\t\t\t\t\tchangeHeaderByState(state);\n\t\t\t\t\t\t\t}else if (offsetY<=0) {\n\t\t\t\t\t\t\t\tstate = DONE;\n\t\t\t\t\t\t\t\tchangeHeaderByState(state);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (state == DONE && isRecord) {\n\t\t\t\t\t\t\tif (offsetY>=0) {\n\t\t\t\t\t\t\t\tstate = PULL_TO_REFRESH;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (state == PULL_TO_REFRESH) {\n\t\t\t\t\t\t\theaderView.setPadding(0,(int)(-headerViewHeight+offsetY/RATIO) ,0,0);\n\t\t\t\t\t\t\tmAutoHome.setCurrentProgress(currentProgress);\n\t\t\t\t\t\t\tmAutoHome.postInvalidate();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (state == RELEASE_TO_REFRESH) {\n\t\t\t\t\t\t\theaderView.setPadding(0,(int)(-headerViewHeight+offsetY/RATIO) ,0, 0);\n\t\t\t\t\t\t\tmAutoHome.setCurrentProgress(currentProgress);\n\t\t\t\t\t\t\tmAutoHome.postInvalidate();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase MotionEvent.ACTION_UP:\n\t\t\t\t\tif (state == PULL_TO_REFRESH) {\n\t\t\t\t\t\tthis.smoothScrollBy((int)(-headerViewHeight+offsetY/RATIO)+headerViewHeight, 500);\n\t\t\t\t\t\tchangeHeaderByState(state);\n\t\t\t\t\t}\n\t\t\t\t\tif (state == RELEASE_TO_REFRESH) {\n\t\t\t\t\t\tthis.smoothScrollBy((int)(-headerViewHeight+offsetY/RATIO), 500);\n\t\t\t\t\t\tstate = REFRESHING;\n\t\t\t\t\t\tmOnRefreshListener.onRefresh();\n\t\t\t\t\t\tchangeHeaderByState(state);\n\t\t\t\t\t}\n\t\t\t\t\tisRecord = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn super.onTouchEvent(ev);\n\t}\n\t\n\tprivate void changeHeaderByState(int state){\n\t\tswitch (state) {\n\t\tcase DONE:\n\t\t\theaderView.setPadding(0, -headerViewHeight, 0, 0);\n\t\t\t//第一状态的view显示出来\n\t\t\tmAutoHome.setVisibility(View.VISIBLE);\n\t\t\t//先停止一下第二阶段view的动画\n\t\t\tmAutoHomeAnim.clearAnimation();\n\t\t\t//将第二阶段view隐藏起来\n\t\t\tmAnimContainer.setVisibility(View.GONE);\n\t\t\tbreak;\n\t\tcase RELEASE_TO_REFRESH:\n\t\t\ttv_pull_to_refresh.setText(\"放开刷新\");\n\t\t\n\t\t\tbreak;\n\t\tcase PULL_TO_REFRESH:\n\t\t\ttv_pull_to_refresh.setText(\"下拉刷新\");\n\t\t\t//第一状态view显示出来\n\t\t\tmAutoHome.setVisibility(View.VISIBLE);\n\t\t\t//停止第二阶段动画\n\t\t\tmAutoHomeAnim.clearAnimation();\n\t\t\t//将第二阶段view隐藏\n\t\t\tmAnimContainer.setVisibility(View.GONE);\n\t\t\tbreak;\n\t\tcase REFRESHING:\n\t\t\ttv_pull_to_refresh.setText(\"正在刷新\");\n\t\t\t//将第一阶段view隐藏\n\t\t\tmAutoHome.setVisibility(View.GONE);\n\t\t\t//将第二阶段view显示出来\n\t\t\tmAnimContainer.setVisibility(View.VISIBLE);\n\t\t\t//先停止第二阶段动画\n\t\t\tmAutoHomeAnim.clearAnimation();\n\t\t\t//启动第二阶段动画\n\t\t\tmAutoHomeAnim.startAnimation(animation);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t\n\tprivate void measureView(View child) {\n\t\tViewGroup.LayoutParams p = child.getLayoutParams();\n\t\tif (p == null) {\n\t\t\tp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,\n\t\t\t\t\tViewGroup.LayoutParams.WRAP_CONTENT);\n\t\t}\n\t\tint childWidthSpec = ViewGroup.getChildMeasureSpec(0, 0 + 0, p.width);\n\t\tint lpHeight = p.height;\n\t\tint childHeightSpec;\n\t\tif (lpHeight > 0) {\n\t\t\tchildHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight,\n\t\t\t\t\tMeasureSpec.EXACTLY);\n\t\t} else {\n\t\t\tchildHeightSpec = MeasureSpec.makeMeasureSpec(0,\n\t\t\t\t\tMeasureSpec.UNSPECIFIED);\n\t\t}\n\t\tchild.measure(childWidthSpec, childHeightSpec);\n\t}\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/zhangqi/autohomerefreshlistview/MainActivity.java",
    "content": "package com.zhangqi.autohomerefreshlistview;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.widget.SeekBar;\n\n\npublic class MainActivity extends Activity {\n\n  private SeekBar mSeekBar;\n  private AutoHome mAutoHome;\n  private float mCurrentProgress;\n  @Override\n  protected void onCreate(Bundle savedInstanceState) {\n      super.onCreate(savedInstanceState);\n      setContentView(R.layout.activity_main);\n      mSeekBar = (SeekBar) findViewById(R.id.seekbar);\n      mAutoHome = (AutoHome) findViewById(R.id.autohome);\n\n      mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n          @Override\n          public void onProgressChanged(SeekBar seekBar, int i, boolean b) {\n              mCurrentProgress = (float)seekBar.getProgress()/(float)seekBar.getMax();\n              mAutoHome.setCurrentProgress(mCurrentProgress);\n              mAutoHome.invalidate();\n          }\n\n          @Override\n          public void onStartTrackingTouch(SeekBar seekBar) {\n\n          }\n\n          @Override\n          public void onStopTrackingTouch(SeekBar seekBar) {\n\n          }\n      });\n  }\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/zhangqi/autohomerefreshlistview/PointerView.java",
    "content": "package com.zhangqi.autohomerefreshlistview;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Canvas;\nimport android.util.AttributeSet;\nimport android.view.View;\n\n/**\n * Created by zhangqi on 15/10/27.\n */\npublic class PointerView extends View {\n    private int x;\n    private int y;\n    private Bitmap finalPointerBitmap;\n    private Bitmap pointerBitmap;\n    public PointerView(Context context) {\n        super(context);\n        init();\n    }\n\n    public PointerView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        init();\n    }\n\n    public PointerView(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        init();\n    }\n\n    private void init() {\n        pointerBitmap = Bitmap.createBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.load_icon_pointer2x));\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        setMeasuredDimension(measureWidth(widthMeasureSpec), measureHeight(heightMeasureSpec));\n    }\n\n    private int measureWidth(int widthMeasureSpec){\n        int result = 0;\n        int size = MeasureSpec.getSize(widthMeasureSpec);\n        int mode = MeasureSpec.getMode(widthMeasureSpec);\n        if (mode == MeasureSpec.EXACTLY){\n            result = size;\n        }else{\n            result = pointerBitmap.getWidth();\n            if (mode == MeasureSpec.AT_MOST){\n                result = Math.min(result,size);\n            }\n        }\n        return result;\n    }\n    private int measureHeight(int heightMeasureSpec){\n        int result = 0;\n        int size = MeasureSpec.getSize(heightMeasureSpec);\n        int mode = MeasureSpec.getMode(heightMeasureSpec);\n        if (mode == MeasureSpec.EXACTLY){\n            result = size;\n        }else{\n            result = pointerBitmap.getHeight();\n            if (mode == MeasureSpec.AT_MOST){\n                result = Math.min(result,size);\n            }\n        }\n        return result;\n    }\n\n    @Override\n    protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n        super.onSizeChanged(w, h, oldw, oldh);\n        x = w;\n        y = h;\n        finalPointerBitmap = Bitmap.createScaledBitmap(pointerBitmap, x, y, true);\n    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        super.onDraw(canvas);\n        canvas.rotate(270,x/2,y/2);\n        canvas.drawBitmap(finalPointerBitmap,0,0,null);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/zhangqi/autohomerefreshlistview/PullToFreshActivity.java",
    "content": "package com.zhangqi.autohomerefreshlistview;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Message;\nimport android.widget.ArrayAdapter;\n\nimport java.lang.ref.WeakReference;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Created by zhangqi on 15/10/18.\n */\npublic class PullToFreshActivity extends Activity implements AutoHomeListView.OnAutoHomeRefreshListener {\n    private static AutoHomeListView mListView;\n    private static ArrayAdapter<String> mAdapter;\n    private final static int REFRESH_COMPLETE = 0;\n    private List<String> mDatas;\n\n    private InterHandler mInterHandler = new InterHandler(this);\n\n    private static class InterHandler extends Handler{\n        private WeakReference<PullToFreshActivity> mActivity;\n        public InterHandler(PullToFreshActivity activity){\n            mActivity = new WeakReference<PullToFreshActivity>(activity);\n        }\n        @Override\n        public void handleMessage(Message msg) {\n            PullToFreshActivity activity = mActivity.get();\n            if (activity != null) {\n                switch (msg.what) {\n                    case REFRESH_COMPLETE:\n                        activity.mListView.setOnRefreshComplete();\n                        activity.mAdapter.notifyDataSetChanged();\n                        activity.mListView.setSelection(0);\n                        break;\n                }\n            }else{\n                super.handleMessage(msg);\n            }\n        }\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_autohome);\n        String[] data = new String[]{\"hello world1\", \"hello world2\", \"hello world3\", \"hello world4\", \"hello world5\", \"hello world6\", \"hello world7\", \"hello world8\", \"hello world9\", \"hello world10\", \"hello world11\", \"hello world12\", \"hello world13\", \"hello world14\", \"hello world15\"};\n        mDatas = new ArrayList<String>(Arrays.asList(data));\n        mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mDatas);\n        mListView = (AutoHomeListView) findViewById(R.id.listview);\n        mListView.setAdapter(mAdapter);\n        mListView.setOnAutoHomeRefreshListener(this);\n    }\n\n    @Override\n    public void onRefresh() {\n        new Thread(new Runnable() {\n\n            @Override\n            public void run() {\n                try {\n                    Thread.sleep(3000);\n                    mDatas.add(0, \"new data\");\n                    mInterHandler.sendEmptyMessage(REFRESH_COMPLETE);\n                } catch (InterruptedException e) {\n                    // TODO Auto-generated catch block\n                    e.printStackTrace();\n                }\n            }\n        }).start();\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/anim/pointer_rotate.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rotate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:fromDegrees=\"0\"\n    android:toDegrees=\"-150\"\n    android:pivotY=\"50%\"\n    android:pivotX=\"50%\"\n    android:duration=\"1000\"\n    android:repeatCount=\"infinite\"\n    android:repeatMode=\"reverse\"\n\n    >\n</rotate>"
  },
  {
    "path": "app/src/main/res/layout/activity_autohome.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:orientation=\"vertical\" >\r\n    <com.zhangqi.autohomerefreshlistview.AutoHomeListView\r\n        android:id=\"@+id/listview\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"\r\n        />\r\n    \r\n\r\n</LinearLayout>\r\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    xmlns:tools=\"http://schemas.android.com/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:orientation=\"vertical\"\r\n   >\r\n\r\n    <SeekBar\r\n        android:id=\"@+id/seekbar\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        \r\n        />\r\n    <com.example.autohomerefreshlistview.AutoHome\r\n        android:id=\"@+id/autohome\"\r\n        android:layout_width=\"38dp\"\r\n        android:layout_height=\"38dp\"\r\n        \r\n        />\r\n\r\n</LinearLayout>\r\n"
  },
  {
    "path": "app/src/main/res/layout/autohome_animationview.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"\n    >\n    <com.zhangqi.autohomepulltorefresh.PointerView\n        android:id=\"@+id/pointer_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" />\n    <ImageView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@drawable/load_icon_dial2x\"\n        />\n</FrameLayout>"
  },
  {
    "path": "app/src/main/res/layout/autohome_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center\"\n    android:orientation=\"horizontal\" >\n\n    <com.zhangqi.autohomerefreshlistview.AutoHome\n        android:id=\"@+id/auto_home\"\n        android:layout_width=\"45dp\"\n        android:layout_height=\"45dp\"\n        android:layout_gravity=\"center\"\n        android:layout_margin=\"15dp\"\n        />\n\n    <FrameLayout\n        android:id=\"@+id/anim_container\"\n        android:layout_width=\"45dp\"\n        android:layout_height=\"45dp\"\n        android:layout_margin=\"15dp\"\n        android:visibility=\"gone\" >\n\n        <com.zhangqi.autohomerefreshlistview.PointerView\n            android:id=\"@+id/anim_pointer\"\n            android:layout_width=\"45dp\"\n            android:layout_height=\"45dp\"\n            android:layout_margin=\"15dp\"\n            android:layout_gravity=\"center\" />\n\n        <ImageView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:src=\"@drawable/load_icon_dial2x\" />\n    </FrameLayout>\n\n    <TextView\n        android:id=\"@+id/tv_pull_to_refresh\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginLeft=\"20dp\"\n        android:text=\"下拉刷新\" />\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/listview_header_view.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:orientation=\"horizontal\" >\r\n    <com.example.autohomerefreshlistview.AutoHome\r\n        android:id=\"@+id/autohome\"\r\n        android:layout_width=\"75dp\"\r\n        android:layout_height=\"75dp\"\r\n        />\r\n    <TextView \r\n        android:id=\"@+id/tv_autohome\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"下拉刷新\"\r\n        />\r\n    \r\n\r\n</LinearLayout>\r\n"
  },
  {
    "path": "app/src/main/res/menu/menu_main.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\" tools:context=\".MainActivity\">\n    <item android:id=\"@+id/action_settings\" android:title=\"@string/action_settings\"\n        android:orderInCategory=\"100\" app:showAsAction=\"never\" />\n</menu>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">AutoHomeRefreshListView</string>\n\n    <string name=\"hello_world\">Hello world!</string>\n    <string name=\"action_settings\">Settings</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:1.3.0'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sun Nov 01 15:18:44 CST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.4-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]