diff options
author | Scott Jackson <daneren2005@gmail.com> | 2016-02-01 11:43:36 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2016-02-01 11:43:36 -0800 |
commit | 456a4d99197a77cfd0e1135b890d64036b02ce58 (patch) | |
tree | 798748cdbedc5911cba18b3ff6f3a5a6cff0cdee | |
parent | a9e07def2b64b6301033c8360b5311d205af15ab (diff) | |
parent | bcb5b880c923aff4c09aa5ad4e975307d4662006 (diff) | |
download | dsub-456a4d99197a77cfd0e1135b890d64036b02ce58.tar.gz dsub-456a4d99197a77cfd0e1135b890d64036b02ce58.tar.bz2 dsub-456a4d99197a77cfd0e1135b890d64036b02ce58.zip |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/util/Util.java | 25 | ||||
-rw-r--r-- | app/src/main/res/drawable/drawer_header_clean.psd | bin | 0 -> 660427 bytes | |||
-rw-r--r-- | app/src/main/res/drawable/drawer_header_dark.png | bin | 115054 -> 39431 bytes | |||
-rw-r--r-- | app/src/main/res/drawable/drawer_header_holo.png | bin | 149240 -> 43226 bytes | |||
-rw-r--r-- | app/src/main/res/drawable/drawer_header_light.png | bin | 131371 -> 45565 bytes |
5 files changed, 25 insertions, 0 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java index 98bbe1df..be9536ed 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/Util.java +++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java @@ -22,6 +22,8 @@ import android.app.Activity; import android.graphics.Color; import android.support.annotation.StringRes; import android.support.v7.app.AlertDialog; +import android.content.ClipboardManager; +import android.content.ClipData; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; @@ -46,9 +48,11 @@ import android.text.method.LinkMovementMethod; import android.text.util.Linkify; import android.util.Log; import android.util.SparseArray; +import android.view.View; import android.view.Gravity; import android.view.Window; import android.view.WindowManager; +import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; @@ -1247,6 +1251,27 @@ public final class Util { listView.setDivider(null); listView.setScrollbarFadingEnabled(false); + // Let the user long-click on a row to copy its value to the clipboard + final Context contextRef = context; + listView.setOnItemLongClickListener(new ListView.OnItemLongClickListener() { + @Override + public boolean onItemLongClick(AdapterView<?> parent, View view, int pos, long id) { + + TextView nameView = (TextView) view.findViewById(R.id.detail_name); + TextView detailsView = (TextView) view.findViewById(R.id.detail_value); + CharSequence name = nameView.getText(); + CharSequence value = detailsView.getText(); + + ClipboardManager clipboard = (ClipboardManager) contextRef.getSystemService(Context.CLIPBOARD_SERVICE); + ClipData clip = ClipData.newPlainText(name, value); + clipboard.setPrimaryClip(clip); + + toast(contextRef, "Copied " + name + " to clipboard"); + + return true; + } + }); + new AlertDialog.Builder(context) // .setIcon(android.R.drawable.ic_dialog_info) .setTitle(title) diff --git a/app/src/main/res/drawable/drawer_header_clean.psd b/app/src/main/res/drawable/drawer_header_clean.psd Binary files differnew file mode 100644 index 00000000..a708d49c --- /dev/null +++ b/app/src/main/res/drawable/drawer_header_clean.psd diff --git a/app/src/main/res/drawable/drawer_header_dark.png b/app/src/main/res/drawable/drawer_header_dark.png Binary files differindex a6d2c1fb..a1c8d61f 100644 --- a/app/src/main/res/drawable/drawer_header_dark.png +++ b/app/src/main/res/drawable/drawer_header_dark.png diff --git a/app/src/main/res/drawable/drawer_header_holo.png b/app/src/main/res/drawable/drawer_header_holo.png Binary files differindex 3caa320b..d84d096d 100644 --- a/app/src/main/res/drawable/drawer_header_holo.png +++ b/app/src/main/res/drawable/drawer_header_holo.png diff --git a/app/src/main/res/drawable/drawer_header_light.png b/app/src/main/res/drawable/drawer_header_light.png Binary files differindex 8f041092..1bcf4ec3 100644 --- a/app/src/main/res/drawable/drawer_header_light.png +++ b/app/src/main/res/drawable/drawer_header_light.png |