diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 5 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/XmppActivity.java | 16 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java | 48 | ||||
-rw-r--r-- | src/main/res/layout/activity_about.xml | 10 | ||||
-rw-r--r-- | src/main/res/layout/activity_contact_details.xml | 20 | ||||
-rw-r--r-- | src/main/res/layout/activity_edit_account.xml | 21 | ||||
-rw-r--r-- | src/main/res/layout/activity_muc_details.xml | 28 | ||||
-rw-r--r-- | src/main/res/layout/message_content.xml | 1 | ||||
-rw-r--r-- | src/main/res/values/styles.xml | 18 | ||||
-rw-r--r-- | src/main/res/values/themes.xml | 12 |
12 files changed, 122 insertions, 63 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index d99c37d5b..703e66d82 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -581,6 +581,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers if (self.getAffiliation().ranks(MucOptions.Affiliation.OWNER)) { if (mAdvancedMode) { this.binding.destroy.getBackground().setColorFilter(getWarningButtonColor(), PorterDuff.Mode.MULTIPLY); + this.binding.destroy.setTextColor(getWarningTextColor()); this.binding.destroy.setVisibility(View.VISIBLE); } else { this.binding.destroy.setVisibility(View.GONE); @@ -606,10 +607,12 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers LeaveMucDialog.create().show(); }); this.binding.leaveMuc.getBackground().setColorFilter(getWarningButtonColor(), PorterDuff.Mode.MULTIPLY); + this.binding.leaveMuc.setTextColor(getWarningTextColor()); this.binding.addContactButton.setVisibility(View.VISIBLE); if (mConversation.getBookmark() != null) { this.binding.addContactButton.setText(R.string.delete_bookmark); this.binding.addContactButton.getBackground().setColorFilter(getWarningButtonColor(), PorterDuff.Mode.MULTIPLY); + this.binding.addContactButton.setTextColor(getWarningTextColor()); this.binding.addContactButton.setOnClickListener(v2 -> { final AlertDialog.Builder deleteFromRosterDialog = new AlertDialog.Builder(ConferenceDetailsActivity.this); deleteFromRosterDialog.setNegativeButton(getString(R.string.cancel), null); @@ -624,6 +627,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } else { this.binding.addContactButton.setText(R.string.save_as_bookmark); this.binding.addContactButton.getBackground().clearColorFilter(); + this.binding.addContactButton.setTextColor(getDefaultButtonTextColor()); this.binding.addContactButton.setOnClickListener(v2 -> { saveAsBookmark(); }); diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java index e04507892..c18c8cf4c 100644 --- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java @@ -443,6 +443,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp binding.addContactButton.setVisibility(View.VISIBLE); binding.addContactButton.setText(getString(R.string.action_delete_contact)); binding.addContactButton.getBackground().setColorFilter(getWarningButtonColor(), PorterDuff.Mode.MULTIPLY); + binding.addContactButton.setTextColor(getWarningTextColor()); binding.addContactButton.setOnClickListener(view -> { final AlertDialog.Builder deleteFromRosterDialog = new AlertDialog.Builder(ContactDetailsActivity.this); deleteFromRosterDialog.setNegativeButton(getString(R.string.cancel), null) @@ -523,6 +524,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp binding.addContactButton.setVisibility(View.VISIBLE); binding.addContactButton.setText(getString(R.string.add_contact)); binding.addContactButton.getBackground().clearColorFilter(); + binding.addContactButton.setTextColor(getDefaultButtonTextColor()); binding.addContactButton.setOnClickListener(view -> showAddToRosterDialog(contact)); binding.detailsSendPresence.setVisibility(View.GONE); binding.detailsReceivePresence.setVisibility(View.GONE); diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index d0f5f8542..26ebf5d4b 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -1,7 +1,6 @@ package de.pixart.messenger.ui; import android.app.Activity; -import android.app.AlertDialog.Builder; import android.app.PendingIntent; import android.content.ActivityNotFoundException; import android.content.Intent; @@ -1468,7 +1467,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } public void showWipePepDialog() { - Builder builder = new Builder(this); + AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.clear_other_devices)); builder.setIconAttribute(android.R.attr.alertDialogIcon); builder.setMessage(getString(R.string.clear_other_devices_desc)); @@ -1560,7 +1559,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (mFetchingMamPrefsToast != null) { mFetchingMamPrefsToast.cancel(); } - Builder builder = new Builder(EditAccountActivity.this); + AlertDialog.Builder builder = new AlertDialog.Builder(EditAccountActivity.this); builder.setTitle(R.string.server_side_mam_prefs); String defaultAttr = prefs.getAttribute("default"); final List<String> defaults = Arrays.asList("never", "roster", "always"); diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index e1abbe593..ac2289d92 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -114,6 +114,8 @@ public abstract class XmppActivity extends ActionBarActivity { public boolean xmppConnectionServiceBound = false; protected int mColorWarningButton; + protected int mColorWarningText; + protected int mColorDefaultButtonText; protected int mColorWhite; protected static final String FRAGMENT_TAG_DIALOG = "dialog"; @@ -406,9 +408,12 @@ public abstract class XmppActivity extends ActionBarActivity { this.isCameraFeatureAvailable = getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA); if (isDarkTheme()) { mColorWarningButton = ContextCompat.getColor(this, R.color.warning_button_dark); + mColorWarningText = ContextCompat.getColor(this, R.color.warning_button); } else { mColorWarningButton = ContextCompat.getColor(this, R.color.warning_button); + mColorWarningText = ContextCompat.getColor(this, R.color.warning_button_dark); } + mColorDefaultButtonText = ContextCompat.getColor(this, R.color.realwhite); mColorWhite = ContextCompat.getColor(this, R.color.white70); this.mUsingEnterKey = usingEnterKey(); } @@ -676,8 +681,7 @@ public abstract class XmppActivity extends ActionBarActivity { protected void displayErrorDialog(final int errorCode) { runOnUiThread(() -> { - Builder builder = new Builder( - XmppActivity.this); + AlertDialog.Builder builder = new AlertDialog.Builder(XmppActivity.this); builder.setIconAttribute(android.R.attr.alertDialogIcon); builder.setTitle(getString(R.string.error)); builder.setMessage(errorCode); @@ -945,6 +949,14 @@ public abstract class XmppActivity extends ActionBarActivity { return this.mColorWarningButton; } + public int getWarningTextColor() { + return this.mColorWarningText; + } + + public int getDefaultButtonTextColor() { + return this.mColorDefaultButtonText; + } + public int getPixel(int dp) { DisplayMetrics metrics = getResources().getDisplayMetrics(); return ((int) (dp * metrics.density)); diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java index 79157b413..5eb425d69 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java @@ -7,6 +7,7 @@ import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.Rect; import android.graphics.Typeface; +import android.graphics.drawable.Drawable; import android.net.Uri; import android.preference.PreferenceManager; import android.text.Editable; @@ -38,13 +39,13 @@ import android.widget.Toast; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; +import androidx.core.graphics.drawable.DrawableCompat; import com.google.common.base.Strings; import com.squareup.picasso.Picasso; import java.io.UnsupportedEncodingException; import java.net.URL; -import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; import java.util.regex.Matcher; @@ -442,9 +443,15 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie viewHolder.download_button.setVisibility(View.VISIBLE); viewHolder.download_button.setText(add_contact); if (group) { - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_account_multiple_plus_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_account_multiple_plus_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); } else { - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_account_plus_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_account_plus_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); } viewHolder.download_button.setOnClickListener(v -> { try { @@ -638,7 +645,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie viewHolder.richlinkview.setVisibility(View.GONE); viewHolder.download_button.setVisibility(View.VISIBLE); viewHolder.download_button.setText(text); - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_download_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_download_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); viewHolder.download_button.setOnClickListener(v -> ConversationFragment.downloadFile(activity, message)); } @@ -651,7 +661,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie viewHolder.download_button.setVisibility(View.VISIBLE); final String mimeType = message.getMimeType(); if (mimeType != null && message.getMimeType().contains("pdf")) { - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_file_pdf_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_file_pdf_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); viewHolder.download_button.setText(activity.getString(R.string.open_x_file, UIHelper.getFileDescriptionString(activity, message))); } else if (mimeType != null && message.getMimeType().contains("vcard")) { try { @@ -660,7 +673,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie e.printStackTrace(); } } else if (mimeType != null && message.getMimeType().contains("calendar")) { - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_calendar_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_calendar_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); viewHolder.download_button.setText(activity.getString(R.string.open_x_file, UIHelper.getFileDescriptionString(activity, message))); } else if (mimeType != null && message.getMimeType().equals("application/vnd.android.package-archive")) { try { @@ -669,7 +685,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie e.printStackTrace(); } } else { - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_file_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_file_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); viewHolder.download_button.setText(activity.getString(R.string.open_x_file, UIHelper.getFileDescriptionString(activity, message))); } viewHolder.download_button.setOnClickListener(v -> openDownloadable(message)); @@ -686,7 +705,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie e.printStackTrace(); } } - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_android_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_android_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); viewHolder.download_button.setText(activity.getString(R.string.open_x_file, UIHelper.getFileDescriptionString(activity, message) + APKName)); } @@ -701,7 +723,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie e.printStackTrace(); } } - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_account_card_details_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_account_card_details_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); viewHolder.download_button.setText(activity.getString(R.string.open_x_file, UIHelper.getFileDescriptionString(activity, message) + VCardName)); } @@ -790,7 +815,10 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie viewHolder.image.setVisibility(View.GONE); viewHolder.download_button.setVisibility(View.VISIBLE); viewHolder.download_button.setText(R.string.show_location); - viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_map_marker_grey600_48dp, 0, 0, 0); + Drawable icon = activity.getResources().getDrawable(R.drawable.ic_map_marker_grey600_48dp); + Drawable drawable = DrawableCompat.wrap(icon); + DrawableCompat.setTint(drawable, StyledAttributes.getColor(getContext(), R.attr.colorAccent)); + viewHolder.download_button.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); viewHolder.download_button.setOnClickListener(v -> showLocation(message)); } } diff --git a/src/main/res/layout/activity_about.xml b/src/main/res/layout/activity_about.xml index 427042215..db89771a6 100644 --- a/src/main/res/layout/activity_about.xml +++ b/src/main/res/layout/activity_about.xml @@ -77,20 +77,18 @@ <Button android:id="@+id/show_privacy_policy" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:layout_marginTop="4dp" - android:layout_marginBottom="4dp" + android:layout_margin="4dp" android:text="@string/show_privacy" /> <Button android:id="@+id/show_terms_of_use" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:layout_marginTop="4dp" - android:layout_marginBottom="4dp" + android:layout_margin="4dp" android:text="@string/show_termsofuse" /> </LinearLayout> diff --git a/src/main/res/layout/activity_contact_details.xml b/src/main/res/layout/activity_contact_details.xml index b0130f5cb..cb02d53e2 100644 --- a/src/main/res/layout/activity_contact_details.xml +++ b/src/main/res/layout/activity_contact_details.xml @@ -22,7 +22,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/activity_horizontal_margin" @@ -220,8 +220,8 @@ <Button android:id="@+id/add_contact_button" - style="?android:attr/buttonStyleSmall" - android:layout_width="match_parent" + style="@style/Widget.Conversations.Button" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="24dp" @@ -238,9 +238,9 @@ android:visibility="visible" /> </LinearLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:id="@+id/media_wrapper" android:layout_width="fill_parent" android:layout_height="wrap_content" @@ -289,9 +289,9 @@ android:textColor="?attr/colorAccent" /> </LinearLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:id="@+id/keys_wrapper" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -325,7 +325,7 @@ <Button android:id="@+id/scan_button" - style="?android:attr/borderlessButtonStyle" + style="@style/Widget.Conversations.Button.Borderless" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth="0dp" @@ -338,7 +338,7 @@ <Button android:id="@+id/show_inactive_devices" - style="?android:attr/borderlessButtonStyle" + style="@style/Widget.Conversations.Button.Borderless" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth="0dp" @@ -350,7 +350,7 @@ android:textColor="?attr/colorAccent" /> </LinearLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> </LinearLayout> </ScrollView> </LinearLayout> diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml index a4638fee3..1be75305b 100644 --- a/src/main/res/layout/activity_edit_account.xml +++ b/src/main/res/layout/activity_edit_account.xml @@ -25,7 +25,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:id="@+id/editor" android:layout_width="fill_parent" android:layout_height="wrap_content" @@ -307,9 +307,9 @@ android:layout_marginTop="8dp" android:text="@string/register_account" /> </RelativeLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:id="@+id/os_optimization" android:layout_width="fill_parent" android:layout_height="wrap_content" @@ -369,16 +369,16 @@ android:textColor="@color/accent" /> </LinearLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:id="@+id/stats" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:layout_marginBottom="@dimen/activity_vertical_margin" android:layout_marginLeft="@dimen/activity_horizontal_margin" - android:layout_marginRight="@dimen/activity_horizontal_margin" android:layout_marginTop="@dimen/activity_vertical_margin" + android:layout_marginRight="@dimen/activity_horizontal_margin" + android:layout_marginBottom="@dimen/activity_vertical_margin" android:visibility="gone"> <LinearLayout @@ -401,6 +401,7 @@ android:layout_height="wrap_content" android:shrinkColumns="0" android:stretchColumns="1"> + <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" @@ -818,9 +819,9 @@ </LinearLayout> </RelativeLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:id="@+id/other_device_keys_card" android:layout_width="fill_parent" android:layout_height="wrap_content" @@ -862,7 +863,7 @@ android:text="@string/clear_other_devices" android:textColor="@color/accent" /> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> </LinearLayout> </ScrollView> diff --git a/src/main/res/layout/activity_muc_details.xml b/src/main/res/layout/activity_muc_details.xml index 81bd1274b..894649cc2 100644 --- a/src/main/res/layout/activity_muc_details.xml +++ b/src/main/res/layout/activity_muc_details.xml @@ -24,7 +24,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/activity_horizontal_margin" @@ -286,7 +286,7 @@ <Button android:id="@+id/destroy" - style="?android:attr/buttonStyleSmall" + style="@style/Widget.Conversations.Button" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" @@ -294,8 +294,8 @@ <Button android:id="@+id/add_contact_button" - style="?android:attr/buttonStyleSmall" - android:layout_width="match_parent" + style="@style/Widget.Conversations.Button" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="24dp" @@ -312,9 +312,9 @@ android:visibility="gone" /> </LinearLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/activity_horizontal_margin" @@ -400,17 +400,17 @@ <Button android:id="@+id/leave_muc" - style="?android:attr/buttonStyleSmall" - android:layout_width="match_parent" + style="@style/Widget.Conversations.Button" + android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="24dp" /> </LinearLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:id="@+id/users_wrapper" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -462,8 +462,6 @@ style="@style/Widget.Conversations.Button.Borderless" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentStart="true" - android:layout_alignParentLeft="true" android:minWidth="0dp" android:paddingStart="16dp" android:paddingLeft="16dp" @@ -486,9 +484,9 @@ tools:text="View n Participants" /> </LinearLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> - <androidx.cardview.widget.CardView + <com.google.android.material.card.MaterialCardView android:id="@+id/media_wrapper" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -539,7 +537,7 @@ android:textColor="?attr/colorAccent" /> </LinearLayout> </LinearLayout> - </androidx.cardview.widget.CardView> + </com.google.android.material.card.MaterialCardView> </LinearLayout> </ScrollView> </LinearLayout> diff --git a/src/main/res/layout/message_content.xml b/src/main/res/layout/message_content.xml index 9dfe4392e..2e494e914 100644 --- a/src/main/res/layout/message_content.xml +++ b/src/main/res/layout/message_content.xml @@ -50,6 +50,7 @@ <Button android:id="@+id/download_button" + style="@style/Widget.Conversations.Button.Outline" android:layout_width="wrap_content" android:layout_height="wrap_content" android:longClickable="true" diff --git a/src/main/res/values/styles.xml b/src/main/res/values/styles.xml index 4b7b84c56..0818bbd5b 100644 --- a/src/main/res/values/styles.xml +++ b/src/main/res/values/styles.xml @@ -55,8 +55,20 @@ <item name="android:textSize">?TextSizeBody1</item> </style> - <style name="Widget.Conversations.Button.Borderless" parent="@style/Widget.AppCompat.Button.Borderless"> + <style name="Widget.Conversations.Button.Borderless" parent="@style/Widget.MaterialComponents.Button.TextButton"> <item name="android:textSize">?TextSizeBody2</item> + <item name="android:textColor">?attr/colorAccent</item> + </style> + + <style name="Widget.Conversations.Button.Outline" parent="@style/Widget.MaterialComponents.Button.OutlinedButton"> + <item name="android:textSize">?TextSizeBody2</item> + <item name="strokeColor">?attr/colorAccent</item> + <item name="android:textColor">?attr/colorAccent</item> + </style> + + <style name="Widget.Conversations.Button" parent="@style/Widget.MaterialComponents.Button.UnelevatedButton"> + <item name="android:textSize">?TextSizeBody2</item> + <item name="android:textColor">@color/realwhite</item> </style> <style name="TextAppearance.Conversations.Design.Hint" parent="TextAppearance.Design.Hint"> @@ -138,4 +150,8 @@ <style name="TextAppearance.Conversations.Body1.Secondary.OnDark" parent="TextAppearance.Conversations.Body1"> <item name="android:textColor">@color/white70</item> </style> + + <style name="Conversations.Dialog" parent="ThemeOverlay.MaterialComponents.Dialog.Alert" > + <item name="android:buttonStyle">@style/Widget.Conversations.Button.Borderless</item> + </style> </resources>
\ No newline at end of file diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index de0a449a6..54e6a4356 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <resources xmlns:tools="http://schemas.android.com/tools"> - <style name="ConversationsTheme" parent="Theme.AppCompat.Light.NoActionBar"> + <style name="ConversationsTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> @@ -159,7 +159,7 @@ <item name="ic_settings_about" type="reference">@drawable/ic_help_black_24dp</item> </style> - <style name="ConversationsTheme.Dark" parent="Theme.AppCompat.NoActionBar"> + <style name="ConversationsTheme.Dark" parent="Theme.MaterialComponents.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> @@ -345,7 +345,7 @@ <item name="color_bubble_warning">@color/darkred</item> </style> - <style name="ConversationsTheme.Dialog" parent="@style/Theme.AppCompat.Light.Dialog"> + <style name="ConversationsTheme.Dialog" parent="Theme.MaterialComponents.Light.Dialog"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> @@ -363,7 +363,7 @@ <item name="colorAccent">@color/accent_orange</item> </style> - <style name="ConversationsTheme.Dark.Dialog" parent="@style/Theme.AppCompat.Dialog"> + <style name="ConversationsTheme.Dark.Dialog" parent="Theme.MaterialComponents.Dialog"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> @@ -420,7 +420,7 @@ <item name="TextSizeTitle">56sp</item> </style> - <style name="ConversationsTheme.FullScreen" parent="@style/Theme.AppCompat.Light"> + <style name="ConversationsTheme.FullScreen" parent="Theme.MaterialComponents.Light"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="android:windowNoTitle">true</item> @@ -431,7 +431,7 @@ <item name="android:navigationBarColor" tools:targetApi="21">@color/black</item> </style> - <style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"> + <style name="SplashTheme" parent="Theme.MaterialComponents.NoActionBar"> <item name="colorPrimaryDark">@android:color/transparent</item> <item name="android:windowBackground">@drawable/background</item> </style> |