This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Showing
14 changed files
with
219 additions
and
358 deletions.
There are no files selected for viewing
Binary file not shown.
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
Binary file renamed
BIN
+56.4 KB
com.haarman.listviewanimations-2.2.3.jar → com.haarman.listviewanimations-2.3.0.jar
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" > | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_horizontal" | ||
android:orientation="vertical" | ||
android:padding="8dp"> | ||
android:padding="8dp" > | ||
|
||
<Button | ||
android:layout_width="150dp" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:onClick="onStickyListHeadersClicked" | ||
android:text="@string/stickylistheaders" /> | ||
|
||
<Button | ||
android:layout_width="150dp" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:onClick="onBottomInClicked" | ||
android:text="@string/bottomin"/> | ||
android:text="@string/bottomin" /> | ||
|
||
<Button | ||
android:layout_width="150dp" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:onClick="onRightInClicked" | ||
android:text="@string/rightin"/> | ||
android:text="@string/rightin" /> | ||
|
||
<Button | ||
android:layout_width="150dp" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:onClick="onLeftInClicked" | ||
android:text="@string/leftin"/> | ||
android:text="@string/leftin" /> | ||
|
||
<Button | ||
android:layout_width="150dp" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:onClick="onBottomRightInClicked" | ||
android:text="@string/bottomrightin"/> | ||
android:text="@string/bottomrightin" /> | ||
|
||
<Button | ||
android:layout_width="150dp" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:onClick="onScaleInClicked" | ||
android:text="@string/scalein"/> | ||
android:text="@string/scalein" /> | ||
|
||
<Button | ||
android:layout_width="150dp" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:onClick="onAlphaInClicked" | ||
android:text="@string/alphain"/> | ||
|
||
android:text="@string/alphain" /> | ||
</LinearLayout> | ||
|
||
</ScrollView> |
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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" > | ||
|
||
<com.emilsjolander.components.stickylistheaders.StickyListHeadersListView | ||
android:id="@android:id/list" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" /> | ||
|
||
</LinearLayout> |
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
82 changes: 82 additions & 0 deletions
82
example/src/com/haarman/listviewanimations/animationinexamples/StickyListHeadersExample.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,82 @@ | ||
package com.haarman.listviewanimations.animationinexamples; | ||
|
||
import java.util.ArrayList; | ||
|
||
import android.app.ListActivity; | ||
import android.content.Context; | ||
import android.graphics.Color; | ||
import android.os.Bundle; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import com.emilsjolander.components.stickylistheaders.StickyListHeadersAdapter; | ||
import com.haarman.listviewanimations.ArrayAdapter; | ||
import com.haarman.listviewanimations.R; | ||
import com.haarman.listviewanimations.swinginadapters.prepared.AlphaInAnimationAdapter; | ||
|
||
public class StickyListHeadersExample extends ListActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_stickylistheaders); | ||
getListView().setDivider(null); | ||
|
||
MyStickyListAdapter myStickyListAdapter = new MyStickyListAdapter(this, getItems()); | ||
AlphaInAnimationAdapter animAdapter = new AlphaInAnimationAdapter(myStickyListAdapter); | ||
animAdapter.setAbsListView(getListView()); | ||
getListView().setAdapter(animAdapter); | ||
} | ||
|
||
public static ArrayList<Integer> getItems() { | ||
ArrayList<Integer> items = new ArrayList<Integer>(); | ||
for (int i = 0; i < 1000; i++) { | ||
items.add(i); | ||
} | ||
return items; | ||
} | ||
|
||
private static class MyStickyListAdapter extends ArrayAdapter<Integer> implements StickyListHeadersAdapter { | ||
|
||
private Context mContext; | ||
|
||
public MyStickyListAdapter(Context context, ArrayList<Integer> items) { | ||
super(items); | ||
mContext = context; | ||
} | ||
|
||
@Override | ||
public long getItemId(int position) { | ||
return getItem(position).hashCode(); | ||
} | ||
|
||
@Override | ||
public View getView(int position, View convertView, ViewGroup parent) { | ||
TextView tv = (TextView) convertView; | ||
if (tv == null) { | ||
tv = (TextView) LayoutInflater.from(mContext).inflate(R.layout.list_row, parent, false); | ||
} | ||
tv.setText("This is row number " + getItem(position)); | ||
return tv; | ||
} | ||
|
||
@Override | ||
public long getHeaderId(int position) { | ||
return getItem(position) / 10; | ||
} | ||
|
||
@Override | ||
public View getHeaderView(int position, View convertView, ViewGroup parent) { | ||
TextView tv = (TextView) convertView; | ||
if (tv == null) { | ||
tv = (TextView) LayoutInflater.from(mContext).inflate(R.layout.list_row, parent, false); | ||
tv.setBackgroundColor(Color.CYAN); | ||
} | ||
tv.setText(String.valueOf(getItem(position) / 10)); | ||
return tv; | ||
} | ||
} | ||
|
||
} |
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
Binary file not shown.
Oops, something went wrong.