Search in sources :

Example 1 with Element

use of mehdi.sakout.aboutpage.Element in project VirtualXposed by android-hacker.

the class AboutActivity method getFeedbackElement.

Element getFeedbackElement() {
    Element feedback = new Element();
    final String qqGroup = "597478474";
    feedback.setTitle(getResources().getString(R.string.about_feedback_title, qqGroup));
    feedback.setOnClickListener(v -> {
        ClipboardManager clipboardManager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
        if (clipboardManager != null) {
            clipboardManager.setPrimaryClip(ClipData.newPlainText(null, qqGroup));
        }
        Toast.makeText(v.getContext(), getResources().getString(R.string.about_feedback_tips), Toast.LENGTH_SHORT).show();
    });
    return feedback;
}
Also used : ClipboardManager(android.content.ClipboardManager) Element(mehdi.sakout.aboutpage.Element)

Example 2 with Element

use of mehdi.sakout.aboutpage.Element in project VirtualXposed by android-hacker.

the class AboutActivity method getThanksElement.

Element getThanksElement() {
    Element thanks = new Element();
    thanks.setTitle(getResources().getString(R.string.about_thanks));
    thanks.setOnClickListener(v -> {
        AlertDialog alertDialog = new AlertDialog.Builder(this, R.style.Theme_AppCompat_DayNight_Dialog_Alert).setTitle(R.string.thanks_dialog_title).setMessage(R.string.thanks_dialog_content).setPositiveButton(R.string.about_icon_yes, null).create();
        try {
            alertDialog.show();
        } catch (Throwable ignored) {
        // BadTokenException.
        }
    });
    return thanks;
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) Element(mehdi.sakout.aboutpage.Element)

Example 3 with Element

use of mehdi.sakout.aboutpage.Element in project VirtualXposed by android-hacker.

the class AboutActivity method getCheckUpdateElement.

Element getCheckUpdateElement() {
    Element checkUpdate = new Element();
    checkUpdate.setTitle(getResources().getString(R.string.check_update));
    checkUpdate.setOnClickListener(v -> {
        VAVersionService.checkUpdateImmediately(getApplicationContext(), true);
    });
    return checkUpdate;
}
Also used : Element(mehdi.sakout.aboutpage.Element)

Example 4 with Element

use of mehdi.sakout.aboutpage.Element in project MyNewCC98 by 6769.

the class AboutActivity method getShareAppRow.

private Element getShareAppRow() {
    Element row = new Element();
    String title = getString(R.string.application_share_to_download_title);
    String downloadUrl = getString(R.string.application_share_to_download_url);
    String messageTemplate = getString(R.string.application_share_to_download_template);
    String text = String.format(messageTemplate, downloadUrl, getString(R.string.app_name));
    row.setTitle(title).setIconDrawable(R.drawable.ic_share_black_24dp);
    row.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ShareContent.shareText(AboutActivity.this, text, title);
        }
    });
    return row;
}
Also used : Element(mehdi.sakout.aboutpage.Element) View(android.view.View)

Example 5 with Element

use of mehdi.sakout.aboutpage.Element in project android-about-page by medyo.

the class MainActivity method getCopyRightsElement.

Element getCopyRightsElement() {
    Element copyRightsElement = new Element();
    final String copyrights = String.format(getString(R.string.copy_right), Calendar.getInstance().get(Calendar.YEAR));
    copyRightsElement.setTitle(copyrights);
    copyRightsElement.setIconDrawable(R.drawable.about_icon_copy_right);
    copyRightsElement.setAutoApplyIconTint(true);
    copyRightsElement.setIconTint(mehdi.sakout.aboutpage.R.color.about_item_icon_color);
    copyRightsElement.setIconNightTint(android.R.color.white);
    copyRightsElement.setGravity(Gravity.CENTER);
    copyRightsElement.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Toast.makeText(MainActivity.this, copyrights, Toast.LENGTH_SHORT).show();
        }
    });
    return copyRightsElement;
}
Also used : Element(mehdi.sakout.aboutpage.Element) View(android.view.View)

Aggregations

Element (mehdi.sakout.aboutpage.Element)12 View (android.view.View)5 ClipboardManager (android.content.ClipboardManager)2 AboutPage (mehdi.sakout.aboutpage.AboutPage)2 PackageInfo (android.content.pm.PackageInfo)1 PackageManager (android.content.pm.PackageManager)1 Nullable (android.support.annotation.Nullable)1 AlertDialog (android.support.v7.app.AlertDialog)1