mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge pull request #4448 from deltachat/adb/issue-4447
respect IMAP Folder field if set
This commit is contained in:
@@ -73,6 +73,9 @@ public class EditRelayActivity extends BaseActionBarActivity
|
||||
private ProgressDialog progressDialog;
|
||||
private boolean cancelled = false;
|
||||
|
||||
private View imapFolderLayout;
|
||||
private boolean showImapFolder = false;
|
||||
|
||||
Spinner imapSecurity;
|
||||
Spinner smtpSecurity;
|
||||
Spinner certCheck;
|
||||
@@ -102,9 +105,11 @@ public class EditRelayActivity extends BaseActionBarActivity
|
||||
|
||||
advancedGroup = findViewById(R.id.advanced_group);
|
||||
advancedIcon = findViewById(R.id.advanced_icon);
|
||||
imapFolderLayout = findViewById(R.id.imap_folder);
|
||||
TextView advancedTextView = findViewById(R.id.advanced_text);
|
||||
TextInputEditText imapServerInput = findViewById(R.id.imap_server_text);
|
||||
TextInputEditText imapPortInput = findViewById(R.id.imap_port_text);
|
||||
TextInputEditText imapFolderInput = findViewById(R.id.imap_folder_text);
|
||||
TextInputEditText smtpServerInput = findViewById(R.id.smtp_server_text);
|
||||
TextInputEditText smtpPortInput = findViewById(R.id.smtp_port_text);
|
||||
TextView viewLogText = findViewById(R.id.view_log_button);
|
||||
@@ -197,6 +202,12 @@ public class EditRelayActivity extends BaseActionBarActivity
|
||||
if (config.imapPort != null) imapPortInput.setText(config.imapPort.toString());
|
||||
expandAdvanced = expandAdvanced || config.imapPort != null;
|
||||
|
||||
showImapFolder = !TextUtils.isEmpty(config.imapFolder);
|
||||
if (showImapFolder) {
|
||||
imapFolderInput.setText(config.imapFolder);
|
||||
expandAdvanced = true;
|
||||
}
|
||||
|
||||
intVal = socketSecurityToInt(config.imapSecurity);
|
||||
imapSecurity.setSelection(ViewUtil.checkBounds(intVal, imapSecurity));
|
||||
expandAdvanced = expandAdvanced || intVal != 0;
|
||||
@@ -393,9 +404,11 @@ public class EditRelayActivity extends BaseActionBarActivity
|
||||
boolean advancedViewVisible = advancedGroup.getVisibility() == View.VISIBLE;
|
||||
if (advancedViewVisible) {
|
||||
advancedGroup.setVisibility(View.GONE);
|
||||
imapFolderLayout.setVisibility(View.GONE);
|
||||
advancedIcon.setRotation(45);
|
||||
} else {
|
||||
advancedGroup.setVisibility(View.VISIBLE);
|
||||
imapFolderLayout.setVisibility(showImapFolder ? View.VISIBLE : View.GONE);
|
||||
advancedIcon.setRotation(0);
|
||||
}
|
||||
}
|
||||
@@ -498,6 +511,7 @@ public class EditRelayActivity extends BaseActionBarActivity
|
||||
param.password = getParam(R.id.password_text, false);
|
||||
param.imapServer = getParam(R.id.imap_server_text, true);
|
||||
param.imapPort = Util.objectToInt(getParam(R.id.imap_port_text, true));
|
||||
param.imapFolder = getParam(R.id.imap_folder_text, true);
|
||||
param.imapSecurity = socketSecurityFromInt(imapSecurity.getSelectedItemPosition());
|
||||
param.imapUser = getParam(R.id.imap_login_text, false);
|
||||
param.smtpServer = getParam(R.id.smtp_server_text, true);
|
||||
|
||||
@@ -220,6 +220,23 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/imap_folder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="58dp"
|
||||
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
|
||||
app:layout_constraintTop_toBottomOf="@id/imap_port">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/imap_folder_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:hint="IMAP folder" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/imap_security_label"
|
||||
style="@style/TextAppearance.AppCompat.Caption"
|
||||
@@ -228,7 +245,7 @@
|
||||
android:text="@string/login_imap_security"
|
||||
app:layout_constraintEnd_toEndOf="@id/guideline_root_end"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline_root_start"
|
||||
app:layout_constraintTop_toBottomOf="@id/imap_port" />
|
||||
app:layout_constraintTop_toBottomOf="@id/imap_folder" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/imap_security"
|
||||
|
||||
Reference in New Issue
Block a user