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
Feature/support rtl #606
Feature/support rtl #606
Conversation
👁 |
I missed your reply 😮 |
np |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TextView has a property for text alignment.
To align the text according to layout direction, use viewStart
or viewEnd
:
viewStart
aligns text to start of the view: Left alignment for LTR layout direction and right alignment for RTL layout direction. viewEnd
behaves opposite way.
text = when (roomName) { null -> "" | ||
else -> context.getString(R.string.room_format, prefix, roomName) | ||
roomName ?: return | ||
val isLayoutDirectionRtl = resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_RTL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you extract this comparison as an extension method of View?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done with 5937050
💥Nice! 💥 |
setPadding(start, top, end, bottom) | ||
} | ||
|
||
fun View.isLayoutDirectionRtl() = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -53,7 +53,7 @@ open class BottomNavigationBehavior : CoordinatorLayout.Behavior<BottomNavigatio | |||
internal fun updateSnackBarPaddingBottomByBottomNavigationView(view: BottomNavigationView) { | |||
snackbar?.apply { | |||
val translateY = (view.height - view.translationY).toInt() | |||
setPadding(paddingLeft, paddingTop, paddingRight, translateY) | |||
setPadding(paddingEnd, paddingTop, paddingStart, translateY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀 I guess here should be setPaddingWithLayoutDirction(paddingStart, paddingTop, paddingEnd, translateY)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
@@ -34,3 +34,13 @@ var View.elevationForPostLollipop: Float | |||
elevation = value | |||
} | |||
} | |||
|
|||
fun View.setPaddingWithLayoutDirction(start: Int, top: Int, end: Int, bottom: Int) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
android:layout_marginTop="16dp" | ||
android:fontFamily="sans-serif-light" | ||
android:text="@string/about_what_is_prefix" | ||
android:textColor="#de000000" | ||
android:textSize="23sp" | ||
android:textStyle="normal" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintLeft_toLeftOf="@id/conference_name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
app:highlightText="@{searchQuery}" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toEndOf="@id/speaker_image" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 nice catch
@@ -15,8 +15,10 @@ import android.text.style.StyleSpan | |||
import android.view.ActionMode | |||
import android.view.Menu | |||
import android.view.MenuItem | |||
import android.view.View |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please check this one?
https://github.com/DroidKaigi/conference-app-2018/pull/606/files#r165896490
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Thank you so much!
Issue
Overview (Required)
session detail
screen shot blow) looks ugly because Japanese and English are NOT RTL language. Should I setandroid:textDirection="locale"
or marginEnd as well as marginStart?Screenshot
Set RTL On