Last active
August 29, 2015 14:10
-
-
Save frogermcs/58a327605fc020354658 to your computer and use it in GitHub Desktop.
InstaMaterial source files
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"?> | |
<!--drawable/btn_feed_action.xml--> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:enterFadeDuration="200" android:exitFadeDuration="200"> | |
<item android:state_pressed="false"> | |
<shape android:shape="oval"> | |
<solid android:color="@android:color/transparent" /> | |
</shape> | |
</item> | |
<item android:state_pressed="true"> | |
<shape android:shape="oval"> | |
<solid android:color="#6621425d" /> | |
</shape> | |
</item> | |
</selector> |
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"?> | |
<!--drawable-v21/btn_feed_action.xml--> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="?attr/colorPrimaryDark" /> |
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"?> | |
<!--drawable/btn_send_comment.xml--> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item android:state_pressed="false"> | |
<layer-list> | |
<item android:bottom="0dp" android:left="2dp" android:right="0dp" android:top="2dp"> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/fab_color_shadow" /> | |
<corners android:radius="2dp" /> | |
</shape> | |
</item> | |
<item android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp"> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/btn_send_normal" /> | |
<corners android:radius="2dp" /> | |
</shape> | |
</item> | |
</layer-list> | |
</item> | |
<item android:state_pressed="true"> | |
<shape android:bottom="0dp" android:left="2dp" android:right="0dp" android:shape="rectangle" android:top="2dp"> | |
<solid android:color="@color/btn_send_pressed" /> | |
<corners android:radius="2dp" /> | |
</shape> | |
</item> | |
</selector> |
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"?> | |
<!--drawable-v21/btn_send_comment.xml--> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="#ffffff"> | |
<item> | |
<shape android:shape="rectangle"> | |
<solid android:color="@color/btn_send_normal" /> | |
</shape> | |
</item> | |
</ripple> |
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"?> | |
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" | |
android:cycles="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"?> | |
<!-- item_feed.xml --> | |
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!--...--> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:paddingLeft="8dp" | |
android:paddingRight="8dp"> | |
<ImageButton | |
android:id="@+id/btnLike" | |
android:layout_width="48dp" | |
android:layout_height="48dp" | |
android:background="@drawable/btn_feed_action" | |
android:src="@drawable/ic_heart_outline_grey" /> | |
<ImageButton | |
android:id="@+id/btnComments" | |
android:layout_width="48dp" | |
android:layout_height="48dp" | |
android:background="@drawable/btn_feed_action" | |
android:src="@drawable/ic_comment_outline_grey" /> | |
</LinearLayout> | |
<!--...--> | |
</android.support.v7.widget.CardView> |
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 ActionBarActivity implements FeedAdapter.OnFeedItemClickListener { | |
//... | |
private void setupFeed() { | |
//Increase the amount of extra space that should be laid out by LayoutManager. | |
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this) { | |
@Override | |
protected int getExtraLayoutSpace(RecyclerView.State state) { | |
return 300; | |
} | |
}; | |
rvFeed.setLayoutManager(linearLayoutManager); | |
//... | |
} | |
//... | |
} |
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"?> | |
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="300" | |
android:fromXDelta="0%" | |
android:interpolator="@anim/cycle_2" | |
android:toXDelta="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"?> | |
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="100" | |
android:fromYDelta="80%p" | |
android:interpolator="@android:anim/linear_interpolator" | |
android:toYDelta="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
<?xml version="1.0" encoding="utf-8"?> | |
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="100" | |
android:fromYDelta="-80%p" | |
android:interpolator="@android:anim/linear_interpolator" | |
android:toYDelta="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
<?xml version="1.0" encoding="utf-8"?> | |
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="100" | |
android:fromYDelta="0" | |
android:interpolator="@android:anim/linear_interpolator" | |
android:toYDelta="80%p" /> |
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"?> | |
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="100" | |
android:fromYDelta="0" | |
android:interpolator="@android:anim/linear_interpolator" | |
android:toYDelta="-80%p" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment