• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MaterialAboutTitleItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getMaterialAboutList

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


示例2: buildApp

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


示例3: getViewHolder

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


示例4: setupItem

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


示例5: buildGeneralInfoCard

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


示例6: getViewHolder

import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem; //导入依赖的package包/类
public MaterialAboutItemViewHolder getViewHolder(int itemType, View view) {
    switch (itemType) {
        case ACTION_ITEM:
            return MaterialAboutActionItem.getViewHolder(view);
        case TITLE_ITEM:
            return MaterialAboutTitleItem.getViewHolder(view);
        default:
            return null;
    }
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:11,代码来源:DefaultViewTypeManager.java


示例7: setupItem

import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem; //导入依赖的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;
    }
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:11,代码来源:DefaultViewTypeManager.java


示例8: buildApp

import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem; //导入依赖的package包/类
private void buildApp(final Context context, MaterialAboutCard.Builder appCardBuilder) {
    appCardBuilder.addItem(new MaterialAboutTitleItem.Builder()
            .text(getString(R.string.app_name))
            .icon(R.mipmap.ic_launcher)
            .build());
            try {
                appCardBuilder.addItem(ConvenienceBuilder.createVersionActionItem(context, new IconicsDrawable(context)
                        .icon(GoogleMaterial.Icon.gmd_info)
                        .color(Color.GRAY)
                        .sizeDp(18), getString(R.string.about_version), false));
            } catch (PackageManager.NameNotFoundException e) {
                e.printStackTrace();
            }

    appCardBuilder.addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_sourcecode))
                    .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/VelocityCalculator")))
                    .build())
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_license))
                    .subText(getString(R.string.about_gpl))
                    .icon(new IconicsDrawable(context)
                            .icon(GoogleMaterial.Icon.gmd_book)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(context, Uri.parse("https://www.gnu.org/licenses/gpl.html")))
                    .build())
            .addItem(ConvenienceBuilder.createWebsiteActionItem(context, new IconicsDrawable(context)
                    .icon(CommunityMaterial.Icon.cmd_book_open)
                    .color(Color.GRAY)
                    .sizeDp(18), getString(R.string.about_documentation), false, Uri.parse("https://github.com/Jiikuy/VelocityCalculator/wiki/")))
            .addItem(new MaterialAboutActionItem.Builder()
                    .text(getString(R.string.about_translations))
                    .icon(new IconicsDrawable(context)
                            .icon(CommunityMaterial.Icon.cmd_translate)
                            .color(Color.GRAY)
                            .sizeDp(18))
                    .setOnClickAction(new MaterialAboutItemOnClickAction() {
                        @Override
                        public void onClick() {
                            Intent intent = new Intent(AboutActivity.this, ShowTranslationsActivity.class);
                            startActivity(intent);
                        }
                        })
                    .build())
            .addItem(new MaterialAboutActionItem.Builder()
                .text(getString(R.string.about_opensourcelibs))
                .icon(new IconicsDrawable(context)
                    .icon(CommunityMaterial.Icon.cmd_git)
                    .color(Color.GRAY)
                    .sizeDp(18))
                .setOnClickAction(new MaterialAboutItemOnClickAction() {
                        @Override
                        public void onClick() {
                            LibsBuilder builder = new LibsBuilder();
                                    builder.withActivityTheme(R.style.AboutLibrariesTheme)
                                    .withAboutVersionShown(false)
                                    .withAutoDetect(true)
                                    .withAboutIconShown(false)
                                    .start(context);
                        }

                })
                .build());
}
 
开发者ID:Jiikuy,项目名称:VelocityCalculator,代码行数:70,代码来源:AboutActivity.java


示例9: getMaterialAboutList

import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem; //导入依赖的package包/类
@NonNull @Override
protected MaterialAboutList getMaterialAboutList(@NonNull final Context c) {
    MaterialAboutCard.Builder advancedCardBuilder = new MaterialAboutCard.Builder();
    advancedCardBuilder.title("Advanced");

    advancedCardBuilder.addItem(new MaterialAboutTitleItem.Builder()
            .text("TitleItem OnClickAction")
            .icon(R.mipmap.ic_launcher)
            .setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(c, Uri.parse("http://www.daniel-stone.uk")))
            .build());

    advancedCardBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text("Snackbar demo")
            .icon(new IconicsDrawable(c)
                    .icon(CommunityMaterial.Icon.cmd_code_tags)
                    .color(ContextCompat.getColor(c, colorIcon))
                    .sizeDp(18))
            .setOnClickAction(new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    Snackbar.make(((ExampleMaterialAboutActivity) c).findViewById(R.id.mal_material_about_activity_coordinator_layout), "Test", Snackbar.LENGTH_SHORT).show();
                }
            })
            .build());

    advancedCardBuilder.addItem(new MaterialAboutActionItem.Builder()
            .text("OnLongClickAction demo")
            .icon(new IconicsDrawable(c)
                    .icon(CommunityMaterial.Icon.cmd_hand_pointing_right)
                    .color(ContextCompat.getColor(c, colorIcon))
                    .sizeDp(18))
            .setOnLongClickAction(new MaterialAboutItemOnClickAction() {
                @Override
                public void onClick() {
                    Toast.makeText(c, "Long pressed", Toast.LENGTH_SHORT).show();
                }
            })
            .build());

    advancedCardBuilder.addItem(new MyCustomItem.Builder()
            .text("Custom Item")
            .icon(new IconicsDrawable(c)
                    .icon(CommunityMaterial.Icon.cmd_code_braces)
                    .color(ContextCompat.getColor(c, colorIcon))
                    .sizeDp(18))
            .build());

    final MaterialAboutActionItem dynamicItem = new MaterialAboutActionItem.Builder()
            .text("Dynamic UI")
            .subText("Tap for a random number.")
            .icon(new IconicsDrawable(c)
                    .icon(CommunityMaterial.Icon.cmd_refresh)
                    .color(ContextCompat.getColor(c, colorIcon)
                    ).sizeDp(18))
            .build();
    dynamicItem.setOnClickAction(new MaterialAboutItemOnClickAction() {
        @Override
        public void onClick() {
            dynamicItem.setSubText("Random number: " + ((int) (Math.random() * 10)));
            refreshMaterialAboutList();
        }
    });
    advancedCardBuilder.addItem(dynamicItem);

    return Demo.createMaterialAboutList(c, colorIcon, getIntent().getIntExtra(THEME_EXTRA, THEME_LIGHT_DARKBAR)).addCard(advancedCardBuilder.build());
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:67,代码来源:ExampleMaterialAboutActivity.java


示例10: createAppTitleItem

import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem; //导入依赖的package包/类
public static MaterialAboutTitleItem createAppTitleItem(String appName, Drawable applicationIcon) {
    return new MaterialAboutTitleItem(appName, null, applicationIcon);
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:4,代码来源:ConvenienceBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SimpleFactory类代码示例发布时间:2022-05-22
下一篇:
Java PublishRequest类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap