diff options
author | Thomas <tschneider.ac@gmail.com> | 2023-02-04 17:53:25 +0100 |
---|---|---|
committer | Thomas <tschneider.ac@gmail.com> | 2023-02-04 17:53:25 +0100 |
commit | f75d8258f4c31133a184b5ad09e2d71f4f7e3671 (patch) | |
tree | f533aa452d3766a7347a1c886e44141ab2df3546 | |
parent | 7a11e156a555b8453791e45acd47e99c8153bf85 (diff) |
Fix button sizes not updated
3 files changed, 27 insertions, 22 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java index 3c556efaa..361f9d922 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java @@ -1069,7 +1069,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> } //Button sizes depending of the defined scale float normalSize = Helper.convertDpToPixel(28, context); - holder.binding.actionButtonReply.getLayoutParams().width = (int) (normalSize * scaleIcon); holder.binding.actionButtonReply.getLayoutParams().height = (int) (normalSize * scaleIcon); holder.binding.actionButtonReply.requestLayout(); @@ -1082,6 +1081,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> holder.binding.actionButtonFavorite.setImageSize((int) (normalSize * scaleIcon)); holder.binding.actionButtonBookmark.setImageSize((int) (normalSize * scaleIcon)); + holder.binding.statusAddCustomEmoji.getLayoutParams().width = (int) (normalSize * scaleIcon); holder.binding.statusAddCustomEmoji.getLayoutParams().height = (int) (normalSize * scaleIcon); holder.binding.statusAddCustomEmoji.requestLayout(); diff --git a/app/src/main/res/layouts/mastodon/layout/drawer_status.xml b/app/src/main/res/layouts/mastodon/layout/drawer_status.xml index b20a053b4..adde24f03 100644 --- a/app/src/main/res/layouts/mastodon/layout/drawer_status.xml +++ b/app/src/main/res/layouts/mastodon/layout/drawer_status.xml @@ -630,10 +630,10 @@ app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.0"> - <androidx.appcompat.widget.AppCompatImageButton + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/action_button_reply" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="28dp" + android:layout_height="28dp" android:layout_gravity="center" android:adjustViewBounds="true" android:background="@color/transparent" @@ -671,10 +671,10 @@ app:primaryColor="@color/boost_icon" app:secondaryColor="@color/boost_icon" /> - <androidx.appcompat.widget.AppCompatImageButton + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/action_button_quote" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="28dp" + android:layout_height="28dp" android:layout_gravity="center" android:adjustViewBounds="true" android:background="@color/transparent" @@ -726,10 +726,10 @@ sparkbutton:iconSize="28dp" /> - <androidx.appcompat.widget.AppCompatImageButton + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/action_button_translate" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="28dp" + android:layout_height="28dp" android:layout_gravity="center" android:adjustViewBounds="true" android:background="@color/transparent" @@ -745,10 +745,10 @@ tools:visibility="visible" /> - <androidx.appcompat.widget.AppCompatImageButton + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/action_button_maths" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="28dp" + android:layout_height="28dp" android:layout_gravity="center" android:adjustViewBounds="true" android:background="@color/transparent" @@ -763,10 +763,10 @@ app:layout_constraintTop_toTopOf="parent" tools:visibility="visible" /> - <androidx.appcompat.widget.AppCompatImageButton + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/status_add_custom_emoji" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="28dp" + android:layout_height="28dp" android:layout_gravity="center" android:adjustViewBounds="true" android:background="@color/transparent" @@ -781,10 +781,10 @@ app:layout_constraintTop_toTopOf="parent" tools:visibility="visible" /> - <androidx.appcompat.widget.AppCompatImageButton + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/status_emoji" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="28dp" + android:layout_height="28dp" android:layout_gravity="center" android:adjustViewBounds="true" android:background="@color/transparent" @@ -799,10 +799,10 @@ app:layout_constraintTop_toTopOf="parent" tools:visibility="visible" /> - <androidx.appcompat.widget.AppCompatImageButton + <androidx.appcompat.widget.AppCompatImageView android:id="@+id/action_button_more" - android:layout_width="48dp" - android:layout_height="48dp" + android:layout_width="28dp" + android:layout_height="28dp" android:layout_gravity="center|end" android:adjustViewBounds="true" android:background="@color/transparent" diff --git a/sparkbutton/src/main/java/com/varunest/sparkbutton/SparkButton.java b/sparkbutton/src/main/java/com/varunest/sparkbutton/SparkButton.java index febfe0534..fd6b90d89 100644 --- a/sparkbutton/src/main/java/com/varunest/sparkbutton/SparkButton.java +++ b/sparkbutton/src/main/java/com/varunest/sparkbutton/SparkButton.java @@ -194,6 +194,11 @@ public class SparkButton extends FrameLayout implements View.OnClickListener { public void setImageSize(@Px int imageSize) { this.imageSize = imageSize; + if (imageView != null) { + imageView.getLayoutParams().width = imageSize; + imageView.getLayoutParams().height = imageSize; + imageView.requestLayout(); + } } public @ColorInt |