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
Changes from 9 commits
99e6cc6
e4721e9
28e584d
7639232
376899f
a8e1476
b66ed31
b89aa58
c7a1f37
5937050
b870783
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import android.text.style.StyleSpan | |
import android.view.ActionMode | ||
import android.view.Menu | ||
import android.view.MenuItem | ||
import android.view.View | ||
import android.widget.TextView | ||
import io.github.droidkaigi.confsched2018.R | ||
import io.github.droidkaigi.confsched2018.util.ext.selectedText | ||
|
@@ -45,8 +46,12 @@ fun TextView.setPeriodText(startDate: Date?, endDate: Date?) { | |
@BindingAdapter(value = ["prefix", "roomName"]) | ||
fun TextView.setRoomText(prefix: String?, roomName: String?) { | ||
prefix ?: return | ||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. done with 5937050 |
||
text = if (isLayoutDirectionRtl) { | ||
context.getString(R.string.room_format_rtl, prefix, roomName) | ||
} else { | ||
context.getString(R.string.room_format, prefix, roomName) | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. 👀 I guess here should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😂 |
||
requestLayout() | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,10 @@ 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 commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
if (resources.configuration.layoutDirection == View.LAYOUT_DIRECTION_RTL) { | ||
setPadding(end, top, start, bottom) | ||
} else { | ||
setPadding(start, top, end, bottom) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,13 @@ | |
android:id="@+id/about_this_app_name" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="16dp" | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
app:layout_constraintTop_toTopOf="parent" | ||
/> | ||
|
||
|
@@ -54,7 +53,7 @@ | |
android:textColor="#de000000" | ||
android:textSize="23sp" | ||
android:textStyle="normal" | ||
app:layout_constraintEnd_toEndOf="@id/conference_name" | ||
app:layout_constraintRight_toRightOf="@id/conference_name" | ||
app:layout_constraintTop_toTopOf="parent" | ||
/> | ||
|
||
|
@@ -68,6 +67,7 @@ | |
android:fontFamily="sans-serif" | ||
android:lineSpacingExtra="9.6sp" | ||
android:text="@{headItem.description}" | ||
android:textAlignment="viewStart" | ||
android:textColor="#000000" | ||
android:textSize="12sp" | ||
android:textStyle="normal" | ||
|
@@ -85,8 +85,8 @@ | |
android:contentDescription="@string/about_content_description_facebook" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintHorizontal_chainStyle="spread" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toLeftOf="@id/about_this_app_twitter" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toStartOf="@id/about_this_app_twitter" | ||
app:layout_constraintTop_toBottomOf="@id/about_this_app_description" | ||
app:srcCompat="@drawable/ic_facebook_purple_24dp" | ||
/> | ||
|
@@ -96,8 +96,8 @@ | |
style="@style/SocialMediaButton" | ||
android:contentDescription="@string/about_content_description_twitter" | ||
app:layout_constraintBottom_toBottomOf="@id/about_this_app_facebook" | ||
app:layout_constraintLeft_toRightOf="@+id/about_this_app_facebook" | ||
app:layout_constraintRight_toLeftOf="@+id/about_this_app_github" | ||
app:layout_constraintStart_toEndOf="@+id/about_this_app_facebook" | ||
app:layout_constraintEnd_toStartOf="@+id/about_this_app_github" | ||
app:layout_constraintTop_toTopOf="@id/about_this_app_facebook" | ||
app:srcCompat="@drawable/ic_twitter_blue_24dp" | ||
/> | ||
|
@@ -107,8 +107,8 @@ | |
style="@style/SocialMediaButton" | ||
android:contentDescription="@string/about_content_description_github" | ||
app:layout_constraintBottom_toBottomOf="@id/about_this_app_twitter" | ||
app:layout_constraintLeft_toRightOf="@+id/about_this_app_twitter" | ||
app:layout_constraintRight_toLeftOf="@+id/about_this_app_youtube" | ||
app:layout_constraintStart_toEndOf="@+id/about_this_app_twitter" | ||
app:layout_constraintEnd_toStartOf="@+id/about_this_app_youtube" | ||
app:layout_constraintTop_toTopOf="@id/about_this_app_twitter" | ||
app:srcCompat="@drawable/ic_github_black_24dp" | ||
/> | ||
|
@@ -118,8 +118,8 @@ | |
style="@style/SocialMediaButton" | ||
android:contentDescription="@string/about_content_description_youtube" | ||
app:layout_constraintBottom_toBottomOf="@id/about_this_app_github" | ||
app:layout_constraintLeft_toRightOf="@+id/about_this_app_github" | ||
app:layout_constraintRight_toLeftOf="@+id/about_this_app_Medium" | ||
app:layout_constraintStart_toEndOf="@+id/about_this_app_github" | ||
app:layout_constraintEnd_toStartOf="@+id/about_this_app_Medium" | ||
app:layout_constraintTop_toTopOf="@id/about_this_app_github" | ||
app:srcCompat="@drawable/ic_youtube_24dp" | ||
/> | ||
|
@@ -129,8 +129,8 @@ | |
style="@style/SocialMediaButton" | ||
android:contentDescription="@string/about_content_description_medium" | ||
app:layout_constraintBottom_toBottomOf="@id/about_this_app_youtube" | ||
app:layout_constraintLeft_toRightOf="@+id/about_this_app_youtube" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintStart_toEndOf="@+id/about_this_app_youtube" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="@id/about_this_app_youtube" | ||
app:srcCompat="@drawable/ic_medium_24dp" | ||
/> | ||
|
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.