Skip to content

Commit ca97dea

Browse files
committed
refactored colors: renamed to default_table_xxx and moved to lib
1 parent 3fd73ed commit ca97dea

File tree

10 files changed

+31
-29
lines changed

10 files changed

+31
-29
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
xmlns:tools="http://schemas.android.com/tools"
2828
android:layout_width="wrap_content"
2929
android:layout_height="@dimen/cell_height"
30-
android:background="@color/cell_background_color"
30+
android:background="@color/default_table_cell_background_color"
3131
android:gravity="center"
3232
android:orientation="vertical">
3333

@@ -41,7 +41,7 @@
4141
android:layout_marginStart="10dp"
4242
android:gravity="center"
4343
android:maxLines="1"
44-
android:textColor="@color/table_view_default_text_color"
44+
android:textColor="@color/default_table_view_text_color"
4545
android:textSize="@dimen/text_size"
4646
android:visibility="visible"
4747
tools:text="Cell Data"/>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
xmlns:tools="http://schemas.android.com/tools"
3030
android:layout_width="wrap_content"
3131
android:layout_height="@dimen/cell_height"
32-
android:background="@color/cell_background_color"
32+
android:background="@color/default_table_cell_background_color"
3333
android:orientation="vertical">
3434

3535
<FrameLayout
@@ -52,7 +52,7 @@
5252
android:layout_gravity="center"
5353
android:layout_weight="4"
5454
android:gravity="center"
55-
android:textColor="@color/table_view_default_text_color"
55+
android:textColor="@color/default_table_view_text_color"
5656
android:textSize="@dimen/text_size"
5757
tools:text="Header Data"/>
5858

@@ -73,7 +73,7 @@
7373
android:layout_width="match_parent"
7474
android:layout_height="1dp"
7575
android:layout_gravity="bottom"
76-
android:background="@color/header_line_color"/>
76+
android:background="@color/default_table_header_line_color"/>
7777
</FrameLayout>
7878
</LinearLayout>
7979

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@
2525
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2626
android:layout_width="@dimen/row_header_width"
2727
android:layout_height="@dimen/cell_height"
28-
android:background="@color/cell_background_color">
28+
android:background="@color/default_table_cell_background_color">
2929

3030
<TextView
3131
android:layout_width="wrap_content"
3232
android:layout_height="wrap_content"
3333
android:layout_centerHorizontal="true"
3434
android:layout_centerVertical="true"
3535
android:text="Corner"
36-
android:textColor="@color/table_view_default_text_color"
36+
android:textColor="@color/default_table_view_text_color"
3737
android:textSize="@dimen/text_size"/>
3838

3939
<View
4040
android:layout_width="1dp"
4141
android:layout_height="match_parent"
4242
android:layout_alignParentRight="true"
43-
android:background="@color/header_line_color"/>
43+
android:background="@color/default_table_header_line_color"/>
4444

4545
<View
4646
android:layout_width="match_parent"
4747
android:layout_height="1dp"
4848
android:layout_alignParentBottom="true"
49-
android:background="@color/header_line_color"/>
49+
android:background="@color/default_table_header_line_color"/>
5050
</RelativeLayout>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
xmlns:app="http://schemas.android.com/apk/res-auto"
2828
android:layout_width="wrap_content"
2929
android:layout_height="@dimen/cell_height"
30-
android:background="@color/cell_background_color"
30+
android:background="@color/default_table_cell_background_color"
3131
android:gravity="center"
3232
android:orientation="vertical">
3333

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<RelativeLayout android:id="@+id/root"
2626
xmlns:android="http://schemas.android.com/apk/res/android"
2727
xmlns:tools="http://schemas.android.com/tools"
28-
android:background="@color/cell_background_color"
28+
android:background="@color/default_table_cell_background_color"
2929
android:layout_width="@dimen/row_header_width"
3030
android:layout_height="@dimen/cell_height">
3131

@@ -43,7 +43,7 @@
4343
android:ellipsize="end"
4444
android:gravity="center"
4545
android:maxLines="1"
46-
android:textColor="@color/table_view_default_text_color"
46+
android:textColor="@color/default_table_view_text_color"
4747
android:textSize="@dimen/text_size"
4848
tools:text="Row Data"/>
4949

