-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from aitsuki/fix-9
Fix #9
- Loading branch information
Showing
9 changed files
with
176 additions
and
24 deletions.
There are no files selected for viewing
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
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
28 changes: 28 additions & 0 deletions
28
demo/src/main/java/com/aitsuki/swipedemo/items/WithMarginItem.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.aitsuki.swipedemo.items | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import android.widget.Toast | ||
import com.aitsuki.swipedemo.BaseItem | ||
import com.aitsuki.swipedemo.databinding.ItemWithMarginBinding | ||
|
||
class WithMarginItem : BaseItem<ItemWithMarginBinding>() { | ||
|
||
override fun inflate(inflater: LayoutInflater, parent: ViewGroup): ItemWithMarginBinding { | ||
return ItemWithMarginBinding.inflate(inflater, parent, false) | ||
} | ||
|
||
override val bindFun = fun (binding: ItemWithMarginBinding, position: Int) { | ||
binding.content.text = "With margin $position" | ||
binding.content.setOnClickListener { | ||
Toast.makeText(it.context, "With margin $position", Toast.LENGTH_SHORT).show() | ||
} | ||
binding.leftMenu.setOnClickListener { | ||
Toast.makeText(it.context, "LEFT $position", Toast.LENGTH_SHORT).show() | ||
} | ||
binding.rightMenu.setOnClickListener { | ||
Toast.makeText(it.context, "RIGHT $position", Toast.LENGTH_SHORT).show() | ||
} | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
demo/src/main/java/com/aitsuki/swipedemo/items/WithPaddingItem.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.aitsuki.swipedemo.items | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import android.widget.Toast | ||
import com.aitsuki.swipedemo.BaseItem | ||
import com.aitsuki.swipedemo.databinding.ItemWithPaddingBinding | ||
|
||
class WithPaddingItem : BaseItem<ItemWithPaddingBinding>() { | ||
|
||
override fun inflate(inflater: LayoutInflater, parent: ViewGroup): ItemWithPaddingBinding { | ||
return ItemWithPaddingBinding.inflate(inflater, parent, false) | ||
} | ||
|
||
override val bindFun = fun (binding: ItemWithPaddingBinding, position: Int) { | ||
binding.content.text = "With padding $position" | ||
binding.content.setOnClickListener { | ||
Toast.makeText(it.context, "With padding $position", Toast.LENGTH_SHORT).show() | ||
} | ||
binding.leftMenu.setOnClickListener { | ||
Toast.makeText(it.context, "LEFT $position", Toast.LENGTH_SHORT).show() | ||
} | ||
binding.rightMenu.setOnClickListener { | ||
Toast.makeText(it.context, "RIGHT $position", Toast.LENGTH_SHORT).show() | ||
} | ||
} | ||
|
||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<com.aitsuki.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="80dp" | ||
android:layout_margin="10dp" | ||
app:autoClose="true" | ||
app:designer="@string/classic_designer" | ||
app:preview="none"> | ||
|
||
<TextView | ||
android:id="@+id/left_menu" | ||
android:layout_width="100dp" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="start" | ||
android:background="@color/red500" | ||
android:gravity="center" | ||
android:text="LEFT" | ||
android:textSize="18sp" /> | ||
|
||
<TextView | ||
android:id="@+id/right_menu" | ||
android:layout_width="100dp" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="end" | ||
android:background="@color/blue500" | ||
android:gravity="center" | ||
android:text="RIGHT" | ||
android:textSize="18sp" /> | ||
|
||
<TextView | ||
android:id="@+id/content" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/white" | ||
android:gravity="center" | ||
android:text="With margin" | ||
android:textSize="18sp" /> | ||
|
||
</com.aitsuki.swipe.SwipeLayout> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<com.aitsuki.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="100dp" | ||
android:padding="10dp" | ||
app:autoClose="true" | ||
app:designer="@string/classic_designer" | ||
app:preview="none"> | ||
|
||
<TextView | ||
android:id="@+id/left_menu" | ||
android:layout_width="100dp" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="start" | ||
android:background="@color/red500" | ||
android:gravity="center" | ||
android:text="LEFT" | ||
android:textSize="18sp" /> | ||
|
||
<TextView | ||
android:id="@+id/right_menu" | ||
android:layout_width="100dp" | ||
android:layout_height="match_parent" | ||
android:layout_gravity="end" | ||
android:background="@color/blue500" | ||
android:gravity="center" | ||
android:text="RIGHT" | ||
android:textSize="18sp" /> | ||
|
||
<TextView | ||
android:id="@+id/content" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/white" | ||
android:gravity="center" | ||
android:text="With padding" | ||
android:textSize="18sp" /> | ||
|
||
</com.aitsuki.swipe.SwipeLayout> |
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