Comments (11)
Yep, the Button Border is just the outlined text button.
For the Text Font, I was thinking of maybe having something different for the sheet title that's all. It's entirely up to you, most people do like to keep the fonts static & uniform across the App
I will play around with the ScaleTypes. I should be ok, I just didn't know you had an option for that. The demo only shows a few configurations. I'll take a deep dive to see all the features.
from sheets.
Image Cropping: You can use ratio: Ratio or scaleType: ImageView.ScaleType for the ImageView CoverImage.
Lottie Display: Has the same attributes, if you adapt your animation ratio to the view, it should fit.
Text Color: Will be added
Button Border: You mean for the outlined text button? Using an outlined text button will give it a border. I can add an attr for the color of the border.
Text font: For which components? It would be quite messy to set all fonts in a sheet builder, and I guess usually one sets the font for all anyways to have the same look across the app? Or do you only need to set the font for a specific component as for example the title too?
from sheets.
Quick feedback, so the scaling works well, but I do think we need a way to set a background color for the image area. This would be great in cases where the image scaling is not appropriate, and the intention is to keep the same aspect ratio. If the background color is something we can set dynamically, the image can blend well the background without any noticeable open spaces on the sides. It's an issue with small images or lottie animations that are too small width wise to fit the sheet.
Let me know what you think.
from sheets.
Since LottieAnimationView is based on a normal ImageView, not a ShapeableImageView, I would need to find another way to clip the corners of it. Otherwise, the background color (or a Lottie Animation with a fixed background color) would result in square dialogs and bottom sheets instead of rounded or cut corners.
Perhaps I misunderstand that - why would you not want the Lottie Animation take the necessary height to keep its aspect ratio while fitting to the width of the sheet? The dimension ratio is applied to the parent container view of the cover image/ animation view.
from sheets.
So it's a bit of an illusion. It's more so trying to blend the LottieAnimationView with the surroundings to give a better visual appearance. If it's a LottieAnimationView with a white background, there's no issues. Only becomes an eye sore if you have a different color. Scaling with FIT_XY works, but doesn't look clean. I would say look at the LottieDialog example we started out with. They do offer the same feature, not sure if they also have a way to clip the corners.
from sheets.
Alright, I believe I understand what you want to achieve. I will add an option to set the background color of the ImageView/LottieAnimationView and clip the corners depending on the TopStyle and CornerFamily of the sheet, likely tomorrow after work. Any other things you would like to control regarding the LottieAnimationView/ ImageView in gernal of the cover?
from sheets.
withCoverLottieAnimation(LottieAnimation {
ratio(Ratio(3, 2))
setupAnimation {
// Lottie animation setup
setAnimation(R.raw.anim_lottie_business_team)
// .. more settings
}
setupImageView {
// Manipulate ImageView
setBackgroundColor(ContextCompat.getColor(context, R.color.sheetDividerColor))
}
})
If you set a background color to the ImageView, it will be replaced by a shapeDrawable with the same color and clipped top corners, if necessary depending on the TopStyle.
from sheets.
Thanks, I just played with the sample + the changes you mentioned. Looks great. I took a peek, I think all the options/settings are covered under LottieAnimationRequest.
from sheets.
You are welcome. Great to hear!
from sheets.
Hey, can we get a quick example of how to change the button outline & fill color?
from sheets.
Thanks for mentioning it - it's missing in the README.
Use this for the border color of the outlined button:
<attr name="sheetButtonOutlinedButtonBorderColor" format="reference" />
Use this for the border width of the outlined button:
<attr name="sheetButtonOutlinedButtonBorderWidth" format="dimension" />
from sheets.
Related Issues (20)
- Color: TextView overlaps SeekBar HOT 2
- Localization: consider using platform resources HOT 1
- onNegative / onPositive support for dynamic drawables
- Text content on OptionSheet HOT 1
- Option constructor with long click listener without specifying sub-text. HOT 2
- Core module leaking colour attributes into consuming applications HOT 1
- make bottom sheet form scrollable HOT 1
- Option customisation support HOT 1
- Cannot use textview on bottomsheet HOT 3
- How to modify the size of the TextView of OptionSheet? HOT 1
- ColorSheet For Jetpack Compose. HOT 4
- CharSequence to the rescue
- Positive button should be invisible or unclickable.
- Custom year range in CalendarSheet HOT 1
- Text/Icons not centered when using OptionSheet as dialog HOT 1
- Upgrade to material 3. HOT 1
- Looping for option sheet HOT 1
- prevent dismiss
- Months Layout
- `rememberSheetState` and `rememberLauncherForActivityResult` not working together in the same page
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 sheets.