-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WalletDetails showing token price and genuineness #9
- Loading branch information
1 parent
24d0aeb
commit fe0a0c6
Showing
12 changed files
with
197 additions
and
103 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
41 changes: 0 additions & 41 deletions
41
android/src/main/java/org/ergoplatform/android/tokens/WalletDetailsView.kt
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
android/src/main/java/org/ergoplatform/android/tokens/WalletEntryView.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,40 @@ | ||
package org.ergoplatform.android.tokens | ||
|
||
import org.ergoplatform.android.databinding.EntryWalletTokenDetailsBinding | ||
import org.ergoplatform.android.ui.AndroidStringProvider | ||
import org.ergoplatform.android.ui.setTextAndVisibility | ||
import org.ergoplatform.persistance.WalletToken | ||
import org.ergoplatform.uilogic.StringProvider | ||
import org.ergoplatform.uilogic.tokens.WalletEntryViewUiLogic | ||
|
||
class WalletEntryView(val binding: EntryWalletTokenDetailsBinding, walletToken: WalletToken) : | ||
WalletEntryViewUiLogic(walletToken) { | ||
override val texts: StringProvider | ||
get() = AndroidStringProvider(binding.root.context) | ||
|
||
override fun setDisplayedTokenName(tokenName: String) { | ||
binding.labelTokenName.text = tokenName | ||
} | ||
|
||
override fun setGenuineFlag(genuineFlag: Int) { | ||
binding.labelTokenName.setCompoundDrawablesRelativeWithIntrinsicBounds( | ||
0, | ||
0, | ||
getGenuineDrawableId(genuineFlag), | ||
0 | ||
) | ||
} | ||
|
||
override fun setDisplayedTokenId(tokenId: String?) { | ||
binding.labelTokenId.setTextAndVisibility(tokenId) | ||
} | ||
|
||
override fun setDisplayedBalance(value: String?) { | ||
binding.labelTokenVal.setTextAndVisibility(value) | ||
} | ||
|
||
override fun setDisplayedPrice(price: String?) { | ||
binding.labelBalanceValue.setTextAndVisibility(price) | ||
} | ||
|
||
} |
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
77 changes: 50 additions & 27 deletions
77
android/src/main/res/layout/entry_wallet_token_details.xml
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 |
---|---|---|
@@ -1,52 +1,75 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="?selectableItemBackground" | ||
android:orientation="vertical" | ||
android:minHeight="55dp" | ||
android:paddingVertical="5dp" | ||
tools:showIn="@layout/fragment_wallet_details"> | ||
|
||
<LinearLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:orientation="horizontal"> | ||
android:orientation="vertical" | ||
tools:ignore="UselessParent"> | ||
|
||
<LinearLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/label_token_val" | ||
style="@style/TextAppearance.App.Body1" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:layout_marginHorizontal="6dp" | ||
android:maxLines="1" | ||
android:textStyle="bold" | ||
tools:text="1230000" /> | ||
|
||
<TextView | ||
android:id="@+id/label_token_name" | ||
style="@style/TextAppearance.App.Body1" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:drawablePadding="@dimen/small_padding" | ||
android:ellipsize="end" | ||
android:maxLines="1" | ||
app:drawableTint="@color/primary" | ||
tools:drawableEnd="@drawable/ic_verified_24" | ||
tools:text="Very long NFT name here" /> | ||
|
||
</LinearLayout> | ||
|
||
<TextView | ||
android:id="@+id/label_token_val" | ||
style="@style/TextAppearance.App.Body1" | ||
android:id="@+id/label_token_id" | ||
style="@style/TextAppearance.App.Body2" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:layout_marginHorizontal="6dp" | ||
android:layout_marginHorizontal="@dimen/half_horizontal_margin" | ||
android:ellipsize="middle" | ||
android:maxLines="1" | ||
android:textStyle="bold" | ||
tools:text="1230000" /> | ||
android:textColor="@color/darkgrey" | ||
tools:text="ba5856162d6342d2a0072f464a5a8b62b4ac4dd77195bec18c6bf268c2def831" /> | ||
|
||
<TextView | ||
android:id="@+id/label_token_name" | ||
android:id="@+id/label_balance_value" | ||
style="@style/TextAppearance.App.Body1" | ||
android:layout_width="match_parent" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:ellipsize="end" | ||
android:maxLines="1" | ||
tools:text="Very long NFT name here" /> | ||
android:gravity="center" | ||
android:maxLines="5" | ||
android:textColor="@color/lightgrey" | ||
tools:text="904.2 ERG" /> | ||
|
||
</LinearLayout> | ||
|
||
<TextView | ||
android:id="@+id/label_token_id" | ||
style="@style/TextAppearance.App.Body2" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="@dimen/half_horizontal_margin" | ||
android:ellipsize="middle" | ||
android:gravity="center" | ||
android:maxLines="1" | ||
android:textColor="@color/darkgrey" | ||
tools:text="ba5856162d6342d2a0072f464a5a8b62b4ac4dd77195bec18c6bf268c2def831" /> | ||
|
||
|
||
</LinearLayout> | ||
</FrameLayout> |
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
Oops, something went wrong.