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