当前位置: 首页>>代码示例>>Java>>正文


Java MaterialAboutCard类代码示例

本文整理汇总了Java中com.danielstone.materialaboutlibrary.model.MaterialAboutCard的典型用法代码示例。如果您正苦于以下问题:Java MaterialAboutCard类的具体用法?Java MaterialAboutCard怎么用?Java MaterialAboutCard使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MaterialAboutCard类属于com.danielstone.materialaboutlibrary.model包,在下文中一共展示了MaterialAboutCard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMaterialAboutList

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@Override
protected MaterialAboutList getMaterialAboutList(Context context) {
    // Build the cards
    MaterialAboutCard.Builder appCardBuilder = new MaterialAboutCard.Builder();
    buildApp(this, appCardBuilder);

    MaterialAboutCard.Builder authorCardBuilder = new MaterialAboutCard.Builder();
    buildAuthor(this, authorCardBuilder);

    MaterialAboutCard.Builder contributeCardBuilder = new MaterialAboutCard.Builder();
    buildContribute(this, contributeCardBuilder);

    return new MaterialAboutList.Builder()
            .addCard(appCardBuilder.build())
            .addCard(authorCardBuilder.build())
            .addCard(contributeCardBuilder.build())
            .build();
}
 
开发者ID:Jiikuy,项目名称:VelocityCalculator,代码行数:19,代码来源:AboutActivity.java

示例2: buildAuthor

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
private void buildAuthor(Context context, MaterialAboutCard.Builder authorCardBuilder) {
    authorCardBuilder.title(getString(R.string.about_author))
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_authorname))
                    .subText(getString(R.string.about_country))
                    .icon(new IconicsDrawable(context)
                            .icon(GoogleMaterial.Icon.gmd_person)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .build())
            .addItem(ConvenienceBuilder.createEmailItem(context, new IconicsDrawable(context)
                    .icon(GoogleMaterial.Icon.gmd_email)
                    .color(Color.GRAY)
                    .sizeDp(18), getString(R.string.about_sendemail), true, getString(R.string.about_emailaddress), ""))
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_github))
                    .subText(getString(R.string.about_githubusername))
                    .icon(new IconicsDrawable(context)
                            .icon(CommunityMaterial.Icon.cmd_github_circle)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(context, Uri.parse("https://github.com/Jiikuy/") ))
                    .build());
}
 
开发者ID:Jiikuy,项目名称:VelocityCalculator,代码行数:25,代码来源:AboutActivity.java

示例3: buildContribute

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
private void buildContribute(Context context, MaterialAboutCard.Builder contributeCardBuilder) {
    contributeCardBuilder.title(getString(R.string.about_contribute))
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_reportissue))
                    .subText(getString(R.string.about_reportissuehere))
                    .icon(new IconicsDrawable(context)
                            .icon(GoogleMaterial.Icon.gmd_bug_report)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(context, Uri.parse("https://github.com/Jiikuy/VelocityCalculator/issues")))
                    .build())
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_translate))
                    .subText(getString(R.string.about_translatehere))
                    .icon(new IconicsDrawable(context)
                            .icon(GoogleMaterial.Icon.gmd_translate)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(context, Uri.parse("https://www.poeditor.com/join/project/EIvRjgfGRO")))
                    .build());
}
 
开发者ID:Jiikuy,项目名称:VelocityCalculator,代码行数:22,代码来源:AboutActivity.java

示例4: getMaterialAboutList

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@NonNull
@Override
protected MaterialAboutList getMaterialAboutList(@NonNull Context context)
{
    MaterialAboutCard.Builder appCardBuilder = new MaterialAboutCard.Builder();

    appCardBuilder.addItem(new MaterialAboutTitleItem.Builder()
            .text(getString(R.string.app_name))
            .icon(R.drawable.ic_app)
            .build());

    appCardBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text("Licenses")
            .icon(new IconDrawable(context, FontAwesomeIcons.fa_file_text).sizeDp(18))
            .setOnClickAction(() ->
                    context.startActivity(LicenseActivity.createIntent(context)))
            .build());

    MaterialAboutCard.Builder authorCardBuilder = new MaterialAboutCard.Builder();
    authorCardBuilder.title("Author");

    authorCardBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text("Josh Laird")
            .subText("London, UK")
            .icon(new IconDrawable(context, FontAwesomeIcons.fa_user).sizeDp(18))
            .build());

    authorCardBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text("Fork on Github")
            .icon(new IconDrawable(context, FontAwesomeIcons.fa_github).sizeDp(18))
            .setOnClickAction(() ->
            {
                Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://github.com/jbmlaird"));
                startActivity(intent);
            })
            .build());

    return new MaterialAboutList(appCardBuilder.build(), authorCardBuilder.build());
}
 
开发者ID:jbmlaird,项目名称:DiscogsBrowser,代码行数:40,代码来源:AboutActivity.java

示例5: getMaterialAboutList

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@NonNull
@Override
protected MaterialAboutList getMaterialAboutList(@NonNull Context context)
{
    MaterialAboutCard discogsBrowser = buildMaterialAboutCard(context, context.getString(R.string.app_name), R.string.license_mit, "2017", "Josh Laird");
    MaterialAboutCard rxJavaRxAndroid = buildMaterialAboutCard(context, "RxJava2/RxAndroid", R.string.license_apache2, "2016-present", "RxJava Contributors");
    MaterialAboutCard retrofit2 = buildMaterialAboutCard(context, "Retrofit2", R.string.license_apache2, "2013", "Square, Inc.");
    MaterialAboutCard rxCache = buildMaterialAboutCard(context, "RxCache", R.string.license_apache2, "2015", "Victor Albertos");
    MaterialAboutCard dagger2 = buildMaterialAboutCard(context, "ButterKnife", R.string.license_apache2, "2012", "The Dagger Authors");
    MaterialAboutCard butterKnife = buildMaterialAboutCard(context, "ButterKnife", R.string.license_apache2, "2013", "Jake Wharton");
    MaterialAboutCard materialDrawer = buildMaterialAboutCard(context, "MaterialDrawer", R.string.license_apache2, "2016", "Mike Penz");
    MaterialAboutCard rxBinding2 = buildMaterialAboutCard(context, "RxBinding2", R.string.license_apache2, "2015", "Jake Wharton");
    MaterialAboutCard leakCanary = buildMaterialAboutCard(context, "RxRelay", R.string.license_apache2, "2015", "Square, Inc.");
    MaterialAboutCard rxRelay = buildMaterialAboutCard(context, "RxRelay", R.string.license_apache2, "2015", "Jake Wharton");
    MaterialAboutCard jSoup = buildMaterialAboutCard(context, "Jsoup", R.string.license_mit, "2009-2017", "Jonathon Hedley");
    MaterialAboutCard circleImageView = buildMaterialAboutCard(context, "CircleImageView", R.string.license_apache2, "2014-2017", "Henning Dodenhof");
    MaterialAboutCard materialDialogs = buildMaterialAboutCard(context, "Material Dialogs", R.string.license_mit, "2014-2017", "Aidan Michael Follestad");
    MaterialAboutCard rxSocialConnect = buildMaterialAboutCard(context, "RxSocialConnect", R.string.license_apache2, "2016", "Boilerplate");
    MaterialAboutCard greenDao = buildMaterialAboutCard(context, "GreenDAO", R.string.license_apache2, "2016", "greenrobot");
    MaterialAboutCard loadingButtonAndroid = buildMaterialAboutCard(context, "LoadingButtonAndroid", R.string.license_mit, "2016", "leandroBorgesFerreira");
    MaterialAboutCard toasty = buildMaterialAboutCard(context, "Toasty", R.string.license_gpl, "2017", "GrenderG");
    MaterialAboutCard materialAboutLibrary = buildMaterialAboutCard(context, "Material About Library", R.string.license_apache2, "2016", "Daniel Stone");
    MaterialAboutCard tapTargetView = buildMaterialAboutCard(context, "TapTargetView", R.string.license_apache2, "2016", "Keepsafe Software Inc.");
    MaterialAboutCard youTubeAndroidPlayer = buildMaterialAboutCard(context, "YouTube Android Player", R.string.license_apache2, "2017", "YouTube");
    MaterialAboutCard conductor = buildMaterialAboutCard(context, "Conductor", R.string.license_apache2, "2016-2017", "BlueLine Labs");
    MaterialAboutCard draggablePanel = buildMaterialAboutCard(context, "Draggable Panel", R.string.license_apache2, "2014", "Pedro Vicente Gómez Sánchez");

    return new MaterialAboutList(discogsBrowser, rxJavaRxAndroid, retrofit2, rxCache, dagger2, butterKnife, materialDrawer, rxBinding2, leakCanary, rxRelay,
            jSoup, circleImageView, materialDialogs, rxSocialConnect, greenDao, loadingButtonAndroid, toasty, materialAboutLibrary, tapTargetView,
            youTubeAndroidPlayer, conductor, draggablePanel);
}
 
开发者ID:jbmlaird,项目名称:DiscogsBrowser,代码行数:32,代码来源:LicenseActivity.java

示例6: buildMaterialAboutCard

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
/**
 * Convenience builder for the {@link MaterialAboutCard}s.
 *
 * @param c       Activity context
 * @param text    Library name
 * @param license Library license
 * @param year    Library year copyright
 * @param author  Library author
 * @return Built MaterialAboutCard
 */
private MaterialAboutCard buildMaterialAboutCard(Context c, String text, int license, String year, String author)
{
    MaterialAboutCard.Builder builder = new MaterialAboutCard.Builder();
    builder.addItem(new MaterialAboutActionItem.Builder()
            .text(text)
            .subText(String.format(getString(license), year, author))
            .icon(new IconDrawable(c, FontAwesomeIcons.fa_book).sizeDp(18))
            .setIconGravity(MaterialAboutActionItem.GRAVITY_TOP)
            .build());
    return builder.build();
}
 
开发者ID:jbmlaird,项目名称:DiscogsBrowser,代码行数:22,代码来源:LicenseActivity.java

示例7: getMaterialAboutList

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@NonNull
@Override
protected MaterialAboutList getMaterialAboutList(@NonNull Context context) {
    MaterialAboutCard.Builder appBuilder = new MaterialAboutCard.Builder();
    buildApp(appBuilder, context);
    MaterialAboutCard.Builder authorBuilder = new MaterialAboutCard.Builder();
    buildAuthor(authorBuilder, context);
    MaterialAboutCard.Builder shareBuilder = new MaterialAboutCard.Builder();
    buildShare(shareBuilder, context);
    return new MaterialAboutList(appBuilder.build(), authorBuilder.build(), shareBuilder.build());
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:12,代码来源:AboutActivity.java

示例8: buildApp

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
private void buildApp(MaterialAboutCard.Builder appBuilder, final Context context){
    appBuilder.addItem(new MaterialAboutTitleItem.Builder()
            .text(getString(R.string.app_github_name))
            .desc(getString(R.string.app_copyright))
            .icon(R.mipmap.logo)
            .build());
    appBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text(R.string.version)
            .subText(BuildConfig.VERSION_NAME)
            .icon(R.drawable.ic_menu_about)
            .setOnClickAction(new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    Beta.checkUpgrade(true, true);
                }
            })
            .build());
    appBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text(R.string.source_code)
            .subText(R.string.source_code_wishes)
            .icon(R.drawable.ic_code)
            .setOnClickAction(new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    RepositoryActivity.show(context, getString(R.string.author_login_id), getString(R.string.app_github_name));
                }
            })
            .build());
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:30,代码来源:AboutActivity.java

