Commit 4b3236e9 authored by Thomas's avatar Thomas
Browse files

Fix button sizes for messages

parent 9ad51774
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ public class CustomEmoji extends ReplacementSpan {
        Context mContext = viewWeakReference.get().getContext();
        this.viewWeakReference = viewWeakReference;
        SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
        scale = sharedpreferences.getFloat(mContext.getString(R.string.SET_FONT_SCALE), 1.0f);
        scale = sharedpreferences.getFloat(mContext.getString(R.string.SET_FONT_SCALE), 1.1f);
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -1188,7 +1188,7 @@ public class Helper {
    public static MultipartBody.Part getMultipartBodyWithWM(Context context, String waterMark, @NonNull String paramName, @NonNull Attachment attachment) {
        File files = new File(attachment.local_path);
        SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
        float scale = sharedpreferences.getFloat(context.getString(R.string.SET_FONT_SCALE), 1.0f);
        float scale = sharedpreferences.getFloat(context.getString(R.string.SET_FONT_SCALE), 1.1f);
        float textSize = 15;
        Paint mPaint = new Paint();
        mPaint.setTextSize(textSize);
+2 −0
Original line number Diff line number Diff line
@@ -226,6 +226,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
            } else if (getItemViewType(position) == TYPE_POLL) {
                holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_poll_24);
            }

            StatusesVM statusesVM = new ViewModelProvider((ViewModelStoreOwner) context).get(StatusesVM.class);
            SearchVM searchVM = new ViewModelProvider((ViewModelStoreOwner) context).get(SearchVM.class);
            if (notification.status != null) {
@@ -272,6 +273,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
                }
            } else {
                holderStatus.bindingNotification.containerTransparent.setVisibility(View.VISIBLE);
                holderStatus.bindingNotification.status.mediaContainer.setVisibility(View.GONE);
                String title = "";
                MastodonHelper.loadPPMastodon(holderStatus.binding.avatar, notification.account);
                if (getItemViewType(position) == TYPE_FAVOURITE) {
+21 −5
Original line number Diff line number Diff line
@@ -915,17 +915,34 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
        if (theme_text_header_2_line != -1) {
            holder.binding.username.setTextColor(theme_text_header_2_line);
        }

        //final float scale = context.getResources().getDisplayMetrics().density;
        final float scale = sharedpreferences.getFloat(context.getString(R.string.SET_FONT_SCALE), 1.1f);
        if (statusToDeal.account.locked) {
            final float scale = context.getResources().getDisplayMetrics().density;
            Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_baseline_lock_24);
            assert img != null;
            img.setBounds(0, 0, (int) (16 * scale + 0.5f), (int) (16 * scale + 0.5f));
            img.setBounds(0, 0, (int) (Helper.convertDpToPixel(16, context) * scale + 0.5f), (int) (Helper.convertDpToPixel(16, context) * scale + 0.5f));
            holder.binding.username.setCompoundDrawables(null, null, img, null);
        } else {
            holder.binding.username.setCompoundDrawables(null, null, null, null);
        }

        float normalSize = Helper.convertDpToPixel(28, context);
        holder.binding.actionButtonReply.getLayoutParams().width = (int) (normalSize * scale);
        holder.binding.actionButtonReply.getLayoutParams().height = (int) (normalSize * scale);
        holder.binding.actionButtonReply.requestLayout();
        holder.binding.actionButtonBoost.setImageSize((int) (normalSize * scale));
        holder.binding.actionButtonFavorite.setImageSize((int) (normalSize * scale));
        holder.binding.actionButtonBookmark.setImageSize((int) (normalSize * scale));
        holder.binding.statusAddCustomEmoji.getLayoutParams().width = (int) (normalSize * scale);
        holder.binding.statusAddCustomEmoji.getLayoutParams().height = (int) (normalSize * scale);
        holder.binding.statusAddCustomEmoji.requestLayout();
        holder.binding.statusEmoji.getLayoutParams().width = (int) (normalSize * scale);
        holder.binding.statusEmoji.getLayoutParams().height = (int) (normalSize * scale);
        holder.binding.actionButtonMore.getLayoutParams().width = (int) (normalSize * scale);
        holder.binding.actionButtonMore.getLayoutParams().height = (int) (normalSize * scale);
        holder.binding.actionButtonMore.requestLayout();
        holder.binding.actionShare.getLayoutParams().width = (int) (normalSize * scale);
        holder.binding.actionShare.getLayoutParams().height = (int) (normalSize * scale);
        holder.binding.actionShare.requestLayout();

        if (statusToDeal.account.bot) {
            holder.binding.botIcon.setVisibility(View.VISIBLE);
@@ -1416,7 +1433,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
                    if (ownvotes != null && ownvotes.contains(j)) {
                        Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_baseline_check_24);
                        assert img != null;
                        final float scale = context.getResources().getDisplayMetrics().density;
                        img.setColorFilter(ContextCompat.getColor(context, R.color.cyanea_accent_reference), PorterDuff.Mode.SRC_IN);
                        img.setBounds(0, 0, (int) (20 * scale + 0.5f), (int) (20 * scale + 0.5f));
                        pollItemBinding.pollItemText.setCompoundDrawables(null, null, img, null);
+10 −0
Original line number Diff line number Diff line
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:tint="#FFFFFF"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M2,20h20v-4L2,16v4zM4,17h2v2L4,19v-2zM2,4v4h20L22,4L2,4zM6,7L4,7L4,5h2v2zM2,14h20v-4L2,10v4zM4,11h2v2L4,13v-2z" />
</vector>
Loading