aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2015-11-20 22:41:30 +0100
committersteckbrief <steckbrief@chefmail.de>2015-11-20 22:41:30 +0100
commit2531c88f2c8a992aa0c40c9f96e88099dc94139e (patch)
treee3815b7f1ef0bbd227df8c4452d4aa52b54830e4 /src/main/java/de/thedevstack/conversationsplus/ui
parent8838a5094812e0540ccfef3334e49e1a5c1a564b (diff)
Implements FS#67: Introduce central logging class to use log prefix, new activity to show logcat output and button to copy contents
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java8
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java6
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java2
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java4
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java6
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/preferences/LogInformationPreference.java31
6 files changed, 44 insertions, 13 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java
index 4cd24a4b..6a5d47c2 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java
@@ -24,7 +24,7 @@ import android.support.v13.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.text.Editable;
import android.text.TextWatcher;
-import android.util.Log;
+import de.thedevstack.conversationsplus.utils.Logging;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
@@ -615,12 +615,12 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
switch (intent.getAction()) {
case Intent.ACTION_SENDTO:
case Intent.ACTION_VIEW:
- Log.d(Config.LOGTAG, "received uri=" + intent.getData());
+ Logging.d(Config.LOGTAG, "received uri=" + intent.getData());
return new Invite(intent.getData()).invite();
case NfcAdapter.ACTION_NDEF_DISCOVERED:
for (Parcelable message : getIntent().getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES)) {
if (message instanceof NdefMessage) {
- Log.d(Config.LOGTAG, "received message=" + message);
+ Logging.d(Config.LOGTAG, "received message=" + message);
for (NdefRecord record : ((NdefMessage) message).getRecords()) {
switch (record.getTnf()) {
case NdefRecord.TNF_WELL_KNOWN:
@@ -652,7 +652,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
Contact contact = contacts.get(0);
if (invite.getFingerprint() != null) {
if (contact.addOtrFingerprint(invite.getFingerprint())) {
- Log.d(Config.LOGTAG,"added new fingerprint");
+ Logging.d(Config.LOGTAG,"added new fingerprint");
xmppConnectionService.syncRosterToDisk(contact.getAccount());
}
}
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java
index 97582fc7..15a614d4 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/XmppActivity.java
@@ -37,7 +37,7 @@ import android.os.IBinder;
import android.os.SystemClock;
import android.text.InputType;
import android.util.DisplayMetrics;
-import android.util.Log;
+import de.thedevstack.conversationsplus.utils.Logging;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
@@ -797,7 +797,7 @@ public abstract class XmppActivity extends Activity {
}
protected Bitmap createQrCodeBitmap(String input, int size) {
- Log.d(Config.LOGTAG,"qr code requested size: "+size);
+ Logging.d(Config.LOGTAG,"qr code requested size: "+size);
try {
final QRCodeWriter QR_CODE_WRITER = new QRCodeWriter();
final Hashtable<EncodeHintType, Object> hints = new Hashtable<>();
@@ -813,7 +813,7 @@ public abstract class XmppActivity extends Activity {
}
}
final Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- Log.d(Config.LOGTAG,"output size: "+width+"x"+height);
+ Logging.d(Config.LOGTAG,"output size: "+width+"x"+height);
bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
return bitmap;
} catch (final WriterException e) {
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
index 56e1baa4..abb77993 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
@@ -8,7 +8,7 @@ import android.graphics.Typeface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
-import android.util.Log;
+import de.thedevstack.conversationsplus.utils.Logging;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
index 16939a1b..670fb9ee 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/MessageDetailsDialog.java
@@ -2,7 +2,7 @@ package de.thedevstack.conversationsplus.ui.dialogs;
import android.app.Activity;
import android.text.format.DateFormat;
-import android.util.Log;
+import de.thedevstack.conversationsplus.utils.Logging;
import android.view.View;
import android.widget.TextView;
@@ -145,7 +145,7 @@ public class MessageDetailsDialog extends AbstractAlertDialog {
String me = conversation.getAccount().getJid().getResourcepart();
// Get resource name of chat partner, if available
String other = (message.getCounterpart().isBareJid()) ? "" : message.getCounterpart().getResourcepart();
- Log.d("MesageDialog", "Me: " + me + ", other: " + other);
+ Logging.d("MesageDialog", "Me: " + me + ", other: " + other);
TextView sender = (TextView) view.findViewById(R.id.dlgMsgDetSender);
TextView receipient = (TextView) view.findViewById(R.id.dlgMsgDetReceipient);
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java
index 05591b74..84203bf4 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/listeners/ConversationSwipeRefreshListener.java
@@ -1,7 +1,7 @@
package de.thedevstack.conversationsplus.ui.listeners;
import android.support.v4.widget.SwipeRefreshLayout;
-import android.util.Log;
+import de.thedevstack.conversationsplus.utils.Logging;
import android.widget.ListView;
import java.util.List;
@@ -28,7 +28,7 @@ public class ConversationSwipeRefreshListener implements SwipeRefreshLayout.OnRe
@Override
public void onRefresh() {
- Log.d(Config.LOGTAG, "Refresh swipe container");
+ Logging.d(Config.LOGTAG, "Refresh swipe container");
synchronized (this.messageList) {
long timestamp;
if (messageList.isEmpty()) {
@@ -39,6 +39,6 @@ public class ConversationSwipeRefreshListener implements SwipeRefreshLayout.OnRe
ConversationActivity activity = (ConversationActivity) fragment.getActivity();
activity.xmppConnectionService.loadMoreMessages(activity.getSelectedConversation(), timestamp, this.listener);
}
- Log.d(Config.LOGTAG, "End Refresh swipe container");
+ Logging.d(Config.LOGTAG, "End Refresh swipe container");
}
}
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/preferences/LogInformationPreference.java b/src/main/java/de/thedevstack/conversationsplus/ui/preferences/LogInformationPreference.java
new file mode 100644
index 00000000..65b3b1b3
--- /dev/null
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/preferences/LogInformationPreference.java
@@ -0,0 +1,31 @@
+package de.thedevstack.conversationsplus.ui.preferences;
+
+import android.content.Context;
+import android.content.Intent;
+import android.preference.Preference;
+import android.util.AttributeSet;
+
+import de.thedevstack.android.logcat.ui.LogCatOutputActivity;
+
+/**
+ * Created by tzur on 07.10.2015.
+ */
+public class LogInformationPreference extends Preference {
+ public LogInformationPreference(final Context context, final AttributeSet attrs, final int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ public LogInformationPreference(final Context context, final AttributeSet attrs) {
+ super(context, attrs);
+ }
+ public LogInformationPreference(Context context) {
+ super(context);
+ }
+
+ @Override
+ protected void onClick() {
+ super.onClick();
+ final Intent intent = new Intent(getContext(), LogCatOutputActivity.class);
+ getContext().startActivity(intent);
+ }
+}