Add initialization message to loading popup window
This commit is contained in:
parent
bd0c41c2d3
commit
03c92efc24
3 changed files with 9 additions and 5 deletions
|
@ -167,10 +167,10 @@ class CreateBackupActivityController {
|
||||||
BackupSession backupSession = backupManager.backup(backupObserver, selectedPackages);
|
BackupSession backupSession = backupManager.backup(backupObserver, selectedPackages);
|
||||||
|
|
||||||
View popupWindowButton = popupWindow.getContentView().findViewById(R.id.popup_cancel_button);
|
View popupWindowButton = popupWindow.getContentView().findViewById(R.id.popup_cancel_button);
|
||||||
|
|
||||||
if (popupWindowButton != null) {
|
|
||||||
popupWindowButton.setOnClickListener(new BackupPopupWindowListener(backupSession));
|
popupWindowButton.setOnClickListener(new BackupPopupWindowListener(backupSession));
|
||||||
}
|
|
||||||
|
TextView textView = popupWindow.getContentView().findViewById(R.id.popup_text_view);
|
||||||
|
textView.setText(R.string.initializing);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "Error while running backup: ", e);
|
Log.e(TAG, "Error while running backup: ", e);
|
||||||
|
|
|
@ -5,7 +5,6 @@ import android.widget.PopupWindow;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.stevesoltys.backup.R;
|
import com.stevesoltys.backup.R;
|
||||||
import com.stevesoltys.backup.session.restore.RestoreResult;
|
import com.stevesoltys.backup.session.restore.RestoreResult;
|
||||||
import com.stevesoltys.backup.session.restore.RestoreSessionObserver;
|
import com.stevesoltys.backup.session.restore.RestoreSessionObserver;
|
||||||
|
@ -31,6 +30,10 @@ class RestoreObserver implements RestoreSessionObserver {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void restoreSessionStarted(int packageCount) {
|
public void restoreSessionStarted(int packageCount) {
|
||||||
|
context.runOnUiThread(() -> {
|
||||||
|
TextView textView = popupWindow.getContentView().findViewById(R.id.popup_text_view);
|
||||||
|
textView.setText(R.string.initializing);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,5 +21,6 @@
|
||||||
<string name="select_all">Select all</string>
|
<string name="select_all">Select all</string>
|
||||||
<string name="loading_backup">Loading backup…</string>
|
<string name="loading_backup">Loading backup…</string>
|
||||||
<string name="loading_packages">Loading packages…</string>
|
<string name="loading_packages">Loading packages…</string>
|
||||||
|
<string name="initializing">Initializing…</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue