From 65857d2b5fea5cbb5d156b1b4ddfd68ded311624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 26 Mar 2014 17:43:26 +0100 Subject: Accounts list prettified --- .../keychain/remote/ui/AccountsListFragment.java | 27 +++++++++++++++++++++ .../keychain/remote/ui/AppSettingsActivity.java | 1 - .../main/res/drawable-hdpi/ic_action_person.png | Bin 0 -> 573 bytes .../main/res/drawable-mdpi/ic_action_person.png | Bin 0 -> 468 bytes .../main/res/drawable-xhdpi/ic_action_person.png | Bin 0 -> 781 bytes .../main/res/drawable-xxhdpi/ic_action_person.png | Bin 0 -> 1004 bytes .../res/layout/api_accounts_adapter_list_item.xml | 15 ++++++++++-- .../main/res/layout/api_app_settings_activity.xml | 6 ++--- 8 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_action_person.png create mode 100644 OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_action_person.png create mode 100644 OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_action_person.png create mode 100644 OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_action_person.png (limited to 'OpenPGP-Keychain/src') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountsListFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountsListFragment.java index 22ee7db76..8e65a2f04 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountsListFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountsListFragment.java @@ -32,11 +32,15 @@ import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; +import android.widget.LinearLayout; +import android.widget.ListView; import android.widget.TextView; import org.sufficientlysecure.keychain.Constants; +import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.provider.KeychainContract; +import org.sufficientlysecure.keychain.ui.widget.FixedListView; import org.sufficientlysecure.keychain.util.Log; public class AccountsListFragment extends ListFragment implements @@ -63,6 +67,29 @@ public class AccountsListFragment extends ListFragment implements return frag; } + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View layout = super.onCreateView(inflater, container, + savedInstanceState); + ListView lv = (ListView) layout.findViewById(android.R.id.list); + ViewGroup parent = (ViewGroup) lv.getParent(); + + /* + * http://stackoverflow.com/a/15880684 + * Remove ListView and add FixedListView in its place. + * This is done here programatically to be still able to use the progressBar of ListFragment. + * + * We want FixedListView to be able to put this ListFragment inside a ScrollView + */ + int lvIndex = parent.indexOfChild(lv); + parent.removeViewAt(lvIndex); + FixedListView newLv = new FixedListView(getActivity()); + newLv.setId(android.R.id.list); + parent.addView(newLv, lvIndex, lv.getLayoutParams()); + return layout; + } + @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java index e4b943734..9e0ba49eb 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java @@ -103,7 +103,6 @@ public class AppSettingsActivity extends ActionBarActivity { } setTitle(appName); - Uri accountsUri = appUri.buildUpon().appendPath(KeychainContract.PATH_ACCOUNTS).build(); Log.d(Constants.TAG, "accountsUri: " + accountsUri); startListFragment(savedInstanceState, accountsUri); diff --git a/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_action_person.png b/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_action_person.png new file mode 100644 index 000000000..9fd81097b Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-hdpi/ic_action_person.png differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_action_person.png b/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_action_person.png new file mode 100644 index 000000000..359da1c12 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-mdpi/ic_action_person.png differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_action_person.png b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_action_person.png new file mode 100644 index 000000000..03eeb8d6a Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-xhdpi/ic_action_person.png differ diff --git a/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_action_person.png b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_action_person.png new file mode 100644 index 000000000..fd1bcdd45 Binary files /dev/null and b/OpenPGP-Keychain/src/main/res/drawable-xxhdpi/ic_action_person.png differ diff --git a/OpenPGP-Keychain/src/main/res/layout/api_accounts_adapter_list_item.xml b/OpenPGP-Keychain/src/main/res/layout/api_accounts_adapter_list_item.xml index bbe6bc2ef..d31ae52d7 100644 --- a/OpenPGP-Keychain/src/main/res/layout/api_accounts_adapter_list_item.xml +++ b/OpenPGP-Keychain/src/main/res/layout/api_accounts_adapter_list_item.xml @@ -2,8 +2,19 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?android:attr/listPreferredItemHeight" - android:paddingTop="4dp" - android:paddingBottom="4dp"> + android:gravity="center_vertical" + android:singleLine="true" + android:orientation="horizontal"> + + @@ -27,9 +27,7 @@ android:id="@+id/api_accounts_list_fragment" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" - android:paddingLeft="4dp" - android:paddingRight="4dp" /> + android:orientation="vertical" /> -- cgit v1.2.3