Better leyout for account settings

This commit is contained in:
Dominik Schürmann
2014-08-31 20:26:06 +02:00
parent f6d1b45007
commit 5e7eed239f
6 changed files with 113 additions and 95 deletions

View File

@@ -35,29 +35,55 @@
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<fragment
android:id="@+id/api_account_settings_select_key_fragment"
android:name="org.sufficientlysecure.keychain.ui.SelectSecretKeyLayoutFragment"
<TextView
style="@style/SectionHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/select_secret_key_layout_fragment" />
android:text="@string/api_settings_settings" />
<Button
android:id="@+id/api_account_settings_create_key"
android:layout_width="wrap_content"
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/api_settings_key"
android:textAppearance="?android:attr/textAppearanceMedium" />
<org.sufficientlysecure.keychain.ui.widget.SignKeySpinner
android:id="@+id/api_account_settings_key_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_gravity="center_vertical" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
<TextView
android:id="@+id/api_account_settings_create_key"
style="@style/SelectableItem"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginBottom="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="4dp"
android:text="@string/api_settings_create_key"
android:background="@drawable/button_edgy"
android:drawableLeft="@drawable/ic_action_accounts"
android:textSize="14sp"/>
android:minHeight="48dp"
android:drawableRight="@drawable/ic_action_new_account"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:clickable="true" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
<org.sufficientlysecure.keychain.ui.widget.FoldableLinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="16dp"
custom:foldedLabel="@string/api_settings_show_advanced"
custom:unFoldedLabel="@string/api_settings_hide_advanced">

View File

@@ -25,10 +25,10 @@
tools:layout="@layout/api_app_settings_fragment" />
<TextView
style="@style/SectionHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/api_settings_accounts"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:text="@string/api_settings_accounts" />
<FrameLayout
android:id="@+id/api_accounts_list_fragment"

View File

@@ -5,67 +5,68 @@
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical">
<ListView
android:id="@+id/selected_files_list"
android:dividerHeight="4dip"
android:divider="@android:color/transparent"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_marginTop="8dp"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"/>
android:id="@+id/selected_files_list"
android:dividerHeight="4dip"
android:divider="@android:color/transparent"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_marginTop="8dp"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"/>
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
<!-- Note: The following construct should be a widget, we use it quiet often -->
<LinearLayout
android:id="@+id/action_encrypt_share"
android:paddingLeft="8dp"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_marginBottom="8dp"
android:clickable="true"
style="@style/SelectableItem"
android:orientation="horizontal">
android:id="@+id/action_encrypt_share"
android:paddingLeft="8dp"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_marginBottom="8dp"
android:clickable="true"
style="@style/SelectableItem"
android:orientation="horizontal">
<TextView
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="0dip"
android:layout_height="match_parent"
android:text="@string/btn_encrypt_share_file"
android:layout_weight="1"
android:drawableRight="@drawable/ic_action_share"
android:drawablePadding="8dp"
android:gravity="center_vertical"/>
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="0dip"
android:layout_height="match_parent"
android:text="@string/btn_encrypt_share_file"
android:layout_weight="1"
android:drawableRight="@drawable/ic_action_share"
android:drawablePadding="8dp"
android:gravity="center_vertical" />
<View
android:layout_width="1dip"
android:layout_height="match_parent"
android:gravity="right"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="?android:attr/listDivider"/>
android:layout_width="1dip"
android:layout_height="match_parent"
android:gravity="right"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="?android:attr/listDivider" />
<ImageButton
android:id="@+id/action_encrypt_file"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="8dp"
android:src="@drawable/ic_action_save"
android:layout_gravity="center_vertical"
style="@style/SelectableItem"/>
android:id="@+id/action_encrypt_file"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="8dp"
android:src="@drawable/ic_action_save"
android:layout_gravity="center_vertical"
style="@style/SelectableItem" />
</LinearLayout>
</LinearLayout>

View File

@@ -407,6 +407,8 @@
<string name="api_settings_package_name">Package Name</string>
<string name="api_settings_package_signature">SHA-256 of Package Signature</string>
<string name="api_settings_accounts">Accounts</string>
<string name="api_settings_settings">Settings</string>
<string name="api_settings_key">My key for this account</string>
<string name="api_settings_accounts_empty">No accounts attached to this app.</string>
<string name="api_create_account_text">The app requests the creation of a new account. Please select one of your existing keys or create a new one.\nApps are restricted to the usage of keys you select here!</string>
<string name="api_update_account_text">The key saved for this account has been deleted. Please select a different one!\nApps are restricted to the usage of keys you select here!</string>