add.xml revision b76e85d5549ba6fc5535ec2a590bad9443bb14d8
<?xml version="1.0" encoding="utf-8"?>
<!--
- FreeOTP
-
- Authors: Nathaniel McCallum <npmccallum@redhat.com>
-
- Copyright (C) 2013 Nathaniel McCallum, Red Hat
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="16dp"
android:layout_weight="1"
android:orientation="vertical">
<include layout="@layout/metadata" />
<View
style="@style/Divider"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow
android:layout_width="match_parent"
android:layout_height="48dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:paddingRight="8dp"
android:text="@string/secret"
android:textStyle="bold" />
<EditText
android:id="@+id/secret"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ234567="
android:hint="(Base32)"
android:inputType="textVisiblePassword|textCapCharacters|textNoSuggestions"
android:textAppearance="?android:attr/textAppearanceSmall" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="48dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:paddingRight="8dp"
android:text="@string/type"
android:textStyle="bold" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<RadioButton
android:id="@+id/totp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:checked="true"
android:text="TOTP" />
<RadioButton
android:id="@+id/hotp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="HOTP" />
</RadioGroup>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="48dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:paddingRight="8dp"
android:text="@string/digits"
android:textStyle="bold" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<RadioButton
android:id="@+id/digits6"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:checked="true"
android:text="6" />
<RadioButton
android:id="@+id/digits8"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="8" />
</RadioGroup>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="48dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:paddingRight="8dp"
android:text="@string/algorithm"
android:textStyle="bold" />
<Spinner
android:id="@+id/algorithm"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:entries="@array/algorithms" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="48dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:paddingRight="8dp"
android:text="@string/interval"
android:textStyle="bold" />
<EditText
android:id="@+id/interval"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="number"
android:text="30" />
</TableRow>
<TableRow
android:id="@+id/counter_row"
android:layout_width="match_parent"
android:layout_height="48dp"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical|right"
android:paddingRight="8dp"
android:text="@string/counter"
android:textStyle="bold" />
<EditText
android:id="@+id/counter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:inputType="numberDecimal"
android:text="0" />
</TableRow>
</TableLayout>
</ScrollView>
</LinearLayout>
<View style="@style/Divider" />
<LinearLayout style="@style/Dialog.Button.Layout">
<Button
android:id="@+id/cancel"
style="@style/Dialog.Button"
android:text="@android:string/cancel" />
<Button
android:id="@+id/add"
style="@style/Dialog.Button"
android:text="@string/add" />
</LinearLayout>
</LinearLayout>