use of com.giua.app.Analytics in project Giua-App by Giua-app.
the class AboutActivity method getMaterialAboutList.
@NonNull
@Override
protected MaterialAboutList getMaterialAboutList(@NonNull Context context) {
loggerManager = new LoggerManager("AboutActivity", this);
loggerManager.d("getMaterialAboutList chiamato");
loggerManager.d("costruisco pagina about...");
importantInteger += 160 + 120 + 20 - 1;
MaterialAboutCard.Builder appCardBuilder = new MaterialAboutCard.Builder();
// Add items to card
appCardBuilder.addItem(new MaterialAboutTitleItem.Builder().text("Giua App").desc("L'app non ufficiale per registri giua@school").icon(R.mipmap.ic_launcher).build());
appCardBuilder.addItem(ConvenienceBuilder.createVersionActionItem(this, new IconicsDrawable(this).icon(CommunityMaterial.Icon2.cmd_information_outline).sizeDp(18), "Versione", false).setOnClickAction(this::justANormalJavaFunction));
appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Changelog").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon2.cmd_history).sizeDp(18)).setOnClickAction(() -> {
loggerManager.d("Mostro dialogo changelog");
new Thread(() -> {
String body = AppUpdateManager.buildChangelogForHTML(new AppUpdateManager(this).getReleasesJson());
final SpannableString txt = new SpannableString(Html.fromHtml(body, 0));
Linkify.addLinks(txt, Linkify.ALL);
runOnUiThread(() -> {
final AlertDialog d = new AlertDialog.Builder(this).setTitle("Changelog").setMessage(txt).setPositiveButton("Chiudi", (dialog, id) -> dialog.dismiss()).setCancelable(true).create();
d.show();
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
});
}).start();
}).build());
appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Privacy Policy").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon2.cmd_lock).sizeDp(18)).setOnClickAction(() -> {
loggerManager.d("Mostro dialogo privacy");
String body = getString(R.string.privacy);
final SpannableString txt = new SpannableString(Html.fromHtml(body, 0));
Linkify.addLinks(txt, Linkify.ALL);
final AlertDialog d = new AlertDialog.Builder(this).setTitle("Privacy Policy").setMessage(txt).setPositiveButton("Chiudi", (dialog, id) -> dialog.dismiss()).setCancelable(true).create();
d.show();
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
}).build());
appCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Licenze").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon.cmd_book).sizeDp(18)).setOnClickAction(() -> {
Intent intent = new Intent(getBaseContext(), AboutLicenseActivity.class);
intent.putExtra("", getIntent().getIntExtra("", 0));
context.startActivity(intent);
}).build());
MaterialAboutCard.Builder authorCardBuilder = new MaterialAboutCard.Builder();
authorCardBuilder.title("Sviluppatori");
// authorCardBuilder.titleColor(ContextCompat.getColor(c, R.color.colorAccent));
authorCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Hiem").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon.cmd_account).sizeDp(18)).build());
authorCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Franck1421").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon.cmd_account).sizeDp(18)).build());
authorCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Krek3r").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon.cmd_account).sizeDp(18)).build());
authorCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Source code su GitHub").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon.cmd_github_circle).sizeDp(18)).setOnClickAction(ConvenienceBuilder.createWebViewDialogOnClickAction(this, "", "Chiudi", "https://github.com/Giua-app/Giua-App", true, false)).build());
authorCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Sito web ufficiale").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon2.cmd_web).sizeDp(18)).setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(this, Uri.parse("https://giua-app.github.io"))).build());
MaterialAboutCard.Builder otherCardBuilder = new MaterialAboutCard.Builder();
otherCardBuilder.title("Altro");
otherCardBuilder.addItem(new MaterialAboutActionItem.Builder().text("Guarda gli analytics pubblici").icon(new IconicsDrawable(this).icon(CommunityMaterial.Icon.cmd_google_analytics).sizeDp(18)).setOnClickAction(ConvenienceBuilder.createWebsiteOnClickAction(this, Uri.parse("https://app.posthog.com/shared_dashboard/m3EBhJ_T3dsd4rl3HV399mwKj8szDg"))).build());
loggerManager.d("Creazione pagina about completata");
return new MaterialAboutList(appCardBuilder.build(), authorCardBuilder.build(), otherCardBuilder.build());
}
Aggregations