diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt index d90e2a00..8e5e1ee3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt @@ -32,11 +32,9 @@ import android.widget.LinearLayout import android.widget.LinearLayout.LayoutParams import android.widget.RelativeLayout import androidx.annotation.StringRes -import androidx.appcompat.widget.AppCompatButton import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.res.ResourcesCompat import androidx.core.view.WindowInsetsCompat -import androidx.core.view.children import androidx.core.view.updateLayoutParams import com.google.gson.Gson import com.google.gson.reflect.TypeToken @@ -1362,20 +1360,26 @@ class ThreadActivity : SimpleActivity() { .toArrayList() private fun setupAttachmentPickerView() { - val colors = arrayOf( + val buttonColors = arrayOf( R.color.md_red_500, R.color.md_pink_500, R.color.md_purple_500, R.color.md_teal_500, R.color.md_green_500, - R.color.md_light_green_500, + R.color.md_indigo_500, R.color.md_blue_500 - ) - attachment_picker_holder.children.filterIsInstance().forEachIndexed { index, button -> - button.setTextColor(getProperTextColor()) - val color = resources.getColor(colors[index]) - button.compoundDrawables.forEach { it?.applyColorFilter(color) } - } + ).map { ResourcesCompat.getColor(resources, it, theme) } + arrayOf(choose_photo_icon, take_photo_icon, record_video_icon, record_audio_icon, pick_file_icon, pick_contact_icon, schedule_message_icon) + .forEachIndexed { index, icon -> + val iconColor = buttonColors[index] + icon.background.applyColorFilter(iconColor) + icon.applyColorFilter(iconColor.getContrastColor()) + } + + val textColor = getProperTextColor() + arrayOf(choose_photo_text, take_photo_text, record_video_text, record_audio_text, pick_file_text, pick_contact_text, schedule_message_text) + .forEach { it.setTextColor(textColor) } + pick_from_gallery.setOnClickListener { launchPickPhotoVideoIntent() } diff --git a/app/src/main/res/layout/activity_thread.xml b/app/src/main/res/layout/activity_thread.xml index 7bdec389..92f829f4 100644 --- a/app/src/main/res/layout/activity_thread.xml +++ b/app/src/main/res/layout/activity_thread.xml @@ -307,125 +307,16 @@ android:importantForAccessibility="no" app:layout_constraintBottom_toTopOf="@id/attachment_picker_holder" /> - - - - - - - - - - - - - - - - - + tools:visibility="visible" /> diff --git a/app/src/main/res/layout/layout_attachment_picker.xml b/app/src/main/res/layout/layout_attachment_picker.xml new file mode 100644 index 00000000..f86e87bc --- /dev/null +++ b/app/src/main/res/layout/layout_attachment_picker.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 0a03e197..d8f37a56 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -11,6 +11,6 @@ 64dp 20dp 36dp - 80dp + 96dp 90dp