mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +03:00
Move the style to the layout, for code clarity. Style are not reused, and it's better to have layout attr in the layout itself
This commit is contained in:
parent
558cd6f376
commit
7a1c6b78d4
4 changed files with 99 additions and 151 deletions
|
@ -1,115 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="VoiceMessageLockBackground">
|
||||
<item name="android:layout_width">52dp</item>
|
||||
<item name="android:layout_height">160dp</item>
|
||||
<item name="android:background">@drawable/bg_voice_message_lock</item>
|
||||
<item name="android:backgroundTint">?vctr_voice_message_lock_background</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageMicButton">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||
<item name="android:layout_marginBottom">12dp</item>
|
||||
<item name="android:layout_marginEnd">12dp</item>
|
||||
<item name="android:src">@drawable/ic_voice_mic</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageSendButton">
|
||||
<item name="android:layout_width">56dp</item>
|
||||
<item name="android:layout_height">56dp</item>
|
||||
<item name="android:background">@drawable/bg_send</item>
|
||||
<item name="android:scaleType">center</item>
|
||||
<item name="android:src">@drawable/ic_send</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageTimerIndicator">
|
||||
<item name="android:layout_width">10dp</item>
|
||||
<item name="android:layout_height">10dp</item>
|
||||
<item name="android:layout_marginStart">20dp</item>
|
||||
<item name="android:src">@drawable/circle</item>
|
||||
<item name="tint">@color/palette_vermilion</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageTimer">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginStart">4dp</item>
|
||||
<item name="android:lineSpacingExtra">4dp</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textColor">@color/palette_gray_200</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageSlideToCancel">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textColor">@color/palette_gray_300</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="drawableStartCompat">@drawable/ic_voice_slide_to_cancel_arrow</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageLockImage">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginTop">16dp</item>
|
||||
<item name="android:src">@drawable/ic_voice_message_unlocked</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageLockArrow">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:src">@drawable/ic_voice_lock_arrow</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageRecordingPlaybackLayout">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:background">@drawable/bg_voice_playback</item>
|
||||
<item name="android:layout_marginStart">16dp</item>
|
||||
<item name="android:backgroundTint">?vctr_voice_message_recording_playback_background</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessageDeletePlayback">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||
<item name="android:src">@drawable/ic_recycle_bin</item>
|
||||
<item name="tint">@color/palette_gray_200</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceMessagePlaybackTimerIndicator">
|
||||
<item name="android:layout_width">10dp</item>
|
||||
<item name="android:layout_height">10dp</item>
|
||||
<item name="android:layout_marginStart">8dp</item>
|
||||
<item name="android:src">@drawable/circle</item>
|
||||
<item name="layout_goneMarginStart">24dp</item>
|
||||
<item name="tint">@color/palette_vermilion</item>
|
||||
</style>
|
||||
|
||||
<style name="VoicePlaybackControlButton">
|
||||
<item name="android:layout_width">32dp</item>
|
||||
<item name="android:layout_height">32dp</item>
|
||||
<item name="android:background">@drawable/bg_voice_play_pause_button</item>
|
||||
<item name="android:paddingStart">3dp</item>
|
||||
<item name="android:paddingEnd">0dp</item>
|
||||
<item name="android:layout_marginStart">8dp</item>
|
||||
<item name="android:src">@drawable/ic_voice_play</item>
|
||||
<item name="android:backgroundTint">?vctr_voice_message_play_pause_button_background</item>
|
||||
</style>
|
||||
|
||||
<style name="VoicePlaybackTime" parent="VoiceMessageTimer">
|
||||
<item name="android:layout_marginStart">6dp</item>
|
||||
<item name="layout_goneMarginStart">24dp</item>
|
||||
</style>
|
||||
|
||||
<style name="VoicePlaybackWaveform">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">0dp</item>
|
||||
<item name="android:layout_marginStart">8dp</item>
|
||||
<item name="android:layout_marginEnd">8dp</item>
|
||||
<item name="chunkColor">@color/palette_gray_300</item>
|
||||
<item name="chunkAlignTo">center</item>
|
||||
<item name="chunkMinHeight">1dp</item>
|
||||
|
@ -120,30 +12,4 @@
|
|||
<item name="direction">leftToRight</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceTimelinePlaybackLayout">
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:background">@drawable/bg_voice_playback</item>
|
||||
<item name="android:minHeight">48dp</item>
|
||||
<item name="android:paddingStart">8dp</item>
|
||||
<item name="android:paddingTop">6dp</item>
|
||||
<item name="android:paddingEnd">8dp</item>
|
||||
<item name="android:paddingBottom">6dp</item>
|
||||
<item name="android:backgroundTint">?vctr_voice_message_playback_background</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceTimelinePlaybackControlButton">
|
||||
<item name="android:layout_width">32dp</item>
|
||||
<item name="android:layout_height">32dp</item>
|
||||
<item name="android:background">@drawable/bg_voice_play_pause_button</item>
|
||||
<item name="android:paddingStart">3dp</item>
|
||||
<item name="android:paddingEnd">0dp</item>
|
||||
<item name="android:src">@drawable/ic_voice_play</item>
|
||||
<item name="android:backgroundTint">?vctr_voice_message_play_pause_button_background</item>
|
||||
</style>
|
||||
|
||||
<style name="VoiceTimelinePlaybackTime" parent="VoiceMessageTimer">
|
||||
<item name="android:layout_marginStart">6dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -4,7 +4,7 @@
|
|||
android:width="56dp"
|
||||
android:height="160dp" />
|
||||
|
||||
<solid android:color="?vctr_voice_message_lock_background" />
|
||||
<solid android:color="#F00" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="28dp"
|
||||
|
|
|
@ -8,21 +8,39 @@
|
|||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/voicePlaybackLayout"
|
||||
style="@style/VoiceTimelinePlaybackLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_voice_playback"
|
||||
android:backgroundTint="?vctr_voice_message_playback_background"
|
||||
android:minHeight="48dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="6dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/voicePlaybackControlButton"
|
||||
style="@style/VoiceTimelinePlaybackControlButton"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/bg_voice_play_pause_button"
|
||||
android:backgroundTint="?vctr_voice_message_play_pause_button_background"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:src="@drawable/ic_voice_play"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/voicePlaybackTime"
|
||||
style="@style/VoiceTimelinePlaybackTime"
|
||||
style="@style/Widget.Vector.TextView.Body.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:textColor="@color/palette_gray_200"
|
||||
app:layout_constraintBottom_toBottomOf="@id/voicePlaybackControlButton"
|
||||
app:layout_constraintStart_toEndOf="@id/voicePlaybackControlButton"
|
||||
app:layout_constraintTop_toTopOf="@id/voicePlaybackControlButton"
|
||||
|
@ -31,6 +49,10 @@
|
|||
<com.visualizer.amplitude.AudioRecordView
|
||||
android:id="@+id/voicePlaybackWaveform"
|
||||
style="@style/VoicePlaybackWaveform"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/voicePlaybackTime"
|
||||
|
|
|
@ -9,23 +9,36 @@
|
|||
|
||||
<View
|
||||
android:id="@+id/voiceMessageLockBackground"
|
||||
style="@style/VoiceMessageLockBackground"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="160dp"
|
||||
android:background="@drawable/bg_voice_message_lock"
|
||||
android:backgroundTint="?vctr_voice_message_lock_background"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/voiceMessageMicButton"
|
||||
tools:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/voiceMessageMicButton"
|
||||
style="@style/VoiceMessageMicButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/a11y_start_voice_message"
|
||||
android:src="@drawable/ic_voice_mic"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/voiceMessageSendButton"
|
||||
style="@style/VoiceMessageSendButton"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:background="@drawable/bg_send"
|
||||
android:contentDescription="@string/send"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_send"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -33,18 +46,26 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/voiceMessageTimerIndicator"
|
||||
style="@style/VoiceMessageTimerIndicator"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:contentDescription="@string/a11y_recording_voice_message"
|
||||
android:src="@drawable/circle"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/voiceMessageMicButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/voiceMessageMicButton"
|
||||
app:tint="@color/palette_vermilion"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/voiceMessageTimer"
|
||||
style="@style/VoiceMessageTimer"
|
||||
style="@style/Widget.Vector.TextView.Body.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textColor="@color/palette_gray_200"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/voiceMessageMicButton"
|
||||
app:layout_constraintStart_toEndOf="@id/voiceMessageTimerIndicator"
|
||||
|
@ -54,9 +75,14 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/voiceMessageSlideToCancel"
|
||||
style="@style/VoiceMessageSlideToCancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/voice_message_slide_to_cancel"
|
||||
android:textColor="@color/palette_gray_300"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone"
|
||||
app:drawableStartCompat="@drawable/ic_voice_slide_to_cancel_arrow"
|
||||
app:layout_constraintBottom_toBottomOf="@id/voiceMessageMicButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -65,8 +91,11 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/voiceMessageLockImage"
|
||||
style="@style/VoiceMessageLockImage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:contentDescription="@string/a11y_lock_voice_message"
|
||||
android:src="@drawable/ic_voice_message_unlocked"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="@id/voiceMessageLockBackground"
|
||||
app:layout_constraintStart_toStartOf="@id/voiceMessageLockBackground"
|
||||
|
@ -75,7 +104,9 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/voiceMessageLockArrow"
|
||||
style="@style/VoiceMessageLockArrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_voice_lock_arrow"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/voiceMessageMicButton"
|
||||
app:layout_constraintEnd_toEndOf="@id/voiceMessageLockBackground"
|
||||
|
@ -99,15 +130,23 @@
|
|||
|
||||
<ImageButton
|
||||
android:id="@+id/voiceMessageDeletePlayback"
|
||||
style="@style/VoiceMessageDeletePlayback"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/a11y_delete_recorded_voice_message"
|
||||
android:src="@drawable/ic_recycle_bin"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="@color/palette_gray_200"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
style="@style/VoiceMessageRecordingPlaybackLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:background="@drawable/bg_voice_playback"
|
||||
android:backgroundTint="?vctr_voice_message_recording_playback_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/voiceMessageDeletePlayback"
|
||||
|
@ -115,17 +154,29 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/voiceMessagePlaybackTimerIndicator"
|
||||
style="@style/VoiceMessagePlaybackTimerIndicator"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="@string/a11y_recording_voice_message"
|
||||
android:src="@drawable/circle"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginStart="24dp"
|
||||
app:tint="@color/palette_vermilion"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/voicePlaybackControlButton"
|
||||
style="@style/VoicePlaybackControlButton"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/bg_voice_play_pause_button"
|
||||
android:backgroundTint="?vctr_voice_message_play_pause_button_background"
|
||||
android:contentDescription="@string/a11y_play_voice_message"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:src="@drawable/ic_voice_play"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -133,15 +184,24 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/voicePlaybackTime"
|
||||
style="@style/VoicePlaybackTime"
|
||||
style="@style/Widget.Vector.TextView.Body.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textColor="@color/palette_gray_200"
|
||||
app:layout_constraintBottom_toBottomOf="@id/voicePlaybackControlButton"
|
||||
app:layout_constraintStart_toEndOf="@id/voicePlaybackControlButton"
|
||||
app:layout_constraintTop_toTopOf="@id/voicePlaybackControlButton"
|
||||
app:layout_goneMarginStart="24dp"
|
||||
tools:text="0:23" />
|
||||
|
||||
<com.visualizer.amplitude.AudioRecordView
|
||||
android:id="@+id/voicePlaybackWaveform"
|
||||
style="@style/VoicePlaybackWaveform"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/voicePlaybackTime"
|
||||
|
|
Loading…
Add table
Reference in a new issue