GithubHelp home page GithubHelp logo

InfoSheet General Cleanup about sheets HOT 11 CLOSED

irvine752 avatar irvine752 commented on July 23, 2024
InfoSheet General Cleanup

from sheets.

Comments (11)

irvine752 avatar irvine752 commented on July 23, 2024 1

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.

maxkeppeler avatar maxkeppeler commented on July 23, 2024

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.

irvine752 avatar irvine752 commented on July 23, 2024

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.

maxkeppeler avatar maxkeppeler commented on July 23, 2024

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.

irvine752 avatar irvine752 commented on July 23, 2024

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.

maxkeppeler avatar maxkeppeler commented on July 23, 2024

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.

maxkeppeler avatar maxkeppeler commented on July 23, 2024
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.

irvine752 avatar irvine752 commented on July 23, 2024

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.

maxkeppeler avatar maxkeppeler commented on July 23, 2024

You are welcome. Great to hear!

from sheets.

irvine752 avatar irvine752 commented on July 23, 2024

Hey, can we get a quick example of how to change the button outline & fill color?

from sheets.

maxkeppeler avatar maxkeppeler commented on July 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.