diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2015-03-08 11:42:27 +0100 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2015-03-08 11:42:27 +0100 |
commit | f41fe5e565b51211ef0453d8cb1d9f1ca4e6e43d (patch) | |
tree | b798c1ceb97b53cb552b5ac4a1e687a10a8ef95e /main/src | |
parent | 222b5c5ab47750e6776d4e500faff33d4a15af5b (diff) | |
download | cgeo-f41fe5e565b51211ef0453d8cb1d9f1ca4e6e43d.zip cgeo-f41fe5e565b51211ef0453d8cb1d9f1ca4e6e43d.tar.gz cgeo-f41fe5e565b51211ef0453d8cb1d9f1ca4e6e43d.tar.bz2 |
fix #4605: add a copy to clipboard button for system info
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/cgeo/geocaching/AboutActivity.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/AboutActivity.java b/main/src/cgeo/geocaching/AboutActivity.java index 829d987..7ec74d7 100644 --- a/main/src/cgeo/geocaching/AboutActivity.java +++ b/main/src/cgeo/geocaching/AboutActivity.java @@ -13,6 +13,7 @@ import cgeo.geocaching.sensors.Sensors; import cgeo.geocaching.settings.Settings; import cgeo.geocaching.ui.AbstractCachingPageViewCreator; import cgeo.geocaching.ui.AnchorAwareLinkMovementMethod; +import cgeo.geocaching.utils.ClipboardUtils; import cgeo.geocaching.utils.ProcessUtils; import cgeo.geocaching.utils.Version; @@ -31,6 +32,7 @@ import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; +import android.widget.Button; import android.widget.ScrollView; import android.widget.TextView; @@ -104,14 +106,23 @@ public class AboutActivity extends AbstractViewPagerActivity<AboutActivity.Page> class SystemViewCreator extends AbstractCachingPageViewCreator<ScrollView> { @InjectView(R.id.system) protected TextView system; + @InjectView(R.id.copy) protected Button copy; @Override public ScrollView getDispatchedView(final ViewGroup parentView) { final ScrollView view = (ScrollView) getLayoutInflater().inflate(R.layout.about_system_page, parentView, false); ButterKnife.inject(this, view); - system.setText(systemInformation(AboutActivity.this)); + final String systemInfo = systemInformation(AboutActivity.this); + system.setText(systemInfo); system.setMovementMethod(AnchorAwareLinkMovementMethod.getInstance()); Compatibility.setTextIsSelectable(system, true); + copy.setOnClickListener(new OnClickListener() { + @Override + public void onClick(final View view) { + ClipboardUtils.copyToClipboard(systemInfo); + showShortToast(getString(R.string.clipboard_copy_ok)); + } + }); return view; } } |