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

Commit 2ea0228

Browse files
committed
Convert hardcoded colors to be changed when Theme changes
1 parent 0106191 commit 2ea0228

20 files changed

+61
-52
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import android.database.MatrixCursor;
2525
import android.database.MergeCursor;
2626
import android.graphics.Bitmap;
27-
import android.graphics.Color;
2827
import android.graphics.PorterDuff;
2928
import android.graphics.drawable.Drawable;
3029
import android.os.Build;
@@ -239,6 +238,7 @@ public void recyclerViewScrolled() {
239238
displayChatBox(false);
240239
}
241240
}
241+
242242
public RefreshableCursorAdapter getPeopleAdapter() {
243243
return peopleAdapter;
244244
}
@@ -686,9 +686,9 @@ public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
686686
name.setText(streamName);
687687
//Change color in the drawer if this stream is inHomeView only.
688688
if (!Stream.getByName(app, streamName).getInHomeView()) {
689-
name.setTextColor(ContextCompat.getColor(ZulipActivity.this, android.R.color.secondary_text_light_nodisable));
689+
name.setTextColor(ContextCompat.getColor(ZulipActivity.this, R.color.colorTextTertiary));
690690
} else {
691-
name.setTextColor(ContextCompat.getColor(ZulipActivity.this, android.R.color.primary_text_light));
691+
name.setTextColor(ContextCompat.getColor(ZulipActivity.this, R.color.colorTextPrimary));
692692
}
693693
view.setOnClickListener(new View.OnClickListener() {
694694
@Override
@@ -707,8 +707,8 @@ public void onClick(View v) {
707707
case R.id.name_child:
708708
TextView name_child = (TextView) view;
709709
name_child.setText(cursor.getString(columnIndex));
710-
if (app.isTopicMute(cursor.getInt(1), cursor.getString(columnIndex))){
711-
name_child.setTextColor(ContextCompat.getColor(ZulipActivity.this, android.R.color.secondary_text_light_nodisable));
710+
if (app.isTopicMute(cursor.getInt(1), cursor.getString(columnIndex))) {
711+
name_child.setTextColor(ContextCompat.getColor(ZulipActivity.this, R.color.colorTextSecondary));
712712
}
713713
return true;
714714
}
@@ -1171,6 +1171,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
11711171

11721172
return false;
11731173
}
1174+
11741175
private boolean prepareSearchView(Menu menu) {
11751176
if (this.logged_in && Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
11761177
// Get the SearchView and set the searchable configuration
@@ -1180,7 +1181,7 @@ private boolean prepareSearchView(Menu menu) {
11801181
final android.support.v7.widget.SearchView searchView = (android.support.v7.widget.SearchView) MenuItemCompat.getActionView(mSearchMenuItem);
11811182
searchView.setSearchableInfo(searchManager.getSearchableInfo(new ComponentName(getApplicationContext(), ZulipActivity.class)));
11821183
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
1183-
((EditText) searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text)).setHintTextColor(Color.BLACK);
1184+
((EditText) searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text)).setHintTextColor(ContextCompat.getColor(this,R.color.colorTextPrimary));
11841185
searchView.setOnQueryTextListener(new android.support.v7.widget.SearchView.OnQueryTextListener() {
11851186
@Override
11861187
public boolean onQueryTextSubmit(String s) {

app/src/main/res/color/huddle_body.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/src/main/res/color/huddle_header.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/src/main/res/color/stream_body.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/src/main/res/color/stream_header.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/src/main/res/drawable/stream_header.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

app/src/main/res/drawable/triangle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<group android:name="triableGroup">
88
<path
99
android:name="triangle"
10-
android:fillColor="#444444"
10+
android:fillColor="@color/stream_header"
1111
android:pathData="M0 0 L0 0 L10 5 L0 10 Z" />
1212
</group>
1313
</vector>

app/src/main/res/layout-v21/login.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
6+
android:background="@color/windowBackground"
67
android:gravity="center_horizontal"
78
android:orientation="vertical">
89

app/src/main/res/layout/fragment_message_list.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
android:id="@+id/recyclerView"
88
android:layout_width="match_parent"
99
android:layout_height="fill_parent"
10-
android:background="@android:color/white"
10+
android:background="@color/listBackground"
1111
android:fadeScrollbars="false"
1212
android:scrollbars="vertical" />
1313

@@ -20,4 +20,4 @@
2020
android:text="@string/empty_list"
2121
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
2222
android:visibility="gone" />
23-
</LinearLayout>
23+
</LinearLayout>

app/src/main/res/layout/list_loading.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ per http://pivotallabs.com/android-tidbits-6-22-2011-hiding-header-views/
1111
android:layout_width="match_parent"
1212
android:layout_height="48dp"
1313
android:layout_gravity="center"
14-
android:background="#eeeeee"
14+
android:background="@color/loadingBackground"
1515
android:gravity="center|center_vertical">
1616

1717
<ProgressBar
@@ -23,8 +23,9 @@ per http://pivotallabs.com/android-tidbits-6-22-2011-hiding-header-views/
2323
android:layout_width="wrap_content"
2424
android:layout_height="wrap_content"
2525
android:paddingLeft="16dp"
26+
android:textColor="@color/colorTextPrimary"
2627
android:text="@string/loading_messages"
2728
android:textSize="18sp" />
2829
</LinearLayout>
2930

30-
</LinearLayout>
31+
</LinearLayout>

0 commit comments

Comments
 (0)