Comments (7)
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.
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.
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.
Problem is that it only looks nice in portrait. For now it's really "hack"-y. Looking forward to a proper implementation. :)
from materialdatetimepicker.
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.
Hey walt,
I actually really need this feature. Do you want a pull request or are you already working on it? :)
from materialdatetimepicker.
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)
- arrows of month in arabic version HOT 1
- maxDate is capped to 2100
- custom style
- Using on jetpack Compose
- View Only Month like year HOT 1
- Why time picker is not using declared material colors? HOT 1
- SetTitle not working
- DatePickerDialog resets to selected date's month when changing selectableDays
- How to set a different color to Sundays
- Material design 3 layout
- Focus first selectable date HOT 1
- Date picker throws exception when the activity is destroyed
- Date picker throws exception when the activity is destroyed HOT 1
- i'm getting a stretched picker as if it is stretching to full screen
- can anyone solve this!!
- Hidden header
- It is not added as an Android library
- Minutes visibility
- Minutes visibility HOT 1
- Leap year issue
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 materialdatetimepicker.