use of com.danielstone.materialaboutlibrary.model.MaterialAboutCard in project material-about-library by daniel-stoneuk.
the class Demo method createMaterialAboutLicenseList.
public static MaterialAboutList createMaterialAboutLicenseList(final Context c, int colorIcon) {
MaterialAboutCard materialAboutLIbraryLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).color(ContextCompat.getColor(c, colorIcon)).sizeDp(18), "material-about-library", "2016", "Daniel Stone", OpenSourceLicense.APACHE_2);
MaterialAboutCard androidIconicsLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).color(ContextCompat.getColor(c, colorIcon)).sizeDp(18), "Android Iconics", "2016", "Mike Penz", OpenSourceLicense.APACHE_2);
MaterialAboutCard leakCanaryLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).color(ContextCompat.getColor(c, colorIcon)).sizeDp(18), "LeakCanary", "2015", "Square, Inc", OpenSourceLicense.APACHE_2);
MaterialAboutCard mitLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).color(ContextCompat.getColor(c, colorIcon)).sizeDp(18), "MIT Example", "2017", "Matthew Ian Thomson", OpenSourceLicense.MIT);
MaterialAboutCard gplLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).color(ContextCompat.getColor(c, colorIcon)).sizeDp(18), "GPL Example", "2017", "George Perry Lindsay", OpenSourceLicense.GNU_GPL_3);
return new MaterialAboutList(materialAboutLIbraryLicenseCard, androidIconicsLicenseCard, leakCanaryLicenseCard, mitLicenseCard, gplLicenseCard);
}
use of com.danielstone.materialaboutlibrary.model.MaterialAboutCard in project material-about-library by daniel-stoneuk.
the class Demo method createMaterialAboutLicenseList.
public static MaterialAboutList createMaterialAboutLicenseList(final Context c) {
MaterialAboutCard materialAboutLibraryLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "material-about-library", "2016", "Daniel Stone", OpenSourceLicense.APACHE_2);
MaterialAboutCard androidIconicsLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "Android Iconics", "2016", "Mike Penz", OpenSourceLicense.APACHE_2);
MaterialAboutCard leakCanaryLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "LeakCanary", "2015", "Square, Inc", OpenSourceLicense.APACHE_2);
MaterialAboutCard mitLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "MIT Example", "2017", "Matthew Ian Thomson", OpenSourceLicense.MIT);
MaterialAboutCard gplLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "GPL Example", "2017", "George Perry Lindsay", OpenSourceLicense.GNU_GPL_3);
return new MaterialAboutList(materialAboutLibraryLicenseCard, androidIconicsLicenseCard, leakCanaryLicenseCard, mitLicenseCard, gplLicenseCard);
}
use of com.danielstone.materialaboutlibrary.model.MaterialAboutCard in project Giua-App by Giua-app.
the class AboutActivity method createMaterialAboutLicenseList.
public static MaterialAboutList createMaterialAboutLicenseList(final Context c) {
MaterialAboutCard appIntroLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "AppIntro", "2015-2020", "AppIntro Developers", OpenSourceLicense.APACHE_2);
MaterialAboutCard giuaScraperLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "Giua Webscraper", "2021-2022", "Hiem, Franck1421 and contributors", OpenSourceLicense.GNU_GPL_3);
MaterialAboutCard caocLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "CustomActivityOnCrash", "", "Eduard Ereza MartÃnez", OpenSourceLicense.MIT);
MaterialAboutCard jsoupLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "JSoup", "2009-2021", "Jonathan Hedley", OpenSourceLicense.MIT);
MaterialAboutCard materialAboutLibraryLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "material-about-library", "2016", "Daniel Stone", OpenSourceLicense.APACHE_2);
MaterialAboutCard androidIconicsLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "Android Iconics", "2016", "Mike Penz", OpenSourceLicense.APACHE_2);
MaterialAboutCard leakCanaryLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "LeakCanary", "2015", "Square, Inc", OpenSourceLicense.APACHE_2);
MaterialAboutCard androidChartLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "MPAndroidChart", "2020", "Philipp Jahoda", OpenSourceLicense.APACHE_2);
MaterialAboutCard drawerLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "Material Drawer", "2021", "Mike Penz", OpenSourceLicense.APACHE_2);
MaterialAboutCard calendarLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "Compact Calendar View", "2017", "Sundeepk", OpenSourceLicense.MIT);
MaterialAboutCard glideLicenseCard = ConvenienceBuilder.createLicenseCard(c, new IconicsDrawable(c).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18), "Glide", "2014", "bumptech", // FIXME: NON E' LA VERA LICENZA
OpenSourceLicense.APACHE_2);
return new MaterialAboutList(giuaScraperLicenseCard, appIntroLicenseCard, caocLicenseCard, jsoupLicenseCard, materialAboutLibraryLicenseCard, androidIconicsLicenseCard, leakCanaryLicenseCard, androidChartLicenseCard, drawerLicenseCard, calendarLicenseCard, glideLicenseCard);
}
use of com.danielstone.materialaboutlibrary.model.MaterialAboutCard in project material-about-library by daniel-stoneuk.
the class MaterialAboutListAdapter method setData.
public void setData(ArrayList<MaterialAboutCard> newData) {
List<MaterialAboutCard> data = new ArrayList<>();
for (MaterialAboutCard card : newData) {
data.add(card.clone());
}
differ.submitList(data);
}
use of com.danielstone.materialaboutlibrary.model.MaterialAboutCard in project material-about-library by daniel-stoneuk.
the class MaterialAboutListAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(MaterialAboutListViewHolder holder, int position) {
MaterialAboutCard card = differ.getCurrentList().get(position);
if (holder.cardView instanceof CardView) {
CardView cardView = (CardView) holder.cardView;
int cardColor = card.getCardColor();
if (cardColor != 0) {
cardView.setCardBackgroundColor(cardColor);
} else {
cardView.setCardBackgroundColor(cardView.getCardBackgroundColor().getDefaultColor());
}
}
CharSequence title = card.getTitle();
int titleRes = card.getTitleRes();
holder.title.setVisibility(View.VISIBLE);
if (title != null) {
holder.title.setText(title);
} else if (titleRes != 0) {
holder.title.setText(titleRes);
} else {
holder.title.setVisibility(View.GONE);
}
int titleColor = card.getTitleColor();
if (holder.title.getVisibility() == View.VISIBLE) {
if (titleColor != 0) {
holder.title.setTextColor(titleColor);
} else {
holder.title.setTextColor(holder.title.getTextColors().getDefaultColor());
}
}
if (holder.cardView instanceof MaterialCardView) {
MaterialCardView materialCardView = (MaterialCardView) holder.cardView;
if (card.isOutline()) {
materialCardView.setStrokeWidth((int) context.getResources().getDimension(R.dimen.mal_stroke_width));
materialCardView.setCardElevation(0);
} else {
materialCardView.setStrokeWidth(0);
materialCardView.setCardElevation(context.getResources().getDimension(R.dimen.mal_card_elevation));
}
}
if (card.getCustomAdapter() != null) {
holder.useCustomAdapter(card.getCustomAdapter());
} else {
holder.useMaterialAboutItemAdapter();
((MaterialAboutItemAdapter) holder.adapter).setData(card.getItems());
}
}
Aggregations