├── sample ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── ids.xml │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-hdpi │ │ │ └── ic_keyboard_arrow_down.png │ │ ├── drawable-mdpi │ │ │ └── ic_keyboard_arrow_down.png │ │ ├── drawable-xhdpi │ │ │ └── ic_keyboard_arrow_down.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_keyboard_arrow_down.png │ │ ├── drawable-xxxhdpi │ │ │ └── ic_keyboard_arrow_down.png │ │ ├── drawable-v21 │ │ │ ├── bg_child.xml │ │ │ └── bg_parent.xml │ │ ├── values-v19 │ │ │ └── styles.xml │ │ ├── values-v21 │ │ │ └── styles.xml │ │ ├── animator │ │ │ ├── list_arror_down_indicator.xml │ │ │ └── list_arror_up_indicator.xml │ │ ├── drawable │ │ │ ├── bg_child.xml │ │ │ ├── bg_parent.xml │ │ │ └── ic_arrow_back_white_24dp.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── layout │ │ │ ├── item_child_2.xml │ │ │ ├── item_parent_2.xml │ │ │ ├── fragment_single_rv.xml │ │ │ ├── item_parent_1.xml │ │ │ ├── item_child_1.xml │ │ │ ├── item_child.xml │ │ │ ├── fragment_main.xml │ │ │ ├── fragment_multiple_rv.xml │ │ │ ├── activity_base.xml │ │ │ ├── item_parent.xml │ │ │ └── table.xml │ │ ├── menu │ │ │ ├── context.xml │ │ │ └── menu_main.xml │ │ ├── values-v24 │ │ │ └── styles.xml │ │ └── values-en │ │ │ └── strings.xml │ │ ├── java │ │ └── com │ │ │ └── github │ │ │ └── huajianjiang │ │ │ └── expandablerecyclerview │ │ │ └── sample │ │ │ ├── SingleRvActivity.java │ │ │ ├── MultipleRvActivity.java │ │ │ ├── viewholder │ │ │ ├── MyChildViewHolder.java │ │ │ └── MyParentViewHolder.java │ │ │ ├── IPresenter.java │ │ │ ├── MainActivity.java │ │ │ ├── model │ │ │ ├── MyChild.java │ │ │ └── MyParent.java │ │ │ ├── BaseActivity.java │ │ │ ├── util │ │ │ └── AppUtil.java │ │ │ ├── adapter │ │ │ └── MyAdapter.java │ │ │ ├── MyDialog.java │ │ │ ├── PresenterImpl.java │ │ │ ├── MultipleRvFragment.java │ │ │ ├── SingleRvFragment.java │ │ │ └── anim │ │ │ └── CircularRevealItemAnimator.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── expandablerecyclerview ├── .gitignore ├── gradle.properties ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ └── values │ │ │ └── values.xml │ │ └── java │ │ └── com │ │ └── github │ │ └── huajianjiang │ │ └── expandablerecyclerview │ │ ├── widget │ │ ├── Parent.java │ │ ├── ExpandableAdapters.java │ │ ├── SavedState.java │ │ ├── BaseViewHolder.java │ │ ├── ParentViewHolder.java │ │ ├── ChildViewHolder.java │ │ ├── ExpandableRecyclerView.java │ │ ├── ItemWrapper.java │ │ └── PatchedRecyclerView.java │ │ └── util │ │ ├── Preconditions.java │ │ ├── Packager.java │ │ └── Logger.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── screenshots ├── demo.gif ├── screenshot_1.png ├── screenshot_2.png ├── screenshot_3.png ├── screenshot_4.png └── screenshot_5.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitattributes ├── .gitignore ├── gradle.properties ├── README.md ├── gradlew.bat ├── gradlew └── LICENSE /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /expandablerecyclerview/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':sample', ':expandablerecyclerview' -------------------------------------------------------------------------------- /screenshots/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/screenshots/demo.gif -------------------------------------------------------------------------------- /screenshots/screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/screenshots/screenshot_1.png -------------------------------------------------------------------------------- /screenshots/screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/screenshots/screenshot_2.png -------------------------------------------------------------------------------- /screenshots/screenshot_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/screenshots/screenshot_3.png -------------------------------------------------------------------------------- /screenshots/screenshot_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/screenshots/screenshot_4.png -------------------------------------------------------------------------------- /screenshots/screenshot_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/screenshots/screenshot_5.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /expandablerecyclerview/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=ExpandableRecyclerView 2 | POM_ARTIFACT_ID=expandablerecyclerview 3 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /sample/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-hdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/drawable-hdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-mdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/drawable-mdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xhdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/drawable-xhdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xxhdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/drawable-xxhdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable-xxxhdpi/ic_keyboard_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deverhjj/ExpandableRecyclerView/HEAD/sample/src/main/res/drawable-xxxhdpi/ic_keyboard_arrow_down.png -------------------------------------------------------------------------------- /expandablerecyclerview/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable-v21/bg_child.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable-v21/bg_parent.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon May 08 21:54:33 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /sample/src/main/res/values-v19/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /sample/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 8dp 7 | 8 | -------------------------------------------------------------------------------- /sample/src/main/res/animator/list_arror_down_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/src/main/res/animator/list_arror_up_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/bg_child.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/bg_parent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sample/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/ic_arrow_back_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.myChildren diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/item_child_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 13 | 14 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/item_parent_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 13 | 14 | -------------------------------------------------------------------------------- /sample/src/main/res/menu/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /expandablerecyclerview/src/main/res/values/values.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sample/src/main/res/values-v24/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Android-SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /expandablerecyclerview/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Android-SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_single_rv.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /expandablerecyclerview/src/main/java/com/github/huajianjiang/expandablerecyclerview/widget/Parent.java: -------------------------------------------------------------------------------- 1 | package com.github.huajianjiang.expandablerecyclerview.widget; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 父列表项接口,客户端父列表项数据需要实现该基类实现自定义的父列表项数据模型 7 | * Created by jhj_Plus on 2015/12/23. 8 | */ 9 | public interface Parent { 10 | /** 11 | * 获取属于该父列表项的子项列表 12 | * 13 | * @return 所属该父列表项的子项列表 14 | */ 15 | List getChildren(); 16 | 17 | /** 18 | * 单独设置该父列表项是否可以展开折叠,不影响 {@link #isInitiallyExpanded()},但是后期无法再展开折叠,除非再次设置该返回值 19 | * @return 该父父列表项是否可展开折叠 20 | */ 21 | boolean isInitiallyExpandable(); 22 | 23 | /** 24 | * 父列表项初始化时是否展开回调 25 | * 26 | * @return 父列表项初始化时是否展开 27 | */ 28 | boolean isInitiallyExpanded(); 29 | } 30 | -------------------------------------------------------------------------------- /sample/src/main/java/com/github/huajianjiang/expandablerecyclerview/sample/SingleRvActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.huajianjiang.expandablerecyclerview.sample; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | 6 | /** 7 | * @author HuaJian Jiang. 8 | * Date 2017/1/23. 9 | */ 10 | public class SingleRvActivity extends BaseActivity { 11 | private static final String TAG = SingleRvActivity.class.getSimpleName(); 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setBackNaviAction(); 17 | setTitle(R.string.single_rv_title); 18 | } 19 | 20 | @Override 21 | public Fragment getFragment() { 22 | return new SingleRvFragment(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/src/main/java/com/github/huajianjiang/expandablerecyclerview/sample/MultipleRvActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.huajianjiang.expandablerecyclerview.sample; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | 6 | /** 7 | * @author HuaJian Jiang. 8 | * Date 2017/1/23. 9 | */ 10 | public class MultipleRvActivity extends BaseActivity { 11 | private static final String TAG = MultipleRvActivity.class.getSimpleName(); 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setBackNaviAction(); 17 | setTitle(R.string.multiple_rv_title); 18 | } 19 | 20 | @Override 21 | public Fragment getFragment() { 22 | return new MultipleRvFragment(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/src/main/res/values-en/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CANCEL 4 | Input form error! parent:parentPos,[count]; child:parentPos,childPos,[count];count default value is 1 5 | OK 6 | collapse 1 7 | collapse all 8 | expand 1 9 | expand all 10 | toggle expandable 1 11 | Multiple RecyclerView with the same Adapter 12 | Single RecyclerView 13 | 14 | -------------------------------------------------------------------------------- /expandablerecyclerview/src/main/java/com/github/huajianjiang/expandablerecyclerview/util/Preconditions.java: -------------------------------------------------------------------------------- 1 | package com.github.huajianjiang.expandablerecyclerview.util; 2 | 3 | import java.util.Collection; 4 | 5 | /** 6 | * Title: 7 | *

Description: 8 | *

Author: Huajian Jiang 9 | *
Date: 2017/3/28 10 | *
Email: developer.huajianjiang@gmail.com 11 | */ 12 | 13 | public class Preconditions { 14 | 15 | public static boolean isNullOrEmpty(Object[] obj) { 16 | return obj == null || obj.length == 0; 17 | } 18 | 19 | public static boolean isNullOrEmpty(Collection c) { 20 | return c == null || c.isEmpty(); 21 | } 22 | 23 | public static T checkNoNull(T obj, String msg) { 24 | if (obj == null) throw new IllegalArgumentException(msg); 25 | return obj; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/dictionaries 41 | .idea/libraries 42 | 43 | # Keystore files 44 | *.jks 45 | 46 | # External native build folder generated in Android Studio 2.2 and later 47 | .externalNativeBuild 48 | /.idea/ 49 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/item_parent_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 21 | 22 | 24 | 25 | -------------------------------------------------------------------------------- /sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #ff424242 7 | #ff37474f 8 | #ff4db6ac 9 | #ff009688 10 | 11 | #ffffffff 12 | #ffdcdcdc 13 | #4dFF4081 14 | #66ffffff 15 | #00000000 16 | #66FF4081 17 | #664db6ac 18 | 19 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/item_child_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 21 | 22 | 24 | 25 | -------------------------------------------------------------------------------- /sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion '25.0.2' 6 | 7 | defaultConfig { 8 | applicationId "com.github.huajianjiang.expandablerecyclerview.sample" 9 | minSdkVersion 14 10 | targetSdkVersion 25 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(include: ['*.jar'], dir: 'libs') 28 | testCompile 'junit:junit:4.12' 29 | compile 'com.android.support:appcompat-v7:25.3.1' 30 | compile 'com.android.support:design:25.3.1' 31 | compile project(':expandablerecyclerview') 32 | } 33 | -------------------------------------------------------------------------------- /sample/src/main/java/com/github/huajianjiang/expandablerecyclerview/sample/viewholder/MyChildViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.github.huajianjiang.expandablerecyclerview.sample.viewholder; 2 | 3 | import android.view.View; 4 | import android.widget.TextView; 5 | 6 | import com.github.huajianjiang.expandablerecyclerview.sample.R; 7 | import com.github.huajianjiang.expandablerecyclerview.sample.model.MyChild; 8 | import com.github.huajianjiang.expandablerecyclerview.widget.ChildViewHolder; 9 | 10 | /** 11 | * Created by jhj_Plus on 2016/9/2. 12 | */ 13 | public class MyChildViewHolder extends ChildViewHolder { 14 | private static final String TAG = "MyChildViewHolder"; 15 | 16 | public MyChildViewHolder(View itemView) { 17 | super(itemView); 18 | } 19 | 20 | public void bind(MyChild data) { 21 | String info = data.getInfo(); 22 | TextView tv_info = getView(R.id.info); 23 | tv_info.setText(info); 24 | getView(R.id.dot).setBackgroundColor(data.getDot()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/item_child.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 25 | 26 | -------------------------------------------------------------------------------- /sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 13 | 14 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 |