File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed
src/main/java/com/github/bitcoinlabs/bitcoinmobileandroid Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 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">
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"
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"
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 + "\n New Balance: " + MoneyUtils .formatSatoshisAsBtcString (balance ) + "BTC" , Toast .LENGTH_LONG ).show ();
8387 }
8488
8589// @Override
You can’t perform that action at this time.
0 commit comments