Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve previews #46

Merged
merged 16 commits into from Mar 26, 2020
Merged

Improve previews #46

merged 16 commits into from Mar 26, 2020

Conversation

rock3r
Copy link
Contributor

@rock3r rock3r commented Jan 14, 2020

This PR improves previews for composable functions, by:

  1. Providing a name for all previews
  2. Ensuring the correct theme is used by all previews
Before After
image image

@objcode
Copy link
Contributor

objcode commented Mar 23, 2020

Ahoy!

It looks like this PR is a bit behind develop, sorry about not merging it earlier. Happy to accept the change if you'd like to update it to the current develop branch - otherwise will close this on Mar 30 (and feel free to reopen)!

Thanks,
Sean

@objcode objcode changed the base branch from master to develop March 23, 2020 18:06
@rock3r
Copy link
Contributor Author

rock3r commented Mar 23, 2020

Hey @objcode sure thing, will pick it up over the next few days and rebase on master

rock3r and others added 2 commits March 25, 2020 09:46
Also fixes a bunch of missing tintings so that Dark themes are 100% legible
@rock3r
Copy link
Contributor Author

rock3r commented Mar 25, 2020

@objcode all yours. Snuck in a bunch of other fixes too, while I was at that

@@ -103,6 +106,12 @@ fun AppDrawer(
}
}

private fun dividerColor(isLight: Boolean) = if (isLight) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be an alpha modification of a theme color like onSurface?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit my ignorance on that, will check if I can do the same. I went with an approach of "keep the colour where it was already defined" but will see if I can use a theme colour instead.

VectorImage(id = R.drawable.ic_account_circle_black)
VectorImage(
id = R.drawable.ic_account_circle_black,
tint = MaterialTheme.colors().onSurface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the tint be contentColor() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the design intent was originally this so I went for final result. Happy to change.

@@ -311,8 +329,24 @@ fun Markup.toAnnotatedStringItem(typography: Typography): AnnotatedString.Item<S
}
}

@Preview
private fun codeBlockBackground(isLight: Boolean) = if (isLight) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, couldn't this be an alpha mod of onSurface?

rock3r and others added 4 commits March 25, 2020 16:30
Co-Authored-By: Nick Butcher <nickbutcher@users.noreply.github.com>
…leScreen.kt

Co-Authored-By: Nick Butcher <nickbutcher@users.noreply.github.com>
…ontent.kt

Co-Authored-By: Nick Butcher <nickbutcher@users.noreply.github.com>
…s.kt

Co-Authored-By: Nick Butcher <nickbutcher@users.noreply.github.com>
@rock3r
Copy link
Contributor Author

rock3r commented Mar 25, 2020

PR went red after applying suggestions... will review asap and fix :)

@rock3r
Copy link
Contributor Author

rock3r commented Mar 25, 2020

All done and ready to go

@nickbutcher
Copy link
Contributor

Thanks for the changes, sorry just spotted a few more.

@rock3r
Copy link
Contributor Author

rock3r commented Mar 26, 2020

No worries — I did fix some inconsistencies in the naming I spotted in the codebase but clearly forgot some :) Push incoming

@rock3r
Copy link
Contributor Author

rock3r commented Mar 26, 2020

 All done and ready to go

@nickbutcher
Copy link
Contributor

Thanks for the changes! All LGTM but looks like needs a rebase.

@rock3r
Copy link
Contributor Author

rock3r commented Mar 26, 2020

@nickbutcher oh yeah, not sure why it says there's no conflicts here...

@nickbutcher nickbutcher merged commit ab64152 into android:develop Mar 26, 2020
@nickbutcher
Copy link
Contributor

Hmm, now it let me merge?! Oh well. Thanks again!

@rock3r rock3r deleted the improve_previews branch March 26, 2020 11:10
@rock3r
Copy link
Contributor Author

rock3r commented Mar 26, 2020

No worries :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants