mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-09 20:53:47 +01:00
Add amount to subaddress list
This commit is contained in:
parent
ea0849a88c
commit
fd78ebc89c
@ -30,6 +30,7 @@ import net.mynero.wallet.model.CoinsInfo;
|
||||
import net.mynero.wallet.model.Wallet;
|
||||
import net.mynero.wallet.service.PrefService;
|
||||
import net.mynero.wallet.util.Constants;
|
||||
import net.mynero.wallet.util.Helper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -94,6 +95,7 @@ public class SubaddressAdapter extends RecyclerView.Adapter<SubaddressAdapter.Vi
|
||||
public void bind(Subaddress subaddress) {
|
||||
TextView addressTextView = itemView.findViewById(R.id.address_item_address_textview);
|
||||
TextView addressLabelTextView = itemView.findViewById(R.id.address_label_textview);
|
||||
TextView addressAmountTextView = itemView.findViewById(R.id.address_amount_textview);
|
||||
|
||||
addressTextView.setText(subaddress.getAddress());
|
||||
|
||||
@ -102,6 +104,19 @@ public class SubaddressAdapter extends RecyclerView.Adapter<SubaddressAdapter.Vi
|
||||
subaddress.getAddressIndex(), subaddress.getSquashedAddress());
|
||||
addressLabelTextView.setText(label.isEmpty() ? address : label);
|
||||
|
||||
final long amount = subaddress.getAmount();
|
||||
if (amount > 0) {
|
||||
boolean streetMode = PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false);
|
||||
if(streetMode) {
|
||||
addressAmountTextView.setText(itemView.getContext().getString(R.string.tx_list_amount_positive,
|
||||
Constants.STREET_MODE_BALANCE));
|
||||
} else {
|
||||
addressAmountTextView.setText(itemView.getContext().getString(R.string.tx_list_amount_positive,
|
||||
Helper.getDisplayAmount(amount, Helper.DISPLAY_DIGITS_INFO)));
|
||||
}
|
||||
}
|
||||
else
|
||||
addressAmountTextView.setText("");
|
||||
|
||||
itemView.setOnClickListener(view -> listener.onSubaddressSelected(subaddress));
|
||||
}
|
||||
|
@ -35,4 +35,20 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:singleLine="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/address_amount_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="Amount"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:ellipsize="middle"
|
||||
android:textAlignment="viewEnd"
|
||||
android:textColor="@color/oled_positiveColor"
|
||||
app:layout_constraintTop_toBottomOf="@id/address_item_address_textview"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/address_label_textview"
|
||||
android:singleLine="true" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<color name="oled_toolbarTextColor">#F4F4F4</color>
|
||||
<color name="oled_favouriteColor">#cb5a2e</color>
|
||||
<color name="oled_softFavouriteColor">#FF104E</color>
|
||||
<color name="oled_positiveColor">#19ED60</color>
|
||||
<color name="oled_positiveColor">#13D855</color>
|
||||
<color name="oled_negativeColor">#CB2E2E</color>
|
||||
<color name="oled_neutralColor">#838383</color>
|
||||
<color name="oled_noticeColor">#7E37F1</color>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<color name="oled_toolbarTextColor">@color/oled_colorOnBackground</color>
|
||||
<color name="oled_favouriteColor">#f38854</color>
|
||||
<color name="oled_softFavouriteColor">@color/oled_favouriteColor</color>
|
||||
<color name="oled_positiveColor">#19ED60</color>
|
||||
<color name="oled_positiveColor">#13D855</color>
|
||||
<color name="oled_negativeColor">#f38854</color>
|
||||
<color name="oled_neutralColor">#171717</color>
|
||||
<color name="oled_noticeColor">#3DC2FF</color>
|
||||
|
Loading…
Reference in New Issue
Block a user