Full Code of mcxtzhang/DiffUtils for AI

master 73e091cc0962 cached
65 files
61.8 KB
19.5k tokens
63 symbols
1 requests
Download .txt
Repository: mcxtzhang/DiffUtils
Branch: master
Commit: 73e091cc0962
Files: 65
Total size: 61.8 KB

Directory structure:
gitextract_90o5h7_s/

├── .gitignore
├── .idea/
│   ├── compiler.xml
│   ├── copyright/
│   │   └── profiles_settings.xml
│   ├── encodings.xml
│   ├── gradle.xml
│   ├── libraries/
│   │   ├── animated_vector_drawable_24_2_0.xml
│   │   ├── appcompat_v7_24_2_0.xml
│   │   ├── espresso_core_2_2_2.xml
│   │   ├── espresso_idling_resource_2_2_2.xml
│   │   ├── exposed_instrumentation_api_publish_0_5.xml
│   │   ├── hamcrest_core_1_3.xml
│   │   ├── hamcrest_integration_1_3.xml
│   │   ├── hamcrest_library_1_3.xml
│   │   ├── javawriter_2_1_1.xml
│   │   ├── javax_annotation_api_1_2.xml
│   │   ├── javax_inject_1.xml
│   │   ├── jsr305_2_0_1.xml
│   │   ├── junit_4_12.xml
│   │   ├── recyclerview_v7_24_2_0.xml
│   │   ├── rules_0_5.xml
│   │   ├── runner_0_5.xml
│   │   ├── support_annotations_24_2_0.xml
│   │   ├── support_compat_24_2_0.xml
│   │   ├── support_core_ui_24_2_0.xml
│   │   ├── support_core_utils_24_2_0.xml
│   │   ├── support_fragment_24_2_0.xml
│   │   ├── support_media_compat_24_2_0.xml
│   │   ├── support_v4_24_2_0.xml
│   │   └── support_vector_drawable_24_2_0.xml
│   ├── misc.xml
│   ├── modules.xml
│   ├── runConfigurations.xml
│   └── vcs.xml
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── mcxtzhang/
│       │               └── diffutils/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── mcxtzhang/
│       │   │           └── diffutils/
│       │   │               ├── LauncherActivity.java
│       │   │               ├── diffutil/
│       │   │               │   ├── DiffAdapter.java
│       │   │               │   ├── DiffCallBack.java
│       │   │               │   ├── MainActivity.java
│       │   │               │   └── TestBean.java
│       │   │               └── sortedlist/
│       │   │                   ├── SortedAdapter.java
│       │   │                   ├── SortedListActivity.java
│       │   │                   ├── SortedListCallback.java
│       │   │                   └── TestSortBean.java
│       │   └── res/
│       │       ├── layout/
│       │       │   ├── activity_launcher.xml
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_sorted_list.xml
│       │       │   └── item_diff.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── mcxtzhang/
│                       └── diffutils/
│                           └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle

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

================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/workspace.xml

# Keystore files
*.jks


================================================
FILE: .idea/compiler.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CompilerConfiguration">
    <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" />
      <entry name="!?*.aj" />
    </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="modules">
          <set>
            <option value="$PROJECT_DIR$" />
            <option value="$PROJECT_DIR$/app" />
          </set>
        </option>
        <option name="resolveModulePerSourceSet" value="false" />
      </GradleProjectSettings>
    </option>
  </component>
</project>

================================================
FILE: .idea/libraries/animated_vector_drawable_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="animated-vector-drawable-24.2.0">
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.0/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/animated-vector-drawable/24.2.0/animated-vector-drawable-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/appcompat_v7_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="appcompat-v7-24.2.0">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.0/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.0/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/espresso_core_2_2_2.xml
================================================
<component name="libraryTable">
  <library name="espresso-core-2.2.2">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-core/2.2.2/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-core/2.2.2/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/test/espresso/espresso-core/2.2.2/espresso-core-2.2.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/espresso_idling_resource_2_2_2.xml
================================================
<component name="libraryTable">
  <library name="espresso-idling-resource-2.2.2">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-idling-resource/2.2.2/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-idling-resource/2.2.2/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/test/espresso/espresso-idling-resource/2.2.2/espresso-idling-resource-2.2.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/exposed_instrumentation_api_publish_0_5.xml
================================================
<component name="libraryTable">
  <library name="exposed-instrumentation-api-publish-0.5">
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test/exposed-instrumentation-api-publish/0.5/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test/exposed-instrumentation-api-publish/0.5/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/test/exposed-instrumentation-api-publish/0.5/exposed-instrumentation-api-publish-0.5-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/hamcrest_core_1_3.xml
================================================
<component name="libraryTable">
  <library name="hamcrest-core-1.3">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b/hamcrest-core-1.3-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/hamcrest_integration_1_3.xml
================================================
<component name="libraryTable">
  <library name="hamcrest-integration-1.3">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-integration/1.3/5de0c73fef18917cd85d0ab70bb23818685e4dfd/hamcrest-integration-1.3.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

================================================
FILE: .idea/libraries/hamcrest_library_1_3.xml
================================================
<component name="libraryTable">
  <library name="hamcrest-library-1.3">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-library/1.3/4785a3c21320980282f9f33d0d1264a69040538f/hamcrest-library-1.3.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

================================================
FILE: .idea/libraries/javawriter_2_1_1.xml
================================================
<component name="libraryTable">
  <library name="javawriter-2.1.1">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.squareup/javawriter/2.1.1/67ff45d9ae02e583d0f9b3432a5ebbe05c30c966/javawriter-2.1.1.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

================================================
FILE: .idea/libraries/javax_annotation_api_1_2.xml
================================================
<component name="libraryTable">
  <library name="javax.annotation-api-1.2">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.annotation/javax.annotation-api/1.2/479c1e06db31c432330183f5cae684163f186146/javax.annotation-api-1.2.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

================================================
FILE: .idea/libraries/javax_inject_1.xml
================================================
<component name="libraryTable">
  <library name="javax.inject-1">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/a00123f261762a7c5e0ec916a2c7c8298d29c400/javax.inject-1-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/jsr305_2_0_1.xml
================================================
<component name="libraryTable">
  <library name="jsr305-2.0.1">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/2.0.1/516c03b21d50a644d538de0f0369c620989cd8f0/jsr305-2.0.1.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

================================================
FILE: .idea/libraries/junit_4_12.xml
================================================
<component name="libraryTable">
  <library name="junit-4.12">
    <CLASSES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/a6c32b40bf3d76eca54e3c601e5d1470c86fcdfa/junit-4.12-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/recyclerview_v7_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="recyclerview-v7-24.2.0">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/24.2.0/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/24.2.0/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/24.2.0/recyclerview-v7-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/rules_0_5.xml
================================================
<component name="libraryTable">
  <library name="rules-0.5">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/test/rules/0.5/rules-0.5-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/runner_0_5.xml
================================================
<component name="libraryTable">
  <library name="runner-0.5">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/test/runner/0.5/runner-0.5-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_annotations_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="support-annotations-24.2.0">
    <CLASSES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/24.2.0/support-annotations-24.2.0.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/24.2.0/support-annotations-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_compat_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="support-compat-24.2.0">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.0/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.0/jars/libs/internal_impl-24.2.0.jar!/" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.0/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-compat/24.2.0/support-compat-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_core_ui_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="support-core-ui-24.2.0">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.0/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.0/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.0/jars/libs/internal_impl-24.2.0.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-core-ui/24.2.0/support-core-ui-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_core_utils_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="support-core-utils-24.2.0">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/jars/libs/internal_impl-24.2.0.jar!/" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.0/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-core-utils/24.2.0/support-core-utils-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_fragment_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="support-fragment-24.2.0">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.0/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.0/jars/classes.jar!/" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.0/jars/libs/internal_impl-24.2.0.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-fragment/24.2.0/support-fragment-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_media_compat_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="support-media-compat-24.2.0">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/24.2.0/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/24.2.0/jars/classes.jar!/" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-media-compat/24.2.0/jars/libs/internal_impl-24.2.0.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-media-compat/24.2.0/support-media-compat-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
FILE: .idea/libraries/support_v4_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="support-v4-24.2.0">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.0/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.0/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

================================================
FILE: .idea/libraries/support_vector_drawable_24_2_0.xml
================================================
<component name="libraryTable">
  <library name="support-vector-drawable-24.2.0">
    <CLASSES>
      <root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.0/jars/classes.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/support-vector-drawable/24.2.0/support-vector-drawable-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>

================================================
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_7" 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>
  <component name="masterDetails">
    <states>
      <state key="ProjectJDKs.UI">
        <settings>
          <last-edited>1.8</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
    </states>
  </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$/DiffUtils.iml" filepath="$PROJECT_DIR$/DiffUtils.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
================================================
#SupportDemos
本工程最初仅为DiffUtil的一个Demo,后发展为讲解Google Android Support包内那些常用or冷门有用的工具类的合集。



## 索引:
合集Blog地址:

http://blog.csdn.net/column/details/13763.html  



### DiffUtil:

DiffUtils是Google官方在support-v7-24.2.0新出的一个工具类,本工程为一个讲解它使用的Demo

博文传送门:

http://blog.csdn.net/zxt0601/article/details/52562770

代码地址:

https://github.com/mcxtzhang/DiffUtils/tree/master/app/src/main/java/com/mcxtzhang/diffutils/diffutil

入口:

MainActivity.java

---

### SortedList:

关键点:
**搭配RecyclerView使用,去重,有序,自动定向刷新**

博文传送门:

待补

代码地址:

https://github.com/mcxtzhang/DiffUtils/tree/master/app/src/main/java/com/mcxtzhang/diffutils/sortedlist

入口:

SortedListActivity.java



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


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

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"
    defaultConfig {
        applicationId "com.mcxtzhang.diffutils"
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.2.0'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:recyclerview-v7:24.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 C:\Users\admin\AppData\Local\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 *;
#}


================================================
FILE: app/src/androidTest/java/com/mcxtzhang/diffutils/ExampleInstrumentedTest.java
================================================
package com.mcxtzhang.diffutils;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.mcxtzhang.diffutils", appContext.getPackageName());
    }
}


================================================
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.mcxtzhang.diffutils">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".diffutil.MainActivity">
        </activity>
        <activity android:name=".sortedlist.SortedListActivity">
        </activity>
        <activity android:name=".LauncherActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>

</manifest>

================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/LauncherActivity.java
================================================
package com.mcxtzhang.diffutils;

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

import com.mcxtzhang.diffutils.diffutil.MainActivity;
import com.mcxtzhang.diffutils.sortedlist.SortedListActivity;

public class LauncherActivity extends AppCompatActivity {

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

        findViewById(R.id.btnDiff).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(LauncherActivity.this, MainActivity.class));
            }
        });

        findViewById(R.id.btnSortedList).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(LauncherActivity.this, SortedListActivity.class));
            }
        });
    }
}


================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/diffutil/DiffAdapter.java
================================================
package com.mcxtzhang.diffutils.diffutil;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.mcxtzhang.diffutils.R;

import java.util.List;

/**
 * 介绍:普普通的adapter,
 * 但是 唯一亮点~
 * public void onBindViewHolder(DiffVH holder, int position, List<Object> payloads)
 * 重写这个方法
 * 作者:zhangxutong
 * 邮箱:zhangxutong@imcoming.com
 * 时间: 2016/9/12.
 */

public class DiffAdapter extends RecyclerView.Adapter<DiffAdapter.DiffVH> {
    private final static String TAG = "zxt";
    private List<TestBean> mDatas;
    private Context mContext;
    private LayoutInflater mInflater;

    public DiffAdapter(Context mContext, List<TestBean> mDatas) {
        this.mContext = mContext;
        this.mDatas = mDatas;
        mInflater = LayoutInflater.from(mContext);
    }

    public void setDatas(List<TestBean> mDatas) {
        this.mDatas = mDatas;
    }

    @Override
    public DiffVH onCreateViewHolder(ViewGroup parent, int viewType) {
        return new DiffVH(mInflater.inflate(R.layout.item_diff, parent, false));
    }

    @Override
    public void onBindViewHolder(final DiffVH holder, final int position) {
        TestBean bean = mDatas.get(position);
        holder.tv1.setText(bean.getName());
        holder.tv2.setText(bean.getDesc());
        holder.iv.setImageResource(bean.getPic());
    }

    @Override
    public void onBindViewHolder(DiffVH holder, int position, List<Object> payloads) {
        if (payloads.isEmpty()) {
            onBindViewHolder(holder, position);
        } else {
            //文艺青年中的文青
            Bundle payload = (Bundle) payloads.get(0);//取出我们在getChangePayload()方法返回的bundle
            TestBean bean = mDatas.get(position);//取出新数据源,(可以不用)
            for (String key : payload.keySet()) {
                switch (key) {
                    case "KEY_DESC":
                        //这里可以用payload里的数据,不过data也是新的 也可以用
                        holder.tv2.setText(bean.getDesc());
                        break;
                    case "KEY_PIC":
                        holder.iv.setImageResource(payload.getInt(key));
                        break;
                    default:
                        break;
                }
            }
        }
    }

    @Override
    public int getItemCount() {
        return mDatas != null ? mDatas.size() : 0;
    }

    class DiffVH extends RecyclerView.ViewHolder {
        TextView tv1, tv2;
        ImageView iv;

        public DiffVH(View itemView) {
            super(itemView);
            tv1 = (TextView) itemView.findViewById(R.id.tv1);
            tv2 = (TextView) itemView.findViewById(R.id.tv2);
            iv = (ImageView) itemView.findViewById(R.id.iv);
        }
    }
}


================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/diffutil/DiffCallBack.java
================================================
package com.mcxtzhang.diffutils.diffutil;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.util.DiffUtil;
import android.support.v7.widget.RecyclerView;

import java.util.List;

/**
 * 介绍:核心类 用来判断 新旧Item是否相等
 * 作者:zhangxutong
 * 邮箱:zhangxutong@imcoming.com
 * 时间: 2016/9/12.
 */

public class DiffCallBack extends DiffUtil.Callback {
    private List<TestBean> mOldDatas, mNewDatas;//看名字

    public DiffCallBack(List<TestBean> mOldDatas, List<TestBean> mNewDatas) {
        this.mOldDatas = mOldDatas;
        this.mNewDatas = mNewDatas;
    }

    //老数据集size
    @Override
    public int getOldListSize() {
        return mOldDatas != null ? mOldDatas.size() : 0;
    }

    //新数据集size
    @Override
    public int getNewListSize() {
        return mNewDatas != null ? mNewDatas.size() : 0;
    }

    /**
     * Called by the DiffUtil to decide whether two object represent the same Item.
     * 被DiffUtil调用,用来判断 两个对象是否是相同的Item。
     * For example, if your items have unique ids, this method should check their id equality.
     * 例如,如果你的Item有唯一的id字段,这个方法就 判断id是否相等。
     * 本例判断name字段是否一致
     *
     * @param oldItemPosition The position of the item in the old list
     * @param newItemPosition The position of the item in the new list
     * @return True if the two items represent the same object or false if they are different.
     */
    @Override
    public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
        return mOldDatas.get(oldItemPosition).getName().equals(mNewDatas.get(newItemPosition).getName());
    }

    /**
     * Called by the DiffUtil when it wants to check whether two items have the same data.
     * 被DiffUtil调用,用来检查 两个item是否含有相同的数据
     * DiffUtil uses this information to detect if the contents of an item has changed.
     * DiffUtil用返回的信息(true false)来检测当前item的内容是否发生了变化
     * DiffUtil uses this method to check equality instead of {@link Object#equals(Object)}
     * DiffUtil 用这个方法替代equals方法去检查是否相等。
     * so that you can change its behavior depending on your UI.
     * 所以你可以根据你的UI去改变它的返回值
     * For example, if you are using DiffUtil with a
     * {@link android.support.v7.widget.RecyclerView.Adapter RecyclerView.Adapter}, you should
     * return whether the items' visual representations are the same.
     * 例如,如果你用RecyclerView.Adapter 配合DiffUtil使用,你需要返回Item的视觉表现是否相同。
     * This method is called only if {@link #areItemsTheSame(int, int)} returns
     * {@code true} for these items.
     * 这个方法仅仅在areItemsTheSame()返回true时,才调用。
     *
     * @param oldItemPosition The position of the item in the old list
     * @param newItemPosition The position of the item in the new list which replaces the
     *                        oldItem
     * @return True if the contents of the items are the same or false if they are different.
     */
    @Override
    public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
        TestBean beanOld = mOldDatas.get(oldItemPosition);
        TestBean beanNew = mNewDatas.get(newItemPosition);
        if (!beanOld.getDesc().equals(beanNew.getDesc())) {
            return false;//如果有内容不同,就返回false
        }
        if (beanOld.getPic() != beanNew.getPic()) {
            return false;//如果有内容不同,就返回false
        }
        return true; //默认两个data内容是相同的
    }

    /**
     * When {@link #areItemsTheSame(int, int)} returns {@code true} for two items and
     * {@link #areContentsTheSame(int, int)} returns false for them, DiffUtil
     * calls this method to get a payload about the change.
     * <p>
     * 当{@link #areItemsTheSame(int, int)} 返回true,且{@link #areContentsTheSame(int, int)} 返回false时,DiffUtils会回调此方法,
     * 去得到这个Item(有哪些)改变的payload。
     * <p>
     * For example, if you are using DiffUtil with {@link RecyclerView}, you can return the
     * particular field that changed in the item and your
     * {@link android.support.v7.widget.RecyclerView.ItemAnimator ItemAnimator} can use that
     * information to run the correct animation.
     * <p>
     * 例如,如果你用RecyclerView配合DiffUtils,你可以返回  这个Item改变的那些字段,
     * {@link android.support.v7.widget.RecyclerView.ItemAnimator ItemAnimator} 可以用那些信息去执行正确的动画
     * <p>
     * Default implementation returns {@code null}.\
     * 默认的实现是返回null
     *
     * @param oldItemPosition The position of the item in the old list
     * @param newItemPosition The position of the item in the new list
     * @return A payload object that represents the change between the two items.
     * 返回 一个 代表着新老item的改变内容的 payload对象,
     */
    @Nullable
    @Override
    public Object getChangePayload(int oldItemPosition, int newItemPosition) {
        //实现这个方法 就能成为文艺青年中的文艺青年
        // 定向刷新中的部分更新
        // 效率最高
        //只是没有了ItemChange的白光一闪动画,(反正我也觉得不太重要)
        TestBean oldBean = mOldDatas.get(oldItemPosition);
        TestBean newBean = mNewDatas.get(newItemPosition);

        //这里就不用比较核心字段了,一定相等
        Bundle payload = new Bundle();
        if (!oldBean.getDesc().equals(newBean.getDesc())) {
            payload.putString("KEY_DESC", newBean.getDesc());
        }
        if (oldBean.getPic() != newBean.getPic()) {
            payload.putInt("KEY_PIC", newBean.getPic());
        }

        if (payload.size() == 0)//如果没有变化 就传空
            return null;
        return payload;//
    }
}


================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/diffutil/MainActivity.java
================================================
package com.mcxtzhang.diffutils.diffutil;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.util.DiffUtil;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.mcxtzhang.diffutils.R;

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

public class MainActivity extends AppCompatActivity {
    private List<TestBean> mDatas;
    private RecyclerView mRv;
    private DiffAdapter mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initData();
        mRv = (RecyclerView) findViewById(R.id.rv);
        mRv.setLayoutManager(new LinearLayoutManager(this));
        mAdapter = new DiffAdapter(this, mDatas);
        mRv.setAdapter(mAdapter);
    }

    private void initData() {
        mDatas = new ArrayList<>();
        mDatas.add(new TestBean("张旭童1", "Android", R.drawable.pic1));
        mDatas.add(new TestBean("张旭童2", "Java", R.drawable.pic2));
        mDatas.add(new TestBean("张旭童3", "背锅", R.drawable.pic3));
        mDatas.add(new TestBean("张旭童4", "手撕产品", R.drawable.pic4));
        mDatas.add(new TestBean("张旭童5", "手撕测试", R.drawable.pic5));
    }

    /**
     * 模拟刷新操作
     *
     * @param view
     */
    public void onRefresh(View view) {
        try {
            mNewDatas = new ArrayList<>();
            for (TestBean bean : mDatas) {
                mNewDatas.add(bean.clone());//clone一遍旧数据 ,模拟刷新操作
            }
            mNewDatas.add(new TestBean("赵子龙", "帅", R.drawable.pic6));//模拟新增数据
            mNewDatas.get(0).setDesc("Android+");
            mNewDatas.get(0).setPic(R.drawable.pic7);//模拟修改数据
            TestBean testBean = mNewDatas.get(1);//模拟数据位移
            mNewDatas.remove(testBean);
            mNewDatas.add(testBean);

            //新宠
            //利用DiffUtil.calculateDiff()方法,传入一个规则DiffUtil.Callback对象,和是否检测移动item的 boolean变量,得到DiffUtil.DiffResult 的对象
            new Thread(new Runnable() {
                @Override
                public void run() {
                    //放在子线程中计算DiffResult
                    DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(new DiffCallBack(mDatas, mNewDatas), true);
                    Message message = mHandler.obtainMessage(H_CODE_UPDATE);
                    message.obj = diffResult;//obj存放DiffResult
                    message.sendToTarget();
                }
            }).start();
            //mAdapter.notifyDataSetChanged();//以前普通青年的我们只能这样,现在我们是文艺青年了,有新宠了

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

    private static final int H_CODE_UPDATE = 1;
    private List<TestBean> mNewDatas;//增加一个变量暂存newList
    private Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case H_CODE_UPDATE:
                    //取出Result
                    DiffUtil.DiffResult diffResult = (DiffUtil.DiffResult) msg.obj;
                    //利用DiffUtil.DiffResult对象的dispatchUpdatesTo()方法,传入RecyclerView的Adapter,轻松成为文艺青年
                    diffResult.dispatchUpdatesTo(mAdapter);

                    //这种方法可以fix add 0 不滑动
                    /*diffResult.dispatchUpdatesTo(new ListUpdateCallback() {
                        @Override
                        public void onInserted(int position, int count) {
                            mAdapter.notifyItemRangeInserted(position, count);
                            if (position==0){
                                mRv.scrollToPosition(0);
                            }
                        }

                        @Override
                        public void onRemoved(int position, int count) {
                            mAdapter.notifyItemRangeRemoved(position, count);
                        }

                        @Override
                        public void onMoved(int fromPosition, int toPosition) {
                            mAdapter.notifyItemMoved(fromPosition, toPosition);
                        }

                        @Override
                        public void onChanged(int position, int count, Object payload) {
                            mAdapter.notifyItemRangeChanged(position, count, payload);
                        }
                    });*/

                    //别忘了将新数据给Adapter
                    mDatas = mNewDatas;
                    mAdapter.setDatas(mDatas);
                    break;
            }
        }
    };

}


================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/diffutil/TestBean.java
================================================
package com.mcxtzhang.diffutils.diffutil;

/**
 * 介绍:一个普通的JavaBean,但是实现了clone方法,仅仅用于写Demo时,模拟刷新从网络获取数据用,
 * 因为使用DiffUtils比较新老数据集差异时,会遍历新老数据集的每个data,要确保他们的内存地址(指针)不一样,否则比较的是新老data是同一个,就一定相同,
 * 实际项目不需要,因为刷新时,数据一般从网络拉取,并且用Gson等解析出来,内存地址一定是不一样的。
 * 作者:zhangxutong
 * 邮箱:zhangxutong@imcoming.com
 * 时间: 2016/9/12.
 */
public class TestBean implements Cloneable {
    private String name;
    private String desc;
    private int pic;

    public TestBean(String name, String desc, int pic) {
        this.name = name;
        this.desc = desc;
        this.pic = pic;
    }

    public int getPic() {
        return pic;
    }

    public void setPic(int pic) {
        this.pic = pic;
    }

    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;
    }

    //仅写DEMO 用 实现克隆方法
    @Override
    public TestBean clone() throws CloneNotSupportedException {
        TestBean bean = null;
        try {
            bean = (TestBean) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return bean;
    }
}

================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedAdapter.java
================================================
package com.mcxtzhang.diffutils.sortedlist;

import android.content.Context;
import android.support.v7.util.SortedList;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.mcxtzhang.diffutils.R;

/**
 * 介绍:Adapter要修改,
 * 数据源都要从以前的ArrayList->替换为SortedList.
 * 其他的话,倒没有太大变化,
 * 因为SortedList虽然没有继承自List,但是暴漏出API还和List一样的。
 * 作者:zhangxutong
 * 邮箱:mcxtzhang@163.com
 * 主页:http://blog.csdn.net/zxt0601
 * 时间: 2016/11/29.
 */

public class SortedAdapter extends RecyclerView.Adapter<SortedAdapter.VH> {
    private final static String TAG = "zxt";
    /**
     * 数据源替换为SortedList,
     * 以前可能会用ArrayList。
     */
    private SortedList<TestSortBean> mDatas;
    private Context mContext;
    private LayoutInflater mInflater;

    public SortedAdapter(Context mContext, SortedList<TestSortBean> mDatas) {
        this.mContext = mContext;
        this.mDatas = mDatas;
        mInflater = LayoutInflater.from(mContext);
    }

    public void setDatas(SortedList<TestSortBean> mDatas) {
        this.mDatas = mDatas;
    }

    @Override
    public SortedAdapter.VH onCreateViewHolder(ViewGroup parent, int viewType) {
        return new SortedAdapter.VH(mInflater.inflate(R.layout.item_diff, parent, false));
    }

    @Override
    public void onBindViewHolder(final SortedAdapter.VH holder, final int position) {
        TestSortBean bean = mDatas.get(position);
        holder.tv1.setText(bean.getName());
        holder.tv2.setText(bean.getId() + "");
        holder.iv.setImageResource(bean.getIcon());
    }

    @Override
    public int getItemCount() {
        return mDatas != null ? mDatas.size() : 0;
    }

