Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add item headers in the modal #16

Open
brunodeprez opened this issue Nov 8, 2017 · 4 comments
Open

Add item headers in the modal #16

brunodeprez opened this issue Nov 8, 2017 · 4 comments

Comments

@brunodeprez
Copy link

Hi,

thanks for your great work developing this plugin.
I am using it to make a time picker, and I would like to show a header per wheel (in my case "hours" and "minutes").

Thanks

@enesaltinkaya
Copy link

+1

@jasonmamy
Copy link
Owner

jasonmamy commented Feb 8, 2018 via email

@enesaltinkaya
Copy link

enesaltinkaya commented Feb 8, 2018

I changed the loop in SelectorCordovaPlugin.java line 120.

          ` for (int i = 0; i < views.size(); ++i) {
                        LinearLayout layoutVertical = new LinearLayout(cordova.getActivity());
                        layoutVertical.setOrientation(LinearLayout.VERTICAL);

                        TextView textView = new TextView(cordova.getActivity());
                        textView.setText(i == 0 ? "Hour" : "Minute");
                        textView.setTextColor(Color.BLACK);
                        textView.setGravity(Gravity.CENTER);

                        layoutVertical.addView(textView);
                        layoutVertical.addView(views.get(i).getNumberPicker());

                        layout.addView(layoutVertical, views.get(i).getLayoutParams());
                }`

To the top;

import android.widget.TextView; import android.graphics.Color;

And it works, trying to add some margin to new TextViews now.

@brunodeprez
Copy link
Author

Awesome, would it be possible to put that in a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants