Created
February 15, 2017 10:40
-
-
Save daniel-stoneuk/dfb90778da83ac244d640cda02c8aa4a to your computer and use it in GitHub Desktop.
Create interactive version card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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