    class VH extends RecyclerView.ViewHolder {
        TextView tv1, tv2;
        ImageView iv;

        public VH(View itemView) {
            super(itemView);
            tv1 = (TextView) itemView.findViewById(R.id.tv1);
            tv2 = (TextView) itemView.findViewById(R.id.tv2);
            iv = (ImageView) itemView.findViewById(R.id.iv);
        }
    }
}



================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedListActivity.java
================================================
package com.mcxtzhang.diffutils.sortedlist;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.util.SortedList;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.mcxtzhang.diffutils.R;

/**
 * SortedListDemo
 */
public class SortedListActivity extends AppCompatActivity {
    /**
     * 数据源替换为SortedList,
     * 以前可能会用ArrayList。
     */
    private SortedList<TestSortBean> mDatas;
    private RecyclerView mRv;
    private SortedAdapter mAdapter;

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

        mRv = (RecyclerView) findViewById(R.id.rv);
        mRv.setLayoutManager(new LinearLayoutManager(this));
        //★以前构建Adapter时,一般会将data也一起传入,现在有变化
        mAdapter = new SortedAdapter(this, null);
        mRv.setAdapter(mAdapter);


        initData();


        //mDatas.beginBatchedUpdates();
        mAdapter.setDatas(mDatas);
        //mDatas.endBatchedUpdates();
    }

    private void initData() {
        //★SortedList初始化的时候,要将Adapter传进来。所以先构建Adapter,再构建SortedList
        mDatas = new SortedList<>(TestSortBean.class, new SortedListCallback(mAdapter));
        mDatas.add(new TestSortBean(10, "Android", R.drawable.pic1));
        //★注意这里有一个重复的字段 会自动去重的。
        mDatas.add(new TestSortBean(10, "Android重复", R.drawable.pic1));
        mDatas.add(new TestSortBean(2, "Java", R.drawable.pic2));
        mDatas.add(new TestSortBean(30, "背锅", R.drawable.pic3));
        mDatas.add(new TestSortBean(4, "手撕产品", R.drawable.pic4));
        mDatas.add(new TestSortBean(50, "手撕测试", R.drawable.pic5));
    }

    /**
     * 模拟刷新操作
     *
     * @param view
     */
    public void onRefresh(View view) {

        //add 内部会自动调用  mCallback.onInserted(index, 1); ->notifyItemRangeInserted(index,1);
        //也就是说我们add一次 它就刷新一次,没有batch操作,有点low

        mDatas.add(new TestSortBean(26, "温油对待产品", R.drawable.pic6));//模拟新增
        mDatas.add(new TestSortBean(12, "小马可以来点赞了", R.drawable.pic6));//模拟新增
        mDatas.add(new TestSortBean(2, "Python", R.drawable.pic6));//add进去 重复的会自动修改

        // 如果想batch 就必须用addAll()操作,感觉这算一个限制。
        //addAll 也分两种
        //第一种 以可变参数addAll
        //mDatas.addAll(new TestSortBean(26, "帅", R.drawable.pic6),new TestSortBean(27, "帅", R.drawable.pic6));
        //第二种 集合形式
/*
        List<TestSortBean> temp = new ArrayList<>();
        temp.add(new TestSortBean(26, "帅", R.drawable.pic6));
        temp.add(new TestSortBean(28, "帅", R.drawable.pic6));
        mDatas.addAll(temp);
*/


        //刷新时,服务器给我们的一般都是一个List
        //直接addAll 要先clear, 会闪屏
/*        List<TestSortBean> newDatas = new ArrayList<>();
        for (int i = 0; i < mDatas.size(); i++) {
            try {
                newDatas.add(mDatas.get(i).clone());//clone一遍旧数据 ,模拟刷新操作
            } catch (CloneNotSupportedException e) {
                e.printStackTrace();
            }
        }
        newDatas.add(new TestSortBean(29, "帅", R.drawable.pic6));//模拟新增数据
        newDatas.get(0).setName("Android+");
        newDatas.get(0).setIcon(R.drawable.pic7);//模拟修改数据
        TestSortBean testBean = newDatas.get(1);//模拟数据位移
        newDatas.remove(testBean);
        newDatas.add(testBean);
        mDatas.clear();
        mDatas.addAll(newDatas);*/


        new Thread(new Runnable() {
            @Override
            public void run() {
                //每次add都会计算一次 想放在子线程中
                //然而这是肯定不行的,上文提过,每次add 会自动 mAdapter.notifyItemRangeInserted(position, count);
                //这一点就不如DiffUtil啦。
                //android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
                /*mDatas.add(new TestSortBean(26, "帅", R.drawable.pic6));//模拟新增数据
                mDatas.add(new TestSortBean(27, "帅", R.drawable.pic6));//模拟新增数据*/
            }
        }).start();
    }
}


================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedListCallback.java
================================================
package com.mcxtzhang.diffutils.sortedlist;

import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.util.SortedListAdapterCallback;

/**
 * 介绍:比较规则Callback。
 * 和DiffUtil.Callback。写法套路一毛一样。
 * 而且比DiffUtil.Callback简单。
 * 因为不用传数据集进来,每次直接给你Item比较。
 *
 * 作者:zhangxutong
 * 邮箱:mcxtzhang@163.com
 * 主页:http://blog.csdn.net/zxt0601
 * 时间: 2016/11/29.
 */

public class SortedListCallback extends SortedListAdapterCallback<TestSortBean> {
    /**
     * Creates a {@link SortedList.Callback} that will forward data change events to the provided
     * Adapter.
     *
     * @param adapter The Adapter instance which should receive events from the SortedList.
     */
    public SortedListCallback(RecyclerView.Adapter adapter) {
        super(adapter);
    }

    /**
     * 把它当成equals 方法就好
     */
    @Override
    public int compare(TestSortBean o1, TestSortBean o2) {
        return o1.getId() - o2.getId();
    }

    /**
     * 和DiffUtil方法一致,不再赘述
     */
    @Override
    public boolean areItemsTheSame(TestSortBean item1, TestSortBean item2) {
        return item1.getId() == item2.getId();
    }
    /**
     * 和DiffUtil方法一致,不再赘述
     */
    @Override
    public boolean areContentsTheSame(TestSortBean oldItem, TestSortBean newItem) {
        //默认相同 有一个不同就是不同
        if (oldItem.getId() != newItem.getId()) {
            return false;
        }
        if (oldItem.getName().equals(newItem.getName())) {
            return false;
        }
        if (oldItem.getIcon() != newItem.getIcon()) {
            return false;
        }
        return true;
    }


}


