Giter Site home page Giter Site logo

Comments (7)

wdullaer avatar wdullaer commented on May 18, 2024

I hope that's a mock and not a screenshot of this library with the dark theme. If it is, I'll need to clean that up a bit!

I can see the usefulness, but it should fit the overall design. Unfortunately I'm not a good graphic designer, so this might take some time.

Alternatively, you might try extending the pickers. In onCreateView call the super method first, which gives you the current picker view and embed that in your own custom layout which has the title.

@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
    // Have the library create the View with the picker
    View pickerView = super(inflater, container, savedInstanceState);
    // Inflate your own view which contains the title and room for the picker
    View parentView = inflater.inflate(R.layout.dialog_parent, container, false);
    // Add the picker to your layout
    ViewGroup container = (ViewGroup)parentView.find(R.id.container);
    container.addChild(pickerView);
    // Return your custom layout with the picker in
    return parentView;
}

This is just some code on top of my head, it will need some tweaking probably.

from materialdatetimepicker.

geecko86 avatar geecko86 commented on May 18, 2024

No it's not from this library. it's from Talon for Twitter and the dev says he coded it himself.

The problem with just overriding onCreateView is that calling your static newInstance method will create a TimePickerDialog (without the overridden methods) no matter what.

Edit: Well, silly me. Overriding the static method as well works. Screenshot

from materialdatetimepicker.

wdullaer avatar wdullaer commented on May 18, 2024

I was just going to suggest that :-)

The screenshot looks nice.
The material design spec suggests that you align the title of a dialog left.

Adding this to the timepicker will be easy.
Adding it to the datepicker will require some thinking: it's already close to the max length. There's hardly any room for a title.

from materialdatetimepicker.

geecko86 avatar geecko86 commented on May 18, 2024

Problem is that it only looks nice in portrait. For now it's really "hack"-y. Looking forward to a proper implementation. :)

from materialdatetimepicker.

wdullaer avatar wdullaer commented on May 18, 2024

The landscape versions have the same problem as the DatePicker: there is not enough space left to fit a title at the top.
Adding this will require more redesign than just adding an additional TextView at the top.
It'll take some time before I get around to working on this.

from materialdatetimepicker.

geecko86 avatar geecko86 commented on May 18, 2024

Hey walt,

I actually really need this feature. Do you want a pull request or are you already working on it? :)

from materialdatetimepicker.

wdullaer avatar wdullaer commented on May 18, 2024

I haven't had a lot of spare time lately, so I didn't start working on this yet.

Like I mentioned: it will require some redesign of most of the components, because they're close to max height already see #17 .
If you need it urgent, it's probably best to give it a shot yourself.

from materialdatetimepicker.

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.