Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 9d27952

Browse files
committed
Change editText color to colorPrimary to match app theme Fixes #287
1 parent 3a4f5f6 commit 9d27952

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ protected void onCreate(Bundle savedInstanceState) {
317317
sendBtn = (ImageView) findViewById(R.id.send_btn);
318318
cameraBtn = (ImageView) findViewById(R.id.camera_btn);
319319
appBarLayout = (AppBarLayout) findViewById(R.id.appBarLayout);
320+
boolean isCurrentThemeNight = (AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES);
320321
etSearchPeople = (EditText) findViewById(R.id.people_drawer_search);
321322
ivSearchPeopleCancel = (ImageView) findViewById(R.id.iv_people__search_cancel_button);
322323
onTextChangeOfPeopleSearchEditText();
@@ -328,6 +329,10 @@ public void onClick(View v) {
328329
}
329330
});
330331
etSearchStream = (EditText) findViewById(R.id.stream_drawer_search);
332+
if (isCurrentThemeNight) {
333+
etSearchPeople.setTextColor(ContextCompat.getColor(this, R.color.color_text_black));
334+
etSearchStream.setTextColor(ContextCompat.getColor(this, R.color.color_text_black));
335+
}
331336
ivSearchStreamCancel = (ImageView) findViewById(R.id.iv_stream_search_cancel_button);
332337
onTextChangeOfStreamSearchEditText();
333338
ivSearchStreamCancel.setOnClickListener(new View.OnClickListener() {

app/src/main/res/values-night/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<color name="colorTextPrimary">@android:color/primary_text_dark</color>
1313
<color name="colorTextSecondary">@android:color/secondary_text_dark</color>
1414
<color name="colorTextTertiary">@android:color/tertiary_text_dark</color>
15+
<color name="color_text_black">#000000</color>
1516
<color name="windowBackground">#616161</color>
1617
<color name="listBackground">#262626</color>
1718
<color name="loadingBackground">#757575</color>

0 commit comments

Comments
 (0)