diff options
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui')
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); + } +} |