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


Java MaterialAboutActionItem类代码示例

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


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

示例1: buildAuthor

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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

示例2: buildContribute

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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

示例3: createVersionActionItem

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的package包/类
/**
 * Creates an item with version info read from the PackageManager for current application.
 *
 * @param c      context
 * @param icon
 * @param text
 * @param includeVersionCode
 * @return Item to add to card.
 */
public static MaterialAboutActionItem createVersionActionItem(Context c, Drawable icon, CharSequence text, boolean includeVersionCode) {
 String versionName = "";
 int versionCode = 0;
 try {
  PackageInfo pInfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
  versionName = pInfo.versionName;
  versionCode = pInfo.versionCode;
 } catch (PackageManager.NameNotFoundException ignored) {
  // This shouldn't happen.
 }
    return new MaterialAboutActionItem.Builder()
            .text(text)
            .subText(versionName + (includeVersionCode ? " (" + versionCode + ")" : ""))
            .icon(icon)
            .build();
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:26,代码来源:ConvenienceBuilder.java

示例4: getMaterialAboutList

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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: buildMaterialAboutCard

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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

示例6: buildApp

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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

示例7: buildShare

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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

示例8: getViewHolder

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的package包/类
public MaterialAboutItemViewHolder getViewHolder(int itemType, View view) {
    switch (itemType) {
        case ACTION_ITEM:
            return MaterialAboutActionItem.getViewHolder(view);
        case TITLE_ITEM:
            return MaterialAboutTitleItem.getViewHolder(view);
        case CUSTOM_ITEM:
            return MyCustomItem.getViewHolder(view);
        default:
            return null;
    }
}
 
开发者ID:Delsart,项目名称:Bookster,代码行数:13,代码来源:MyViewTypeManager.java

示例9: setupItem

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的package包/类
public void setupItem(int itemType, MaterialAboutItemViewHolder holder, MaterialAboutItem item, Context context) {
    switch (itemType) {
        case ACTION_ITEM:
            MaterialAboutActionItem.setupItem((MaterialAboutActionItem.MaterialAboutActionItemViewHolder) holder, (MaterialAboutActionItem) item, context);
            break;
        case TITLE_ITEM:
            MaterialAboutTitleItem.setupItem((MaterialAboutTitleItem.MaterialAboutTitleItemViewHolder) holder, (MaterialAboutTitleItem) item, context);
            break;
        case CUSTOM_ITEM:
            MyCustomItem.setupItem((MyCustomItem.MyCustomItemViewHolder) holder, (MyCustomItem) item, context);
            break;
    }
}
 
开发者ID:Delsart,项目名称:Bookster,代码行数:14,代码来源:MyViewTypeManager.java

示例10: buildGeneralInfoCard

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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: buildAboutCard

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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

示例12: itemHelper

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的package包/类
private MaterialAboutActionItem itemHelper(int name, int icon, MaterialAboutItemOnClickAction clickAction) {
    return new MaterialAboutActionItem.Builder()
            .text(name)
            .icon(icon)
            .setOnClickAction(clickAction)
            .build();
}
 
开发者ID:eggheadgames,项目名称:android-about-box,代码行数:8,代码来源:AboutActivity.java

示例13: createWebViewDialogItem

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的package包/类
public static MaterialAboutActionItem createWebViewDialogItem(Context c, Drawable icon, CharSequence text, @Nullable CharSequence subText, CharSequence dialogTitle, CharSequence dialogNegativeButton, String htmlString, boolean isStringUrl, boolean supportZoom) {
    return new MaterialAboutActionItem.Builder()
            .text(text)
            .subText(subText)
            .icon(icon)
            .setOnClickAction(createWebViewDialogOnClickAction(c, dialogTitle, dialogNegativeButton, htmlString, isStringUrl, supportZoom))
            .build();
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:9,代码来源:ConvenienceBuilder.java

示例14: createRateActionItem

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的package包/类
/**
 * Creates an ActionItem which will open the play store when tapped
 *
 * @param c       context
 * @param text
 * @param subText
 * @param icon
 * @return Item to add to card.
 */
public static MaterialAboutActionItem createRateActionItem(Context c, Drawable icon, CharSequence text, @Nullable CharSequence subText) {

    return new MaterialAboutActionItem.Builder()
            .text(text)
            .subText(subText)
            .icon(icon)
            .setOnClickAction(createRateOnClickAction(c))
            .build();
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:19,代码来源:ConvenienceBuilder.java

示例15: createLicenseCard

import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; //导入依赖的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.items.MaterialAboutActionItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。