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); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
File walletFile = new File(getApplicationInfo().dataDir, Constants.WALLET_NAME); 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); boolean promptPassword = PrefService.getInstance().getBoolean(Constants.PREF_USES_PASSWORD, false);
if (!promptPassword) { if (!promptPassword) {
init(walletFile, ""); init(walletFile, "");

View file

@ -141,7 +141,11 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
txHistoryRecyclerView.setVisibility(View.GONE); txHistoryRecyclerView.setVisibility(View.GONE);
} else { } else {
Collections.sort(history); Collections.sort(history);
if(history.size() > 100) {
adapter.submitList(history.subList(0, 99));
} else {
adapter.submitList(history); adapter.submitList(history);
}
txHistoryRecyclerView.setVisibility(View.VISIBLE); 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 <TextView
android:id="@+id/balance_unlocked_textview" android:id="@+id/balance_unlocked_textview"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:layout_marginEnd="24dp" android:layout_marginEnd="24dp"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:textAlignment="center" android:textSize="24sp"
tools:text="UNLOCKED BALANCE" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" tools:text="100.000000000000 XMR"
app:layout_constraintEnd_toStartOf="@id/settings_imageview"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/> app:layout_constraintTop_toTopOf="parent"/>
@ -37,8 +38,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:layout_marginEnd="24dp" android:layout_marginEnd="24dp"
android:textAlignment="center" tools:text="+ 100.000000000000 confirming"
tools:text="LOCKED BALANCE"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/balance_unlocked_textview" /> app:layout_constraintTop_toBottomOf="@id/balance_unlocked_textview" />
@ -46,22 +46,44 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/transaction_history_recyclerview" android:id="@+id/transaction_history_recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_marginTop="16dp" 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_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_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintVertical_bias="0.0"/> 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 <Button
android:id="@+id/receive_button" android:id="@+id/receive_button"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="16dp"
android:background="@drawable/button_bg" android:background="@drawable/button_bg"
android:layout_marginEnd="4dp"
android:text="@string/receive" android:text="@string/receive"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/send_button" app:layout_constraintEnd_toStartOf="@id/send_button"
@ -71,14 +93,13 @@
android:id="@+id/send_button" android:id="@+id/send_button"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="16dp"
android:background="@drawable/button_bg" android:background="@drawable/button_bg"
android:layout_marginStart="4dp"
android:text="@string/send" android:text="@string/send"
app:layout_constraintStart_toEndOf="@id/receive_button" app:layout_constraintStart_toEndOf="@id/receive_button"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/> app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView <ImageView
android:id="@+id/settings_imageview" android:id="@+id/settings_imageview"

View file

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