示例9: buildShare

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
private void buildShare(MaterialAboutCard.Builder appBuilder, final Context context) {
    appBuilder.title(R.string.feedback_and_share);
    appBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text(R.string.share_to_friends)
            .icon(R.drawable.ic_share)
            .setOnClickAction(new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    AppOpener.shareText(AboutActivity.this, getString(R.string.cookapk_download_url));
                }
            })
            .build());
    appBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text(R.string.rate_in_market)
            .icon(R.drawable.ic_menu_star)
            .setOnClickAction(new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    AppOpener.openInMarket(context);
                }
            })
            .build());
    appBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text(R.string.feedback)
            .icon(R.drawable.ic_feedback)
            .setOnClickAction(new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    IssuesActivity.showForRepo(AboutActivity.this,
                            getString(R.string.author_login_id), getString(R.string.app_name));
                }
            })
            .build());
}
 
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:35,代码来源:AboutActivity.java

示例10: buildGeneralInfoCard

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@NonNull
private MaterialAboutCard buildGeneralInfoCard(AboutConfig config) {
    MaterialAboutCard.Builder generalInfoCardBuilder = new MaterialAboutCard.Builder();

    generalInfoCardBuilder.addItem(new MaterialAboutTitleItem.Builder()
            .text(config.appName)
            .icon(config.appIcon)
            .build());

    generalInfoCardBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text(R.string.egab_version)
            .subText(config.version)
            .build());

    if (!TextUtils.isEmpty(config.author)) {
        generalInfoCardBuilder.addItem(new MaterialAboutActionItem.Builder()
                .text(R.string.egab_author)
                .subText(config.author)
                .build());
    }

    if (!TextUtils.isEmpty(config.extra) && !TextUtils.isEmpty(config.extraTitle)) {
        generalInfoCardBuilder.addItem(new MaterialAboutActionItem.Builder()
                .text(config.extraTitle)
                .subTextHtml(config.extra)
                .build());
    }

    return generalInfoCardBuilder.build();
}
 
开发者ID:eggheadgames,项目名称:android-about-box,代码行数:31,代码来源:AboutActivity.java

示例11: buildSupportCard

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@NonNull
private MaterialAboutCard buildSupportCard(final AboutConfig config) {
    MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();

    if (!TextUtils.isEmpty(config.guideHtmlPath)) {
        card.addItem(itemHelper(R.string.egab_guide, R.drawable.ic_help_green,
                new MaterialAboutItemOnClickAction() {
                    @Override
                    public void onClick() {
                        if (config.dialog == null) {
                            AboutBoxUtils.openHTMLPage(AboutActivity.this, config.guideHtmlPath);
                        } else {
                            config.dialog.open(AboutActivity.this, config.guideHtmlPath, getString(R.string.egab_guide));
                        }
                        logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_guide));
                    }
                })
        );
    }
    card.addItem(itemHelper(R.string.egab_contact_support, R.drawable.ic_email_black,
            new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    EmailUtil.contactUs(AboutActivity.this);
                    logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_contact_log_event));
                }
            }));

    return card.build();
}
 
开发者ID:eggheadgames,项目名称:android-about-box,代码行数:31,代码来源:AboutActivity.java

示例12: buildShareCard

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@NonNull
private MaterialAboutCard buildShareCard(final AboutConfig config) {
    MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
    if (config.buildType != null && !TextUtils.isEmpty(config.packageName)) {
        card.addItem(itemHelper(R.string.egab_leave_review, R.drawable.ic_review,
                new MaterialAboutItemOnClickAction() {
                    @Override
                    public void onClick() {
                        AboutBoxUtils.openApp(AboutActivity.this, config.buildType, config.packageName);
                        logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_review_log_event));
                    }
                }));
    }
    card.addItem(itemHelper(R.string.egab_share, R.drawable.ic_share_black,
            new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    if (config.share == null) {
                        ShareUtil.share(AboutActivity.this);
                    } else {
                        config.share.share(AboutActivity.this);
                    }
                    logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_share_log_event));
                }
            }));
    return card.build();
}
 
开发者ID:eggheadgames,项目名称:android-about-box,代码行数:28,代码来源:AboutActivity.java

