This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Difference of px, dp, dip and sp in Android?
So I know I should use sp only for text font sizes. Now, what I don't understand is what they do exactly. Let's say I have the following attribute for a TextView in a layout for a normal screen size:
android:textSize="17dp"
If I replace it with this:
android:textSize="17sp"
What happens? In the visual editor, it doesn't look any different?
I am guessing that if I have, say a 3.2" screen which qualifies for the normal size layout, and a 4.0" screen which also qualifies for my normal size layout, then if I use sp, the text's size will be slightly scaled up? Is that right?
text rendered with sp is more compatible with accessibility options, for example if the users enables a high contrast mode or universally increases the size of text. Since sp is also density independent, that is the only difference between sp and dp.
I wouldn't like to start a new thread about it is so please have a look on a thread where it was already answered. Your question is answered mostly in the comments. Difference of px, dp, dip and sp in Android?
Related
This question already has answers here:
PyQt GUI size on high resolution screens
(3 answers)
Closed 3 years ago.
I've developed an application using PyQt on a computer that has a resolution of 3840x2160. I used QtDesigner to create almost all of my UI needs, then added the few other things I needed manually in python. Once I went to deploy the application, I realized that the target computer had a resolution of 1920x1080. Some widgets in the application (generally those that just had text/buttons) are fine, but once I start to get in to more complex layouts things don't appear as clearly. Specifically, QLabels and other QItems overlap each other, images are scaled disproportionately along their horizontal axis, and spacing between objects decreases. The following are a couple of images that illustrate the problem.
3480x2160 Screen (250% Scaling according to Windows Scale and Layout)
Note: This is what I see when I am developing.
3480x2160 Screen (100% Scaling according to Windows Scale and Layout)
1920x1080 Screen (100% Scaling according to Windows Scale and Layout)
I also noticed that Qt Designer itself has a similar problem when transitioning to a different screen resolution (see images attached).
High Resolution Screen - QtDesigner
Lower Resolution Screen - QtDesigner
What is the proper way to go about dealing with multiple screen resolutions in PyQt if I want to leverage QtDesigner? I know that I can retrieve the screen resolution with QDesktopWidget.screenGeometry, but is there any way to scale every parameter at once rather than manually changing each item? Will avoiding a particular "Size Policy" help at all with this?
If the issues is more with different dpi than resolution, you can tell Qt to use high dpi scaling/pixmaps by adding the following lines to your application before you create your QApplication (or any other Qt classes):
# Handle high resolution displays:
if hasattr(QtCore.Qt, 'AA_EnableHighDpiScaling'):
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
if hasattr(QtCore.Qt, 'AA_UseHighDpiPixmaps'):
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)
I have found that this makes my applications behave the same (or at least more similar) when switching between my laptop (high dpi, high resolution) and desktop (normal dpi, 1920x1080).
I don't use QtDesigner, so I have no idea how this suggestion plays with QtDesigner.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am looking for a tool / standard / concept / convention that would improved the communications between a designer and a developer for describing UI elements and their layout.
I will try to explain by example:
consider a design that shows a 200 by 200 pixels red box with a 100 by 100 pixels green box centered within it.
This is very clear as long as nothing is dynamic,
but the moment you want to account for any dynamic change this is not enough any more.
just consider what should be happen to this design if the size of the device turns out to be 300 by 400 pixels... instead of 200 by 200.
It can be interpreted as:
Keeping the 200 by 200 square pinned to any of the corners of the 300 by 400 area leaving unbalanced white margins.
Keeping the 200 by 200 square centered with respect to the 300 by 400 are leaving balanced white margins.
stretching the red area to fit the new available area but leaving the internal square the same original size.
And so on.
This is not some theoretical Q, This is a real problem with designing UIs for applications that need to support more then a single language.
the dimensions of a button can change due to text contained within it changing as a different language is used.
I am looking for a (graphic?) standard for showing anchors / margins / minimum or maximum sizes, relative positioning and so on.
Something that can easily convey a message such as:
Those two buttons should have margins of 5px on each side, and a middle area that is at least 80px or bigger if so required to accommodate their texts. both buttons should eventually have the same size (by increasing them all to the size required by the largest of them).
I manage developers and designers at an agency. We make sure our designers design for every possible (device) screen. If the UI is designed for a PC, the developers will have questions about how the layout changes from PC to mobile to tablet. Most designers are aware of this and design for all screens from the beginning.
For a specific answer to your hypothetical question, using percentages for dimensions would help translate a design from large to small screens and keep the design aesthetic better than using absolute pixel sizes.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
in the standard keyboard the homerow and the bottom row are offeset horizontally by about half key size. so they are symmetrical for left and right hands. but the home row and toprow are offset horizontally by about a quarter key size. so they become asymmetrical for the left and right hand positons when fingers extend to the top row
i guess it is a relic from the heredity.
is there a keyboard available without this asymmetry?
Have you seen the typematrix keyboard?
I believe that I've seen the layout you describe referred to as "stacked" because the keys are stacked on top of one another, rather than offset. Apparently this company calls it a "matrix" design. They also have little images showing the difference:
Staggered Columns
Forces unbalanced motions that strain fingers, hands, and wrists.
Vertical Columns
Reduces motions that cause repetitive strain injury (RSI).
Why you'd ever willingly use anything other than a Model M is beyond me, however. :-)
There are some nifty symmetric keyboards under the "Solutions" section here. From the same author, here is a list (with illustrations!) of some other attempts at symmetric keyboards, some of which have no offset whatsoever.
check this:
http://www.trulyergonomic.com/
I think this keyboard really uses the symmetry idea in a good way. It will be released soon, though.
About the offset, the reason is there come from long ago, with the mechanical type-machines...
No serious reason any longer, but people just get used to that.
Many keyboards without the offset are available, here's several from one company: http://www.chestercreektech.com/keyboards.html
I've tried typing on keyboards without the offset, and it is hard. You might be surprised.
Some keyboards are very very different: http://www.frogpad.com/
I'd like to try one, but am under no illusions that I could ever get used to it.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm suffering from early RSI symptoms and am looking for a way to avoid injury. My physiotherapist has determined that the worst thing I seem to be doing is using my mouse at such a weird angle. The problem for me is, I keep my keyboard positioned such that my left and right forearms are angled in the same amount, i.e., my body is centred roughly with the B key. On my current keyboard, which is not a split, this means the wide Enter key, the arrow keys, and the number pad all jut out to the right before I have space for my mouse. I have a medium-width frame, but even still, this leaves my wrist at a really awkward angle when using the mouse. I'd prefer not to have to push my keyboard out of the way every time I switch between the two, but I do use the num pad occasionally, so I wouldn't want a keyboard without that.
I think it'd be ideal to have about a 30-50 cm space between the left and right halves of the keyboard, so my arms are more perpendicular to my collarbone, and the arrow keys and number pad in the middle, maybe even with the numbers on a 45 degree angle, so I could configure them for use with either hand.
(In case you were wondering, then a touch-screen with a stylus that has a right-click modifier button for mousing, because otherwise the mouse pad would be right where I'd put the right half of the home row, in the most natural position for my right arm while sitting.)
With that much space, you could fit so many custom keys for things that you normally use two-key combos for...or you could detach them completely (save for a wire) and just have, you know, actual desktop showing through.
What's the closest keyboard you've seen to this?
I use a keyboard with the numeric keypad on the left hand side. This allows me to bring my mouse in closer on the right hand side, allowing for a more natural position. I am right handed. You can see the keyboard I use here.
(source: keyboardco.com)
http://www.thehumansolution.com/keyboards.html
I've been looking here at some keyboards (I've got severe Carpal Tunnel). The Kinesis keyboards are nice, but there where a few there with the number pad in the middle.
alt text http://us.st12.yimg.com/us.st.yimg.com/I/thehumansolution_2020_3491616
alt text http://us.st12.yimg.com/us.st.yimg.com/I/thehumansolution_2016_1198996
Just an advice. I was also suffering from the RSI symptoms, up to the shoulders. I've tried MS and Logitech ergonomic keyboard without succes. It was even worth than before because the mouse was more distant than before.
Then I founded the TypeMatrix Keyboard and it reduce my RSI to nearly nothing.
Unfortunately, they are hard to found for non US nor Canada citizens.
(source: typematrix.com)
In line with Joel Coehoorn's suggestion, I find that a trackpoint (aka "nipple") is even more ergonomical than a touchpad. Lenovo's USB Keyboard with UltraNav has both.
My mouse usage is minimal, though, because I focus on using the keyboard for everything. This might not be easy in your particular development environment.
(source: ibm.com)
A few years ago I had wrist problems, too.
What worked for me was changing my posture, how I hold myself, my arms. I move my keyboard and mouse around, I change my position and the position of those two.
Additionally I use keyboard shortcuts a lot to not overuse the mouse.
This way I got rid of my wrist problems without replacing keyboard or mouse.
As a fellow RSI suffer, I hope one of these helps out.
The ErgoMagic and ErgoFlex keyboards are split into 3 sections, and you can position the number pad in the middle.
The ErgoFlex is a flat design:
http://www.safecomputingtips.com/blog/ergonomic-keyboard/ergoflex-keyboard/
http://www.comfortkeyboard.com/keyboards_ergoflex.html
(source: safecomputingtips.com)
The ErgoMagic has adjustable tilts for each section:
http://www.comfortkeyboard.com/keyboards_ergomagic.html
(source: comfortkeyboard.com)
I did try a PCD Maltron keyboard for a while when I was having some problems with referred pain, but I never really got used to it. I'm left handed, so my mouse is quite close to the keyboard. If you're having trouble with your mouse being too far out to the right you could try a small footprint keyboard such as a Happy Hacking Keyboard and a Separate Numeric Pad on the left or somewhere else to get a more clement key layout.
I also learned to use a mouse with both hands - you might also try learning to use a mouse left-handed.
alt text http://www.maltron.com/images/keyboards/maltron-usb-dual-l90-uk-mac-qwerty-gray-1-600.jpg
(source: geekstuff4u.com)
The main problem about keyboards is not the keyboard layout or form factor, the main problem of keyboards is the layout. I had really strong RSI problems, to the point I could barely type (only by when accepting major pain!) for two weeks. I couldn't touch a keyboard for 3 weeks till it finally got better. After that the problems always came back every now and then. I tried different keyboards as well. I have a GoldTouch split keyboard, a Microsoft Natural split one, I have even the TypeMatrix one that gizmo mentioned, but it all helped little.
Then I discovered the Dvorak layout. At first I thought it's a silly idea, but I took that route. It was a hard training and it took me quite a long time, but now it's the only one I keep using, as it's the only one I can type on for ours without any RSI symptoms. At first things seem to have gotten worse, but that's only because a new layout will lead to new finger movements.
Recently I found out about Colemak, another alternative to QWERTY, it seems even more promising than Dvorak; I'm just trying to learn it... and I have a hard time again.
Another thing that helped me much more than replacing the keyboard is replacing the mouse. I'm not using a mouse any longer, I'm using a trackball.
(source: arstechnica.com)
And after I tried plenty of keyboard (I have more than 20 at home, no kidding!) I stayed with the Microsoft Natural 4000 keyboard. It might be huge, but I can type very well on it.
I don't know of any keyboards like that, but what might help is a keyboard with a built-in touchpad (like for a laptop) that you can use instead of your other mouse for some of your mousing: small adjustments, quick taps to click, etc, to avoid having to go out to the mouse.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
What are the most user-friendly color combinations for Web 2.0 websites, such as background, button colors, etc.?
ColorSchemer will suggest good schemes for you.
If you want to try something out on your own, try Color Combinations.
I've been using this free color schemer to help me determine some nice layouts. You give it a base color and it will give you a lot of complements.
EDIT: Gah! Curse you jko and your god-like typing abilities! At least we have the same reference though. 8^D
For color schemes, I like browsing Colour Lovers. There are thousands of user-submitted color schemes to pick through for ideas and you can easily create your own scheme if you'd like. A lot of times I use it just for the color palette to create just the right color (it outputs the color in hex, RGB, HSV and CMYK).
These aren't combinations per-say but are good colours if you're just looking to mock something up (or if you're like me and have the colour sense of a bat).
Google Docs & Spreadsheets: Web 2.0 Colours - found this recently and it's been very helpful.
Modern Life is Rubbish: Web 2.0 Colour Palette - a sort of parody but useful :-)
As for when i do use actual palettes I use Colourlovers, kuler and Colourschemer with custom colours.
what about colllor ?
user-friendly color palette generator
My stick figures come out wrong, but the following links have kept me artistically aligned for many years:
Color tools for the design impaired
Color Scheme Generator
To web 2.0-ize it, just put a lens flare on your logo & mark it BETA - you'll be fine.
search for color on useit
search for color on boxesandarrows
There has been loads of research on this sort of stuff and most of it is conflicting a couple of good jump off points are listed above.
Generally lighter backgrounds and good contrast are favoured by all researchers but the details get niggly.
I would say that using the right combination of colors is user-friendly. Make sure your colors coordinate with each other and you should be fine.
A tool I use a lot is kuler (http://kuler.adobe.com). It'll help you pick colors that work well with each other.
Miles Burke has compiled a list of the colors used in the majority of the big names in this Web 2.0 world.
He also gives a PNG or a JPG as a color cheatsheet.
I am sure I can give you an idea from what color to chose for your application.
There is no single set of colours that everyone finds legible, but tools exist to formalise the variation and help you to make informed choices. Anyone doing UI should know about automated colour checking for accessibility. Anytime you have text that people need to read, pop the foreground and background colours into this;
Colour Contrast Check
This is based on a lot of research into contrast and legibility. If your colour combination is >125 and >500 you are as safe as you can be. Between 100 and 125 for brightness difference and 400 and 500 for colour difference then it's fine, but could be better. Below 100 and 400 respectively, increasing numbers of people will have trouble reading it for a variety of reasons.