Skip to content

Commit

Permalink
Transaction confidence indicator shall stay on the top left even for …
Browse files Browse the repository at this point in the history
…selected cards.
  • Loading branch information
schildbach committed May 7, 2015
1 parent e024d33 commit b875d6f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
12 changes: 11 additions & 1 deletion wallet/res/layout/transaction_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,21 @@
android:paddingBottom="2dp"
android:visibility="gone" >

<Space
<de.schildbach.wallet.util.CircularProgressView
android:id="@+id/transaction_row_confidence_circular_selected"
android:layout_width="@dimen/symbol_size_normal"
android:layout_height="@dimen/symbol_size_normal"
android:layout_marginRight="8dp" />

<TextView
android:id="@+id/transaction_row_confidence_textual_selected"
android:layout_width="@dimen/symbol_size_normal"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:gravity="center_horizontal|top"
android:singleLine="true"
android:textStyle="bold" />

<TextView
android:id="@+id/transaction_row_full_time"
android:layout_width="wrap_content"
Expand Down
15 changes: 11 additions & 4 deletions wallet/src/de/schildbach/wallet/ui/TransactionsAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ private class TransactionViewHolder extends RecyclerView.ViewHolder
{
private final View extendTimeView;
private final TextView fullTimeView;
private final CircularProgressView confidenceCircularView;
private final TextView confidenceTextualView;
private final CircularProgressView confidenceCircularNormalView, confidenceCircularSelectedView;
private final TextView confidenceTextualNormalView, confidenceTextualSelectedView;
private final TextView timeView;
private final TextView addressView;
private final View extendFeeView;
Expand All @@ -321,8 +321,10 @@ private TransactionViewHolder(final View itemView)

extendTimeView = itemView.findViewById(R.id.transaction_row_extend_time);
fullTimeView = (TextView) itemView.findViewById(R.id.transaction_row_full_time);
confidenceCircularView = (CircularProgressView) itemView.findViewById(R.id.transaction_row_confidence_circular);
confidenceTextualView = (TextView) itemView.findViewById(R.id.transaction_row_confidence_textual);
confidenceCircularNormalView = (CircularProgressView) itemView.findViewById(R.id.transaction_row_confidence_circular);
confidenceCircularSelectedView = (CircularProgressView) itemView.findViewById(R.id.transaction_row_confidence_circular_selected);
confidenceTextualNormalView = (TextView) itemView.findViewById(R.id.transaction_row_confidence_textual);
confidenceTextualSelectedView = (TextView) itemView.findViewById(R.id.transaction_row_confidence_textual_selected);
timeView = (TextView) itemView.findViewById(R.id.transaction_row_time);
addressView = (TextView) itemView.findViewById(R.id.transaction_row_address);
extendFeeView = itemView.findViewById(R.id.transaction_row_extend_fee);
Expand Down Expand Up @@ -386,6 +388,11 @@ else if (DefaultCoinSelector.isSelectable(tx))
}

// confidence
final CircularProgressView confidenceCircularView = itemView.isActivated() ? confidenceCircularSelectedView
: confidenceCircularNormalView;
final TextView confidenceTextualView = itemView.isActivated() ? confidenceTextualSelectedView : confidenceTextualNormalView;
(itemView.isActivated() ? confidenceCircularNormalView : confidenceCircularSelectedView).setVisibility(View.INVISIBLE);
(itemView.isActivated() ? confidenceTextualNormalView : confidenceTextualSelectedView).setVisibility(View.GONE);
if (confidenceType == ConfidenceType.PENDING)
{
confidenceCircularView.setVisibility(View.VISIBLE);
Expand Down

0 comments on commit b875d6f

Please sign in to comment.