mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-30 23:03:00 +00:00 
			
		
		
		
	Fix content color in comment replies fragment
This commit is contained in:
		| @@ -6,10 +6,13 @@ import androidx.compose.foundation.lazy.LazyColumn | |||||||
| import androidx.compose.foundation.lazy.rememberLazyListState | import androidx.compose.foundation.lazy.rememberLazyListState | ||||||
| import androidx.compose.material3.ExperimentalMaterial3Api | import androidx.compose.material3.ExperimentalMaterial3Api | ||||||
| import androidx.compose.material3.HorizontalDivider | import androidx.compose.material3.HorizontalDivider | ||||||
|  | import androidx.compose.material3.LocalContentColor | ||||||
| import androidx.compose.material3.MaterialTheme | import androidx.compose.material3.MaterialTheme | ||||||
| import androidx.compose.material3.ModalBottomSheet | import androidx.compose.material3.ModalBottomSheet | ||||||
| import androidx.compose.material3.Text | import androidx.compose.material3.Text | ||||||
|  | import androidx.compose.material3.contentColorFor | ||||||
| import androidx.compose.runtime.Composable | import androidx.compose.runtime.Composable | ||||||
|  | import androidx.compose.runtime.CompositionLocalProvider | ||||||
| import androidx.compose.runtime.remember | import androidx.compose.runtime.remember | ||||||
| import androidx.compose.runtime.rememberCoroutineScope | import androidx.compose.runtime.rememberCoroutineScope | ||||||
| import androidx.compose.ui.Modifier | import androidx.compose.ui.Modifier | ||||||
| @@ -67,6 +70,12 @@ private fun CommentRepliesDialog( | |||||||
|     val state = rememberLazyListState() |     val state = rememberLazyListState() | ||||||
|  |  | ||||||
|     ModalBottomSheet(onDismissRequest = onDismissRequest) { |     ModalBottomSheet(onDismissRequest = onDismissRequest) { | ||||||
|  |         CompositionLocalProvider( | ||||||
|  |             // contentColorFor(MaterialTheme.colorScheme.containerColor), i.e. ModalBottomSheet's | ||||||
|  |             // default background color, does not resolve correctly, so need to manually set the | ||||||
|  |             // content color for MaterialTheme.colorScheme.background instead | ||||||
|  |             LocalContentColor provides contentColorFor(MaterialTheme.colorScheme.background) | ||||||
|  |         ) { | ||||||
|             LazyColumnScrollbar( |             LazyColumnScrollbar( | ||||||
|                 state = state, |                 state = state, | ||||||
|                 settings = ScrollbarSettings.Default.copy( |                 settings = ScrollbarSettings.Default.copy( | ||||||
| @@ -104,7 +113,10 @@ private fun CommentRepliesDialog( | |||||||
|                         if (comments.itemCount >= 0) { |                         if (comments.itemCount >= 0) { | ||||||
|                             item { |                             item { | ||||||
|                                 Text( |                                 Text( | ||||||
|                                 modifier = Modifier.padding(horizontal = 12.dp, vertical = 4.dp), |                                     modifier = Modifier.padding( | ||||||
|  |                                         horizontal = 12.dp, | ||||||
|  |                                         vertical = 4.dp | ||||||
|  |                                     ), | ||||||
|                                     text = pluralStringResource( |                                     text = pluralStringResource( | ||||||
|                                         R.plurals.replies, comments.itemCount, comments.itemCount |                                         R.plurals.replies, comments.itemCount, comments.itemCount | ||||||
|                                     ), |                                     ), | ||||||
| @@ -121,6 +133,7 @@ private fun CommentRepliesDialog( | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  | } | ||||||
|  |  | ||||||
| @Preview(name = "Light mode", uiMode = Configuration.UI_MODE_NIGHT_NO) | @Preview(name = "Light mode", uiMode = Configuration.UI_MODE_NIGHT_NO) | ||||||
| @Preview(name = "Dark mode", uiMode = Configuration.UI_MODE_NIGHT_YES) | @Preview(name = "Dark mode", uiMode = Configuration.UI_MODE_NIGHT_YES) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox