mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-22 21:58:53 +01:00
Remove all usages of old ripple application
This commit is contained in:
@@ -7,9 +7,11 @@ import android.util.Log;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
import com.moez.QKSMS.R;
|
import com.moez.QKSMS.R;
|
||||||
|
import com.moez.QKSMS.enums.QKPreference;
|
||||||
import com.moez.QKSMS.external.iab.IabHelper;
|
import com.moez.QKSMS.external.iab.IabHelper;
|
||||||
import com.moez.QKSMS.external.iab.IabResult;
|
import com.moez.QKSMS.external.iab.IabResult;
|
||||||
import com.moez.QKSMS.external.iab.Purchase;
|
import com.moez.QKSMS.external.iab.Purchase;
|
||||||
|
import com.moez.QKSMS.ui.ThemeManager;
|
||||||
import com.moez.QKSMS.ui.base.QKActivity;
|
import com.moez.QKSMS.ui.base.QKActivity;
|
||||||
import com.moez.QKSMS.ui.dialog.QKDialog;
|
import com.moez.QKSMS.ui.dialog.QKDialog;
|
||||||
|
|
||||||
@@ -197,6 +199,13 @@ public class DonationManager {
|
|||||||
view.findViewById(R.id.donate_10).setOnClickListener(clickListener);
|
view.findViewById(R.id.donate_10).setOnClickListener(clickListener);
|
||||||
view.findViewById(R.id.donate_paypal).setOnClickListener(clickListener);
|
view.findViewById(R.id.donate_paypal).setOnClickListener(clickListener);
|
||||||
|
|
||||||
|
LiveViewManager.registerView(QKPreference.BACKGROUND, this, key -> {
|
||||||
|
view.findViewById(R.id.donate_1).setBackgroundDrawable(ThemeManager.getRippleBackground());
|
||||||
|
view.findViewById(R.id.donate_5).setBackgroundDrawable(ThemeManager.getRippleBackground());
|
||||||
|
view.findViewById(R.id.donate_10).setBackgroundDrawable(ThemeManager.getRippleBackground());
|
||||||
|
view.findViewById(R.id.donate_paypal).setBackgroundDrawable(ThemeManager.getRippleBackground());
|
||||||
|
});
|
||||||
|
|
||||||
QKDialog dialog = new QKDialog()
|
QKDialog dialog = new QKDialog()
|
||||||
.setContext(mContext)
|
.setContext(mContext)
|
||||||
.setCustomView(view);
|
.setCustomView(view);
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ import android.graphics.PorterDuff;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.annotation.ColorInt;
|
||||||
|
import android.support.annotation.DrawableRes;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -373,46 +375,57 @@ public class ThemeManager {
|
|||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getBackgroundColor() {
|
public static int getBackgroundColor() {
|
||||||
return mBackgroundColor;
|
return mBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getTextOnColorPrimary() {
|
public static int getTextOnColorPrimary() {
|
||||||
return mTextOnColorPrimary;
|
return mTextOnColorPrimary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getTextOnColorSecondary() {
|
public static int getTextOnColorSecondary() {
|
||||||
return mTextOnColorSecondary;
|
return mTextOnColorSecondary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getTextOnBackgroundPrimary() {
|
public static int getTextOnBackgroundPrimary() {
|
||||||
return mTextOnBackgroundPrimary;
|
return mTextOnBackgroundPrimary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getTextOnBackgroundSecondary() {
|
public static int getTextOnBackgroundSecondary() {
|
||||||
return mtextOnBackgroundSecondary;
|
return mtextOnBackgroundSecondary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DrawableRes
|
||||||
public static int getSentBubbleRes() {
|
public static int getSentBubbleRes() {
|
||||||
return mSentBubbleRes;
|
return mSentBubbleRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DrawableRes
|
||||||
public static int getSentBubbleAltRes() {
|
public static int getSentBubbleAltRes() {
|
||||||
return mSentBubbleAltRes;
|
return mSentBubbleAltRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getSentBubbleColor() {
|
public static int getSentBubbleColor() {
|
||||||
return mSentBubbleColored ? mActiveColor : getNeutralBubbleColor();
|
return mSentBubbleColored ? mActiveColor : getNeutralBubbleColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DrawableRes
|
||||||
public static int getReceivedBubbleRes() {
|
public static int getReceivedBubbleRes() {
|
||||||
return mReceivedBubbleRes;
|
return mReceivedBubbleRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DrawableRes
|
||||||
public static int getReceivedBubbleAltRes() {
|
public static int getReceivedBubbleAltRes() {
|
||||||
return mReceivedBubbleAltRes;
|
return mReceivedBubbleAltRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getReceivedBubbleColor() {
|
public static int getReceivedBubbleColor() {
|
||||||
return mReceivedBubbleColored ? mActiveColor : getNeutralBubbleColor();
|
return mReceivedBubbleColored ? mActiveColor : getNeutralBubbleColor();
|
||||||
}
|
}
|
||||||
@@ -432,6 +445,7 @@ public class ThemeManager {
|
|||||||
mReceivedBubbleColored = colored;
|
mReceivedBubbleColored = colored;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getNeutralBubbleColor() {
|
public static int getNeutralBubbleColor() {
|
||||||
if (mTheme == null) {
|
if (mTheme == null) {
|
||||||
return 0xeeeeee;
|
return 0xeeeeee;
|
||||||
@@ -453,10 +467,12 @@ public class ThemeManager {
|
|||||||
return mResources.getDrawable(mRippleBackgroundRes);
|
return mResources.getDrawable(mRippleBackgroundRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getColor() {
|
public static int getColor() {
|
||||||
return mActiveColor;
|
return mActiveColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ColorInt
|
||||||
public static int getThemeColor() {
|
public static int getThemeColor() {
|
||||||
return mColor;
|
return mColor;
|
||||||
}
|
}
|
||||||
@@ -495,7 +511,6 @@ public class ThemeManager {
|
|||||||
holder.mPager.setAdapter(adapter);
|
holder.mPager.setAdapter(adapter);
|
||||||
holder.mPager.setOffscreenPageLimit(1);
|
holder.mPager.setOffscreenPageLimit(1);
|
||||||
holder.mPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
holder.mPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
||||||
@SuppressWarnings("ResourceAsColor")
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(int position) {
|
public void onPageSelected(int position) {
|
||||||
super.onPageSelected(position);
|
super.onPageSelected(position);
|
||||||
|
|||||||
@@ -13,14 +13,11 @@ import com.moez.QKSMS.common.utils.DateFormatter;
|
|||||||
import com.moez.QKSMS.data.Contact;
|
import com.moez.QKSMS.data.Contact;
|
||||||
import com.moez.QKSMS.data.Conversation;
|
import com.moez.QKSMS.data.Conversation;
|
||||||
import com.moez.QKSMS.enums.QKPreference;
|
import com.moez.QKSMS.enums.QKPreference;
|
||||||
import com.moez.QKSMS.interfaces.LiveView;
|
|
||||||
import com.moez.QKSMS.ui.ThemeManager;
|
import com.moez.QKSMS.ui.ThemeManager;
|
||||||
import com.moez.QKSMS.ui.base.QKActivity;
|
import com.moez.QKSMS.ui.base.QKActivity;
|
||||||
import com.moez.QKSMS.ui.base.RecyclerCursorAdapter;
|
import com.moez.QKSMS.ui.base.RecyclerCursorAdapter;
|
||||||
import com.moez.QKSMS.ui.settings.SettingsFragment;
|
import com.moez.QKSMS.ui.settings.SettingsFragment;
|
||||||
|
|
||||||
import static com.moez.QKSMS.R.id.conversation;
|
|
||||||
|
|
||||||
public class ConversationListAdapter extends RecyclerCursorAdapter<ConversationListViewHolder, Conversation> {
|
public class ConversationListAdapter extends RecyclerCursorAdapter<ConversationListViewHolder, Conversation> {
|
||||||
|
|
||||||
|
|
||||||
@@ -52,6 +49,10 @@ public class ConversationListAdapter extends RecyclerCursorAdapter<ConversationL
|
|||||||
holder.errorIndicator.setColorFilter(ThemeManager.getColor());
|
holder.errorIndicator.setColorFilter(ThemeManager.getColor());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
LiveViewManager.registerView(QKPreference.BACKGROUND, this, key -> {
|
||||||
|
holder.root.setBackgroundDrawable(ThemeManager.getRippleBackground());
|
||||||
|
});
|
||||||
|
|
||||||
return holder;
|
return holder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,8 +105,9 @@ public class ConversationListAdapter extends RecyclerCursorAdapter<ConversationL
|
|||||||
holder.mSelected.setVisibility(View.GONE);
|
holder.mSelected.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
LiveViewManager.registerView(QKPreference.HIDE_AVATAR_CONVERSATIONS, this, key ->
|
LiveViewManager.registerView(QKPreference.HIDE_AVATAR_CONVERSATIONS, this, key -> {
|
||||||
holder.mAvatarView.setVisibility(mContext.getBoolean(QKPreference.HIDE_AVATAR_CONVERSATIONS) ? View.GONE : View.VISIBLE));
|
holder.mAvatarView.setVisibility(mContext.getBoolean(QKPreference.HIDE_AVATAR_CONVERSATIONS) ? View.GONE : View.VISIBLE);
|
||||||
|
});
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
holder.dateView.setText(DateFormatter.getConversationTimestamp(mContext, conversation.getDate()));
|
holder.dateView.setText(DateFormatter.getConversationTimestamp(mContext, conversation.getDate()));
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import com.moez.QKSMS.R;
|
|||||||
import com.moez.QKSMS.data.Contact;
|
import com.moez.QKSMS.data.Contact;
|
||||||
import com.moez.QKSMS.data.Conversation;
|
import com.moez.QKSMS.data.Conversation;
|
||||||
import com.moez.QKSMS.data.ConversationLegacy;
|
import com.moez.QKSMS.data.ConversationLegacy;
|
||||||
import com.moez.QKSMS.ui.MainActivity;
|
|
||||||
import com.moez.QKSMS.ui.ThemeManager;
|
import com.moez.QKSMS.ui.ThemeManager;
|
||||||
import com.moez.QKSMS.ui.base.ClickyViewHolder;
|
import com.moez.QKSMS.ui.base.ClickyViewHolder;
|
||||||
import com.moez.QKSMS.ui.base.QKActivity;
|
import com.moez.QKSMS.ui.base.QKActivity;
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ public class MessageListAdapter extends RecyclerCursorAdapter<MessageListViewHol
|
|||||||
}
|
}
|
||||||
|
|
||||||
LiveViewManager.registerView(QKPreference.BACKGROUND, this, key -> {
|
LiveViewManager.registerView(QKPreference.BACKGROUND, this, key -> {
|
||||||
|
holder.mRoot.setBackgroundDrawable(ThemeManager.getRippleBackground());
|
||||||
holder.mMmsView.getForeground().setColorFilter(ThemeManager.getBackgroundColor(), PorterDuff.Mode.SRC_ATOP);
|
holder.mMmsView.getForeground().setColorFilter(ThemeManager.getBackgroundColor(), PorterDuff.Mode.SRC_ATOP);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -280,7 +281,7 @@ public class MessageListAdapter extends RecyclerCursorAdapter<MessageListViewHol
|
|||||||
|
|
||||||
MessageItem messageItem2 = getItem(position + 1);
|
MessageItem messageItem2 = getItem(position + 1);
|
||||||
|
|
||||||
if(mPrefs.getBoolean(SettingsFragment.FORCE_TIMESTAMPS, false)) {
|
if (mPrefs.getBoolean(SettingsFragment.FORCE_TIMESTAMPS, false)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (messageItem.mDeliveryStatus != MessageItem.DeliveryStatus.NONE) {
|
} else if (messageItem.mDeliveryStatus != MessageItem.DeliveryStatus.NONE) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import com.moez.QKSMS.R;
|
import com.moez.QKSMS.R;
|
||||||
|
import com.moez.QKSMS.common.LiveViewManager;
|
||||||
import com.moez.QKSMS.common.utils.DateFormatter;
|
import com.moez.QKSMS.common.utils.DateFormatter;
|
||||||
|
import com.moez.QKSMS.enums.QKPreference;
|
||||||
|
import com.moez.QKSMS.ui.ThemeManager;
|
||||||
import com.moez.QKSMS.ui.base.QKActivity;
|
import com.moez.QKSMS.ui.base.QKActivity;
|
||||||
import com.moez.QKSMS.ui.base.RecyclerCursorAdapter;
|
import com.moez.QKSMS.ui.base.RecyclerCursorAdapter;
|
||||||
|
|
||||||
@@ -37,6 +40,11 @@ public class SearchAdapter extends RecyclerCursorAdapter<SearchViewHolder, Searc
|
|||||||
public SearchViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
public SearchViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||||
View view = inflater.inflate(R.layout.list_item_search, parent, false);
|
View view = inflater.inflate(R.layout.list_item_search, parent, false);
|
||||||
|
|
||||||
|
LiveViewManager.registerView(QKPreference.BACKGROUND, this, key -> {
|
||||||
|
view.setBackgroundDrawable(ThemeManager.getRippleBackground());
|
||||||
|
});
|
||||||
|
|
||||||
return new SearchViewHolder(mContext, view);
|
return new SearchViewHolder(mContext, view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
android:id="@+id/tab_1"
|
android:id="@+id/tab_1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
@@ -26,7 +25,6 @@
|
|||||||
android:id="@+id/tab_2"
|
android:id="@+id/tab_2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
android:id="@+id/donate_1"
|
android:id="@+id/donate_1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
@@ -52,7 +51,6 @@
|
|||||||
android:id="@+id/donate_5"
|
android:id="@+id/donate_5"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
@@ -74,7 +72,6 @@
|
|||||||
android:id="@+id/donate_10"
|
android:id="@+id/donate_10"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
@@ -104,7 +101,6 @@
|
|||||||
android:id="@+id/donate_paypal"
|
android:id="@+id/donate_paypal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
android:minHeight="72dp"
|
android:minHeight="72dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="2dp">
|
android:paddingTop="2dp">
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingTop="2dp">
|
android:paddingTop="2dp">
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
|
|||||||
@@ -19,9 +19,4 @@
|
|||||||
<item name="type">tertiary</item>
|
<item name="type">tertiary</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ButtonStyle">
|
|
||||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
|
||||||
<item name="android:soundEffectsEnabled">true</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user