aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-03-10 02:22:47 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2015-03-10 03:29:52 +0100
commitf069d9814dd5bb4dcc99be1a08da2d7bcf350cde (patch)
tree486061b9fc9b9cd7f2f8a961bd67b2bb68ea963a /OpenKeychain/src/main/java/org
parent2a42ff016fbe3974811323f4da3775279d6bdccc (diff)
downloadopen-keychain-f069d9814dd5bb4dcc99be1a08da2d7bcf350cde.tar.gz
open-keychain-f069d9814dd5bb4dcc99be1a08da2d7bcf350cde.tar.bz2
open-keychain-f069d9814dd5bb4dcc99be1a08da2d7bcf350cde.zip
minor additions to CertListWidget
Diffstat (limited to 'OpenKeychain/src/main/java/org')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java3
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java24
2 files changed, 18 insertions, 9 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java
index 1c301c642..21c9abca3 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java
@@ -366,8 +366,7 @@ public class LinkedIdViewFragment extends Fragment implements
{
Bundle args = new Bundle();
- args.putParcelable(CertListWidget.ARG_URI, mDataUri);
- args.putInt(CertListWidget.ARG_RANK, mLidRank);
+ args.putParcelable(CertListWidget.ARG_URI, Certs.buildLinkedIdCertsUri(mDataUri, mLidRank));
getLoaderManager().initLoader(CertListWidget.LOADER_ID_LINKED_CERTS,
args, mViewHolder.vLinkedCerts);
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java
index 3e9cffb69..094a84820 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java
@@ -14,6 +14,7 @@ import android.support.v4.content.Loader;
import android.text.SpannableStringBuilder;
import android.util.AttributeSet;
import android.view.View;
+import android.widget.ListView;
import android.widget.TextView;
import android.widget.ViewAnimator;
@@ -53,7 +54,7 @@ public class CertListWidget extends ViewAnimator
public static final int INDEX_CREATION = 8;
private TextView vCollapsed;
- private View vExpanded;
+ private ListView vExpanded;
private View vExpandButton;
public CertListWidget(Context context, AttributeSet attrs) {
@@ -66,11 +67,24 @@ public class CertListWidget extends ViewAnimator
View root = getRootView();
vCollapsed = (TextView) root.findViewById(R.id.cert_collapsed_list);
- vExpanded = root.findViewById(R.id.cert_expanded_list);
+ vExpanded = (ListView) root.findViewById(R.id.cert_expanded_list);
vExpandButton = root.findViewById(R.id.cert_expand_button);
// for now
vExpandButton.setVisibility(View.GONE);
+ vExpandButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ toggleExpanded();
+ }
+ });
+
+ // vExpanded.setAdapter(null);
+
+ }
+
+ void toggleExpanded() {
+ setDisplayedChild(getDisplayedChild() == 1 ? 0 : 1);
}
void setExpanded(boolean expanded) {
@@ -79,13 +93,9 @@ public class CertListWidget extends ViewAnimator
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
- Uri baseUri = args.getParcelable(ARG_URI);
- int rank = args.getInt(ARG_RANK);
-
- Uri uri = Certs.buildLinkedIdCertsUri(baseUri, rank);
+ Uri uri = args.getParcelable(ARG_URI);
return new CursorLoader(getContext(), uri,
CERTS_PROJECTION, null, null, null);
-
}
@Override