Skip to content

Feature/lucide icons pt3 #864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9ed8de8
Starting to import Lucide icons and clean up
ThomasSession Dec 2, 2024
41ceb52
Removing unused icons
ThomasSession Dec 2, 2024
6970122
Merge branch 'dev' into feature/lucide-icons
ThomasSession Dec 2, 2024
271681d
Lucide icons + removing unsued stuff
ThomasSession Dec 3, 2024
6b73a19
More Lucide icons + ui tweaks + clean up
ThomasSession Dec 3, 2024
25a999e
comment
ThomasSession Dec 3, 2024
5845487
Wrong tinting
ThomasSession Dec 3, 2024
7b4347f
delete icon
ThomasSession Dec 3, 2024
9e642ff
More icons
ThomasSession Dec 3, 2024
5fbf4b5
check icons
ThomasSession Dec 3, 2024
1ba03f5
Merge branch 'dev' into feature/lucide-icons-pt2
ThomasSession Jan 5, 2025
31caa14
edit icon (ic_pencil)
ThomasSession Jan 5, 2025
61716a9
edit icon
ThomasSession Jan 5, 2025
5a5a993
Search icon (ic_search)
ThomasSession Jan 5, 2025
743ba54
settings icons (ic_settings)
ThomasSession Jan 5, 2025
f52a3fd
back icon (ic_chevron_left)
ThomasSession Jan 6, 2025
f270425
icon forward arrow (ic_chevron_right)
ThomasSession Jan 6, 2025
39299ba
icon circle dots (ic_circle_dots_custom)
ThomasSession Jan 6, 2025
bf00ccf
icon read (ic_eye)
ThomasSession Jan 6, 2025
d99b96a
icon disappearing messages (ic_clock_x)
ThomasSession Jan 6, 2025
54c7b68
refresh icon (ic_refresh_cw)
ThomasSession Jan 6, 2025
c3eed56
globe icon
ThomasSession Jan 6, 2025
1161c50
message icon (ic_message_square)
ThomasSession Jan 6, 2025
e1489a5
icon message request (ic_message_square_warning)
ThomasSession Jan 6, 2025
968c203
group and invite icons (ic_users_group_custom, ic_user_round_plus))
ThomasSession Jan 6, 2025
748dea8
icons: lock, unlock, audio/notification (ic_lock_keyhole, ic_lock_key…
ThomasSession Jan 6, 2025
86cbe7e
icon mute / mic off (ic_mic_off)
ThomasSession Jan 6, 2025
0bf6e99
icon appearance, recovery (ic_paintbrush_vertical, ic_recovery_passwo…
ThomasSession Jan 6, 2025
2207b60
icons: help, help circle, qr code
ThomasSession Jan 6, 2025
0bec1c4
icon block/ban
ThomasSession Jan 6, 2025
93591e5
Merge branch 'dev' into feature/lucide-icons-pt2
ThomasSession Jan 6, 2025
f8a6d72
close icon (ic_x)
ThomasSession Jan 6, 2025
a2728ec
pin/unpin icons
ThomasSession Jan 6, 2025
dc2963c
switch camera icon (ic_switch_camera)
ThomasSession Jan 6, 2025
177939a
warning icon (ic_triangle_alert)
ThomasSession Jan 7, 2025
1a53958
phone icons
ThomasSession Jan 7, 2025
f3f7784
share icon + clean up unused files
ThomasSession Jan 7, 2025
fe325ad
mark as read icon + clean up
ThomasSession Jan 7, 2025
0205f67
default video placeholder + clean up
ThomasSession Jan 8, 2025
1da317e
Clean up
ThomasSession Jan 8, 2025
2d0b24c
Merge branch 'dev' into feature/lucide-icons-pt3
ThomasSession Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void onAnimationEnd(Animator animation) {
public void onAuthenticationFailed() {
Log.w(TAG, "onAuthenticationFailed()");

fingerprintPrompt.setImageResource(R.drawable.ic_close_white_48dp);
fingerprintPrompt.setImageResource(R.drawable.ic_x);
fingerprintPrompt.getBackground().setColorFilter(errorColor, PorterDuff.Mode.SRC_IN);

TranslateAnimation shake = new TranslateAnimation(0, 30, 0, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import android.widget.Space
import android.widget.TextView
import androidx.annotation.AttrRes
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.annotation.LayoutRes
import androidx.annotation.StringRes
import androidx.annotation.StyleRes
Expand Down Expand Up @@ -111,8 +112,6 @@ class SessionDialogBuilder(val context: Context) {

fun view(@LayoutRes layout: Int): View = LayoutInflater.from(context).inflate(layout, contentView)

fun iconAttribute(@AttrRes icon: Int): AlertDialog.Builder = dialogBuilder.setIconAttribute(icon)

fun singleChoiceItems(
options: Collection<String>,
currentSelected: Int = 0,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public SearchToolbar(Context context, @Nullable AttributeSet attrs, int defStyle
}

private void initialize() {
setNavigationIcon(getContext().getResources().getDrawable(R.drawable.ic_baseline_clear_24));
setNavigationIcon(getContext().getResources().getDrawable(R.drawable.ic_x));
inflateMenu(R.menu.conversation_list_search);

this.searchItem = getMenu().findItem(R.id.action_filter_search);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class DeleteMediaPreviewDialog {
@JvmStatic
fun show(context: Context, doDelete: Runnable) {
context.showSessionDialog {
iconAttribute(R.attr.dialog_alert_icon)
title(context.resources.getQuantityString(R.plurals.deleteMessage, 1, 1))
text(R.string.deleteMessageDescriptionEveryone)
dangerButton(R.string.delete) { doDelete.run() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ package org.thoughtcrime.securesms.conversation.v2.messages
import android.Manifest
import android.content.Context
import android.content.Intent
import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import androidx.compose.ui.graphics.Color
import androidx.core.content.res.ResourcesCompat
import androidx.core.graphics.drawable.toBitmap
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
Expand Down Expand Up @@ -57,6 +61,10 @@ class ControlMessageView : LinearLayout {

val controlContentView: View get() = binding.controlContentView

val iconSize by lazy {
resources.getDimensionPixelSize(R.dimen.medium_spacing)
}

init {
layoutParams = RecyclerView.LayoutParams(RecyclerView.LayoutParams.MATCH_PARENT, RecyclerView.LayoutParams.WRAP_CONTENT)
}
Expand Down Expand Up @@ -127,15 +135,30 @@ class ControlMessageView : LinearLayout {
binding.root.contentDescription = context.getString(R.string.AccessibilityId_message_request_config_message)
}
message.isCallLog -> {
val drawable = when {
message.isIncomingCall -> R.drawable.ic_incoming_call
message.isOutgoingCall -> R.drawable.ic_outgoing_call
val drawableRes = when {
message.isIncomingCall -> R.drawable.ic_phone_incoming
message.isOutgoingCall -> R.drawable.ic_phone_outgoing
else -> R.drawable.ic_missed_call
}

// Since this is using text drawable we need to go the long way around to size and style the drawable
// We could set the colour and style directly in the drawable's xml but it then makes it non reusable
// This will all be simplified once we turn this all to Compose
val icon = ResourcesCompat.getDrawable(resources, drawableRes, context.theme)?.toBitmap()
icon?.let{
val drawable = BitmapDrawable(resources, Bitmap.createScaledBitmap(icon, iconSize, iconSize, true));
binding.callTextView.setCompoundDrawablesRelativeWithIntrinsicBounds(
drawable,null, null, null)

val iconTint = when {
message.isIncomingCall || message.isOutgoingCall -> R.attr.message_received_text_color
else -> R.attr.danger
}

drawable.setTint(context.getColorFromAttr(iconTint))
}

binding.textView.isVisible = false
binding.callTextView.setCompoundDrawablesRelativeWithIntrinsicBounds(
ResourcesCompat.getDrawable(resources, drawable, context.theme),
null, null, null)
binding.callTextView.text = messageBody

if (message.expireStarted > 0 && message.expiresIn > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,13 @@ class VisibleMessageView : FrameLayout {

private fun getMessageStatusInfo(message: MessageRecord): MessageStatusInfo? = when {
message.isFailed ->
MessageStatusInfo(R.drawable.ic_delivery_status_failed,
MessageStatusInfo(R.drawable.ic_triangle_alert,
getThemedColor(context, R.attr.danger),
R.string.messageStatusFailedToSend
)
message.isSyncFailed ->
MessageStatusInfo(
R.drawable.ic_delivery_status_failed,
R.drawable.ic_triangle_alert,
context.getColor(R.color.accent_orange),
R.string.messageStatusFailedToSync
)
Expand Down
Loading