Add initialization message to loading popup window

This commit is contained in:
Steve Soltys 2019-02-22 01:05:55 -05:00
parent bd0c41c2d3
commit 03c92efc24
3 changed files with 9 additions and 5 deletions

View file

@ -167,10 +167,10 @@ class CreateBackupActivityController {
BackupSession backupSession = backupManager.backup(backupObserver, selectedPackages);
View popupWindowButton = popupWindow.getContentView().findViewById(R.id.popup_cancel_button);
if (popupWindowButton != null) {
popupWindowButton.setOnClickListener(new BackupPopupWindowListener(backupSession));
}
TextView textView = popupWindow.getContentView().findViewById(R.id.popup_text_view);
textView.setText(R.string.initializing);
} catch (Exception e) {
Log.e(TAG, "Error while running backup: ", e);

View file

@ -5,7 +5,6 @@ import android.widget.PopupWindow;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.stevesoltys.backup.R;
import com.stevesoltys.backup.session.restore.RestoreResult;
import com.stevesoltys.backup.session.restore.RestoreSessionObserver;
@ -31,6 +30,10 @@ class RestoreObserver implements RestoreSessionObserver {
@Override
public void restoreSessionStarted(int packageCount) {
context.runOnUiThread(() -> {
TextView textView = popupWindow.getContentView().findViewById(R.id.popup_text_view);
textView.setText(R.string.initializing);
});
}
@Override

View file

@ -21,5 +21,6 @@
<string name="select_all">Select all</string>
<string name="loading_backup">Loading backup…</string>
<string name="loading_packages">Loading packages…</string>
<string name="initializing">Initializing…</string>
</resources>