Skip to content

Commit

Permalink
Fixed QK Compose icon
Browse files Browse the repository at this point in the history
  • Loading branch information
moezbhatti committed Nov 2, 2015
1 parent 9c96c4c commit 306d5fc
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@
import android.support.v4.app.NotificationCompat;
import android.text.Html;
import android.util.Log;

import com.android.mms.transaction.TransactionService;
import com.android.mms.transaction.TransactionState;
import com.google.android.mms.pdu_alt.PduHeaders;
import com.moez.QKSMS.R;
import com.moez.QKSMS.common.ConversationPrefsHelper;
import com.moez.QKSMS.common.utils.ImageUtils;
import com.moez.QKSMS.data.Contact;
import com.moez.QKSMS.data.ContactHelper;
import com.moez.QKSMS.data.Message;
import com.moez.QKSMS.model.ImageModel;
import com.moez.QKSMS.model.SlideshowModel;
import com.moez.QKSMS.receiver.WearableIntentReceiver;
import com.moez.QKSMS.common.ConversationPrefsHelper;
import com.moez.QKSMS.common.utils.ImageUtils;
import com.moez.QKSMS.ui.MainActivity;
import com.moez.QKSMS.ui.ThemeManager;
import com.moez.QKSMS.ui.messagelist.MessageItem;
import com.moez.QKSMS.ui.popup.QKComposeActivity;
import com.moez.QKSMS.ui.popup.QKReplyActivity;
Expand Down Expand Up @@ -156,7 +158,7 @@ public void run() {

// If this message is in the foreground, mark it as read
Message message = new Message(context, lastMessage.mMsgId);
if (message.getThreadId() ==MainActivity.sThreadShowing) {
if (message.getThreadId() == MainActivity.sThreadShowing) {
message.markRead();
return;
}
Expand Down Expand Up @@ -391,7 +393,7 @@ public static void dismiss(Context context, int id) {
* Dismisses all old notifications. The purpose of this is to clear notifications that don't need to show up,
* without making the remaining ones dissapear and pop up again like how NotificationMangager.cancelAll and then
* rebuilding them would do
* <p/>
* <p>
* This should stay private, because it assumes that the preferences have already been initialized
*/
private static void dismissOld(Context context, HashMap<Long, ArrayList<MessageItem>> newMessages) {
Expand Down Expand Up @@ -487,7 +489,7 @@ private static void buildSingleMessageNotification(final Context context, ArrayL
String body;
String title;
NotificationCompat.Style nstyle = null;
switch (privateNotifications){
switch (privateNotifications) {
case 0: //Hide nothing
body = message.mBody;
title = message.mContact;
Expand Down Expand Up @@ -517,7 +519,9 @@ private static void buildSingleMessageNotification(final Context context, ArrayL
.addAction(R.drawable.ic_accept, sRes.getString(R.string.read), readPI)
.extend(WearableIntentReceiver.getSingleConversationExtender(context, message.mContact, message.mAddress, threadId))
.setDeleteIntent(seenPI);
if (conversationPrefs.getDimissedReadEnabled()){builder.setDeleteIntent(readPI);}
if (conversationPrefs.getDimissedReadEnabled()) {
builder.setDeleteIntent(readPI);
}

if (conversationPrefs.getCallButtonEnabled()) {
Intent callIntent = new Intent(Intent.ACTION_CALL);
Expand Down Expand Up @@ -545,7 +549,8 @@ private static void buildSingleMessageNotification(final Context context, ArrayL

} else {
Log.d(TAG, "MMS Type: not an image lol");
if (privateNotifications == 0) builder.setStyle(new NotificationCompat.BigTextStyle().bigText(message.mBody));
if (privateNotifications == 0)
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(message.mBody));
else builder.setStyle(null);
}

Expand Down Expand Up @@ -669,9 +674,9 @@ public static void initQuickCompose(Context context, boolean override, boolean o
.setContentText(sRes.getString(R.string.quickcompose_detail))
.setOngoing(true)
.setContentIntent(composePI)
.setSmallIcon(R.drawable.blank)
.setSmallIcon(R.drawable.ic_compose)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setLargeIcon(BitmapFactory.decodeResource(sRes, R.drawable.ic_compose));
.setColor(ThemeManager.getColor());

NotificationManager.notify(context, NOTIFICATION_ID_QUICKCOMPOSE, builder.build());
} else {
Expand Down Expand Up @@ -713,12 +718,12 @@ private static Bitmap getLargeIcon(Context context, Contact contact, Integer pri

if (privateNotification == 2) {
return null;
}
else {
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
return ImageUtils.getCircleBitmap(bitmap, idealIconWidth);
} else {
return bitmap;
}
else return bitmap;
}
}

Expand Down

0 comments on commit 306d5fc

Please sign in to comment.