aboutsummaryrefslogtreecommitdiffstats
path: root/libs/thedevstacklogcat
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-04-07 15:36:16 +0200
committersteckbrief <steckbrief@chefmail.de>2016-04-07 15:36:16 +0200
commit36f3bed2eccb3dfd5266304c482497eff0d25c7c (patch)
treea43598541a1a4ea92142d17e02c02033e49fa8a3 /libs/thedevstacklogcat
parent4ace80d39ade18934d310ba37559c9c7ec8004dd (diff)
parent8c3245dd1f257053b8ec2bf7c5e03a3a98b282c3 (diff)
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Conflicts: src/main/java/de/thedevstack/conversationsplus/ui/LogCatOutputActivity.java
Diffstat (limited to 'libs/thedevstacklogcat')
-rw-r--r--libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/adapters/LogCatArrayAdapter.java8
-rw-r--r--libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/ui/LogCatOutputCopyOnClickListener.java48
2 files changed, 6 insertions, 50 deletions
diff --git a/libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/adapters/LogCatArrayAdapter.java b/libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/adapters/LogCatArrayAdapter.java
index c8a96ea3..eb4efc98 100644
--- a/libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/adapters/LogCatArrayAdapter.java
+++ b/libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/adapters/LogCatArrayAdapter.java
@@ -116,7 +116,11 @@ public class LogCatArrayAdapter extends ArrayAdapter<String> {
logcatItems.remove(object);
}
- public ArrayList<String> getItems() {
- return this.logcatItems;
+ /**
+ * Returns an unmodifiable copy of the log cat entries.
+ * @return UnmodifiableList of logcat entries.
+ */
+ public List<String> getItems() {
+ return Collections.unmodifiableList(this.logcatItems);
}
}
diff --git a/libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/ui/LogCatOutputCopyOnClickListener.java b/libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/ui/LogCatOutputCopyOnClickListener.java
deleted file mode 100644
index 1be04c9c..00000000
--- a/libs/thedevstacklogcat/src/main/java/de/thedevstack/android/logcat/ui/LogCatOutputCopyOnClickListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package de.thedevstack.android.logcat.ui;
-
-import android.content.ClipData;
-import android.content.ClipboardManager;
-import android.content.Context;
-import android.view.View;
-import android.widget.Toast;
-
-import java.util.ArrayList;
-
-import de.thedevstack.android.logcat.Logging;
-import de.thedevstack.android.logcat.adapters.LogCatArrayAdapter;
-
-/**
- * Created by tzur on 20.11.2015.
- */
-public class LogCatOutputCopyOnClickListener implements View.OnClickListener {
- private final LogCatArrayAdapter logCatOutputAdapter;
- private final Context context;
- private final int resIdLogcatCopied;
- private final int resIdLogcatNotCopied;
-
- public LogCatOutputCopyOnClickListener(Context context, LogCatArrayAdapter logCatOutputAdapter, int resIdLogcatCopied, int resIdLogcatNotCopied) {
- this.logCatOutputAdapter = logCatOutputAdapter;
- this.context = context;
- this.resIdLogcatCopied = resIdLogcatCopied;
- this.resIdLogcatNotCopied = resIdLogcatNotCopied;
- }
-
- @Override
- public void onClick(View v) {
- Logging.d("copylogcat", "Start Copying log cat");
- ArrayList<String> items = this.logCatOutputAdapter.getItems();
- if (null != items && !items.isEmpty()) {
- StringBuilder sb = new StringBuilder();
- for (String item : items) {
- sb.append(item);
- sb.append("\n");
- }
- ClipboardManager clipboard = (ClipboardManager) this.context.getSystemService(Context.CLIPBOARD_SERVICE);
- ClipData clip = ClipData.newPlainText("c+logcat", sb.toString());
- clipboard.setPrimaryClip(clip);
- Toast.makeText(this.context, this.context.getText(this.resIdLogcatCopied), Toast.LENGTH_LONG).show();
- } else {
- Toast.makeText(this.context, this.context.getText(this.resIdLogcatNotCopied), Toast.LENGTH_LONG).show();
- }
- }
-}