本文整理汇总了Java中com.danielstone.materialaboutlibrary.model.MaterialAboutCard.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialAboutCard.Builder方法的具体用法?Java MaterialAboutCard.Builder怎么用?Java MaterialAboutCard.Builder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.danielstone.materialaboutlibrary.model.MaterialAboutCard
的用法示例。
在下文中一共展示了MaterialAboutCard.Builder方法的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();
}
示例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());
}
示例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());
}
示例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());
}
示例5: 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();
}
示例6: 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());
}
示例7: 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());
}
示例8: 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());
}
示例9: 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();
}
示例10: 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();
}
示例11: 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();
}
示例12: 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();
}
示例13: 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();
}
示例14: buildAuthor
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入方法依赖的package包/类
private void buildAuthor(MaterialAboutCard.Builder appBuilder, final Context context){
appBuilder.title(R.string.author);
appBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.author_name)
.subText(R.string.author_location)
.icon(R.drawable.ic_menu_person)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
ProfileActivity.show(AboutActivity.this, getString(R.string.author_login_id),
getString(R.string.author_avatar_url));
}
})
.build());
appBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.follow_on_github)
.icon(R.drawable.ic_github)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
ProfileActivity.show(AboutActivity.this, getString(R.string.author_login_id),
getString(R.string.author_avatar_url));
}
})
.build());
appBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.email)
.subText(R.string.auth_email_address)
.icon(R.drawable.ic_mail)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AppOpener.launchEmail(context, getString(R.string.auth_email_address));
}
})
.setOnLongClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AppUtils.copyToClipboard(context, getString(R.string.auth_email_address));
}
})
.build());
}
示例15: buildApp
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; //导入方法依赖的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());
}