================================================
FILE: app/src/main/java/com/mcxtzhang/diffutils/sortedlist/TestSortBean.java
================================================
package com.mcxtzhang.diffutils.sortedlist;

/**
 * 介绍:
 * 作者:zhangxutong
 * 邮箱:mcxtzhang@163.com
 * 主页:http://blog.csdn.net/zxt0601
 * 时间: 2016/11/29.
 */

public class TestSortBean implements Cloneable{
    private int id;
    private String name;
    private int icon;

    //仅写DEMO 用 实现克隆方法
    @Override
    public TestSortBean clone() throws CloneNotSupportedException {
        TestSortBean bean = null;
        try {
            bean = (TestSortBean) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return bean;
    }

    @Override
    public String toString() {
        return "TestSortBean{" +
                "icon='" + icon + '\'' +
                ", name='" + name + '\'' +
                ", id=" + id +
                '}';
    }

    public TestSortBean(int id, String name, int icon) {
        this.id = id;
        this.name = name;
        this.icon = icon;
    }

    public int getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    public int getIcon() {
        return icon;
    }

    public TestSortBean setIcon(int icon) {
        this.icon = icon;
        return this;
    }
}


================================================
FILE: app/src/main/res/layout/activity_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_launcher"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.mcxtzhang.diffutils.LauncherActivity">

    <Button
        android:id="@+id/btnDiff"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="DiffUtil例子"/>


    <Button
        android:id="@+id/btnSortedList"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="SortedList例子"/>


</LinearLayout>


================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <Button
        android:id="@+id/btnRefresh"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:onClick="onRefresh"
        android:text="模拟刷新" />
</RelativeLayout>


================================================
FILE: app/src/main/res/layout/activity_sorted_list.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:id="@+id/activity_main"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingBottom="@dimen/activity_vertical_margin"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <Button
        android:id="@+id/btnRefresh"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:onClick="onRefresh"
        android:text="模拟刷新" />
</RelativeLayout>


================================================
FILE: app/src/main/res/layout/item_diff.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="120dp"
    android:layout_marginBottom="1dp"
    android:background="@color/colorAccent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/tv1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        tools:text="第一个" />

    <TextView
        android:id="@+id/tv2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        tools:text="我的存在只为了证明定向刷新中的定向刷新" />

    <ImageView
        android:id="@+id/iv"
        android:layout_width="70dp"
        android:layout_height="70dp" />

</LinearLayout>

================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
</resources>


================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
</resources>


================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">DiffUtils</string>
</resources>


================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>


================================================
FILE: app/src/main/res/values-w820dp/dimens.xml
================================================
<resources>
    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
         (such as screen margins) for screens with more than 820dp of available width. This
         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
    <dimen name="activity_horizontal_margin">64dp</dimen>
</resources>


================================================
FILE: app/src/test/java/com/mcxtzhang/diffutils/ExampleUnitTest.java
================================================
package com.mcxtzhang.diffutils;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() throws Exception {
        assertEquals(4, 2 + 2);
    }
}

================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip


================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true


================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: settings.gradle
================================================
include ':app'
Download .txt
gitextract_90o5h7_s/

├── .gitignore
├── .idea/
│   ├── compiler.xml
│   ├── copyright/
│   │   └── profiles_settings.xml
│   ├── encodings.xml
│   ├── gradle.xml
│   ├── libraries/
│   │   ├── animated_vector_drawable_24_2_0.xml
│   │   ├── appcompat_v7_24_2_0.xml
│   │   ├── espresso_core_2_2_2.xml
│   │   ├── espresso_idling_resource_2_2_2.xml
│   │   ├── exposed_instrumentation_api_publish_0_5.xml
│   │   ├── hamcrest_core_1_3.xml
│   │   ├── hamcrest_integration_1_3.xml
│   │   ├── hamcrest_library_1_3.xml
│   │   ├── javawriter_2_1_1.xml
│   │   ├── javax_annotation_api_1_2.xml
│   │   ├── javax_inject_1.xml
│   │   ├── jsr305_2_0_1.xml
│   │   ├── junit_4_12.xml
│   │   ├── recyclerview_v7_24_2_0.xml
│   │   ├── rules_0_5.xml
│   │   ├── runner_0_5.xml
│   │   ├── support_annotations_24_2_0.xml
│   │   ├── support_compat_24_2_0.xml
│   │   ├── support_core_ui_24_2_0.xml
│   │   ├── support_core_utils_24_2_0.xml
│   │   ├── support_fragment_24_2_0.xml
│   │   ├── support_media_compat_24_2_0.xml
│   │   ├── support_v4_24_2_0.xml
│   │   └── support_vector_drawable_24_2_0.xml
│   ├── misc.xml
│   ├── modules.xml
│   ├── runConfigurations.xml
│   └── vcs.xml
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── mcxtzhang/
│       │               └── diffutils/
│       │                   └── ExampleInstrumentedTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── mcxtzhang/
│       │   │           └── diffutils/
│       │   │               ├── LauncherActivity.java
│       │   │               ├── diffutil/
│       │   │               │   ├── DiffAdapter.java
│       │   │               │   ├── DiffCallBack.java
│       │   │               │   ├── MainActivity.java
│       │   │               │   └── TestBean.java
│       │   │               └── sortedlist/
│       │   │                   ├── SortedAdapter.java
│       │   │                   ├── SortedListActivity.java
│       │   │                   ├── SortedListCallback.java
│       │   │                   └── TestSortBean.java
│       │   └── res/
│       │       ├── layout/
│       │       │   ├── activity_launcher.xml
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_sorted_list.xml
│       │       │   └── item_diff.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── mcxtzhang/
│                       └── diffutils/
│                           └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
Download .txt
SYMBOL INDEX (63 symbols across 11 files)

FILE: app/src/androidTest/java/com/mcxtzhang/diffutils/ExampleInstrumentedTest.java
  class ExampleInstrumentedTest (line 17) | @RunWith(AndroidJUnit4.class)
    method useAppContext (line 19) | @Test

