Skip to content

Commit

Permalink
修改默认主题样式
Browse files Browse the repository at this point in the history
  • Loading branch information
leavesCZY committed Jun 9, 2024
1 parent 986096a commit aa6e77d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

| 日间主题 | 夜间主题 | 自定义主题 |
|:----------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------:|
| ![](https://github.com/leavesCZY/Matisse/assets/30774063/4cc36e0f-3cdd-4833-ab14-0ff3f6a8603d) | ![](https://github.com/leavesCZY/Matisse/assets/30774063/80f43542-9bea-4bd0-9a16-52af2ac20b25) | ![](https://github.com/leavesCZY/Matisse/assets/30774063/b187f39a-07e5-44a6-ab4f-6622b28553d6) |
| ![](https://github.com/leavesCZY/Matisse/assets/30774063/f2a0f801-d450-4c2c-81f8-07f71d6f6fd6) | ![](https://github.com/leavesCZY/Matisse/assets/30774063/7960c579-6ca7-4a63-bce7-f81d182e1df3) | ![](https://github.com/leavesCZY/Matisse/assets/30774063/d5a8b2cd-63fb-4c36-ad45-0659f4154bc5) |
27 changes: 15 additions & 12 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,33 @@
<integer name="matisse_image_span_count">3</integer>
<bool name="matisse_status_bar_dark_icons">false</bool>
<bool name="matisse_navigation_bar_dark_icons">true</bool>
<color name="matisse_status_bar_color">#FF42A5F5</color>
<color name="matisse_status_bar_color">#FF03A9F4</color>
<color name="matisse_navigation_bar_color">#FFFFFFFF</color>
<color name="matisse_main_page_background_color">#FFFFFFFF</color>
<color name="matisse_preview_page_background_color">#FF22202A</color>
<color name="matisse_preview_page_controller_background_color">#FF2B2A34</color>
<color name="matisse_media_item_background_color">#66CCCCCC</color>
<color name="matisse_media_item_scrim_color_when_selected">#80000000</color>
<color name="matisse_capture_icon_color">#FFFFFFFF</color>
<color name="matisse_top_bar_background_color">#FF42A5F5</color>
<color name="matisse_capture_item_background_color">#66CCCCCC</color>
<color name="matisse_capture_item_icon_color">#FFFFFFFF</color>
<color name="matisse_top_bar_background_color">#FF03A9F4</color>
<color name="matisse_top_bar_icon_color">#FFFFFFFF</color>
<color name="matisse_top_bar_text_color">#FFFFFFFF</color>
<color name="matisse_dropdown_menu_background_color">#FFFFFFFF</color>
<color name="matisse_dropdown_menu_text_color">#FF000000</color>
<color name="matisse_bottom_navigation_bar_background_color">#FFFFFFFF</color>
<color name="matisse_preview_text_color">#FF03A9F4</color>
<color name="matisse_preview_text_color_if_disable">#8003A9F4</color>
<color name="matisse_preview_text_color">#FF000000</color>
<color name="matisse_preview_text_color_if_disable">#FFC6CCD2</color>
<color name="matisse_sure_text_color">#FF03A9F4</color>
<color name="matisse_sure_text_color_if_disable">#8003A9F4</color>
<color name="matisse_back_text_color">#FFFFFFFF</color>
<color name="matisse_sure_text_color_if_disable">#6003A9F4</color>
<color name="matisse_preview_page_background_color">#FF22202A</color>
<color name="matisse_preview_page_bottom_navigation_bar_background_color">#FF2B2A34</color>
<color name="matisse_preview_page_back_text_color">#FFFFFFFF</color>
<color name="matisse_preview_page_sure_text_color">#EF5350</color>
<color name="matisse_preview_page_sure_text_color_if_disable">#FFEE58</color>
<color name="matisse_check_box_circle_color">#FFFFFFFF</color>
<color name="matisse_check_box_circle_color_if_disable">#80FFFFFF</color>
<color name="matisse_check_box_circle_fill_color">#FF42A5F5</color>
<color name="matisse_check_box_circle_color_if_disable">#60FFFFFF</color>
<color name="matisse_check_box_circle_fill_color">#FF03A9F4</color>
<color name="matisse_check_box_text_color">#FFFFFFFF</color>
<color name="matisse_circular_loading_color">#FF42A5F5</color>
<color name="matisse_circular_loading_color">#FF03A9F4</color>
<color name="matisse_video_icon_color">#FFFFFFFF</color>
<color name="matisse_video_view_page_background_color">#FF22202A</color>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<resources>
<string name="app_name">Matisse</string>
<!-- 自定义文本 -->
<string name="matisse_default_bucket_name">所有图片</string>
<string name="matisse_read_media_permission_denied">请授予相册访问权限后重试 ~</string>
<string name="matisse_write_external_storage_permission_denied">请授予存储写入权限后重试 ~</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ private fun LazyGridItemScope.CaptureItem(onClick: () -> Unit) {
.padding(all = 1.dp)
.aspectRatio(ratio = 1f)
.clip(shape = RoundedCornerShape(size = 4.dp))
.background(color = colorResource(id = R.color.matisse_media_item_background_color))
.background(color = colorResource(id = R.color.matisse_capture_item_background_color))
.clickable(onClick = onClick)
) {
Icon(
modifier = Modifier
.fillMaxSize(fraction = 0.5f)
.align(alignment = Alignment.Center),
imageVector = Icons.Filled.PhotoCamera,
tint = colorResource(id = R.color.matisse_capture_icon_color),
tint = colorResource(id = R.color.matisse_capture_item_icon_color),
contentDescription = "Capture"
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private fun BoxScope.BottomController(
Box(
modifier = Modifier
.align(alignment = Alignment.BottomCenter)
.background(color = colorResource(id = R.color.matisse_preview_page_controller_background_color))
.background(color = colorResource(id = R.color.matisse_preview_page_bottom_navigation_bar_background_color))
.navigationBarsPadding()
.fillMaxWidth()
.height(height = bottomControllerHeight)
Expand All @@ -225,9 +225,9 @@ private fun BoxScope.BottomController(
.padding(horizontal = 24.dp)
.wrapContentSize(align = Alignment.Center),
text = stringResource(id = R.string.matisse_back),
color = colorResource(id = R.color.matisse_preview_page_back_text_color),
textAlign = TextAlign.Center,
fontSize = 16.sp,
color = colorResource(id = R.color.matisse_back_text_color)
fontSize = 16.sp
)
MatisseCheckbox(
modifier = Modifier
Expand Down Expand Up @@ -257,15 +257,15 @@ private fun BoxScope.BottomController(
.padding(horizontal = 24.dp)
.wrapContentSize(align = Alignment.Center),
text = pageViewState.sureButtonText,
textAlign = TextAlign.Center,
fontSize = 16.sp,
color = colorResource(
id = if (pageViewState.sureButtonClickable) {
R.color.matisse_sure_text_color
R.color.matisse_preview_page_sure_text_color
} else {
R.color.matisse_sure_text_color_if_disable
R.color.matisse_preview_page_sure_text_color_if_disable
}
)
),
textAlign = TextAlign.Center,
fontSize = 16.sp
)
}
}
11 changes: 7 additions & 4 deletions matisse/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
<color name="matisse_status_bar_color">#FF2B2A34</color>
<color name="matisse_navigation_bar_color">#FF2B2A34</color>
<color name="matisse_main_page_background_color">#FF22202A</color>
<color name="matisse_preview_page_background_color">#FF22202A</color>
<color name="matisse_preview_page_controller_background_color">#FF2B2A34</color>
<color name="matisse_media_item_background_color">#CCFFFFFF</color>
<color name="matisse_media_item_scrim_color_when_selected">#80000000</color>
<color name="matisse_capture_icon_color">#FFFFFFFF</color>
<color name="matisse_capture_item_background_color">#CCFFFFFF</color>
<color name="matisse_capture_item_icon_color">#FFFFFFFF</color>
<color name="matisse_top_bar_background_color">#FF2B2A34</color>
<color name="matisse_top_bar_icon_color">#FFFFFFFF</color>
<color name="matisse_top_bar_text_color">#FFFFFFFF</color>
Expand All @@ -21,7 +20,11 @@
<color name="matisse_preview_text_color_if_disable">#99FFFFFF</color>
<color name="matisse_sure_text_color">#FFFFFFFF</color>
<color name="matisse_sure_text_color_if_disable">#99FFFFFF</color>
<color name="matisse_back_text_color">#FFFFFFFF</color>
<color name="matisse_preview_page_background_color">#FF22202A</color>
<color name="matisse_preview_page_bottom_navigation_bar_background_color">#FF2B2A34</color>
<color name="matisse_preview_page_back_text_color">#FFFFFFFF</color>
<color name="matisse_preview_page_sure_text_color">#FFFFFFFF</color>
<color name="matisse_preview_page_sure_text_color_if_disable">#99FFFFFF</color>
<color name="matisse_check_box_circle_color">#FFFFFFFF</color>
<color name="matisse_check_box_circle_color_if_disable">#80FFFFFF</color>
<color name="matisse_check_box_circle_fill_color">#FF009688</color>
Expand Down
17 changes: 10 additions & 7 deletions matisse/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@
<color name="matisse_status_bar_color">#FFFFFFFF</color>
<color name="matisse_navigation_bar_color">#FFFFFFFF</color>
<color name="matisse_main_page_background_color">#FFFFFFFF</color>
<color name="matisse_preview_page_background_color">#FF22202A</color>
<color name="matisse_preview_page_controller_background_color">#FF2B2A34</color>
<color name="matisse_media_item_background_color">#66CCCCCC</color>
<color name="matisse_media_item_scrim_color_when_selected">#80000000</color>
<color name="matisse_capture_icon_color">#66000000</color>
<color name="matisse_capture_item_background_color">#66CCCCCC</color>
<color name="matisse_capture_item_icon_color">#FFFFFFFF</color>
<color name="matisse_top_bar_background_color">#FFFFFFFF</color>
<color name="matisse_top_bar_icon_color">#FF000000</color>
<color name="matisse_top_bar_text_color">#FF000000</color>
<color name="matisse_dropdown_menu_background_color">#FFFFFFFF</color>
<color name="matisse_dropdown_menu_text_color">#FF000000</color>
<color name="matisse_bottom_navigation_bar_background_color">#FFFFFFFF</color>
<color name="matisse_preview_text_color">#FF000000</color>
<color name="matisse_preview_text_color_if_disable">#99000000</color>
<color name="matisse_sure_text_color">#FF03A9F4</color>
<color name="matisse_sure_text_color_if_disable">#8003A9F4</color>
<color name="matisse_back_text_color">#FFFFFFFF</color>
<color name="matisse_preview_text_color_if_disable">#FFC6CCD2</color>
<color name="matisse_sure_text_color">#FF000000</color>
<color name="matisse_sure_text_color_if_disable">#FFC6CCD2</color>
<color name="matisse_preview_page_background_color">#FF22202A</color>
<color name="matisse_preview_page_bottom_navigation_bar_background_color">#FF2B2A34</color>
<color name="matisse_preview_page_back_text_color">#FFFFFFFF</color>
<color name="matisse_preview_page_sure_text_color">#FFFFFFFF</color>
<color name="matisse_preview_page_sure_text_color_if_disable">#80FFFFFF</color>
<color name="matisse_check_box_circle_color">#FFFFFFFF</color>
<color name="matisse_check_box_circle_color_if_disable">#80FFFFFF</color>
<color name="matisse_check_box_circle_fill_color">#FF03A9F4</color>
Expand Down

0 comments on commit aa6e77d

Please sign in to comment.