@@ -53,5 +53,5 @@
5353
android:layout_width="1dp"
5454
android:layout_height="match_parent"
5555
android:layout_alignParentRight="true"
56-
android:background="@color/header_line_color"/>
56+
android:background="@color/default_table_header_line_color"/>
5757
</RelativeLayout>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,4 @@
2828
<color name="colorAccent">#FF4081</color>
2929
<color name="bg_line">#E7E7E7</color>
3030

31-
<color name="cell_background_color">#ffffff</color>
32-
<color name="header_line_color">@android:color/holo_red_light</color>
33-
34-
<color name="table_view_default_text_color">#0a0a0a</color>
3531
</resources>

tableview/src/androidTest/res/values/colors.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
~ SOFTWARE.
2424
-->
2525
<resources>
26-
<color name="cell_background_color">#ffffff</color>
27-
<color name="header_line_color">#0a0a0a</color>
28-
<color name="table_view_default_text_color">#0a0a0a</color>
26+
<color name="default_table_cell_background_color">#ffffff</color>
27+
<color name="default_table_header_line_color">#0a0a0a</color>
28+
<color name="default_table_view_text_color">#0a0a0a</color>
2929
</resources>

tableview/src/main/java/com/evrencoskun/tableview/TableView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ private void initialDefaultValues(@Nullable AttributeSet attrs) {
180180

181181
// Colors
182182
mSelectedColor = ContextCompat.getColor(getContext(), R.color
183-
.table_view_default_selected_background_color);
183+
.default_table_view_selected_background_color);
184184
mUnSelectedColor = ContextCompat.getColor(getContext(), R.color
185-
.table_view_default_unselected_background_color);
185+
.default_table_view_unselected_background_color);
186186
mShadowColor = ContextCompat.getColor(getContext(), R.color
187-
.table_view_default_shadow_background_color);
187+
.default_table_view_shadow_background_color);
188188

189189
if (attrs == null) {
190190
// That means TableView is created programmatically.
@@ -212,7 +212,7 @@ private void initialDefaultValues(@Nullable AttributeSet attrs) {
212212
mUnSelectedColor = a.getColor(R.styleable.TableView_unselected_color, mUnSelectedColor);
213213
mShadowColor = a.getColor(R.styleable.TableView_shadow_color, mShadowColor);
214214
mSeparatorColor = a.getColor(R.styleable.TableView_separator_color, ContextCompat
215-
.getColor(getContext(), R.color.table_view_default_separator_color));
215+
.getColor(getContext(), R.color.default_table_view_separator_color));
216216

217217
// Booleans
218218
mShowVerticalSeparators = a.getBoolean(R.styleable.TableView_show_vertical_separator,

tableview/src/main/res/drawable/cell_line_divider.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
<size
2929
android:width="1dp"
3030
android:height="1dp"/>
31-
<solid android:color="@color/table_view_default_separator_color"/>
31+
<solid android:color="@color/default_table_view_separator_color"/>
3232
</shape>

tableview/src/main/res/values/colors.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@
2424
-->
2525

2626
<resources>
27-
<color name="table_view_default_separator_color">#E7E7E7</color>
28-
<color name="table_view_default_unselected_background_color">#ffffff</color>
29-
<color name="table_view_default_selected_background_color">#fada65</color>
30-
<color name="table_view_default_shadow_background_color">#f2f2f2</color>
27+
<color name="default_table_view_separator_color">#E7E7E7</color>
28+
<color name="default_table_view_unselected_background_color">#ffffff</color>
29+
<color name="default_table_view_selected_background_color">#fada65</color>
30+
<color name="default_table_view_shadow_background_color">#f2f2f2</color>
31+
32+
<color name="default_table_cell_background_color">#ffffff</color>
33+
<color name="default_table_header_line_color">@android:color/holo_red_light</color>
34+
35+
<color name="default_table_view_text_color">#0a0a0a</color>
36+
3137
</resources>

0 commit comments

Comments
 (0)