forked from Ramotion/expanding-collection-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53fcd1a
commit daae27c
Showing
18 changed files
with
321 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 17 additions & 25 deletions
42
expanding-collection-simple-example/src/main/res/layout/list_element.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_height="100dp" | ||
android:padding="15dip"> | ||
|
||
<ImageView | ||
android:id="@+id/icon" | ||
android:layout_width="wrap_content" | ||
android:layout_height="fill_parent" | ||
android:layout_alignParentBottom="true" | ||
android:layout_alignParentTop="true" | ||
android:layout_marginRight="6dip" | ||
android:contentDescription="TODO" /> | ||
android:layout_width="50dp" | ||
android:layout_height="50dp" | ||
android:layout_alignParentTop="true" /> | ||
|
||
<TextView | ||
android:id="@+id/secondLine" | ||
android:layout_width="fill_parent" | ||
android:layout_height="26dip" | ||
android:layout_alignParentBottom="true" | ||
android:layout_alignParentRight="true" | ||
android:id="@+id/firstLine" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_alignTop="@id/icon" | ||
android:layout_toEndOf="@id/icon" | ||
android:layout_toRightOf="@id/icon" | ||
android:ellipsize="marquee" | ||
android:maxLines="1" | ||
android:text="Description" | ||
android:textSize="12sp" /> | ||
android:text="Example application" /> | ||
|
||
<TextView | ||
android:id="@+id/firstLine" | ||
android:layout_width="fill_parent" | ||
android:id="@+id/secondLine" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_above="@id/secondLine" | ||
android:layout_alignParentRight="true" | ||
android:layout_alignParentTop="true" | ||
android:layout_alignWithParentIfMissing="true" | ||
android:layout_alignLeft="@id/firstLine" | ||
android:layout_alignStart="@id/firstLine" | ||
android:layout_below="@id/firstLine" | ||
android:layout_toEndOf="@id/icon" | ||
android:layout_toRightOf="@id/icon" | ||
android:gravity="center_vertical" | ||
android:text="Example application" | ||
android:textSize="16sp" /> | ||
android:text="Description" /> | ||
|
||
</RelativeLayout> |
21 changes: 0 additions & 21 deletions
21
expanding-collection/src/main/java/com/ramotion/expandingcollection/AnimationListener.java
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
...g-collection/src/main/java/com/ramotion/expandingcollection/ECCardContentListAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.ramotion.expandingcollection; | ||
|
||
import android.content.Context; | ||
import android.support.annotation.LayoutRes; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ArrayAdapter; | ||
|
||
import java.util.List; | ||
|
||
public abstract class ECCardContentListAdapter<T> extends ArrayAdapter<T> { | ||
private boolean zeroItemsMode = true; | ||
|
||
public ECCardContentListAdapter(@NonNull Context context, @LayoutRes int resource, @NonNull List<T> objects) { | ||
super(context, resource, objects); | ||
} | ||
|
||
@Override | ||
public final int getCount() { | ||
return zeroItemsMode ? 0 : super.getCount(); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public abstract View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent); | ||
|
||
protected final void enableZeroItemsMode() { | ||
this.zeroItemsMode = true; | ||
notifyDataSetChanged(); | ||
} | ||
|
||
protected final void disableZeroItemsMode() { | ||
this.zeroItemsMode = false; | ||
notifyDataSetChanged(); | ||
} | ||
|
||
} |
Oops, something went wrong.