Search in sources :

Example 1 with ChangeLogDialog

use of org.qii.weiciyuan.support.lib.changelogdialog.ChangeLogDialog in project weiciyuan by qii.

the class AccountActivity method showChangeLogDialog.

private void showChangeLogDialog() {
    ChangeLogDialog changeLogDialog = new ChangeLogDialog(this);
    changeLogDialog.show();
}
Also used : ChangeLogDialog(org.qii.weiciyuan.support.lib.changelogdialog.ChangeLogDialog)

Example 2 with ChangeLogDialog

use of org.qii.weiciyuan.support.lib.changelogdialog.ChangeLogDialog in project weiciyuan by qii.

the class AboutFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setRetainInstance(false);
    addPreferencesFromResource(R.xml.about_pref);
    findPreference(SettingActivity.SUGGEST).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference preference) {
            Intent intent = new Intent(getActivity(), WriteWeiboActivity.class);
            intent.putExtra("token", GlobalContext.getInstance().getSpecialToken());
            intent.putExtra("account", GlobalContext.getInstance().getAccountBean());
            intent.putExtra("content", buildContent());
            startActivity(intent);
            return true;
        }
    });
    findPreference(SettingActivity.VERSION).setSummary(buildVersionInfo());
    findPreference(SettingActivity.VERSION).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference preference) {
            ChangeLogDialog changeLogDialog = new ChangeLogDialog(getActivity());
            changeLogDialog.show();
            return true;
        }
    });
    findPreference(SettingActivity.DONATE).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference preference) {
            Dialog dialog = new Dialog(getActivity(), R.style.UserAvatarDialog);
            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
            ImageView imageView = new ImageView(getActivity());
            imageView.setImageResource(R.drawable.alipay);
            dialog.setContentView(imageView);
            dialog.show();
            return true;
        }
    });
    detectDebugPreference();
    findPreference(SettingActivity.AUTHOR).setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference preference) {
            blackMagicCount++;
            if (blackMagicCount > 3) {
                SettingUtility.setBlackMagicEnabled();
            }
            if (mp != null && mp.isPlaying()) {
                mp.stop();
                playing = false;
                return true;
            }
            if (mp == null || !playing) {
                mp = MediaPlayer.create(getActivity(), R.raw.star);
            }
            mp.start();
            playing = true;
            Toast.makeText(getActivity(), "♩♪♫♬♭", Toast.LENGTH_SHORT).show();
            return true;
        }
    });
    buildCacheSummary();
    buildLogSummary();
    findPreference(SettingActivity.SAVED_PIC_PATH).setSummary(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath());
}
Also used : Preference(android.preference.Preference) Dialog(android.app.Dialog) ChangeLogDialog(org.qii.weiciyuan.support.lib.changelogdialog.ChangeLogDialog) Intent(android.content.Intent) WriteWeiboActivity(org.qii.weiciyuan.ui.send.WriteWeiboActivity) ImageView(android.widget.ImageView) ChangeLogDialog(org.qii.weiciyuan.support.lib.changelogdialog.ChangeLogDialog)

Aggregations

ChangeLogDialog (org.qii.weiciyuan.support.lib.changelogdialog.ChangeLogDialog)2 Dialog (android.app.Dialog)1 Intent (android.content.Intent)1 Preference (android.preference.Preference)1 ImageView (android.widget.ImageView)1 WriteWeiboActivity (org.qii.weiciyuan.ui.send.WriteWeiboActivity)1