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
const UserCard = ({ user, withAvatar }) => { | |
return ( | |
<div> | |
{ withAvatar && <img src={user.avatarUrl}/> } | |
<span> | |
{user.name} | |
</span> | |
<span> | |
{user.info} | |
</span> |
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
const UserCard = ({ user, withAvatar }) => { | |
return ( | |
<div> | |
{ withAvatar && <img src={user.avatarUrl}/> } | |
<span> | |
{user.name} | |
</span> | |
<span> | |
{user.info} | |
</span> |
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
const UserCard = ({ user, withAvatar }) => { | |
return ( | |
<div> | |
{ withAvatar && <img src={user.avatarUrl}/> } | |
<span> | |
user.name | |
</span> | |
<span> | |
user.info | |
</span> |
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
final View container = findViewById(R.id.container); | |
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) container.getLayoutParams(); | |
final CoordinatorLayout.Behavior<View> behavior = new CoordinatorLayout.Behavior<View>() { | |
@Override | |
public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) { | |
return dependency.getId() == R.id.dismiss; | |
} | |
@Override | |
public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) { |
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 SwipeDismissOnlyOnViewBehavior<V extends View> extends SwipeDismissBehavior<V> { | |
/** | |
* Handle only touches on this current view | |
*/ | |
@Override | |
public boolean onTouchEvent(CoordinatorLayout parent, V child, MotionEvent event) { | |
if (parent.isPointInChildBounds(child, (int) event.getX(), (int) event.getY())) { | |
return super.onTouchEvent(parent, child, event); | |
} |
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
View dismiss = findViewById(R.id.dismiss); | |
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) dismiss.getLayoutParams(); | |
SwipeDismissBehavior<View> behavior = new SwipeDismissBehavior<>(); | |
behavior.setSwipeDirection(SwipeDismissBehavior.SWIPE_DIRECTION_START_TO_END); | |
behavior.setListener(new SwipeDismissBehavior.OnDismissListener() { | |
@Override | |
public void onDismiss(final View view) { | |
finish(); | |
} |
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"?> | |
<android.support.design.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<FrameLayout android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:id="@+id/container" | |
android:background="#06ff87"/> |
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
<animated-vector | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:drawable="@drawable/searchback_search"> | |
<target | |
android:name="line" | |
android:animation="@animator/line_to_cancel" /> | |
<target | |
android:name="circle1" |
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
<set | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:ordering="together"> | |
<objectAnimator | |
android:propertyName="trimPathStart" | |
android:valueFrom="0.4" | |
android:valueTo="0" | |
android:duration="600" /> |
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
<set | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:ordering="together"> | |
<objectAnimator | |
android:propertyName="trimPathStart" | |
android:valueFrom="0" | |
android:valueTo="0.6" | |
android:duration="450" /> |
NewerOlder