add storage stats card to My LBRY downloads page (#278)
* add storage stats card to My LBRY downloads page * add decimalPoints parameter to formatBytes method * some more tweaks to notifications and startup * cancel all notifications if the service is not running when the activity is destroyed
This commit is contained in:
parent
c0b464ae36
commit
404647c4cb
10 changed files with 321 additions and 59 deletions
src/main/java/io/lbry/browser
|
@ -83,6 +83,8 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
|
|||
*/
|
||||
private boolean serviceRunning;
|
||||
|
||||
private boolean receivedStopService;
|
||||
|
||||
protected String getMainComponentName() {
|
||||
return "LBRYApp";
|
||||
}
|
||||
|
@ -138,6 +140,7 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
|
|||
stopServiceReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
MainActivity.this.receivedStopService = true;
|
||||
MainActivity.this.finish();
|
||||
}
|
||||
};
|
||||
|
@ -383,6 +386,9 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
|
|||
notificationManager.cancel(downloadNotificationIds.get(i));
|
||||
}
|
||||
}
|
||||
if (receivedStopService || !isServiceRunning(LbrynetService.class)) {
|
||||
notificationManager.cancelAll();
|
||||
}
|
||||
super.onDestroy();
|
||||
|
||||
if (mReactInstanceManager != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue