Skip to content

Commit bc4b03e

Browse files
committed
layout changes balance refresh messages
1 parent 0903f6e commit bc4b03e

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

res/layout/main.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
android:textSize="20sp"
2424
android:text="0.00BTC"/>
2525
</LinearLayout>
26-
<LinearLayout
26+
<!-- LinearLayout
2727
android:layout_width="fill_parent"
2828
android:layout_height="wrap_content"
2929
android:orientation="horizontal">
@@ -40,7 +40,7 @@
4040
android:id="@+id/balance_unconfirmed"
4141
android:textSize="20sp"
4242
android:text="0.00BTC"/>
43-
</LinearLayout>
43+
</LinearLayout-->
4444
<TextView
4545
android:layout_width="wrap_content"
4646
android:layout_height="wrap_content"
@@ -51,13 +51,12 @@
5151
android:layout_weight="1"
5252
android:id="@+id/transactionsList"/>
5353
<Button
54-
android:layout_width="wrap_content"
54+
android:layout_width="fill_parent"
5555
android:layout_height="wrap_content"
5656
android:id="@+id/refreshButton"
5757
android:text="Refresh"
5858
android:textSize="30sp"
59-
android:layout_margin="10dp"
60-
android:layout_weight="1"/>
59+
android:layout_margin="10dp"/>
6160
<LinearLayout
6261
android:layout_width="fill_parent"
6362
android:layout_height="wrap_content"

src/main/java/com/github/bitcoinlabs/bitcoinmobileandroid/Bitcoin.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void onCreate(Bundle savedInstanceState)
3232
setContentView(R.layout.main);
3333
balanceStatusView = (TextView)findViewById(R.id.balance_status);
3434
balanceView = (TextView)findViewById(R.id.balance);
35-
balanceUnconfirmedView = (TextView)findViewById(R.id.balance_unconfirmed);
35+
// balanceUnconfirmedView = (TextView)findViewById(R.id.balance_unconfirmed);
3636

3737
final View refreshButton = findViewById(R.id.refreshButton);
3838
refreshButton.setOnClickListener(new View.OnClickListener() {
@@ -50,9 +50,15 @@ public void onClick(View view) {
5050
callScan();
5151
}
5252
});
53+
}
54+
55+
@Override
56+
public void onWindowFocusChanged(boolean hasFocus) {
57+
super.onWindowFocusChanged(hasFocus);
58+
super.onResume();
5359
WalletOpenHelper wallet = new WalletOpenHelper(getApplicationContext());
5460
long balance = wallet.getBalance();
55-
balanceView.setText(MoneyUtils.formatSatoshisAsBtcString(balance));
61+
balanceView.setText(MoneyUtils.formatSatoshisAsBtcString(balance) + "BTC");
5662
}
5763

5864
@Override

src/main/java/com/github/bitcoinlabs/bitcoinmobileandroid/OutpointService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ public void onDestroy() {
7878
// Cancel the persistent notification.
7979
mNM.cancel(NOTIFICATION);
8080

81+
WalletOpenHelper wallet = new WalletOpenHelper(getApplicationContext());
82+
long balance = wallet.getBalance();
8183
// Tell the user we stopped.
82-
Toast.makeText(this, R.string.outpoint_service_stopped, Toast.LENGTH_SHORT).show();
84+
CharSequence text = getText(R.string.outpoint_service_stopped);
85+
86+
Toast.makeText(this, text + "\nNew Balance: " + MoneyUtils.formatSatoshisAsBtcString(balance) + "BTC", Toast.LENGTH_LONG).show();
8387
}
8488

8589
// @Override

0 commit comments

Comments
 (0)