Giter Club home page Giter Club logo

Comments (10)

orhanobut avatar orhanobut commented on May 28, 2024

That should work out of box actually, need to check. I'll try to add more tests to cover these situations. Contributions are also very welcome.

from dialogplus.

Kisty avatar Kisty commented on May 28, 2024

OK. So I've managed to get the animation with a complex gravity but now what if I want to show a card, with space either side? Am trying to tinker with the layout params in the DialogPlus class. Any ideas?

from dialogplus.

orhanobut avatar orhanobut commented on May 28, 2024

You can use

.setMargin
//or
.setPadding

from dialogplus.

Kisty avatar Kisty commented on May 28, 2024

I know that, but the problem is, is that by default the custom view takes up the whole width of the screen regardless of whether you use wrap_content of not in the layout XML. I want it to show up like a card with transparent space either side. I've changed this in getContentParams so that it uses a separate params object and width param as WRAP_CONTENT rather than MATCH_PARENT. Try changing content2.xml root's height to WRAP_CONTENT and set background resource id to transparent in the sample app to see what I mean.

It works in my case but breaks everything else. Either we can use the width and height params from the root of the custom view or we could put a switch in to it to say match_parent on the custom view.

from dialogplus.

Kisty avatar Kisty commented on May 28, 2024

This is what I have at the moment:
device-2015-09-15-094838

from dialogplus.

orhanobut avatar orhanobut commented on May 28, 2024

I get it now, no unfortunately this overlay will be shown all the time, I was expecting to have a PR for this feature to be able to change the background.

from dialogplus.

Kisty avatar Kisty commented on May 28, 2024

Which background? Can't you already change the background. I'd like to show
you what I mean by an example. Is a PR the best way to do that?

from dialogplus.

orhanobut avatar orhanobut commented on May 28, 2024

I was assuming that you are talking about the background color with transparency?

from dialogplus.

Kisty avatar Kisty commented on May 28, 2024

No, I didn't mean that only. I can do that easily by using setBackgroundResourceId(android.R.color.transparent). When you do that, it doesn't behave in the way expected. Here's the PR to avoid the crash with a composite gravity #80

from dialogplus.

orhanobut avatar orhanobut commented on May 28, 2024

Closing this issue since a merged PR solves the issue.

from dialogplus.

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.