This file contains hidden or 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"?> | |
<!-- | |
Copyright 2017 Google Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | |
in compliance with the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software distributed under the License |
This file contains hidden or 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
-- Example table | |
CREATE TABLE ring_buffer (id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT); | |
-- Number 10 on where statement defines the ring buffer's size | |
CREATE TRIGGER delete_tail AFTER INSERT ON ring_buffer | |
BEGIN | |
DELETE FROM ring_buffer WHERE id%10=NEW.id%10 AND id!=NEW.id; | |
END; |
This file contains hidden or 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
<com.patrickiv.demo.enteranimationdemo.recyclerview.GridRecyclerView | |
android:id="@+id/recycler_view" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:layoutAnimation="@anim/grid_layout_animation_from_bottom" | |
/> |
This file contains hidden or 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
int resId = R.anim.grid_layout_animation_from_bottom; | |
LayoutAnimationController animation = AnimationUtils.loadLayoutAnimation(ctx, resId); | |
recyclerview.setLayoutAnimation(animation); |
This file contains hidden or 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
com.patrickiv.demo.enteranimationdemo E/AndroidRuntime: FATAL EXCEPTION: main | |
Process: com.patrickiv.demo.enteranimationdemo, PID: 19510 | |
java.lang.ClassCastException: android.view.animation.LayoutAnimationController$AnimationParameters cannot be cast to android.view.animation.GridLayoutAnimationController$AnimationParameters | |
at android.view.animation.GridLayoutAnimationController.getDelayForView(GridLayoutAnimationController.java:299) | |
at android.view.animation.LayoutAnimationController.getAnimationForView(LayoutAnimationController.java:323) | |
at android.view.ViewGroup.bindLayoutAnimation(ViewGroup.java:4584) | |
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3453) | |
at android.view.View.draw(View.java:17240) | |
at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:3985) | |
... |
This file contains hidden or 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
/** | |
* RecyclerView with support for grid animations. | |
* | |
* Based on: | |
* https://gist.github.com/Musenkishi/8df1ab549857756098ba | |
* Credit to Freddie (Musenkishi) Lust-Hed | |
* | |
* ...which in turn is based on the GridView implementation of attachLayoutParameters(...): | |
* https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/widget/GridView.java | |
* |
This file contains hidden or 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"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="@integer/anim_duration_long"> | |
<translate | |
android:interpolator="@android:anim/accelerate_decelerate_interpolator" | |
android:fromYDelta="50%p" | |
android:toYDelta="0" | |
/> |
This file contains hidden or 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"?> | |
<gridLayoutAnimation | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:animation="@anim/item_animation_from_bottom" | |
android:animationOrder="normal" | |
android:columnDelay="15%" | |
android:rowDelay="15%" | |
android:direction="top_to_bottom|left_to_right" | |
/> |
This file contains hidden or 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"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="@integer/anim_duration_long"> | |
<translate | |
android:interpolator="@android:anim/accelerate_decelerate_interpolator" | |
android:fromYDelta="50%p" | |
android:toYDelta="0" | |
/> |
This file contains hidden or 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"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="@integer/anim_duration_long"> | |
<translate | |
android:interpolator="@android:anim/decelerate_interpolator" | |
android:fromXDelta="100%p" | |
android:toXDelta="0" | |
/> |