Merge pull request #1 from moezbhatti/master

Sync with master
This commit is contained in:
searchy2
2016-06-30 10:28:31 -05:00
committed by GitHub
9 changed files with 43 additions and 34 deletions
+2 -2
View File
@@ -31,8 +31,8 @@ android {
buildToolsVersion '23.0.2' buildToolsVersion '23.0.2'
defaultConfig { defaultConfig {
versionCode 130 versionCode 131
versionName "2.6.2" versionName "2.6.3"
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 22 targetSdkVersion 22
multiDexEnabled true multiDexEnabled true
@@ -86,7 +86,7 @@ public enum QKPreference {
MMS_PROXY("mms_proxy", true), MMS_PROXY("mms_proxy", true),
// QK Reply // QK Reply
QK_REPLY("pref_key_quickreply_enabled", Build.VERSION.SDK_INT < 23), QK_REPLY("pref_key_quickreply_enabled", Build.VERSION.SDK_INT < 24),
TAP_DISMISS("pref_key_quickreply_dismiss", true), TAP_DISMISS("pref_key_quickreply_dismiss", true),
// QK Compose // QK Compose
@@ -54,7 +54,7 @@ public class NotificationService extends Service {
if (conversationPrefs.getNotificationsEnabled()) { if (conversationPrefs.getNotificationsEnabled()) {
// Only show QuickReply if we're outside of the app, and they have popups and QuickReply enabled. // Only show QuickReply if we're outside of the app, and they have popups and QuickReply enabled.
if (!LifecycleHandler.isApplicationVisible() && if (!LifecycleHandler.isApplicationVisible() &&
intent.getBooleanExtra(EXTRA_POPUP, false) && prefs.getBoolean(SettingsFragment.QUICKREPLY, Build.VERSION.SDK_INT < 23)) { intent.getBooleanExtra(EXTRA_POPUP, false) && prefs.getBoolean(SettingsFragment.QUICKREPLY, Build.VERSION.SDK_INT < 24)) {
popupIntent = new Intent(context, QKReplyActivity.class); popupIntent = new Intent(context, QKReplyActivity.class);
popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); popupIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@@ -514,7 +514,7 @@ public class NotificationManager {
.extend(RemoteMessagingReceiver.getConversationExtender(context, message.mContact, message.mAddress, threadId)) .extend(RemoteMessagingReceiver.getConversationExtender(context, message.mContact, message.mAddress, threadId))
.setDeleteIntent(seenPI); .setDeleteIntent(seenPI);
if (Build.VERSION.SDK_INT < 23) { if (Build.VERSION.SDK_INT < 24) {
Intent replyIntent = new Intent(context, QKReplyActivity.class); Intent replyIntent = new Intent(context, QKReplyActivity.class);
replyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); replyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
replyIntent.putExtra(QKReplyActivity.EXTRA_THREAD_ID, threadId); replyIntent.putExtra(QKReplyActivity.EXTRA_THREAD_ID, threadId);
@@ -607,7 +607,7 @@ public class NotificationManager {
.extend(RemoteMessagingReceiver.getConversationExtender(context, message.mContact, message.mAddress, threadId)) .extend(RemoteMessagingReceiver.getConversationExtender(context, message.mContact, message.mAddress, threadId))
.setDeleteIntent(seenPI); .setDeleteIntent(seenPI);
if (Build.VERSION.SDK_INT < 23) { if (Build.VERSION.SDK_INT < 24) {
Intent replyIntent = new Intent(context, QKReplyActivity.class); Intent replyIntent = new Intent(context, QKReplyActivity.class);
replyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); replyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
replyIntent.putExtra(QKReplyActivity.EXTRA_THREAD_ID, threadId); replyIntent.putExtra(QKReplyActivity.EXTRA_THREAD_ID, threadId);
@@ -749,7 +749,7 @@ public class NotificationManager {
*/ */
private static int getNotificationPriority(Context context) { private static int getNotificationPriority(Context context) {
boolean qkreplyEnabled = PreferenceManager.getDefaultSharedPreferences(context) boolean qkreplyEnabled = PreferenceManager.getDefaultSharedPreferences(context)
.getBoolean(SettingsFragment.QUICKREPLY, Build.VERSION.SDK_INT < 23); .getBoolean(SettingsFragment.QUICKREPLY, Build.VERSION.SDK_INT < 24);
if (qkreplyEnabled) { if (qkreplyEnabled) {
return NotificationCompat.PRIORITY_DEFAULT; return NotificationCompat.PRIORITY_DEFAULT;
} else { } else {
@@ -39,7 +39,6 @@ public class ComposeFragment extends QKFragment implements ActivityLauncher, Rec
mRecipients = (AutoCompleteContactView) view.findViewById(R.id.compose_recipients); mRecipients = (AutoCompleteContactView) view.findViewById(R.id.compose_recipients);
mRecipients.setOnItemClickListener(this); mRecipients.setOnItemClickListener(this);
view.findViewById(R.id.compose_view_stub).setVisibility(View.VISIBLE);
mComposeView = (ComposeView) view.findViewById(R.id.compose_view); mComposeView = (ComposeView) view.findViewById(R.id.compose_view);
mComposeView.onOpenConversation(null, null); mComposeView.onOpenConversation(null, null);
mComposeView.setActivityLauncher(this); mComposeView.setActivityLauncher(this);
@@ -22,12 +22,16 @@ public class AutoCompleteContactView extends RecipientEditTextView {
public AutoCompleteContactView(Context context) { public AutoCompleteContactView(Context context) {
this(context, null); this(context, null);
init(context); if (!isInEditMode()) {
init(context);
}
} }
public AutoCompleteContactView(Context context, AttributeSet attrs) { public AutoCompleteContactView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
init(context); if (!isInEditMode()) {
init(context);
}
} }
private void init(Context context) { private void init(Context context) {
@@ -40,12 +40,16 @@ public class StarredContactsView extends LinearLayout implements LoaderManager.L
public StarredContactsView(Context context) { public StarredContactsView(Context context) {
super(context); super(context);
init(context); if (!isInEditMode()) {
init(context);
}
} }
public StarredContactsView(Context context, AttributeSet attrs) { public StarredContactsView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
init(context); if (!isInEditMode()) {
init(context);
}
} }
private void init(Context context) { private void init(Context context) {
+24 -22
View File
@@ -1,33 +1,35 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"> android:orientation="vertical">
<com.moez.QKSMS.ui.view.AutoCompleteContactView <ScrollView
android:id="@+id/compose_recipients"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:hint="@string/hint_contacts"
android:padding="16dp" />
<include layout="@layout/view_starred_contacts" />
<View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" /> android:layout_weight="1">
<ViewStub <LinearLayout
android:id="@+id/compose_view_stub" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:focusable="true"
android:clipToPadding="false" android:focusableInTouchMode="true"
android:inflatedId="@+id/compose_view" android:orientation="vertical">
android:layout="@layout/view_compose" />
<com.moez.QKSMS.ui.view.AutoCompleteContactView
android:id="@+id/compose_recipients"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:hint="@string/hint_contacts"
android:padding="16dp" />
<include layout="@layout/view_starred_contacts" />
</LinearLayout>
</ScrollView>
<include layout="@layout/view_compose" />
</LinearLayout> </LinearLayout>