Skip to content

Commit

Permalink
Added swipe to delete icon
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-yun committed Jul 17, 2018
1 parent b69cc1b commit 1f146da
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .idea/assetWizardSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected void onPostExecute(Profile result) {

final LinearLayout fContent = content;
final ProgressBar fProgressBar = progressBar;

// Make sure animation is finished
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>
16 changes: 6 additions & 10 deletions app/src/main/res/layout/list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,27 @@
app:rightViewId="@+id/item_right"
app:swipeViewId="@+id/item_layout">

<TextView
<ImageView
android:id="@+id/item_left"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/item_layout"
android:layout_alignTop="@+id/item_layout"
android:background="#f44336"
android:gravity="start|center_vertical"
android:scaleType="fitStart"
android:padding="16dp"
android:text="Delete"
android:textColor="@android:color/white"
android:textSize="20sp" />
android:src="@drawable/ic_delete"/>

<TextView
<ImageView
android:id="@+id/item_right"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/item_layout"
android:layout_alignTop="@+id/item_layout"
android:background="#f44336"
android:gravity="end|center_vertical"
android:scaleType="fitEnd"
android:padding="16dp"
android:text="Delete"
android:textColor="@android:color/white"
android:textSize="20sp" />
android:src="@drawable/ic_delete" />

<RelativeLayout
android:id="@+id/item_layout"
Expand Down

0 comments on commit 1f146da

Please sign in to comment.