本文整理汇总了Java中com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction类的典型用法代码示例。如果您正苦于以下问题:Java MaterialAboutItemOnClickAction类的具体用法?Java MaterialAboutItemOnClickAction怎么用?Java MaterialAboutItemOnClickAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterialAboutItemOnClickAction类属于com.danielstone.materialaboutlibrary.items包,在下文中一共展示了MaterialAboutItemOnClickAction类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createRateOnClickAction
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的package包/类
/**
* Creates a MaterialAboutItemOnClickAction that will open
* the Google Play store listing for the app.
*
* @param c context
* @return onClickAction
*/
public static MaterialAboutItemOnClickAction createRateOnClickAction(final Context c) {
Uri uri = Uri.parse("market://details?id=" + c.getPackageName());
final Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
Intent.FLAG_ACTIVITY_NEW_DOCUMENT |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
} else {
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
}
return new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
try {
c.startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
c.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id=" + c.getPackageName())));
}
}
};
}
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:32,代码来源:ConvenienceBuilder.java
示例2: createEmailOnClickAction
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的package包/类
/**
* Creates a MaterialAboutItemOnClickAction that will open
* an email intent with specified address.
*
* @param c context
* @param email email address
* @return onClickAction
*/
public static MaterialAboutItemOnClickAction createEmailOnClickAction(final Context c, String email, String emailSubject, final CharSequence chooserTitle) {
final Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" + email));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject);
return new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
try {
c.startActivity(Intent.createChooser(emailIntent, chooserTitle));
} catch (Exception e) {
// No activity to handle intent
Toast.makeText(c, R.string.mal_activity_exception, Toast.LENGTH_SHORT).show();
}
}
};
}
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:26,代码来源:ConvenienceBuilder.java
示例3: createPhoneOnClickAction
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的package包/类
/**
* Creates a MaterialAboutItemOnClickAction that will open
* the dialer with specified number.
*
* @param c context
* @param number phone number
* @return onClickAction
*/
public static MaterialAboutItemOnClickAction createPhoneOnClickAction(final Context c, String number) {
final Intent phoneIntent = new Intent(Intent.ACTION_DIAL);
phoneIntent.setData(Uri.parse("tel:" + number));
return new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
try {
c.startActivity(phoneIntent);
} catch (Exception e) {
// No activity to handle intent
Toast.makeText(c, R.string.mal_activity_exception, Toast.LENGTH_SHORT).show();
}
}
};
}
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:25,代码来源:ConvenienceBuilder.java
示例4: createMapOnClickAction
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的package包/类
/**
* Creates a MaterialAboutItemOnClickAction that will open
* maps with a query.
* Query can be either lat,lng(label) or written address
*
* @param c context
* @param addressQuery address query
* @return onClickAction
*/
public static MaterialAboutItemOnClickAction createMapOnClickAction(final Context c, String addressQuery) {
final Intent mapIntent = new Intent(Intent.ACTION_VIEW);
mapIntent.setData(Uri.parse("geo:0,0").buildUpon().appendQueryParameter("q", addressQuery).build());
return new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
try {
c.startActivity(mapIntent);
} catch (Exception e) {
// No activity to handle intent
Toast.makeText(c, R.string.mal_activity_exception, Toast.LENGTH_SHORT).show();
}
}
};
}
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:25,代码来源:ConvenienceBuilder.java
示例5: webViewDialog
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的package包/类
public static MaterialAboutItemOnClickAction webViewDialog(final Context context,
final String targetUrl,
final String title) {
return () -> {
AlertDialog.Builder alert = new AlertDialog.Builder(context);
alert.setTitle(title);
WebView wv = new WebView(context);
wv.setWebViewClient(
new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (!url.equals("targetUrl")) {
context.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(url)));
view.reload();
return true;
} else {
view.loadUrl(url);
return true;
}
}
}
);
wv.loadUrl(targetUrl);
alert.setView(wv);
alert.setNegativeButton(R.string.Ok, (dialog, id) -> dialog.dismiss()
);
alert.show();
}
;
}
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:35,代码来源:AboutUtil.java
示例6: buildApp
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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.MaterialAboutItemOnClickAction; //导入依赖的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: buildSupportCard
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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
示例9: buildShareCard
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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
示例10: buildAboutCard
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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
示例11: buildPrivacyCard
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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
示例12: itemHelper
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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: createWebsiteOnClickAction
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的package包/类
public static MaterialAboutItemOnClickAction createWebsiteOnClickAction(final Context c, final Uri websiteUrl) {
return new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(websiteUrl);
try {
c.startActivity(i);
} catch (Exception e) {
// No activity to handle intent
Toast.makeText(c, R.string.mal_activity_exception, Toast.LENGTH_SHORT).show();
}
}
};
}
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:16,代码来源:ConvenienceBuilder.java
示例14: buildAuthor
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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());
}
开发者ID:ThirtyDegreesRay,项目名称:OpenHub,代码行数:44,代码来源:AboutActivity.java
示例15: buildApp
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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
示例16: buildSocialNetworksCard
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的package包/类
@NonNull
private MaterialAboutCard buildSocialNetworksCard(final AboutConfig config) {
MaterialAboutCard.Builder card = new MaterialAboutCard.Builder();
if (!TextUtils.isEmpty(config.facebookUserName)) {
card.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.egab_facebook_label)
.subText(config.facebookUserName)
.icon(R.drawable.ic_facebook_24)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutBoxUtils.getOpenFacebookIntent(AboutActivity.this, config.facebookUserName);
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_facebook_log_event));
}
})
.build());
}
if (!TextUtils.isEmpty(config.twitterUserName)) {
card.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.egab_twitter_label)
.subText(config.twitterUserName)
.icon(R.drawable.ic_twitter_24dp)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutBoxUtils.startTwitter(AboutActivity.this, config.twitterUserName);
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_twitter_log_event));
}
})
.build());
}
if (!TextUtils.isEmpty(config.webHomePage)) {
card.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.egab_web_label)
.subText(config.webHomePage.replaceFirst("^https?://", "").replaceAll("/$", ""))
.icon(R.drawable.ic_web_black_24dp)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
AboutBoxUtils.openHTMLPage(AboutActivity.this, config.webHomePage);
logUIEventName(config.analytics, config.logUiEventName, getString(R.string.egab_website_log_event));
}
})
.build());
}
return card.build();
}
开发者ID:eggheadgames,项目名称:android-about-box,代码行数:48,代码来源:AboutActivity.java
示例17: getMaterialAboutList
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的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
示例18: createWebViewDialogOnClickAction
import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; //导入依赖的package包/类
public static MaterialAboutItemOnClickAction createWebViewDialogOnClickAction(final Context c, final CharSequence dialogTitle, final String htmlString, final boolean isStringUrl, final boolean supportZoom) {
return createWebViewDialogOnClickAction(c, dialogTitle, c.getString(R.string.mal_close), htmlString, isStringUrl, supportZoom);
}
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:4,代码来源:ConvenienceBuilder.java
注:本文中的com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论