Comments (14)
Hi, I'll look into this - sorry.
from material-about-library.
Yep, you're right. Sorry I didn't pay enough attention to the PRs in the past - will keep more on top in the future. Will push a release with fixes in a mo
from material-about-library.
Fixed in #245eead, and release 3.1.2.
Cheers. Let me know how the rest of the migration goes - and I'd love to see which app you're using this in.
from material-about-library.
Cheers Daniel for a super-quick fix! I confirm that the fix works.
The only other issue I'm having is regarding theme, though I'm not sure whether this is caused by switching my app theme to MaterialComponents. For example, I notice icons are now black (in about screen, but also nav drawer), and that background color (in night mode) is now black (was very dark grey).
Note - I'm using fragments (i.e. "single activity" approach) (and so I used to override getTheme() which has since gone), and so styling by activity themes mentioned in your docs, doesn't apply here. For migration, I simply removed my getTheme() implementation:
override fun getTheme() =
when (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) {
Configuration.UI_MODE_NIGHT_YES -> R.style.Theme_Mal_Dark
else -> // Configuration.UI_MODE_NIGHT_NO
R.style.Theme_Mal_Light
}
p.s. I'm using your library in an internal project - I'll let you know if/when made public!
from material-about-library.
No worries! Glad that it's solved.
Switching to MaterialComponents has changed the dark theme background colour to black and this is independent of the library.
I decided to get rid of the themes since they aren't required and have become outdated. The colour of the icons is from Material Components 'colorOnSurface' attribute so if you want these to be grey, you can change this.
Is the light / dark theming still working in your app? Have you considered using MaterialComponents DayNight?
from material-about-library.
Yes, I'm using the DayNight theme, but according to this, the dark background color shouldn't be black: https://material.io/develop/android/theming/dark/
My other fragments are also showing black background, so yes I don't think this is anything to do with your library.
The colour of the icons is from Material Components 'colorOnSurface' attribute so if you want these to be grey, you can change this.
So I guess applying a ContextThemeWrapper in the onCreateView of the about fragment?
from material-about-library.
Ah, I couldn't find anything on the Android side of the docs regarding the background colour but in the Material Guidelines there is information on dark themes: https://material.io/design/color/dark-theme.html
The new dark theme surface colour is #121212 which is (I think) the black that we're seeing. Another interesting note - Toolbars don't have any elevation or colour in dark theme.
So I guess applying a ContextThemeWrapper in the onCreateView of the about fragment?
Yep, that sounds like the way to go. Hope it works & let me know how it goes.
from material-about-library.
Yes, you're right #121212 is what I'm seeing, though I've checked out a few of Google's apps (Photos, Gmail, Play Store) and they all use #202124 (which IMO looks nicer). Still, good to know the expected colour is appearing. I'll let you know if I find anything else interesting.
BTW: I use my Pixolor app to inspect the colors: https://play.google.com/store/apps/details?id=com.embermitre.pixolor.app
from material-about-library.
Hi Daniel - I noticed the MaterialCardView is set up with a 0dp elevation. Is there a reason for this, as opposed to using the default (which I think is 1dp).
I noticed, in dark mode, the colour of the card should change according to the elevation, so I wonder if the default elevation was used then the card would/should be a lighter shade of grey compared to the background.
Here is some interesting reading: https://stackoverflow.com/questions/60800857/how-come-the-color-i-set-for-cardbackgroundcolor-isnt-exactly-the-one-that-gets
from material-about-library.
I'd changed the design of the cards to be an outlined card (see: https://material.io/develop/android/components/cards/) since it looks a lot cleaner than the regular cards do in my opinion - the old versions of the library looked quite outdated so I thought I would change up the design whilst changing the version number.
I understand that this might not be for everyone - what do you recommend we do next:
- Add section to README to show how to override card layout
- This is done by adding your own layout named mal_material_about_list_card.xml, and copying in the contents from the library & changing to your preference
- This is quite hacky, and if lots of people want to do this it surely won't be the best option
- Add a parameter to the MaterialAboutCard to switch between outlined card and non-outlined card.
Unless you suggest both an outline and an elevation? Thanks for the feedback, much appreciated π
from material-about-library.
Thanks again Daniel.
I tried using my own layout and I agree an outline card looks better with no elevation. However, using default elevation and default stroke (no outline), looks even cleaner IMO. Regardless, I'm happy with either of the two solutions you propose, though arguably the second is the best.
from material-about-library.
Apparently this is a good way to set the theme in the fragment.
override fun onGetLayoutInflater(savedInstanceState: Bundle?): LayoutInflater {
context?.setTheme(R.style.Theme_About)
return super.onGetLayoutInflater(savedInstanceState)
}
from material-about-library.
Hi Daniel - I noticed the styles used in a couple of the layouts are using AppCompat styles. Is that intentional?
If not, how about:
mal_material_about_list_card
@style/TextAppearance.MaterialComponents.Headline6
mal_material_about_title_item
@style/TextAppearance.MaterialComponents.Headline5
@style/TextAppearance.MaterialComponents.Body2
from material-about-library.
Not intentional - thanks for spotting this. I'll break this into a new issue and fix soon. Cheers.
from material-about-library.
Related Issues (20)
- AboutFragment: FATAL EXCEPTION HOT 3
- Remove AppCompat styles HOT 5
- Icons show up as black boxes in 3.1.2 but not 2.4.2 MaterialAboutActionItem Builder HOT 1
- Outlined Card Toggle
- MaterialAboutActionItem receiving null context in some devices
- Does it support badge at item's icon or text?
- Bottom navigation HOT 1
- ScrollView
- CanΒ΄t get it to work..please help me HOT 5
- Cards not updating with dynamic content HOT 4
- Override icon tint? HOT 2
- Add AndroidX support HOT 18
- Issue with LTR text on RTL devices
- Making This Library Available to Developers Using Xamarin.Android HOT 3
- Replace String Comparisons with Direct Field Comparisons
- NoClassDefFoundError HOT 13
- Build warnings: 'string too large to encode using UTF-8...' HOT 7
- Remove CardView dependency in favour of MaterialCardView from Material Components HOT 1
- Support for Material Components theming system/DayNight styles HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-about-library.