mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
start configuration progress from RegistrationActivity
This commit is contained in:
@@ -209,18 +209,22 @@ public class RegistrationActivity extends BaseActionBarActivity {
|
||||
setConfig(R.id.smtp_port_text, "send_port");
|
||||
setConfig(R.id.smtp_login_text, "send_user");
|
||||
setConfig(R.id.smtp_password_text, "send_pw");
|
||||
|
||||
// calling configure() results in ApplicationDcContext.handleEvent()
|
||||
// receiving multiple DC_EVENT_CONFIGURE_PROGRESS events from different threads
|
||||
ApplicationContext.getInstance(getApplicationContext()).dcContext.configure();
|
||||
}
|
||||
|
||||
private void setConfig(@IdRes int viewId, String configTarget) {
|
||||
TextInputEditText view = findViewById(viewId);
|
||||
String value = view.getText().toString().trim();
|
||||
if (!value.isEmpty()) {
|
||||
//JavaBindings.setConfig(configTarget, value); TODO set configuration value via bindings
|
||||
ApplicationContext.getInstance(getApplicationContext()).dcContext.setConfig(configTarget, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void stopLoginProcess() {
|
||||
//JavaBindings.stopLoginProcess(); TODO stop configuration process via bindings
|
||||
ApplicationContext.getInstance(getApplicationContext()).dcContext.stopOngoingProcess();
|
||||
}
|
||||
|
||||
//@Override
|
||||
|
||||
@@ -216,6 +216,18 @@ public class ApplicationDcContext extends DcContext {
|
||||
});
|
||||
break;
|
||||
|
||||
case DC_EVENT_CONFIGURE_PROGRESS:
|
||||
if (data1==0/*error/aborted*/) {
|
||||
// TODO: send this event to RegistrationActivity, take care, we're not in the main thread!
|
||||
}
|
||||
else if (data1<1000/*progress in permille*/) {
|
||||
// TODO: send this event to RegistrationActivity, take care, we're not in the main thread!
|
||||
}
|
||||
else if (data1==1000/*done*/) {
|
||||
// TODO: send this event to RegistrationActivity, take care, we're not in the main thread!
|
||||
}
|
||||
break;
|
||||
|
||||
case DC_EVENT_HTTP_GET:
|
||||
String httpContent = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user