Skip to content

Commit

Permalink
Convert activity_setup_webdav_sync to constraint layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
frigus02 committed Aug 25, 2017
1 parent f4d5c12 commit a73b7da
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ public static String getShortDescription(X509Certificate certificate, Context co
String validFrom = dateFormat.format(certificate.getNotBefore());
String validUntil = dateFormat.format(certificate.getNotAfter());

return String.format("" +
"Subject: %s\n" +
"Alt. names: %s\n" +
"Serialnumber: %s\n" +
"Issuer: %s\n" +
"Valid: %s - %s\n",
subject, TextUtils.join(", ", subjectAltNames), serialNumber, issuer, validFrom, validUntil);
return "Subject: " + subject +
"\nAlt. names: " + TextUtils.join(", ", subjectAltNames) +
"\nSerialnumber: " + serialNumber +
"\nIssuer: " + issuer +
"\nValid: " + validFrom + " - " + validUntil;
}

public static String toString(X509Certificate certificate) throws CertificateEncodingException {
Expand Down
157 changes: 100 additions & 57 deletions app/src/main/res/layout/activity_setup_webdav_sync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
~ limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -25,69 +26,111 @@
android:layout_height="0dp"
android:layout_weight="1">

<FrameLayout
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp">

<EditText
android:id="@+id/edt_url"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:hint="@string/hint_url"
android:inputType="textUri"
android:maxLines="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<TextView
android:id="@+id/txt_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="@string/description_webdav_url"
android:textAppearance="?android:attr/textAppearanceSmall"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/edt_url"/>

<LinearLayout
android:layout_width="match_parent"
<EditText
android:id="@+id/edt_user_name"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:hint="@string/hint_user_name"
android:inputType="text"
android:maxLines="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_description"/>

<EditText
android:id="@+id/edt_password"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:hint="@string/hint_password"
android:inputType="textPassword"
android:maxLines="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/edt_user_name"/>

<TextView
android:id="@+id/txt_trust_certificate_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:orientation="vertical">
<!-- URL -->
<EditText
android:id="@+id/edt_url"
android:layout_width="match_parent"
android:layout_height="48dp"
android:hint="@string/hint_url"
android:inputType="textUri"
android:singleLine="true"/>
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:text="@string/description_webdav_trust_certificate"
android:textAppearance="?android:attr/textAppearanceSmall"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/edt_password"
app:layout_constraintHorizontal_bias="0.0"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/description_webdav_url"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<!-- UserName -->
<EditText
android:id="@+id/edt_user_name"
android:layout_width="match_parent"
android:layout_height="48dp"
android:hint="@string/hint_user_name"
android:inputType="text"
android:singleLine="true"/>
<!-- Password -->
<EditText
android:id="@+id/edt_password"
android:layout_width="match_parent"
android:layout_height="48dp"
android:hint="@string/hint_password"
android:inputType="textPassword"
android:singleLine="true"/>
<!-- Certificate -->
<TextView
android:id="@+id/txt_trust_certificate_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/description_webdav_trust_certificate"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/txt_trust_certificate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginLeft="24dp"
android:layout_marginRight="16dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:textAppearance="?android:attr/textAppearanceSmall"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_trust_certificate_description"
tools:text="Subject: localhost"/>

<TextView
android:id="@+id/txt_trust_certificate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="Subject: localhost"/>
<CheckBox
android:id="@+id/chk_trust_certificate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:text="@string/label_trust_certificate"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txt_trust_certificate"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
android:layout_marginBottom="16dp"/>

<CheckBox
android:id="@+id/chk_trust_certificate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_trust_certificate"/>
</LinearLayout>
</FrameLayout>
</android.support.constraint.ConstraintLayout>
</ScrollView>

<LinearLayout
Expand Down

0 comments on commit a73b7da

Please sign in to comment.