color-picker-view icon indicating copy to clipboard operation
color-picker-view copied to clipboard

Big empty space in the Colorpicker

Open Muddz opened this issue 9 years ago • 4 comments

On phones with bigger screens or higher resolutions, the colorpickers leaves empty spaces. What I have done here, is that I have removed the button and slider and then set the layouts to wrap parents, which works on some phones, but newer phones like Galaxy S6 and tablets have theese big spaces.

galaxy s6

Muddz avatar Feb 05 '16 23:02 Muddz

Haven't been able to reproduce this bug (ownno samsung devices). If you solve if, please share your solution! :)

danielnilsson9 avatar Feb 12 '16 12:02 danielnilsson9

Hi @danielnilsson9 . Have you used the files I sent you once on mail?

Else it easy:

  • Remove the Button and slider from the default layouet of the colorpicker
  • Remove the 2 minitures showing old/new colors
  • Run a Emulator on a tablet or phone with big screen resolution

Muddz avatar Feb 17 '16 11:02 Muddz

@danielnilsson9 Any idea on how I can edit the protected files? I know where in the code edit to remove these spaces. I removed the preview boxes and hue/alpha sliders from XML but in the code their sizes is still set which makes theese spaces.

Muddz avatar Mar 11 '16 23:03 Muddz

Hi Daniel. I just wanted you to know that I solved this irritating problem with big empty spaces when removing alphaslider etc.

Solution:

In the ColorPickerDialogFragment class:

   @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog d = super.onCreateDialog(savedInstanceState);


      d.requestWindowFeature(Window.FEATURE_NO_TITLE);

    //This put the dialog/frames size according to the screens DIP
    int x = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 200, getActivity().getResources().getDisplayMetrics());
    int y = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 150, getActivity().getResources().getDisplayMetrics());

    d.getWindow().setLayout(x,y);

    return d;
}

Muddz avatar Jun 20 '16 18:06 Muddz