Added issuer to profile card

pull/41/head
Michael Schättgen 8 years ago
parent 099250dd49
commit fd3db9854d

@ -9,6 +9,7 @@ public class KeyProfile implements Serializable {
public String Name;
public String Icon;
public String Code;
public String Issuer;
public KeyInfo Info;
public int Order;
public int ID;

@ -104,6 +104,7 @@ public class KeyProfileAdapter extends RecyclerView.Adapter<KeyProfileAdapter.Ke
public static class KeyProfileHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
TextView profileName;
TextView profileCode;
TextView profileIssuer;
ImageView profileDrawable;
KeyProfile keyProfile;
ProgressBar progressBar;
@ -112,6 +113,7 @@ public class KeyProfileAdapter extends RecyclerView.Adapter<KeyProfileAdapter.Ke
super(itemView);
profileName = (TextView) itemView.findViewById(R.id.profile_name);
profileCode = (TextView) itemView.findViewById(R.id.profile_code);
profileIssuer = (TextView) itemView.findViewById(R.id.profile_issuer);
profileDrawable = (ImageView) itemView.findViewById(R.id.ivTextDrawable);
progressBar = (ProgressBar) itemView.findViewById(R.id.progressBar);
@ -122,6 +124,7 @@ public class KeyProfileAdapter extends RecyclerView.Adapter<KeyProfileAdapter.Ke
this.keyProfile = profile;
profileName.setText(profile.Name);
profileCode.setText(profile.Code);
profileIssuer.setText(" - " + profile.Info.getIssuer());
profileDrawable.setImageDrawable(generateTextDrawable(profile));
}
@ -153,8 +156,7 @@ public class KeyProfileAdapter extends RecyclerView.Adapter<KeyProfileAdapter.Ke
if (profileName == null)
return null;
ColorGenerator generator = ColorGenerator.MATERIAL; // or use DEFAULT
// generate color based on a key (same key returns the same color), useful for list/grid views
ColorGenerator generator = ColorGenerator.MATERIAL;
int profileKeyColor = generator.getColor(profile.Name);
TextDrawable newDrawable = TextDrawable.builder().buildRound(profile.Name.substring(0, 1).toUpperCase(), profileKeyColor);

@ -46,4 +46,22 @@
/>
</RelativeLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="350dp"
android:clipToPadding="true"
android:background="@android:color/holo_orange_light"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/ipsum"
android:padding="16dp"
android:textSize="16sp"/>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>

@ -50,7 +50,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/profile_name"
android:text="Post title"
android:text="Keyprofile Title"
android:textColor="?attr/secondaryText"
android:includeFontPadding="false"
android:textSize="15sp"
@ -60,6 +60,20 @@
android:ellipsize="end"
android:maxLines="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/profile_issuer"
android:text=" - Issuer"
android:textColor="@color/extra_info_text"
android:includeFontPadding="false"
android:textSize="15sp"
android:layout_toRightOf="@id/profile_name"
android:layout_below="@id/profile_code"
android:ellipsize="end"
android:maxLines="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"

@ -7,6 +7,7 @@
<color name="colorAccent">#FF5252</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#434343</color>
<color name="extra_info_text">#8e8e8e</color>
<color name="primary_text_inverted">#ffffff</color>
<color name="secondary_text_inverted">#efefef</color>b
<color name="icons">#FFFFFF</color>

Loading…
Cancel
Save