示例13: buildAboutCard

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@NonNull
private MaterialAboutCard buildAboutCard(final AboutConfig config) {
    MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
    if (config.buildType != null && !TextUtils.isEmpty(config.appPublisher) && !TextUtils.isEmpty(config.packageName)) {
        card.addItem(itemHelper(R.string.egab_try_other_apps, R.drawable.ic_try_other_apps,
                new MaterialAboutItemOnClickAction() {
                    @Override
                    public void onClick() {
                        AboutBoxUtils.openPublisher(AboutActivity.this, config.buildType,
                                config.appPublisher, config.packageName);
                        logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_try_other_app_log_event));
                    }
                }));
    }
    if (!TextUtils.isEmpty(config.companyHtmlPath) && !TextUtils.isEmpty(config.aboutLabelTitle)) {
        card.addItem(new MaterialAboutActionItem.Builder()
                .text(config.aboutLabelTitle)
                .icon(R.drawable.ic_about_black)
                .setOnClickAction(new MaterialAboutItemOnClickAction() {
                    @Override
                    public void onClick() {
                        if (config.dialog == null) {
                            AboutBoxUtils.openHTMLPage(AboutActivity.this, config.companyHtmlPath);
                        } else {
                            config.dialog.open(AboutActivity.this, config.companyHtmlPath, config.aboutLabelTitle);
                        }
                        logUIEventName(config.analytics, config.logUiEventName, config.aboutLabelTitle);
                    }
                })
                .build());
    }
    return card.build();
}
 
开发者ID:eggheadgames,项目名称:android-about-box,代码行数:34,代码来源:AboutActivity.java

示例14: buildPrivacyCard

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
@NonNull
private MaterialAboutCard buildPrivacyCard(final AboutConfig config) {
    MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
    if (!TextUtils.isEmpty(config.privacyHtmlPath)) {
        card.addItem(itemHelper(R.string.egab_privacy_policy, R.drawable.ic_privacy,
                new MaterialAboutItemOnClickAction() {
                    @Override
                    public void onClick() {
                        if (config.dialog == null) {
                            AboutBoxUtils.openHTMLPage(AboutActivity.this, config.privacyHtmlPath);
                        } else {
                            config.dialog.open(AboutActivity.this, config.privacyHtmlPath, getString(R.string.egab_privacy_policy));
                        }

                        logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_privacy_log_event));
                    }
                })
        );
    }
    if (!TextUtils.isEmpty(config.acknowledgmentHtmlPath)) {
        card.addItem(itemHelper(R.string.egab_acknowledgements, R.drawable.ic_acknowledgements,
                new MaterialAboutItemOnClickAction() {
                    @Override
                    public void onClick() {
                        if (config.dialog == null) {
                            AboutBoxUtils.openHTMLPage(AboutActivity.this, config.acknowledgmentHtmlPath);
                        } else {
                            config.dialog.open(AboutActivity.this, config.acknowledgmentHtmlPath, getString(R.string.egab_acknowledgements));
                        }
                        logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_acknowledgements_log_event));
                    }
                })
        );
    }
    return card.build();
}
 
开发者ID:eggheadgames,项目名称:android-about-box,代码行数:37,代码来源:AboutActivity.java

示例15: createLicenseCard

import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入依赖的package包/类
public static MaterialAboutCard createLicenseCard(Context c, Drawable icon, CharSequence libraryTitle, CharSequence year, CharSequence name, OpenSourceLicense license) {

        MaterialAboutActionItem licenseItem = new MaterialAboutActionItem.Builder()
                .icon(icon)
                .setIconGravity(MaterialAboutActionItem.GRAVITY_TOP)
                .text(libraryTitle)
                .subText(String.format(c.getString(license.getResourceId()), year, name))
                .build();

        return new MaterialAboutCard.Builder().addItem(licenseItem).build();
    }
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:12,代码来源:ConvenienceBuilder.java


注:本文中的com.danielstone.materialaboutlibrary.model.MaterialAboutCard类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。