Commit a044e0c3 authored by Hussein El Feky's avatar Hussein El Feky

Fixed layout issues

parent b53054f2
......@@ -3,6 +3,7 @@ package chat.rocket.android.chatrooms.adapter
import android.content.res.Resources
import android.graphics.drawable.Drawable
import android.view.View
import android.widget.TextView
import androidx.core.view.isGone
import androidx.core.view.isInvisible
import androidx.core.view.isVisible
......@@ -15,7 +16,6 @@ import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import kotlinx.android.synthetic.main.item_chat.view.*
import kotlinx.android.synthetic.main.unread_messages_badge.view.*
class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit) :
ViewHolder<RoomItemHolder>(itemView) {
......@@ -31,8 +31,6 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
override fun bindViews(data: RoomItemHolder) {
val room = data.data
with(itemView) {
val avatar = room.avatar
Glide.with(image_avatar.context)
.load(room.avatar)
.apply(RequestOptions.bitmapTransform(RoundedCorners(10)))
......@@ -63,6 +61,7 @@ class RoomViewHolder(itemView: View, private val listener: (RoomUiModel) -> Unit
}
if (room.alert) {
val text_total_unread_messages = text_total_unread_messages as TextView
if (room.unread == null) text_total_unread_messages.text = "!"
if (room.unread != null) text_total_unread_messages.text = room.unread
if (room.mentions) text_total_unread_messages.text = "@${room.unread}"
......
......@@ -11,7 +11,7 @@ import android.widget.TextView
import androidx.fragment.app.FragmentManager
import chat.rocket.android.R
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.android.synthetic.main.bottom_seet_fragment_directory_sorting.*
import kotlinx.android.synthetic.main.bottom_sheet_fragment_directory_sorting.*
fun showDirectorySortingBottomSheetFragment(
isSortByChannels: Boolean,
......@@ -59,7 +59,7 @@ class DirectorySortingBottomSheetFragment : BottomSheetDialogFragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View? =
inflater.inflate(R.layout.bottom_seet_fragment_directory_sorting, container, false)
inflater.inflate(R.layout.bottom_sheet_fragment_directory_sorting, container, false)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="18dp"
android:viewportWidth="20"
android:viewportHeight="18">
<path
android:fillColor="#1D74F5"
android:fillType="nonZero"
android:pathData="M10,10m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"
android:strokeWidth="1"
android:strokeColor="#00000000" />
<path
android:fillColor="#1D74F5"
android:fillType="nonZero"
android:pathData="M7,0L5.17,2L2,2C0.9,2 0,2.9 0,4L0,16C0,17.1 0.9,18 2,18L18,18C19.1,18 20,17.1 20,16L20,4C20,2.9 19.1,2 18,2L14.83,2L13,0L7,0ZM10,15C7.24,15 5,12.76 5,10C5,7.24 7.24,5 10,5C12.76,5 15,7.24 15,10C15,12.76 12.76,15 10,15Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF1D74F5"
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
<path
android:fillColor="#FF1D74F5"
android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
</vector>
......@@ -15,9 +15,11 @@
app:navigationIcon="?android:attr/homeAsUpIndicator"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ActionModeStyle">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/text_change_password"
android:layout_width="wrap_content"
......
......@@ -83,7 +83,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view_divider_two" />
<Switch
android:id="@+id/switch_global_users"
android:layout_width="wrap_content"
......@@ -108,5 +107,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text_search_for_global_users" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/emoji_image_view"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center">
<ImageView
android:id="@+id/emoji_image_view"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
tools:src="@tools:sample/avatars" />
</FrameLayout>
android:layout_gravity="center"
android:padding="8dp"
tools:src="@tools:sample/avatars" />
\ No newline at end of file
......@@ -25,6 +25,7 @@
android:id="@+id/text_on_boarding_title"
style="@style/Authentication.TextView.Headline"
android:layout_marginTop="32dp"
android:gravity="center"
android:text="@string/msg_welcome_to_rocket_chat"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -33,6 +34,7 @@
<TextView
android:id="@+id/text_on_boarding_description"
style="@style/Authentication.TextView.Description"
android:gravity="center"
android:text="@string/msg_team_communication"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -41,7 +43,7 @@
<RelativeLayout
android:id="@+id/connect_with_a_server_container"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_height="60sp"
android:layout_marginTop="32dp"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
......@@ -84,7 +86,7 @@
<RelativeLayout
android:id="@+id/join_community_container"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_height="60sp"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_border"
android:foreground="?selectableItemBackground"
......@@ -136,7 +138,7 @@
<RelativeLayout
android:id="@+id/create_server_container"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_height="60sp"
android:layout_marginTop="10dp"
android:background="@drawable/rounded_color_accent"
android:foreground="?selectableItemBackground"
......
......@@ -26,6 +26,7 @@
android:id="@+id/text_sign_in_to_your_server"
style="@style/Authentication.TextView.Headline"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/title_sign_in_your_server"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -21,7 +21,9 @@
style="@style/ChatDetails.Title.TextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="#important" />
android:drawableStart="@drawable/ic_hashtag_black_12dp"
android:drawablePadding="@dimen/text_view_drawable_padding"
tools:text="important" />
<TextView
android:id="@+id/title_description"
......
......@@ -69,7 +69,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/image_avatar"
app:layout_constraintTop_toBottomOf="@+id/text_display_name"
tools:text="visible" />
tools:text="online" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
......
......@@ -24,7 +24,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="This is a multiline chat message from Bertie that will take more than just one line of text. I have sure that everything is amazing!" />
tools:text="This is a multiline chat message from Bertie that will take more than just one line of text. I have made sure that everything is amazing!" />
<View
android:id="@+id/quote_bar"
......
......@@ -62,16 +62,16 @@
android:layout_marginEnd="12dp"
android:textDirection="locale"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/layout_unread_messages_badge"
app:layout_constraintEnd_toStartOf="@+id/text_total_unread_messages"
app:layout_constraintStart_toStartOf="@+id/image_chat_icon"
app:layout_constraintTop_toBottomOf="@+id/text_chat_name"
tools:text="Filipe de Lima Brito: Type something that is very long and need at least two lines, or maybe even more" />
<include
android:id="@+id/layout_unread_messages_badge"
android:id="@+id/text_total_unread_messages"
layout="@layout/unread_messages_badge"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_width="21sp"
android:layout_height="21sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/text_last_message" />
......
......@@ -156,7 +156,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/message_header"
app:layout_constraintTop_toBottomOf="@+id/message_header"
tools:text="This is a multiline chat message from Bertie that will take more than just one line of text. I have sure that everything is amazing!" />
tools:text="This is a multiline chat message from Bertie that will take more than just one line of text. I have made sure that everything is amazing!" />
<Button
android:id="@+id/button_join_video_call"
......
......@@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="20dp"
android:drawableStart="@drawable/ic_camera"
android:drawableStart="@drawable/ic_camera_24dp"
android:gravity="start|center"
android:text="@string/action_take_a_photo" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/text_total_unread_messages"
style="@style/ChatList.Badge.TextView"
android:layout_width="21dp"
android:layout_height="21dp"
android:background="@drawable/style_total_unread_messages"
android:visibility="gone"
tools:text="1"
tools:visibility="visible" />
</LinearLayout>
\ No newline at end of file
style="@style/ChatList.Badge.TextView"
android:layout_width="21sp"
android:layout_height="21sp"
android:background="@drawable/style_total_unread_messages"
android:visibility="gone"
tools:text="1"
tools:visibility="visible" />
\ No newline at end of file
......@@ -10,6 +10,7 @@
<item name="searchViewStyle">@style/ChatRoom.SearchView</item>
<item name="actionModeBackground">@color/colorPrimary</item>
<item name="android:actionModeBackground">@color/colorPrimary</item>
<item name="android:textDirection">locale</item>
</style>
<!-- Widget styles. -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment