Skip to content
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

Clean up styles #4470

Merged
merged 4 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion changelog.d/4367.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Poll Feature - Create Poll Screen
Poll Feature - Create Poll Screen (Disabled for now)
6 changes: 3 additions & 3 deletions library/ui-styles/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@
<color name="vctr_chat_effect_snow_background_light">@color/black_alpha</color>
<color name="vctr_chat_effect_snow_background_dark">@android:color/transparent</color>

<attr name="vctr_voice_message_toast_background" format="color" />
<color name="vctr_voice_message_toast_background_light">@color/palette_black_900</color>
<color name="vctr_voice_message_toast_background_dark">@color/palette_gray_400</color>
<attr name="vctr_toast_background" format="color" />
<color name="vctr_toast_background_light">@color/palette_black_900</color>
<color name="vctr_toast_background_dark">@color/palette_gray_400</color>

<!-- Presence Indicator colors -->
<attr name="vctr_presence_indicator_offline" format="color" />
Expand Down
5 changes: 5 additions & 0 deletions library/ui-styles/src/main/res/values/styles_buttons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<item name="lineHeight">24sp</item>
</style>

<style name="Widget.Vector.Button.CallToAction" parent="Widget.Vector.Button">
<item name="android:backgroundTint">@color/button_background_tint_selector</item>
<item name="android:textColor">@android:color/white</item>
</style>

<style name="Widget.Vector.Button.Destructive">
<item name="android:minWidth">94dp</item>
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayDestructive</item>
Expand Down
13 changes: 0 additions & 13 deletions library/ui-styles/src/main/res/values/styles_edit_text.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<!-- Default style for TextInputLayout -->
<style name="Widget.Vector.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox" />

<style name="Widget.Vector.TextInputLayout.Password">
<item name="endIconMode">password_toggle</item>
<item name="endIconTint">?vctr_content_secondary</item>
</style>

<style name="Widget.Vector.EditText.Composer" parent="Widget.AppCompat.EditText">
<item name="android:background">@android:color/transparent</item>
<item name="android:inputType">textCapSentences|textMultiLine</item>
Expand All @@ -19,9 +11,4 @@
<item name="android:textColor">?vctr_message_text_color</item>
</style>

<style name="Widget.Vector.EditText.Form" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<item name="boxStrokeColor">@color/form_edit_text_stroke_color_selector</item>
<item name="android:textColorHint">@color/form_edit_text_hint_color_selector</item>
</style>

</resources>
10 changes: 0 additions & 10 deletions library/ui-styles/src/main/res/values/styles_polls.xml

This file was deleted.

17 changes: 17 additions & 0 deletions library/ui-styles/src/main/res/values/styles_text_input_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<!-- Default style for TextInputLayout -->
<style name="Widget.Vector.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox" />

<style name="Widget.Vector.TextInputLayout.Password">
<item name="endIconMode">password_toggle</item>
<item name="endIconTint">?vctr_content_secondary</item>
</style>

<style name="Widget.Vector.TextInputLayout.Form">
<item name="boxStrokeColor">@color/form_edit_text_stroke_color_selector</item>
<item name="android:textColorHint">@color/form_edit_text_hint_color_selector</item>
</style>

</resources>
15 changes: 15 additions & 0 deletions library/ui-styles/src/main/res/values/styles_toast.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Widget.Vector.TextView.Caption.Toast">
<item name="android:paddingTop">8dp</item>
<item name="android:paddingBottom">8dp</item>
<item name="android:paddingStart">12dp</item>
<item name="android:paddingEnd">12dp</item>
<item name="android:background">@drawable/bg_round_corner_8dp</item>
<item name="android:backgroundTint">?vctr_toast_background</item>
<item name="android:textColor">@color/palette_white</item>
<item name="android:gravity">center</item>
</style>

</resources>
11 changes: 0 additions & 11 deletions library/ui-styles/src/main/res/values/styles_voice_message.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,4 @@
<item name="direction">rightToLeft</item>
</style>

<style name="Widget.Vector.TextView.Caption.Toast">
<item name="android:paddingTop">8dp</item>
<item name="android:paddingBottom">8dp</item>
<item name="android:paddingStart">12dp</item>
<item name="android:paddingEnd">12dp</item>
<item name="android:background">@drawable/bg_round_corner_8dp</item>
<item name="android:backgroundTint">?vctr_voice_message_toast_background</item>
<item name="android:textColor">@color/palette_white</item>
<item name="android:gravity">center</item>
</style>

</resources>
3 changes: 1 addition & 2 deletions library/ui-styles/src/main/res/values/theme_dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@
<!-- Keywords -->
<item name="vctr_keyword_style">@style/Widget.Vector.Keyword</item>

<!-- Voice Message -->
<item name="vctr_voice_message_toast_background">@color/vctr_voice_message_toast_background_dark</item>
<item name="vctr_toast_background">@color/vctr_toast_background_dark</item>
</style>

<style name="Theme.Vector.Dark" parent="Base.Theme.Vector.Dark" />
Expand Down
3 changes: 1 addition & 2 deletions library/ui-styles/src/main/res/values/theme_light.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@
<!-- Keywords -->
<item name="vctr_keyword_style">@style/Widget.Vector.Keyword</item>

<!-- Voice Message -->
<item name="vctr_voice_message_toast_background">@color/vctr_voice_message_toast_background_light</item>
<item name="vctr_toast_background">@color/vctr_toast_background_light</item>
</style>

<style name="Theme.Vector.Light" parent="Base.Theme.Vector.Light" />
Expand Down
6 changes: 3 additions & 3 deletions vector/src/main/res/layout/fragment_create_poll.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toTopOf="@id/createPollButton"
app:layout_constraintTop_toBottomOf="@+id/appBarLayout"
tools:listitem="@layout/item_profile_action" />
tools:listitem="@layout/item_form_text_input_with_delete" />

<Button
android:id="@+id/createPollButton"
style="@style/Widget.Vector.Button.CreatePoll"
style="@style/Widget.Vector.Button.CallToAction"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_margin="16dp"
Expand All @@ -92,7 +92,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="@string/voice_message_release_to_send_toast"
tools:text="@string/create_poll_empty_question_error"
tools:visibility="visible" />

</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion vector/src/main/res/layout/item_form_text_input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/formTextInputTextInputLayout"
style="@style/Widget.Vector.EditText.Form"
style="@style/Widget.Vector.TextInputLayout.Form"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_horizontal_margin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/formTextInputTextInputLayout"
style="@style/Widget.Vector.EditText.Form"
style="@style/Widget.Vector.TextInputLayout.Form"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/layout_horizontal_margin"
Expand Down