本文整理汇总了Java中org.irmacard.credentials.Attributes类的典型用法代码示例。如果您正苦于以下问题:Java Attributes类的具体用法?Java Attributes怎么用?Java Attributes使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Attributes类属于org.irmacard.credentials包,在下文中一共展示了Attributes类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newInstance
import org.irmacard.credentials.Attributes; //导入依赖的package包/类
/**
* Constructs and returns a new DisclosureDialogFragment. Users must implement the DisclosureDialogListener
* interface.
*
* @param credentials A hashmap in which the keys are the credentials and the values the disclosed attributes.
* @return The new dialog.
*/
public static DisclosureDialogFragment newInstance(HashMap<CredentialPackage,Attributes> credentials) {
DisclosureDialogFragment dialog = new DisclosureDialogFragment();
Bundle args = new Bundle();
args.putSerializable("credentials", credentials);
dialog.setArguments(args);
return dialog;
}
示例2: onCreate
import org.irmacard.credentials.Attributes; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
credentials = (HashMap<CredentialPackage, Attributes>) getArguments().getSerializable("credentials");
}
示例3: render
import org.irmacard.credentials.Attributes; //导入依赖的package包/类
/**
* Render the specified attributes, adding them to the specified list.
*
* @param credential The credential.
* @param list The list to add the rendered attributes to.
* @param includeTitle If true, the title of the credential will also be rendered and the attributes get a bullet
* in front of them (creating an unordered list).
* @param disclosedAttributes If specified, those attributes found in the credential but not here will be shown in
* light grey to indicate they are not being disclosed.
*/
public void render(Attributes attributes, LinearLayout list, boolean includeTitle, Attributes
disclosedAttributes) {
CredentialDescription cd = attributes.getCredentialDescription();
if (includeTitle) {
TextView attrName = new TextView(context);
attrName.setTextAppearance(context, R.style.DetailHeading);
attrName.setText(cd.getName());
attrName.setTextColor(Color.BLACK);
list.addView(attrName);
}
for (AttributeDescription desc : cd.getAttributes()) {
View attributeView = inflater.inflate(R.layout.row_attribute, null);
TextView name = (TextView) attributeView.findViewById(R.id.detail_attribute_name);
TextView value = (TextView) attributeView.findViewById(R.id.detail_attribute_value);
if (disclosedAttributes != null) {
if (disclosedAttributes.get(desc.getName()) != null) {
value.setTextColor(Color.BLACK);
value.setTextAppearance(context, R.style.DetailHeading);
} else {
name.setTextColor(context.getResources().getColor(R.color.irmagrey));
value.setTextColor(context.getResources().getColor(R.color.irmagrey));
}
}
if (includeTitle) {
name.setText(" \u2022 " + desc.getName() + ":");
} else {
name.setText(desc.getName() + ":");
}
value.setText(new String(attributes.get(desc.getName())));
list.addView(attributeView);
}
}
示例4: onCreate
import org.irmacard.credentials.Attributes; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments().containsKey(ATTRIBUTES)) {
hashCode = getArguments().getInt(HASHCODE);
attributes = (Attributes) getArguments().getSerializable(ATTRIBUTES);
if (attributes == null)
throw new NullPointerException("attributes missing from arguments");
cd = attributes.getCredentialDescription();
}
fileReader = new AndroidFileReader(this.getActivity());
}
示例5: onCreate
import org.irmacard.credentials.Attributes; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_credential_detail);
// Show the Up button in the action bar.
getActionBar().setDisplayHomeAsUpEnabled(true);
// savedInstanceState is non-null when there is fragment state
// saved from previous configurations of this activity
// (e.g. when rotating the screen from portrait to landscape).
// In this case, the fragment will automatically be re-added
// to its container so we don't need to manually add it.
// For more information, see the Fragments API guide at:
//
// http://developer.android.com/guide/components/fragments.html
//
if (savedInstanceState == null) {
// Create the detail fragment and add it to the activity
// using a fragment transaction.
Attributes attributes = (Attributes) getIntent().getSerializableExtra(CredentialDetailFragment.ATTRIBUTES);
int hashCode = getIntent().getIntExtra(CredentialDetailFragment.HASHCODE, 0);
Bundle arguments = new Bundle();
arguments.putSerializable(CredentialDetailFragment.ATTRIBUTES, attributes);
arguments.putInt(CredentialDetailFragment.HASHCODE, hashCode);
CredentialDetailFragment fragment = new CredentialDetailFragment();
fragment.setArguments(arguments);
getSupportFragmentManager().beginTransaction()
.add(R.id.credential_detail_container, fragment).commit();
getActionBar().setTitle(attributes.getCredentialIdentifier().getCredentialName());
}
}
示例6: CredentialPackage
import org.irmacard.credentials.Attributes; //导入依赖的package包/类
public CredentialPackage(CredentialDescription credDesc, Attributes attributes) {
this.credDesc = credDesc;
this.attributes = attributes;
}
示例7: getAttributes
import org.irmacard.credentials.Attributes; //导入依赖的package包/类
public Attributes getAttributes() {
return attributes;
}