├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── wldev
│ │ └── expandablecardviewlist
│ │ ├── MainActivity.java
│ │ ├── MyApplication.java
│ │ ├── bindings
│ │ └── Bindings.java
│ │ ├── data
│ │ ├── ExpandStateItem.java
│ │ └── Item.java
│ │ ├── extra
│ │ ├── ClickAdapter.java
│ │ ├── MyHTMLTagHandler.java
│ │ └── ViewAnimationUtils.java
│ │ └── recyclerview
│ │ ├── BindingViewHolder.java
│ │ └── ExpandableRecyclerViewAdapter.java
│ └── res
│ ├── anim
│ ├── scale_anim.xml
│ └── scale_anim_reverse.xml
│ ├── animator
│ ├── path_morph_down_to_up.xml
│ └── path_morph_up_to_down.xml
│ ├── drawable-hdpi
│ ├── ic_arrow_down.png
│ └── ic_arrow_up.png
│ ├── drawable-mdpi
│ ├── ic_arrow_down.png
│ └── ic_arrow_up.png
│ ├── drawable-xhdpi
│ ├── ic_arrow_down.png
│ └── ic_arrow_up.png
│ ├── drawable-xxhdpi
│ ├── ic_arrow_down.png
│ └── ic_arrow_up.png
│ ├── layout
│ ├── activity_main.xml
│ └── rv_item.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screenrecord.webm
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is the simple project demonstrating how to do expandable CardView list with flexible space between each.
2 |
3 | 
4 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | buildToolsVersion '28.0.3'
6 | defaultConfig {
7 | applicationId "com.wldev.expandablecardviewlist"
8 | minSdkVersion 16
9 | targetSdkVersion 28
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | dataBinding.enabled = true
22 |
23 | }
24 |
25 | ext.supportVersion = '28.0.0'
26 |
27 | dependencies {
28 | implementation fileTree(dir: 'libs', include: ['*.jar'])
29 | implementation "com.android.support:appcompat-v7:$supportVersion"
30 | implementation "com.android.support:support-v4:$supportVersion"
31 | implementation "com.android.support:recyclerview-v7:$supportVersion"
32 | implementation "com.android.support:cardview-v7:$supportVersion"
33 | implementation "com.android.support:design:$supportVersion"
34 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
35 | }
36 |
--------------------------------------------------------------------------------
/app/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 /home/wldev/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 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist;
2 |
3 | import android.databinding.DataBindingUtil;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.support.v7.widget.LinearLayoutManager;
7 |
8 | import com.wldev.expandablecardviewlist.data.Item;
9 | import com.wldev.expandablecardviewlist.databinding.ActivityMainBinding;
10 | import com.wldev.expandablecardviewlist.recyclerview.ExpandableRecyclerViewAdapter;
11 |
12 | import java.util.ArrayList;
13 |
14 | public class MainActivity extends AppCompatActivity {
15 |
16 | public static final String TAG = MainActivity.class.getSimpleName();
17 | ActivityMainBinding binding;
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | binding = DataBindingUtil.setContentView(this,R.layout.activity_main);
22 | binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
23 | final ArrayList- arrayList = new ArrayList<>();
24 | arrayList.add(new Item("Freelancer", getString(R.string.first_plan)));
25 | arrayList.add(new Item("Startup", getString(R.string.second_plan)));
26 | arrayList.add(new Item("Agency", getString(R.string.third_plan)));
27 | arrayList.add(new Item("Corporate", getString(R.string.full_plan)));
28 | binding.recyclerView.setAdapter(new ExpandableRecyclerViewAdapter(arrayList));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/MyApplication.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist;
2 |
3 | import android.app.Application;
4 |
5 | /**
6 | * Created by wldev on 3/10/17.
7 | */
8 |
9 | public class MyApplication extends Application{
10 | private static MyApplication applicationInstance;
11 |
12 | @Override
13 | public void onCreate() {
14 | super.onCreate();
15 | applicationInstance = this;
16 | }
17 |
18 | public static MyApplication get() {
19 | return applicationInstance;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/bindings/Bindings.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist.bindings;
2 |
3 | import android.databinding.BindingAdapter;
4 | import android.graphics.Color;
5 | import android.graphics.PorterDuff;
6 | import android.graphics.PorterDuffColorFilter;
7 | import android.graphics.drawable.Drawable;
8 | import android.os.Build;
9 | import android.text.Html;
10 | import android.util.Log;
11 | import android.view.View;
12 | import android.view.ViewGroup;
13 | import android.view.animation.Animation;
14 | import android.widget.ImageView;
15 | import android.widget.TextView;
16 |
17 | import com.wldev.expandablecardviewlist.extra.MyHTMLTagHandler;
18 | import com.wldev.expandablecardviewlist.extra.ViewAnimationUtils;
19 |
20 | /**
21 | * Created by wldev on 3/10/17.
22 | */
23 |
24 | public class Bindings {
25 | private static final String TAG = Bindings.class.getSimpleName();
26 |
27 | @BindingAdapter("android:layout_height")
28 | public static void setLayoutHeight(View view, float height) {
29 | ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
30 | layoutParams.height = (int) height;
31 | view.setLayoutParams(layoutParams);
32 | }
33 |
34 | @BindingAdapter("android:layout_width")
35 | public static void setLayoutWidth(View view, float width) {
36 | ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
37 | layoutParams.width = (int) width;
38 | view.setLayoutParams(layoutParams);
39 | }
40 |
41 | @BindingAdapter({"layout_marginLeft"})
42 | public static void setMarginLeft(View layout, float margin) {
43 | if (layout.getLayoutParams() instanceof ViewGroup.MarginLayoutParams){
44 | ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) layout.getLayoutParams();
45 | params.leftMargin = (int) margin;
46 | layout.setLayoutParams(params);
47 | }
48 | }
49 |
50 | @BindingAdapter({"layout_marginRight"})
51 | public static void setMarginRight(View layout, float margin) {
52 | if (layout.getLayoutParams() instanceof ViewGroup.MarginLayoutParams){
53 | ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) layout.getLayoutParams();
54 | params.rightMargin = (int) margin;
55 | layout.setLayoutParams(params);
56 | }
57 | }
58 |
59 | @BindingAdapter({"layout_marginTop"})
60 | public static void setMarginTop(View layout, float margin) {
61 | if (layout.getLayoutParams() instanceof ViewGroup.MarginLayoutParams){
62 | ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) layout.getLayoutParams();
63 | params.topMargin = (int) margin;
64 | layout.setLayoutParams(params);
65 | }
66 | }
67 |
68 | @BindingAdapter({"layout_marginBottom"})
69 | public static void setMarginBottom(View layout, float margin) {
70 | if (layout.getLayoutParams() instanceof ViewGroup.MarginLayoutParams){
71 | ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) layout.getLayoutParams();
72 | params.bottomMargin = (int) margin;
73 | layout.setLayoutParams(params);
74 | }
75 | }
76 |
77 | @BindingAdapter({"onClick"})
78 | public static void setOnClick(View view, View.OnClickListener listener){
79 | view.setOnClickListener(listener);
80 | }
81 |
82 | @BindingAdapter({"backgroundTint"})
83 | public static void setBackhroundTint(View textView, String item) {
84 | Drawable drawable = textView.getBackground();
85 | drawable.setColorFilter(new
86 | PorterDuffColorFilter(Color.parseColor(item), PorterDuff.Mode.MULTIPLY));
87 | textView.setBackground(drawable);
88 | }
89 |
90 | @BindingAdapter({"html"})
91 | public static void setHTMLTextToTV(TextView textView, String text){
92 | setHTMLTextToTV(textView, text,false);
93 | }
94 |
95 | @BindingAdapter({"html","useChecks"})
96 | public static void setHTMLTextToTV(TextView textView, String text, boolean useChecks){
97 | Log.d(TAG, "setHTMLTextToTV: ");
98 | if (text == null || text.length()==0) {
99 | textView.setText("");
100 | return;
101 | }
102 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
103 | textView.setText(Html.fromHtml(text,Html.FROM_HTML_MODE_LEGACY,null,new MyHTMLTagHandler(useChecks)));
104 | }
105 | else
106 | textView.setText(Html.fromHtml(text,null,new MyHTMLTagHandler(useChecks)));
107 | }
108 |
109 |
110 | @BindingAdapter({"animate", "animation", "fastAnimation"})
111 | public static void animateWithRes(ImageView imageView, boolean animate, Animation animation, boolean fastAnimation) {
112 | if (animate && imageView.getAnimation() != null) {
113 | if (fastAnimation) {
114 | animation.setDuration(0);
115 | }
116 | imageView.startAnimation(animation);
117 | }
118 | }
119 |
120 | @BindingAdapter({"reverse", "reverseAnimation", "fastReverse"})
121 | public static void reverseAnimationWithRes(ImageView imageView, boolean reverse, Animation animation, boolean fastAnimation) {
122 | if (reverse) {
123 | if (fastAnimation) {
124 | animation.setDuration(0);
125 | }
126 | imageView.startAnimation(animation);
127 | }
128 | }
129 |
130 | @BindingAdapter({"expand", "fastExpand"})
131 | public static void expandView(View view, boolean expand, boolean fast) {
132 | if (expand) {
133 | ViewAnimationUtils.expand(view, null, fast);
134 | } else if (view.getHeight() != 0) {
135 | ViewAnimationUtils.collapse(view, null, fast);
136 | }
137 | }
138 |
139 | }
140 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/data/ExpandStateItem.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist.data;
2 |
3 | import android.databinding.BaseObservable;
4 | import android.databinding.Bindable;
5 |
6 | import com.wldev.expandablecardviewlist.BR;
7 |
8 |
9 | /**
10 | * Created by wldev on 7/7/17.
11 | * Purpose:
12 | */
13 |
14 | public class ExpandStateItem extends BaseObservable {
15 |
16 | @Bindable
17 | private boolean expanded;
18 |
19 | @Bindable
20 | private float margin;
21 |
22 | @Bindable
23 | private boolean fast;
24 |
25 | public ExpandStateItem(boolean expanded) {
26 | this.expanded = expanded;
27 | }
28 |
29 | public ExpandStateItem(boolean expanded, float margin) {
30 | this.expanded = expanded;
31 | this.margin = margin;
32 | }
33 |
34 | public boolean isFast() {
35 | return fast;
36 | }
37 |
38 | public void setFast(boolean fast) {
39 | this.fast = fast;
40 | notifyPropertyChanged(BR.fast);
41 | }
42 |
43 | public boolean isExpanded() {
44 | return expanded;
45 | }
46 |
47 | public float getMargin() {
48 | return margin;
49 | }
50 |
51 | public void setExpanded(boolean expanded) {
52 | this.expanded = expanded;
53 | notifyPropertyChanged(BR.expanded);
54 | }
55 |
56 | public void setMargin(float margin) {
57 | this.margin = margin;
58 | notifyPropertyChanged(BR.margin);
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/data/Item.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist.data;
2 |
3 | /**
4 | * Created by wldev on 3/10/17.
5 | */
6 |
7 | public class Item {
8 |
9 | private String title;
10 | private String desc;
11 |
12 | public Item(String title, String desc) {
13 | this.title = title;
14 | this.desc = desc;
15 | }
16 |
17 |
18 | public String getTitle() {
19 | return title;
20 | }
21 |
22 | public String getDesc() {
23 | return desc;
24 | }
25 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/extra/ClickAdapter.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist.extra;
2 |
3 | import android.view.View;
4 |
5 | /**
6 | * Created by wldev on 3/10/17.
7 | */
8 |
9 | public abstract class ClickAdapter implements View.OnClickListener{
10 | @Override
11 | public abstract void onClick(View v);
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/extra/MyHTMLTagHandler.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist.extra;
2 |
3 | import android.support.v4.content.ContextCompat;
4 | import android.text.Editable;
5 | import android.text.Html;
6 | import android.text.SpannableStringBuilder;
7 | import android.text.Spanned;
8 | import android.text.style.ForegroundColorSpan;
9 |
10 | import com.wldev.expandablecardviewlist.MyApplication;
11 | import com.wldev.expandablecardviewlist.R;
12 |
13 | import org.xml.sax.XMLReader;
14 |
15 | /**
16 | * Created by wldev on 3/10/17.
17 | */
18 |
19 | public class MyHTMLTagHandler implements Html.TagHandler {
20 |
21 | private static final String TAG = MyHTMLTagHandler.class.getSimpleName();
22 | private String listSymbol;
23 |
24 |
25 | public MyHTMLTagHandler(boolean useChecks) {
26 | if (useChecks)
27 | listSymbol = "✓";
28 | else
29 | listSymbol = "•";
30 | }
31 |
32 | private boolean first = true;
33 | private String parent = null;
34 | private int index = 1;
35 |
36 | @Override
37 | public void handleTag(boolean opening, String tag, Editable output,
38 | XMLReader xmlReader) {
39 |
40 | SpannableStringBuilder builder = new SpannableStringBuilder();
41 | ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(ContextCompat.getColor(MyApplication.get(), R.color.colorPrimary));
42 |
43 | if (tag.equals("ul")) parent = "ul";
44 | else if (tag.equals("ol")) parent = "ol";
45 | if (tag.equals("li")) {
46 | if (parent.equals("ul")) {
47 | if (first) {
48 | builder.append("\n\t").append(listSymbol).append(" ");
49 | builder.setSpan(foregroundColorSpan, "\n\t".length(), "\n\t".length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
50 | output.append(builder);
51 | // output.append("\n\t").append(listSymbol).append(" ");
52 | first = false;
53 | } else {
54 | first = true;
55 | }
56 | } else {
57 | if (first) {
58 | builder.append("\n\t").append(String.valueOf(index)).append(". ");
59 | output.append(builder);
60 | first = false;
61 | index++;
62 | } else {
63 | first = true;
64 | }
65 | }
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/extra/ViewAnimationUtils.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist.extra;
2 |
3 | import android.view.View;
4 | import android.view.ViewGroup;
5 | import android.view.animation.Animation;
6 | import android.view.animation.Transformation;
7 |
8 | /**
9 | * Created by wldev on 3/10/17.
10 | */
11 |
12 | public class ViewAnimationUtils {
13 |
14 | public static void expand(final View v, final AnimationEndCallback callback, boolean fast) {
15 | v.measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
16 | final int targtetHeight = v.getMeasuredHeight();
17 |
18 | v.getLayoutParams().height = 0;
19 | v.setVisibility(View.VISIBLE);
20 | Animation a = new Animation() {
21 | @Override
22 | protected void applyTransformation(float interpolatedTime, Transformation t) {
23 | v.getLayoutParams().height = interpolatedTime == 1
24 | ? ViewGroup.LayoutParams.WRAP_CONTENT
25 | : (int) (targtetHeight * interpolatedTime);
26 | v.requestLayout();
27 | }
28 |
29 | @Override
30 | public boolean willChangeBounds() {
31 | return true;
32 | }
33 | };
34 |
35 | int duration = 0;
36 |
37 | if (!fast) {
38 | duration = (int) (targtetHeight / v.getContext().getResources().getDisplayMetrics().density);
39 | }
40 |
41 | a.setDuration(duration);
42 | a.setAnimationListener(new Animation.AnimationListener() {
43 | @Override
44 | public void onAnimationStart(Animation animation) {
45 |
46 | }
47 |
48 | @Override
49 | public void onAnimationEnd(Animation animation) {
50 | if (callback != null)
51 | callback.onAnimationEnded();
52 | }
53 |
54 | @Override
55 | public void onAnimationRepeat(Animation animation) {
56 |
57 | }
58 | });
59 | v.startAnimation(a);
60 | }
61 |
62 | public static void collapse(final View v, final AnimationEndCallback callback, boolean fast) {
63 | final int initialHeight = v.getMeasuredHeight();
64 |
65 | Animation a = new Animation() {
66 | @Override
67 | protected void applyTransformation(float interpolatedTime, Transformation t) {
68 | if (interpolatedTime == 1) {
69 | v.setVisibility(View.GONE);
70 | } else {
71 | v.getLayoutParams().height = initialHeight - (int) (initialHeight * interpolatedTime);
72 | v.requestLayout();
73 | }
74 | }
75 |
76 | @Override
77 | public boolean willChangeBounds() {
78 | return true;
79 | }
80 | };
81 |
82 | int duration = 0;
83 | if (!fast) {
84 | duration = (int) (initialHeight / v.getContext().getResources().getDisplayMetrics().density);
85 | }
86 |
87 | a.setDuration(duration);
88 |
89 | a.setAnimationListener(new Animation.AnimationListener() {
90 | @Override
91 | public void onAnimationStart(Animation animation) {
92 |
93 | }
94 |
95 | @Override
96 | public void onAnimationEnd(Animation animation) {
97 | if (callback != null)
98 | callback.onAnimationEnded();
99 | }
100 |
101 | @Override
102 | public void onAnimationRepeat(Animation animation) {
103 |
104 | }
105 | });
106 | v.startAnimation(a);
107 | }
108 |
109 | interface AnimationEndCallback {
110 | void onAnimationEnded();
111 | }
112 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/recyclerview/BindingViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist.recyclerview;
2 |
3 | import android.databinding.DataBindingUtil;
4 | import android.databinding.ViewDataBinding;
5 | import android.support.annotation.LayoutRes;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.view.LayoutInflater;
8 | import android.view.ViewGroup;
9 |
10 | /**
11 | * Created by wldev on 3/10/17.
12 | */
13 |
14 | public class BindingViewHolder extends RecyclerView.ViewHolder {
15 |
16 | private ViewBinding binding;
17 |
18 | public BindingViewHolder(ViewBinding binding) {
19 | super(binding.getRoot());
20 | this.binding = binding;
21 | }
22 |
23 | public BindingViewHolder(@LayoutRes int layout, ViewGroup parent) {
24 | this(DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), layout, parent, false));
25 | }
26 |
27 | public ViewBinding getBinding() {
28 | return binding;
29 | }
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/wldev/expandablecardviewlist/recyclerview/ExpandableRecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.wldev.expandablecardviewlist.recyclerview;
2 |
3 | import android.animation.ValueAnimator;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | import com.wldev.expandablecardviewlist.R;
9 | import com.wldev.expandablecardviewlist.data.ExpandStateItem;
10 | import com.wldev.expandablecardviewlist.data.Item;
11 | import com.wldev.expandablecardviewlist.databinding.RvItemBinding;
12 | import com.wldev.expandablecardviewlist.extra.ClickAdapter;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | /**
18 | * Created by wldev on 3/10/17.
19 | */
20 |
21 | public class ExpandableRecyclerViewAdapter extends RecyclerView.Adapter> {
22 | private static final String TAG = ExpandableRecyclerViewAdapter.class.getSimpleName();
23 |
24 | private static final float MAX_MARGIN = 16;
25 | private static final float MIN_MARGIN = 2;
26 |
27 | private ValueAnimator marginAnimator = ValueAnimator.ofFloat(MAX_MARGIN, MIN_MARGIN); // replace with dimens
28 |
29 | private final List
- data = new ArrayList<>();
30 | private final List states = new ArrayList<>();
31 | private boolean isListExpanded;
32 |
33 | public ExpandableRecyclerViewAdapter(List
- originData) {
34 | marginAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
35 | @Override
36 | public void onAnimationUpdate(ValueAnimator animation) {
37 | for (ExpandStateItem item :
38 | states) {
39 | item.setMargin((float) animation.getAnimatedValue());
40 | }
41 | }
42 | });
43 |
44 | setData(originData);
45 | }
46 |
47 | @Override
48 | public BindingViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
49 | return new BindingViewHolder<>(R.layout.rv_item, parent);
50 | }
51 |
52 | @Override
53 | public void onBindViewHolder(final BindingViewHolder holder, int position) {
54 | holder.getBinding().setItem(data.get(holder.getAdapterPosition()));
55 | holder.getBinding().executePendingBindings(); // We need to set our item here because view will need to know how to measure itself (which data to use, how many text lines and so on)
56 |
57 |
58 | states.get(holder.getAdapterPosition()).setFast(true);
59 | holder.getBinding().setState(states.get(holder.getAdapterPosition()));
60 |
61 | holder.getBinding().setIsLast(holder.getAdapterPosition() == data.size() - 1);
62 | holder.getBinding().setIsFirst(holder.getAdapterPosition() == 0);
63 |
64 | holder.getBinding().setOnClick(new ClickAdapter() {
65 | @Override
66 | public void onClick(View v) {
67 | states.get(holder.getAdapterPosition()).setFast(false);
68 | states.get(holder.getAdapterPosition()).setExpanded(!states.get(holder.getAdapterPosition()).isExpanded()); // just to keep it short
69 | invalidateExpandedState();
70 | }
71 | });
72 |
73 | holder.getBinding().executePendingBindings();
74 | }
75 |
76 | @Override
77 | public int getItemCount() {
78 | return data.size();
79 | }
80 |
81 | private void invalidateExpandedState() {
82 | boolean isAnyExpanded = false;
83 | for (ExpandStateItem item :
84 | states) {
85 | isAnyExpanded = isAnyExpanded || item.isExpanded();
86 | }
87 |
88 | if (isListExpanded != isAnyExpanded) {
89 | if (!isAnyExpanded) {
90 | isListExpanded = false;
91 | marginAnimator.start();
92 | } else {
93 | isListExpanded = true;
94 | marginAnimator.reverse();
95 | }
96 | }
97 | }
98 |
99 | private void setData(List
- newData) {
100 | this.data.clear();
101 | this.states.clear();
102 |
103 | for (Item i :
104 | newData) {
105 | this.data.add(i);
106 | this.states.add(new ExpandStateItem(false)); // You can actually save expanded states here
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/scale_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/scale_anim_reverse.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/animator/path_morph_down_to_up.xml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/animator/path_morph_up_to_down.xml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/drawable-hdpi/ic_arrow_down.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_arrow_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/drawable-hdpi/ic_arrow_up.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/drawable-mdpi/ic_arrow_down.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_arrow_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/drawable-mdpi/ic_arrow_up.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/drawable-xhdpi/ic_arrow_down.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_arrow_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/drawable-xhdpi/ic_arrow_up.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/drawable-xxhdpi/ic_arrow_down.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_arrow_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/drawable-xxhdpi/ic_arrow_up.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
16 |
17 |
21 |
22 |
23 |
24 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/rv_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 |
15 |
16 |
19 |
20 |
23 |
24 |
27 |
28 |
29 |
37 |
38 |
39 |
45 |
46 |
54 |
55 |
56 |
60 |
61 |
68 |
69 |
81 |
82 |
83 |
90 |
91 |
99 |
100 |
105 |
106 |
113 |
114 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 0dp
4 | 2dp
5 | 4dp
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ExpandableCardViewList
3 | Subscribe
4 |
5 |
6 | Project members enjoy access to the following features and benefits:
7 |
8 |
9 | - Access to entire 5,000+ course library
10 | - Learning paths
11 | - Skill measurement
12 | - Exercise files
13 | - Course learning checks
14 | - Completion certificates
15 | - Mobile apps
16 | - Offline viewing
17 |
]]>
18 |
19 | Project members enjoy access to the following features and benefits:
20 |
21 |
22 | - Access to entire 5,000+ course library
23 | - Learning paths
24 |
]]>
25 |
26 | Project members enjoy access to the following features and benefits:
27 |
28 |
29 | - Access to entire 5,000+ course library
30 | - Learning paths
31 | - Mobile apps
32 | - Offline viewing
33 |
]]>
34 |
35 | Project members enjoy access to the following features and benefits:
36 |
37 |
38 | - Access to entire 5,000+ course library
39 | - Learning paths
40 | - Course learning checks
41 | - Completion certificates
42 | - Mobile apps
43 | - Offline viewing
44 |
]]>
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.2.1'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | google()
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
26 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Mar 10 12:31:10 EET 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-4.6-all.zip
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/screenrecord.webm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ekalips/ExpandableCardViewList/7cd98a77931a55fa54c7dc711416253283f6f4ef/screenrecord.webm
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------