Skip to content

Instantly share code, notes, and snippets.

@daniel-stoneuk
Created February 15, 2017 10:40
Show Gist options
  • Save daniel-stoneuk/dfb90778da83ac244d640cda02c8aa4a to your computer and use it in GitHub Desktop.
Save daniel-stoneuk/dfb90778da83ac244d640cda02c8aa4a to your computer and use it in GitHub Desktop.
Create interactive version card
advancedCardBuilder.addItem(new MaterialAboutActionItem.Builder()
.text("Version")
.subText(BuildConfig.VERSION_NAME)
.icon(new IconicsDrawable(c)
.icon(CommunityMaterial.Icon.cmd_information_outline)
.color(ContextCompat.getColor(c, colorIcon)
).sizeDp(18))
.setOnClickListener(new MaterialAboutItemOnClickListener() {
@Override
public void onClick() {
MaterialAboutList newList = getMaterialAboutList();
((MaterialAboutActionItem) newList.getCards()
.get(4)
.getItems()
.get(4)).setSubText(BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ")");
setMaterialAboutList(newList);
}
})
.build());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment