Skip to content

Commit c11b3d2

Browse files
johnxnguyenmarcoconti83
authored andcommitted
Fix/tablet crashes (#2106)
* Sync layout for tablet with layout for phone * Get color via ContextUtils to avoid API crash
1 parent 0556ce9 commit c11b3d2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

app/src/main/res/layout-sw600dp/single_input_box.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@
105105
android:layout_gravity="center_horizontal|top"/>
106106

107107
<com.waz.zclient.ui.text.TypefaceTextView
108-
android:id="@+id/empty_search_message"
108+
android:id="@+id/error_text"
109109
android:layout_width="match_parent"
110110
android:layout_height="wrap_content"
111+
android:layout_marginTop="@dimen/wire__padding__8"
112+
android:layout_marginStart="@dimen/wire__padding__16"
113+
android:layout_marginEnd="@dimen/wire__padding__16"
111114
android:textSize="@dimen/wire__text_size__small"
112115
android:textColor="@color/teams_error_red"
113116
android:gravity="center"

app/src/main/scala/com/waz/zclient/appentry/fragments/SetTeamPasswordFragment.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ case class SetTeamPasswordFragment() extends CreateTeamFragment {
6262
// We need to adjust the behaviour of the error text view: It should always be visible,
6363
// but it will become red when validation fails.
6464
inputField.errorText.setGravity(Gravity.START)
65-
inputField.errorText.setTextColor(context.getColor(R.color.teams_placeholder_text))
65+
inputField.errorText.setTextColor(ContextUtils.getColor(R.color.teams_placeholder_text))
6666
inputField.setShouldDisableOnClick(false)
6767
inputField.setShouldClearErrorOnClick(false)
6868
inputField.setShouldClearErrorOnTyping(false)
@@ -72,15 +72,15 @@ case class SetTeamPasswordFragment() extends CreateTeamFragment {
7272

7373
inputField.editText.addTextListener { text =>
7474
createTeamController.password = text
75-
inputField.errorText.setTextColor(context.getColor(R.color.teams_placeholder_text))
75+
inputField.errorText.setTextColor(ContextUtils.getColor(R.color.teams_placeholder_text))
7676
}
7777

7878
inputField.editText.requestFocus()
7979
KeyboardUtils.showKeyboard(context.asInstanceOf[Activity])
8080

8181
inputField.setOnClick( text =>
8282
if (!validator.isValidPassword(text)) {
83-
inputField.errorText.setTextColor(context.getColor(R.color.teams_error_red))
83+
inputField.errorText.setTextColor(ContextUtils.getColor(R.color.teams_error_red))
8484
Future.successful(Some(getString(R.string.password_policy_hint, passwordMinLength)))
8585
} else {
8686
AppEntryDialogs.showTermsAndConditions(context).flatMap {

0 commit comments

Comments
 (0)