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

Updating use case icons to match designs #5025

Merged
merged 6 commits into from
Jan 25, 2022

Conversation

ouchadam
Copy link
Contributor

Part of #4585

  • Updates the use case icons to match the latest designs (light and dark changes)
  • Programmatically creates a layer drawable to avoid introducing new colours into the palette, we're blending existing palette colours with a white underlay to create a new set of pastels
BEFORE AFTER LIGHT AFTER DARK
149327198-01f10260-180a-4062-afee-efa50de07fa9 Screenshot_20220121_170459 Screenshot_20220121_170508

- programmatically creates a layer drawable to avoid introducing new colours into the palette
@ouchadam ouchadam mentioned this pull request Jan 21, 2022
6 tasks
@github-actions
Copy link

github-actions bot commented Jan 21, 2022

Unit Test Results

  72 files  ±0    72 suites  ±0   51s ⏱️ -1s
141 tests ±0  141 ✔️ ±0  0 💤 ±0  0 ±0 
440 runs  ±0  440 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 0713877. ± Comparison against base commit 1efb6e1.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 21, 2022

Matrix SDK

Integration Tests Results:

  • [org.matrix.android.sdk.session]
    passed="8" failures="2" errors="0" skipped="0"
  • [org.matrix.android.sdk.account]
    passed="1" failures="1" errors="0" skipped="0"
  • [org.matrix.android.sdk.internal]
    passed="158" failures="11" errors="0" skipped="38"
  • [org.matrix.android.sdk.ordering]
    passed="16" failures="0" errors="0" skipped="0"
  • [org.matrix.android.sdk.PermalinkParserTest]
    passed="1" failures="1" errors="0" skipped="0"

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for this new PR.
Just some small remarks, not blocking!


fun Context.singletonEntryPoint(): SingletonEntryPoint {
return EntryPoints.get(applicationContext, SingletonEntryPoint::class.java)
}

fun Context.getResTintedDrawable(@DrawableRes drawableRes: Int, @ColorRes tint: Int, alpha: Float? = null): Drawable? {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: you could annotate the param alpha with @FloatRange(from = 0.0, to = 1.0)
Nit2: maybe defaulting the param alphato the value 1.0 to avoid making it nullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}

private fun Float.toAndroidAlpha(): Int {
return round(this * 255).toInt()
Copy link
Member

Choose a reason for hiding this comment

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

Call to round could probably be omitted, but I am not sure.

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've merged with the toInt 57be0ba

@@ -125,7 +123,6 @@
android:padding="16dp"
android:text="@string/ftue_auth_use_case_option_three"
android:textColor="?vctr_content_primary"
app:drawableStartCompat="@drawable/ic_communities"
Copy link
Member

Choose a reason for hiding this comment

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

Could be nice to keep those attributes but using the namespace tools, for a better later preview.

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 thought it didn't work and then realised I was only checking the blueprint view 😅

52dc530

2022-01-24T17:52:25,248487460+00:00

Copy link
Member

Choose a reason for hiding this comment

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

Why not using ic_use_case_communities and the 2 other drawables for the preview?

Copy link
Member

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the ic_use_case_* drawables have intrinsic padding which can be a little misleading, I guess it depends if we would prefer the design preview to show relative sizing or the context of the image

no preference from my side!

Copy link
Member

Choose a reason for hiding this comment

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

I see, OK

return getTintedDrawable(drawableRes, ContextCompat.getColor(this, tint), alpha)
}

fun Context.getTintedDrawable(@DrawableRes drawableRes: Int, @ColorInt tint: Int, alpha: Float? = null) = ContextCompat.getDrawable(this, drawableRes)
Copy link
Member

Choose a reason for hiding this comment

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

Same remark.

@ouchadam ouchadam force-pushed the feature/adm/use-case-dark-mode branch from 52dc530 to 203c7e0 Compare January 24, 2022 17:55
@bmarty
Copy link
Member

bmarty commented Jan 25, 2022

(CI is not happy: ❌ Error: '[^─]{161}' detected 1 time, in file './vector/src/main/java/im/vector/app/core/extensions/Context.kt', at line 38.)

@bmarty bmarty merged commit bca6528 into develop Jan 25, 2022
@bmarty bmarty deleted the feature/adm/use-case-dark-mode branch January 25, 2022 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants