mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-23 23:12:06 -05:00
minor additions to CertListWidget
This commit is contained in:
parent
2a42ff016f
commit
f069d9814d
@ -366,8 +366,7 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
|
|
||||||
{
|
{
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putParcelable(CertListWidget.ARG_URI, mDataUri);
|
args.putParcelable(CertListWidget.ARG_URI, Certs.buildLinkedIdCertsUri(mDataUri, mLidRank));
|
||||||
args.putInt(CertListWidget.ARG_RANK, mLidRank);
|
|
||||||
getLoaderManager().initLoader(CertListWidget.LOADER_ID_LINKED_CERTS,
|
getLoaderManager().initLoader(CertListWidget.LOADER_ID_LINKED_CERTS,
|
||||||
args, mViewHolder.vLinkedCerts);
|
args, mViewHolder.vLinkedCerts);
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ import android.support.v4.content.Loader;
|
|||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.ViewAnimator;
|
import android.widget.ViewAnimator;
|
||||||
|
|
||||||
@ -53,7 +54,7 @@ public class CertListWidget extends ViewAnimator
|
|||||||
public static final int INDEX_CREATION = 8;
|
public static final int INDEX_CREATION = 8;
|
||||||
|
|
||||||
private TextView vCollapsed;
|
private TextView vCollapsed;
|
||||||
private View vExpanded;
|
private ListView vExpanded;
|
||||||
private View vExpandButton;
|
private View vExpandButton;
|
||||||
|
|
||||||
public CertListWidget(Context context, AttributeSet attrs) {
|
public CertListWidget(Context context, AttributeSet attrs) {
|
||||||
@ -66,11 +67,24 @@ public class CertListWidget extends ViewAnimator
|
|||||||
|
|
||||||
View root = getRootView();
|
View root = getRootView();
|
||||||
vCollapsed = (TextView) root.findViewById(R.id.cert_collapsed_list);
|
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);
|
vExpandButton = root.findViewById(R.id.cert_expand_button);
|
||||||
|
|
||||||
// for now
|
// for now
|
||||||
vExpandButton.setVisibility(View.GONE);
|
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) {
|
void setExpanded(boolean expanded) {
|
||||||
@ -79,13 +93,9 @@ public class CertListWidget extends ViewAnimator
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
|
||||||
Uri baseUri = args.getParcelable(ARG_URI);
|
Uri uri = args.getParcelable(ARG_URI);
|
||||||
int rank = args.getInt(ARG_RANK);
|
|
||||||
|
|
||||||
Uri uri = Certs.buildLinkedIdCertsUri(baseUri, rank);
|
|
||||||
return new CursorLoader(getContext(), uri,
|
return new CursorLoader(getContext(), uri,
|
||||||
CERTS_PROJECTION, null, null, null);
|
CERTS_PROJECTION, null, null, null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user