Layout fixes for registered apps

This commit is contained in:
Dominik Schürmann 2014-02-13 23:34:57 +01:00
parent 9e4bfcbf2d
commit 519209da63
7 changed files with 158 additions and 149 deletions

View File

@ -109,6 +109,15 @@ public class AppSettingsFragment extends Fragment implements
return view; return view;
} }
/**
* Set error String on key selection
*
* @param error
*/
public void setErrorOnSelectKeyFragment(String error) {
mSelectKeyFragment.setError(error);
}
private void initView(View view) { private void initView(View view) {
mSelectKeyFragment = (SelectSecretKeyLayoutFragment) getFragmentManager().findFragmentById( mSelectKeyFragment = (SelectSecretKeyLayoutFragment) getFragmentManager().findFragmentById(
R.id.api_app_settings_select_key_fragment); R.id.api_app_settings_select_key_fragment);
@ -182,7 +191,7 @@ public class AppSettingsFragment extends Fragment implements
// TODO: Better: collapse/expand animation // TODO: Better: collapse/expand animation
// final Animation animation2 = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, // final Animation animation2 = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
// Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, // Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f,
// Animation.RELATIVE_TO_SELF, 0.0f); // Animation.RELATIVE_TO_SELF, 0.0f);u
// animation2.setDuration(150); // animation2.setDuration(150);
mAdvancedSettingsButton.setOnClickListener(new OnClickListener() { mAdvancedSettingsButton.setOnClickListener(new OnClickListener() {

View File

@ -125,9 +125,8 @@ public class RemoteServiceActivity extends ActionBarActivity {
// user needs to select a key! // user needs to select a key!
if (mSettingsFragment.getAppSettings().getKeyId() == Id.key.none) { if (mSettingsFragment.getAppSettings().getKeyId() == Id.key.none) {
Toast.makeText(RemoteServiceActivity.this, mSettingsFragment.setErrorOnSelectKeyFragment(
R.string.api_register_error_select_key, Toast.LENGTH_LONG) getString(R.string.api_register_error_select_key));
.show();
} else { } else {
ProviderHelper.insertApiApp(RemoteServiceActivity.this, ProviderHelper.insertApiApp(RemoteServiceActivity.this,
mSettingsFragment.getAppSettings()); mSettingsFragment.getAppSettings());

View File

@ -164,8 +164,8 @@ public class CertifyKeyActivity extends ActionBarActivity implements
passphraseDialog.show(getSupportFragmentManager(), "passphraseDialog"); passphraseDialog.show(getSupportFragmentManager(), "passphraseDialog");
} catch (PgpGeneralException e) { } catch (PgpGeneralException e) {
Log.d(Constants.TAG, "No passphrase for this secret key, encrypt directly!"); Log.d(Constants.TAG, "No passphrase for this secret key!");
// send message to handler to start encryption directly // send message to handler to start certification directly
returnHandler.sendEmptyMessage(PassphraseDialogFragment.MESSAGE_OKAY); returnHandler.sendEmptyMessage(PassphraseDialogFragment.MESSAGE_OKAY);
} }
} }

View File

@ -1,25 +1,29 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="fill_parent" android:layout_height="wrap_content">
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
<TextView <LinearLayout
android:id="@+id/api_register_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="3dip"
android:text="@string/api_register_text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<fragment
android:id="@+id/api_app_settings_fragment"
android:name="org.sufficientlysecure.keychain.service.remote.AppSettingsFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
tools:layout="@layout/api_app_settings_fragment" /> android:padding="16dp"
android:orientation="vertical">
</LinearLayout> <TextView
android:id="@+id/api_register_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="3dip"
android:text="@string/api_register_text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<fragment
android:id="@+id/api_app_settings_fragment"
android:name="org.sufficientlysecure.keychain.service.remote.AppSettingsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/api_app_settings_fragment" />
</LinearLayout>
</ScrollView>

View File

@ -1,17 +1,21 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
<fragment <LinearLayout
android:id="@+id/api_app_settings_fragment"
android:name="org.sufficientlysecure.keychain.service.remote.AppSettingsFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
tools:layout="@layout/api_app_settings_fragment" /> android:padding="16dp"
android:orientation="vertical">
</LinearLayout> <fragment
android:id="@+id/api_app_settings_fragment"
android:name="org.sufficientlysecure.keychain.service.remote.AppSettingsFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/api_app_settings_fragment" />
</LinearLayout>
</ScrollView>

View File

@ -1,129 +1,123 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto" xmlns:bootstrapbutton="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" > android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout <RelativeLayout
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ImageView
android:id="@+id/api_app_settings_app_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_marginRight="6dp"
android:src="@drawable/icon" />
<TextView
android:id="@+id/api_app_settings_app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/api_app_settings_app_icon"
android:gravity="center_vertical"
android:orientation="vertical"
android:text="Name (set in-code)"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<fragment
android:id="@+id/api_app_settings_select_key_fragment"
android:name="org.sufficientlysecure.keychain.ui.SelectSecretKeyLayoutFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" > tools:layout="@layout/select_secret_key_layout_fragment" />
<RelativeLayout <com.beardedhen.androidbootstrap.BootstrapButton
android:layout_width="match_parent" android:id="@+id/api_app_settings_advanced_button"
android:layout_height="?android:attr/listPreferredItemHeight" android:layout_width="match_parent"
android:layout_marginBottom="4dp" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_gravity="center_vertical"
android:gravity="center_horizontal" android:layout_marginBottom="4dp"
android:orientation="horizontal" > android:layout_marginTop="4dp"
android:text="@string/api_settings_show_advanced"
bootstrapbutton:bb_icon_left="fa-caret-up"
bootstrapbutton:bb_size="default"
bootstrapbutton:bb_type="default" />
<ImageView <LinearLayout
android:id="@+id/api_app_settings_app_icon" android:id="@+id/api_app_settings_advanced"
android:layout_width="48dp" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:orientation="vertical"
android:layout_alignParentTop="true" android:visibility="gone">
android:layout_marginRight="6dp"
android:src="@drawable/icon" />
<TextView <TextView
android:id="@+id/api_app_settings_app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/api_app_settings_app_icon"
android:gravity="center_vertical"
android:orientation="vertical"
android:text="Name (set in-code)"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
<fragment
android:id="@+id/api_app_settings_select_key_fragment"
android:name="org.sufficientlysecure.keychain.ui.SelectSecretKeyLayoutFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:layout="@layout/select_secret_key_layout_fragment" /> android:text="@string/label_encryption_algorithm"
android:textAppearance="?android:attr/textAppearanceMedium" />
<com.beardedhen.androidbootstrap.BootstrapButton <Spinner
android:id="@+id/api_app_settings_advanced_button" android:id="@+id/api_app_settings_encryption_algorithm"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:text="@string/label_hash_algorithm"
android:layout_marginBottom="4dp" android:textAppearance="?android:attr/textAppearanceMedium" />
android:layout_marginTop="4dp"
android:text="@string/api_settings_show_advanced"
bootstrapbutton:bb_icon_left="fa-caret-up"
bootstrapbutton:bb_size="default"
bootstrapbutton:bb_type="default" />
<LinearLayout <Spinner
android:id="@+id/api_app_settings_advanced" android:id="@+id/api_app_settings_hash_algorithm"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:text="@string/label_message_compression"
android:visibility="gone" > android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView <Spinner
android:layout_width="match_parent" android:id="@+id/api_app_settings_compression"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:text="@string/label_encryption_algorithm" android:layout_height="wrap_content" />
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner <TextView
android:id="@+id/api_app_settings_encryption_algorithm" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" /> android:text="@string/api_settings_package_name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView <TextView
android:layout_width="match_parent" android:id="@+id/api_app_settings_package_name"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:text="@string/label_hash_algorithm" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:text="com.example"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Spinner <TextView
android:id="@+id/api_app_settings_hash_algorithm" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" /> android:text="@string/api_settings_package_signature"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView <TextView
android:layout_width="match_parent" android:id="@+id/api_app_settings_package_signature"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:text="@string/label_message_compression" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:text="Base64 encoded signature"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Spinner
android:id="@+id/api_app_settings_compression"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/api_settings_package_name"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/api_app_settings_package_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="com.example"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/api_settings_package_signature"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/api_app_settings_package_signature"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Base64 encoded signature"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -1,6 +1,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingTop="4dp" android:paddingTop="4dp"
android:paddingBottom="4dp"> android:paddingBottom="4dp">
@ -8,20 +9,18 @@
android:id="@+id/api_apps_adapter_item_icon" android:id="@+id/api_apps_adapter_item_icon"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_alignParentTop="true"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginRight="8dp" android:layout_centerVertical="true"
android:src="@drawable/icon" /> android:src="@drawable/icon" />
<TextView <TextView
android:id="@+id/api_apps_adapter_item_name" android:id="@+id/api_apps_adapter_item_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_marginLeft="8dp"
android:layout_toRightOf="@+id/api_apps_adapter_item_icon"
android:gravity="center_vertical"
android:orientation="vertical"
android:text="Application Name" android:text="Application Name"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/api_apps_adapter_item_icon" />
</RelativeLayout> </RelativeLayout>