mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-25 17:02:28 +00:00
UI fixes (0.4.4.1)
This commit is contained in:
parent
14b989a760
commit
2e5177c20d
5 changed files with 120 additions and 46 deletions
|
@ -9,8 +9,8 @@ android {
|
|||
applicationId "net.mynero.wallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
versionCode 40400
|
||||
versionName "0.4.4 'Fluorine Fermi'"
|
||||
versionCode 40401
|
||||
versionName "0.4.4.1 'Fluorine Fermi'"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
|
|
|
@ -100,6 +100,7 @@ public class CoinsInfoAdapter extends RecyclerView.Adapter<CoinsInfoAdapter.View
|
|||
}
|
||||
|
||||
public void bind(CoinsInfo coinsInfo, List<CoinsInfo> selectedUtxos) {
|
||||
boolean alreadyEditing = selectedUtxos.size() > 0;
|
||||
boolean selected = false;
|
||||
for(CoinsInfo selectedUtxo : selectedUtxos) {
|
||||
if (Objects.equals(selectedUtxo.getKeyImage(), coinsInfo.getKeyImage())) {
|
||||
|
@ -118,6 +119,14 @@ public class CoinsInfoAdapter extends RecyclerView.Adapter<CoinsInfoAdapter.View
|
|||
globalIdxTextView.setText(itemView.getResources().getString(R.string.global_index_text, coinsInfo.getGlobalOutputIndex()));
|
||||
outpointTextView.setText(itemView.getResources().getString(R.string.outpoint_text, coinsInfo.getHash() + ":" + coinsInfo.getLocalOutputIndex()));
|
||||
|
||||
if(alreadyEditing) {
|
||||
itemView.setOnClickListener(view -> {
|
||||
boolean unlocked = coinsInfo.isUnlocked();
|
||||
if (unlocked) {
|
||||
listener.onUtxoSelected(coinsInfo);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
itemView.setOnLongClickListener(view -> {
|
||||
boolean unlocked = coinsInfo.isUnlocked();
|
||||
if (unlocked) {
|
||||
|
@ -125,6 +134,7 @@ public class CoinsInfoAdapter extends RecyclerView.Adapter<CoinsInfoAdapter.View
|
|||
}
|
||||
return unlocked;
|
||||
});
|
||||
}
|
||||
|
||||
if (selected) {
|
||||
itemView.setBackgroundColor(ContextCompat.getColor(itemView.getContext(), R.color.oled_colorSecondary));
|
||||
|
|
|
@ -40,7 +40,6 @@ public class UtxosFragment extends Fragment implements CoinsInfoAdapter.CoinsInf
|
|||
UNFREEZE,
|
||||
TOGGLE_FREEZE
|
||||
}
|
||||
private FreezeActionType freezeActionType = FreezeActionType.FREEZE;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
|
@ -147,10 +146,14 @@ public class UtxosFragment extends Fragment implements CoinsInfoAdapter.CoinsInf
|
|||
sendUtxosButton.setVisibility(View.GONE);
|
||||
churnUtxosButton.setVisibility(View.GONE);
|
||||
freezeUtxosButton.setVisibility(View.GONE);
|
||||
freezeActionType = FreezeActionType.FREEZE;
|
||||
} else {
|
||||
if(frozenExists) {
|
||||
sendUtxosButton.setVisibility(View.GONE);
|
||||
churnUtxosButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
sendUtxosButton.setVisibility(View.VISIBLE);
|
||||
churnUtxosButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
freezeUtxosButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
@ -167,7 +170,9 @@ public class UtxosFragment extends Fragment implements CoinsInfoAdapter.CoinsInf
|
|||
|
||||
@Override
|
||||
public void onSentTransaction() {
|
||||
selectedUtxos.clear();
|
||||
churnUtxosButton.setVisibility(View.GONE);
|
||||
sendUtxosButton.setVisibility(View.GONE);
|
||||
freezeUtxosButton.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
|
@ -7,49 +7,108 @@
|
|||
android:padding="8dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
<TextView
|
||||
android:id="@+id/utxo_pub_key_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/utxo_coin_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Key Image"
|
||||
android:text="Coin"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/oled_addressListColor"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_amount_textview"
|
||||
app:layout_constraintEnd_toStartOf="@id/utxo_outpoint_textview"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_label"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
<TextView
|
||||
android:id="@+id/utxo_amount_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Amount"
|
||||
android:textStyle="bold"
|
||||
android:ellipsize="middle"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_pub_key_textview"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_outpoint_textview"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/utxo_global_index_textview"
|
||||
android:singleLine="true" />
|
||||
<TextView
|
||||
android:id="@+id/utxo_global_index_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Global Idx"
|
||||
android:ellipsize="middle"
|
||||
android:gravity="end"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_pub_key_textview"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_outpoint_textview"
|
||||
app:layout_constraintStart_toEndOf="@id/utxo_amount_textview"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:singleLine="true" />
|
||||
<TextView
|
||||
android:id="@+id/utxo_outpoint_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Outpoint"
|
||||
android:ellipsize="middle"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_amount_textview"
|
||||
android:layout_marginStart="8dp"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/utxo_coin_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_label"
|
||||
android:singleLine="true" />
|
||||
<TextView
|
||||
android:id="@+id/utxo_pub_key_label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Public Key"
|
||||
android:textStyle="bold"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/oled_addressListColor"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_pub_key_textview"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_coin_label"/>
|
||||
<TextView
|
||||
android:id="@+id/utxo_pub_key_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Public Key"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_amount_label"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_pub_key_label"/>
|
||||
<TextView
|
||||
android:id="@+id/utxo_amount_label"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Amount"
|
||||
android:textStyle="bold"
|
||||
android:ellipsize="middle"
|
||||
android:textSize="12sp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:textColor="@color/oled_addressListColor"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_pub_key_textview"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_amount_textview"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/utxo_global_index_label"
|
||||
android:singleLine="true" />
|
||||
<TextView
|
||||
android:id="@+id/utxo_amount_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Amount"
|
||||
android:ellipsize="middle"
|
||||
android:layout_marginStart="32dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_amount_label"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/utxo_global_index_textview"
|
||||
android:singleLine="true" />
|
||||
<TextView
|
||||
android:id="@+id/utxo_global_index_label"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Global Index"
|
||||
android:ellipsize="middle"
|
||||
android:gravity="end"
|
||||
android:textStyle="bold"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/oled_addressListColor"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_pub_key_textview"
|
||||
app:layout_constraintBottom_toTopOf="@id/utxo_global_index_textview"
|
||||
app:layout_constraintStart_toEndOf="@id/utxo_amount_label"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:singleLine="true" />
|
||||
<TextView
|
||||
android:id="@+id/utxo_global_index_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="999999999999"
|
||||
android:ellipsize="middle"
|
||||
android:gravity="end"
|
||||
app:layout_constraintTop_toBottomOf="@id/utxo_global_index_label"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/utxo_amount_textview"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:singleLine="true" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -97,8 +97,8 @@
|
|||
<string name="view_utxos">View UTXOs</string>
|
||||
<string name="selected_utxos_value">Selected value: %1$s XMR</string>
|
||||
<string name="selected_utxos_value_churning">Selected value: %1$s XMR\n\nThe anonymity benefits of churning are still being researched. Only proceed if you know what you are doing.</string>
|
||||
<string name="global_index_text">Global Idx: %1$d</string>
|
||||
<string name="outpoint_text">Outpoint: %1$s</string>
|
||||
<string name="global_index_text">%1$d</string>
|
||||
<string name="outpoint_text">%1$s</string>
|
||||
<string name="create_wallet_failed">Create wallet failed: %1$s</string>
|
||||
<string name="churn">Churn</string>
|
||||
<string name="freeze">Freeze</string>
|
||||
|
|
Loading…
Reference in a new issue