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
dependencies { | |
implementation fileTree(dir: 'libs', include: ['*.jar']) | |
implementation 'com.android.support:appcompat-v7:28.0.0' | |
implementation 'com.android.support:design:28.0.0' | |
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | |
testImplementation 'junit:junit:4.12' | |
androidTestImplementation 'com.android.support.test:runner:1.0.2' | |
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<com.balysv.materialripple.MaterialRippleLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<LinearLayout | |
android:id="@+id/parentLayout" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:clickable="true" |
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
public class Person { | |
public int image; | |
public String name; | |
public String description; | |
public Person() { | |
} |
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
public class RecyclerAnimationAdapter extends RecyclerView.Adapter<RecyclerAnimationAdapter.ViewHolder> { | |
Context context; | |
List<Person> list; | |
public RecyclerAnimationAdapter(Context context, List<Person> personList) { | |
this.context = context; | |
this.list = personList; |
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
<string-array name="people_names"> | |
<item>Anderson Thomas</item> | |
<item>Adams Green</item> | |
<item>Laura Michelle</item> | |
<item>Betty L</item> | |
<item>Miller Wilson</item> | |
<item>Garcia Lewis</item> | |
<item>Roberts Turner</item> | |
<item>Mary Jackson</item> | |
<item>Sarah Scott</item> |
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
public class MainActivity extends AppCompatActivity { | |
ActivityMainBinding bi; | |
List<Person> list; | |
RecyclerAnimationAdapter adapter; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layout> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
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
public class RecyclerAnimationAdapter extends RecyclerView.Adapter<RecyclerAnimationAdapter.ViewHolder> { | |
Context context; | |
List<Person> list; | |
long DURATION = 500; | |
private boolean on_attach = true; | |
public RecyclerAnimationAdapter(Context context, List<Person> personList) { |
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
private void FromLeftToRight(View itemView, int i) { | |
if(!on_attach){ | |
i = -1; | |
} | |
boolean not_first_item = i == -1; | |
i = i + 1; | |
itemView.setTranslationX(-400f); | |
itemView.setAlpha(0.f); | |
AnimatorSet animatorSet = new AnimatorSet(); | |
ObjectAnimator animatorTranslateY = ObjectAnimator.ofFloat(itemView, "translationX", -400f, 0); |
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
private void FromRightToLeft(View itemView, int i) { | |
if(!on_attach){ | |
i = -1; | |
} | |
boolean not_first_item = i == -1; | |
i = i + 1; | |
itemView.setTranslationX(itemView.getX() + 400); | |
itemView.setAlpha(0.f); | |
AnimatorSet animatorSet = new AnimatorSet(); | |
ObjectAnimator animatorTranslateY = ObjectAnimator.ofFloat(itemView, "translationX", itemView.getX() + 400, 0); |
OlderNewer