add gradient to bottom of screen to hide tx list bottom, also fixes app startup issue, and only displays most recent 100 txs

This commit is contained in:
pokkst 2022-09-12 16:25:19 -05:00
parent 158268bac0
commit 765ff8f291
No known key found for this signature in database
GPG Key ID: 90C2ED85E67A50FF
5 changed files with 67 additions and 33 deletions

View File

@ -38,7 +38,8 @@ public class MainActivity extends AppCompatActivity implements MoneroHandlerThre
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
File walletFile = new File(getApplicationInfo().dataDir, Constants.WALLET_NAME);
if (walletFile.exists()) {
File walletKeysFile = new File(getApplicationInfo().dataDir, Constants.WALLET_NAME + ".keys");
if (walletKeysFile.exists()) {
boolean promptPassword = PrefService.getInstance().getBoolean(Constants.PREF_USES_PASSWORD, false);
if (!promptPassword) {
init(walletFile, "");

View File

@ -141,7 +141,11 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
txHistoryRecyclerView.setVisibility(View.GONE);
} else {
Collections.sort(history);
if(history.size() > 100) {
adapter.submitList(history.subList(0, 99));
} else {
adapter.submitList(history);
}
txHistoryRecyclerView.setVisibility(View.VISIBLE);
}
});

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="@android:color/transparent"
android:startColor="@color/oled_colorBackground"
android:type="linear" />
</shape>

View File

@ -20,14 +20,15 @@
<TextView
android:id="@+id/balance_unlocked_textview"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginTop="24dp"
android:textAlignment="center"
tools:text="UNLOCKED BALANCE"
app:layout_constraintEnd_toEndOf="parent"
android:textSize="24sp"
android:textStyle="bold"
tools:text="100.000000000000 XMR"
app:layout_constraintEnd_toStartOf="@id/settings_imageview"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
@ -37,8 +38,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:textAlignment="center"
tools:text="LOCKED BALANCE"
tools:text="+ 100.000000000000 confirming"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/balance_unlocked_textview" />
@ -46,22 +46,44 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/transaction_history_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="16dp"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:paddingBottom="128dp"
android:clipToPadding="false"
app:layout_constraintTop_toBottomOf="@id/balance_locked_textview"
app:layout_constraintBottom_toTopOf="@id/receive_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.0"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:src="@drawable/gradient_bottom"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/receive_send_buttons_layout"
app:layout_constraintBottom_toBottomOf="parent"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/receive_send_buttons_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:paddingBottom="16dp"
android:paddingTop="128dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<Button
android:id="@+id/receive_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="16dp"
android:background="@drawable/button_bg"
android:layout_marginEnd="4dp"
android:text="@string/receive"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/send_button"
@ -71,14 +93,13 @@
android:id="@+id/send_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="16dp"
android:background="@drawable/button_bg"
android:layout_marginStart="4dp"
android:text="@string/send"
app:layout_constraintStart_toEndOf="@id/receive_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/settings_imageview"

View File

@ -4,8 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp">
android:layout_gravity="center">
<LinearLayout
android:layout_width="match_parent"