mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 16:50:04 +02:00
Fix button sizes not updated
This commit is contained in:
parent
7a11e156a5
commit
f75d8258f4
3 changed files with 27 additions and 22 deletions
|
@ -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();
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue