Skip to content

Commit

Permalink
Update pending type (#5384)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeniorZhai authored Mar 7, 2025
1 parent fa73e7a commit 9faac7a
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,11 @@ class AllTransactionsFragment : BaseTransactionsFragment<PagedList<SnapshotItem>
1 -> SnapshotType.deposit
2 -> SnapshotType.withdrawal
3 -> SnapshotType.snapshot
4 -> SnapshotType.pending
else -> SnapshotType.all
}
if (filterParams.recipients?.isNotEmpty() == true) {
if (filterParams.type == SnapshotType.deposit || filterParams.type == SnapshotType.withdrawal) {
if (filterParams.type == SnapshotType.deposit || filterParams.type == SnapshotType.withdrawal || filterParams.type == SnapshotType.pending) {
filterParams.recipients = filterParams.recipients?.filterIsInstance<AddressItem>()
} else if (filterParams.type == SnapshotType.snapshot) {
filterParams.recipients = filterParams.recipients?.filterIsInstance<UserItem>()
Expand Down Expand Up @@ -449,6 +450,7 @@ class AllTransactionsFragment : BaseTransactionsFragment<PagedList<SnapshotItem>
TypeMenuData(SnapshotType.deposit, R.drawable.ic_menu_type_deoisit, R.string.Deposit),
TypeMenuData(SnapshotType.withdrawal, R.drawable.ic_menu_type_withdrawal, R.string.Withdrawal),
TypeMenuData(SnapshotType.snapshot, R.drawable.ic_menu_type_transfer, R.string.Transfer),
TypeMenuData(SnapshotType.pending, R.drawable.ic_menu_type_pending, R.string.Pending),
)
TypeMenuAdapter(requireContext(), menuItems).apply {
checkPosition = filterParams.type.value
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/java/one/mixin/android/ui/wallet/FilterParams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class FilterParams(
SnapshotType.withdrawal -> R.string.Withdrawal
SnapshotType.deposit -> R.string.Deposit
SnapshotType.snapshot -> R.string.Transfer
SnapshotType.pending -> R.string.Pending
}
}

Expand All @@ -62,6 +63,10 @@ class FilterParams(
filters.add("s.deposit != 'null'")
}

SnapshotType.pending -> {
filters.add("s.type == 'pending'")
}

SnapshotType.withdrawal -> {
filters.add("s.withdrawal IS NOT NULL")
filters.add("s.withdrawal != 'null'")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ enum class SnapshotType(val value: Int) {
all(0),
deposit(1),
withdrawal(2),
snapshot(3);
snapshot(3),
pending(4);

companion object {
fun fromInt(value: Int): SnapshotType {
Expand Down
34 changes: 34 additions & 0 deletions app/src/main/res/drawable/ic_menu_type_pending.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18,5L6,5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/icon_black"
android:strokeLineCap="round"/>
<path
android:pathData="M18,19L6,19"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/icon_black"
android:strokeLineCap="round"/>
<path
android:pathData="M16,6C16,8.651 14.209,12 12,12C9.791,12 8,8.651 8,6"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/icon_black"
android:strokeLineCap="round"/>
<path
android:pathData="M16,18C16,15.054 14.209,12 12,12C9.791,12 8,15.054 8,18"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/icon_black"
android:strokeLineCap="round"/>
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
<string name="Delete_Synced_Contact">删除已同步的通讯录</string>
<string name="Delete_withdraw_Address">删除 %1$s 地址</string>
<string name="Deposit">充值</string>
<string name="Pending">确认中</string>
<string name="deposit_account_attention">注意:首次充值建议小额尝试!地址和 Memo(备注)同时使用才能充值 %1$s 到 Mixin Messenger。</string>
<string name="deposit_attention">首次充值建议小额尝试!</string>
<plurals name="deposit_confirmation" tools:ignore="UnusedQuantity">
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
<string name="Delete_Synced_Contact">Delete Synced Contacts</string>
<string name="Delete_withdraw_Address">Delete %1$s Address</string>
<string name="Deposit">Deposit</string>
<string name="Pending">Pending</string>
<string name="deposit_account_attention">Attention: Please try a small amount for the first deposit. Both a Memo and an Address are required to successfully deposit your %1$s to Mixin Messenger.</string>
<string name="deposit_attention">Please try a small amount for the first deposit.</string>
<plurals name="deposit_confirmation">
Expand Down

0 comments on commit 9faac7a

Please sign in to comment.