FILE: app/src/main/java/com/mcxtzhang/diffutils/LauncherActivity.java
  class LauncherActivity (line 11) | public class LauncherActivity extends AppCompatActivity {
    method onCreate (line 13) | @Override

FILE: app/src/main/java/com/mcxtzhang/diffutils/diffutil/DiffAdapter.java
  class DiffAdapter (line 26) | public class DiffAdapter extends RecyclerView.Adapter<DiffAdapter.DiffVH> {
    method DiffAdapter (line 32) | public DiffAdapter(Context mContext, List<TestBean> mDatas) {
    method setDatas (line 38) | public void setDatas(List<TestBean> mDatas) {
    method onCreateViewHolder (line 42) | @Override
    method onBindViewHolder (line 47) | @Override
    method onBindViewHolder (line 55) | @Override
    method getItemCount (line 79) | @Override
    class DiffVH (line 84) | class DiffVH extends RecyclerView.ViewHolder {
      method DiffVH (line 88) | public DiffVH(View itemView) {

FILE: app/src/main/java/com/mcxtzhang/diffutils/diffutil/DiffCallBack.java
  class DiffCallBack (line 17) | public class DiffCallBack extends DiffUtil.Callback {
    method DiffCallBack (line 20) | public DiffCallBack(List<TestBean> mOldDatas, List<TestBean> mNewDatas) {
    method getOldListSize (line 26) | @Override
    method getNewListSize (line 32) | @Override
    method areItemsTheSame (line 48) | @Override
    method areContentsTheSame (line 75) | @Override
    method getChangePayload (line 112) | @Nullable

FILE: app/src/main/java/com/mcxtzhang/diffutils/diffutil/MainActivity.java
  class MainActivity (line 17) | public class MainActivity extends AppCompatActivity {
    method onCreate (line 22) | @Override
    method initData (line 33) | private void initData() {
    method onRefresh (line 47) | public void onRefresh(View view) {
    method handleMessage (line 82) | @Override

FILE: app/src/main/java/com/mcxtzhang/diffutils/diffutil/TestBean.java
  class TestBean (line 11) | public class TestBean implements Cloneable {
    method TestBean (line 16) | public TestBean(String name, String desc, int pic) {
    method getPic (line 22) | public int getPic() {
    method setPic (line 26) | public void setPic(int pic) {
    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 clone (line 47) | @Override

FILE: app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedAdapter.java
  class SortedAdapter (line 25) | public class SortedAdapter extends RecyclerView.Adapter<SortedAdapter.VH> {
    method SortedAdapter (line 35) | public SortedAdapter(Context mContext, SortedList<TestSortBean> mDatas) {
    method setDatas (line 41) | public void setDatas(SortedList<TestSortBean> mDatas) {
    method onCreateViewHolder (line 45) | @Override
    method onBindViewHolder (line 50) | @Override
    method getItemCount (line 58) | @Override
    class VH (line 63) | class VH extends RecyclerView.ViewHolder {
      method VH (line 67) | public VH(View itemView) {

FILE: app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedListActivity.java
  class SortedListActivity (line 15) | public class SortedListActivity extends AppCompatActivity {
    method onCreate (line 24) | @Override
    method initData (line 44) | private void initData() {
    method onRefresh (line 61) | public void onRefresh(View view) {

FILE: app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedListCallback.java
  class SortedListCallback (line 18) | public class SortedListCallback extends SortedListAdapterCallback<TestSo...
    method SortedListCallback (line 25) | public SortedListCallback(RecyclerView.Adapter adapter) {
    method compare (line 32) | @Override
    method areItemsTheSame (line 40) | @Override
    method areContentsTheSame (line 47) | @Override

FILE: app/src/main/java/com/mcxtzhang/diffutils/sortedlist/TestSortBean.java
  class TestSortBean (line 11) | public class TestSortBean implements Cloneable{
    method clone (line 17) | @Override
    method toString (line 28) | @Override
    method TestSortBean (line 37) | public TestSortBean(int id, String name, int icon) {
    method getId (line 43) | public int getId() {
    method setId (line 47) | public TestSortBean setId(int id) {
    method getName (line 52) | public String getName() {
    method setName (line 56) | public TestSortBean setName(String name) {
    method getIcon (line 61) | public int getIcon() {
    method setIcon (line 65) | public TestSortBean setIcon(int icon) {

FILE: app/src/test/java/com/mcxtzhang/diffutils/ExampleUnitTest.java
  class ExampleUnitTest (line 12) | public class ExampleUnitTest {
    method addition_isCorrect (line 13) | @Test
Condensed preview — 65 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (74K chars).
[
  {
    "path": ".gitignore",
    "chars": 465,
    "preview": "# Built application files\n*.apk\n*.ap_\n\n# Files for the ART/Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated file"
  },
  {
    "path": ".idea/compiler.xml",
    "chars": 686,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <resourceExt"
  },
  {
    "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": 626,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linke"
  },
  {
    "path": ".idea/libraries/animated_vector_drawable_24_2_0.xml",
    "chars": 657,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"animated-vector-drawable-24.2.0\">\n    <CLASSES>\n      <root url=\"file:/"
  },
  {
    "path": ".idea/libraries/appcompat_v7_24_2_0.xml",
    "chars": 770,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"appcompat-v7-24.2.0\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PROJECT"
  },
  {
    "path": ".idea/libraries/espresso_core_2_2_2.xml",
    "chars": 639,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"espresso-core-2.2.2\">\n    <CLASSES>\n      <root url=\"jar://$PROJECT_DIR"
  },
  {
    "path": ".idea/libraries/espresso_idling_resource_2_2_2.xml",
    "chars": 694,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"espresso-idling-resource-2.2.2\">\n    <CLASSES>\n      <root url=\"jar://$"
  },
  {
    "path": ".idea/libraries/exposed_instrumentation_api_publish_0_5.xml",
    "chars": 712,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"exposed-instrumentation-api-publish-0.5\">\n    <CLASSES>\n      <root url"
  },
  {
    "path": ".idea/libraries/hamcrest_core_1_3.xml",
    "chars": 516,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"hamcrest-core-1.3\">\n    <CLASSES>\n      <root url=\"jar://$USER_HOME$/.g"
  },
  {
    "path": ".idea/libraries/hamcrest_integration_1_3.xml",
    "chars": 346,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"hamcrest-integration-1.3\">\n    <CLASSES>\n      <root url=\"jar://$USER_H"
  },
  {
    "path": ".idea/libraries/hamcrest_library_1_3.xml",
    "chars": 334,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"hamcrest-library-1.3\">\n    <CLASSES>\n      <root url=\"jar://$USER_HOME$"
  },
  {
    "path": ".idea/libraries/javawriter_2_1_1.xml",
    "chars": 322,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"javawriter-2.1.1\">\n    <CLASSES>\n      <root url=\"jar://$USER_HOME$/.gr"
  },
  {
    "path": ".idea/libraries/javax_annotation_api_1_2.xml",
    "chars": 350,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"javax.annotation-api-1.2\">\n    <CLASSES>\n      <root url=\"jar://$USER_H"
  },
  {
    "path": ".idea/libraries/javax_inject_1.xml",
    "chars": 501,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"javax.inject-1\">\n    <CLASSES>\n      <root url=\"jar://$USER_HOME$/.grad"
  },
  {
    "path": ".idea/libraries/jsr305_2_0_1.xml",
    "chars": 322,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"jsr305-2.0.1\">\n    <CLASSES>\n      <root url=\"jar://$USER_HOME$/.gradle"
  },
  {
    "path": ".idea/libraries/junit_4_12.xml",
    "chars": 467,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"junit-4.12\">\n    <CLASSES>\n      <root url=\"jar://$USER_HOME$/.gradle/c"
  },
  {
    "path": ".idea/libraries/recyclerview_v7_24_2_0.xml",
    "chars": 788,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"recyclerview-v7-24.2.0\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PROJ"
  },
  {
    "path": ".idea/libraries/rules_0_5.xml",
    "chars": 730,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"rules-0.5\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PROJECT_DIR$/app/"
  },
  {
    "path": ".idea/libraries/runner_0_5.xml",
    "chars": 736,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"runner-0.5\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PROJECT_DIR$/app"
  },
  {
    "path": ".idea/libraries/support_annotations_24_2_0.xml",
    "chars": 531,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-annotations-24.2.0\">\n    <CLASSES>\n      <root url=\"jar://$USER"
  },
  {
    "path": ".idea/libraries/support_compat_24_2_0.xml",
    "chars": 939,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-compat-24.2.0\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PROJE"
  },
  {
    "path": ".idea/libraries/support_core_ui_24_2_0.xml",
    "chars": 946,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-core-ui-24.2.0\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PROJ"
  },
  {
    "path": ".idea/libraries/support_core_utils_24_2_0.xml",
    "chars": 788,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-core-utils-24.2.0\">\n    <CLASSES>\n      <root url=\"jar://$PROJE"
  },
  {
    "path": ".idea/libraries/support_fragment_24_2_0.xml",
    "chars": 953,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-fragment-24.2.0\">\n    <ANNOTATIONS>\n      <root url=\"jar://$PRO"
  },
  {
    "path": ".idea/libraries/support_media_compat_24_2_0.xml",
    "chars": 981,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-media-compat-24.2.0\">\n    <ANNOTATIONS>\n      <root url=\"jar://"
  },
  {
    "path": ".idea/libraries/support_v4_24_2_0.xml",
    "chars": 411,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-v4-24.2.0\">\n    <CLASSES>\n      <root url=\"jar://$PROJECT_DIR$/"
  },
  {
    "path": ".idea/libraries/support_vector_drawable_24_2_0.xml",
    "chars": 652,
    "preview": "<component name=\"libraryTable\">\n  <library name=\"support-vector-drawable-24.2.0\">\n    <CLASSES>\n      <root url=\"file://"
  },
  {
    "path": ".idea/misc.xml",
    "chars": 2644,
    "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": 355,
    "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": 650,
    "preview": "#SupportDemos\n本工程最初仅为DiffUtil的一个Demo,后发展为讲解Google Android Support包内那些常用or冷门有用的工具类的合集。\n\n\n\n## 索引:\n合集Blog地址:\n\nhttp://blog.c"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "chars": 928,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 24\n    buildToolsVersion \"24.0.2\"\n    defaultCo"
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 671,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in C:"
  },
  {
    "path": "app/src/androidTest/java/com/mcxtzhang/diffutils/ExampleInstrumentedTest.java",
    "chars": 750,
    "preview": "package com.mcxtzhang.diffutils;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\ni"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 833,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          pa"
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/LauncherActivity.java",
    "chars": 1050,
    "preview": "package com.mcxtzhang.diffutils;\n\nimport android.content.Intent;\nimport android.support.v7.app.AppCompatActivity;\nimport"
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/diffutil/DiffAdapter.java",
    "chars": 2894,
    "preview": "package com.mcxtzhang.diffutils.diffutil;\n\nimport android.content.Context;\nimport android.os.Bundle;\nimport android.supp"
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/diffutil/DiffCallBack.java",
    "chars": 5325,
    "preview": "package com.mcxtzhang.diffutils.diffutil;\n\nimport android.os.Bundle;\nimport android.support.annotation.Nullable;\nimport "
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/diffutil/MainActivity.java",
    "chars": 4690,
    "preview": "package com.mcxtzhang.diffutils.diffutil;\n\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Messag"
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/diffutil/TestBean.java",
    "chars": 1258,
    "preview": "package com.mcxtzhang.diffutils.diffutil;\n\n/**\n * 介绍:一个普通的JavaBean,但是实现了clone方法,仅仅用于写Demo时,模拟刷新从网络获取数据用,\n * 因为使用DiffUtil"
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedAdapter.java",
    "chars": 2144,
    "preview": "package com.mcxtzhang.diffutils.sortedlist;\n\nimport android.content.Context;\nimport android.support.v7.util.SortedList;\n"
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedListActivity.java",
    "chars": 4040,
    "preview": "package com.mcxtzhang.diffutils.sortedlist;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\n"
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/sortedlist/SortedListCallback.java",
    "chars": 1589,
    "preview": "package com.mcxtzhang.diffutils.sortedlist;\n\nimport android.support.v7.widget.RecyclerView;\nimport android.support.v7.wi"
  },
  {
    "path": "app/src/main/java/com/mcxtzhang/diffutils/sortedlist/TestSortBean.java",
    "chars": 1407,
    "preview": "package com.mcxtzhang.diffutils.sortedlist;\n\n/**\n * 介绍:\n * 作者:zhangxutong\n * 邮箱:mcxtzhang@163.com\n * 主页:http://blog.csdn"
  },
  {
    "path": "app/src/main/res/layout/activity_launcher.xml",
    "chars": 994,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    "
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 958,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xm"
  },
  {
    "path": "app/src/main/res/layout/activity_sorted_list.xml",
    "chars": 1054,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      "
  },
  {
    "path": "app/src/main/res/layout/item_diff.xml",
    "chars": 832,
    "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/values/colors.xml",
    "chars": 208,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"color"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 211,
    "preview": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 72,
    "preview": "<resources>\n    <string name=\"app_name\">DiffUtils</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 383,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
  },
  {
    "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/mcxtzhang/diffutils/ExampleUnitTest.java",
    "chars": 401,
    "preview": "package com.mcxtzhang.diffutils;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit t"
  },
  {
    "path": "build.gradle",
    "chars": 498,
    "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": 233,
    "preview": "#Mon Dec 28 10:00:20 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 730,
    "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": 4971,
    "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 1 more files (download for full content)

About this extraction

This page contains the full source code of the mcxtzhang/DiffUtils GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 65 files (61.8 KB), approximately 19.5k tokens, and a symbol index with 63 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!