Back to project page bitfynd-wallet-android.
The source code is released under:
GNU General Public License
If you think the Android project bitfynd-wallet-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright 2013-2014 the original author or authors. */*from ww w . ja v a 2 s.c o m*/ * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package de.schildbach.wallet.ui; import android.app.Activity; import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; import android.os.Bundle; import android.text.Html; import de.schildbach.wallet.Configuration; import de.schildbach.wallet.R; import de.schildbach.wallet.WalletApplication; /** * @author Andreas Schildbach */ public final class HelpDialogFragment extends DialogFragment { private static final String FRAGMENT_TAG = HelpDialogFragment.class.getName(); private static final String KEY_MESSAGE = "message"; private Activity activity; private WalletApplication application; private Configuration config; public static void page(final FragmentManager fm, final int messageResId) { final DialogFragment newFragment = HelpDialogFragment.instance(messageResId); newFragment.show(fm, FRAGMENT_TAG); } private static HelpDialogFragment instance(final int messageResId) { final HelpDialogFragment fragment = new HelpDialogFragment(); final Bundle args = new Bundle(); args.putInt(KEY_MESSAGE, messageResId); fragment.setArguments(args); return fragment; } @Override public void onAttach(final Activity activity) { super.onAttach(activity); this.activity = activity; this.application = (WalletApplication) activity.getApplication(); this.config = application.getConfiguration(); } @Override public Dialog onCreateDialog(final Bundle savedInstanceState) { final Bundle args = getArguments(); final int messageResId = args.getInt(KEY_MESSAGE); final DialogBuilder dialog = new DialogBuilder(activity); dialog.setMessage(Html.fromHtml(getString(messageResId))); dialog.singleDismissButton(null); if(messageResId == R.string.help_safety) { config.setDisclaimerDisabled(); } return dialog.create(); } }