Why my font in design viewer is blurry in Android Studio? - java

Why my text inside the android design viewer appears blurry. I tried changing the resolution DPI setting as well. But it didn't work for me.
Please look at my second picture, to let you know which one is I am talking about.

Try changing the scaling to 100% instead to 125%. Normally in Windows 10 default scale in 125% recommended. But using 100% will fix this.
To Find Scaling Setting:
Right Click on the desktop
Navigate to Display Setting
Dont Forget to go advanced scaling setting
And
Turn on the Fixed Scaling for the apps
Just incase sometimes
Before:
After:

How about changing device settings?
It just change the resolution of example device and it would make more clear sight from design view. It doesn't change the layout codes.
It would help the development with clear visual, but you have to test various resolutions of devices if you needed to.

Go to 'Help' tab and click on 'Edit Custom Properties'. It might ask you to generate a file if it doesn't already exist. Once this properties file was made, I wrote 'hidpi=false' (no quotations) on a new line, saved it, and restarted Android Studio.

Related

CodenameOne - Importing set of images in the theme

My CodenameOne app is mainly intended to be the iOS counterpart of an existing Android app. It is for older devices, in fact, as soon as possible, or in the future, a Swift app is going to replace it for OS 14>.
I need some customised icons and I have the svg code for it.
Initially I had to use the Flamingo tool, that converts svg files in Java classes.
I used it like
ScaleImageButton appButton=new ScaleImageButton(new AppIcon().scaled(doubleButtonSize,doubleButtonSize).toImage());
It is cumbersome but it does not even work on iOS.
So now I resorted to create png images for every icon in every dpi level, as it can also be done on Android.
I renamed the files so they follow the standard I think it is proposed in CodenameOne.
The possible names are:
verylow.png
low.png
medium.png
high.png
veryhigh.png
560.png
hd.png
2hd.png
4k.png
In the end it has to be used like
Image icon = theme.getImage("icon.png");
It seems that the images can be imported in the project in more than one way.
I was said to include them in the theme.
According to the CN1 developer guide I have to set the size for each.
If I import them as a whole (selecting the folder or selecting all images and hitting the "Open" button) in the theme editor a dialog appears with all wrong sizes (but they resemble a particular set of choice, although very unlikely).
They are not always the same sizes but neither they are defaulted according to the provided set of images.
I provide images as 24px, 36px, 48px, 72px, 96px, 144px, 192px, 288px, 384px for normal size icons, and also I provide double sized images for double size icons in my app (the values are not doubled as expected).
I also have to check "Square image" and "Preserve aspect ratio" options (my images are already square).
Then the strangest part is that there is a percentage, I see it is 20 for example.
The caption reads "will affect all entries". I understood that it is to scale images, that is what a developer just do not want, unless the developer has wrong sizes, but still proportioned among themselves, that cannot be the case I think.
However I do not need any scaling, the images are right as they are. I created them on purpose.
The developer guide is not enough clear to me.
So I am asking
is it right to tweak the wrong size to match the right ones, and what about the percentage?
This specific UI is a bit out of date by now and wasn't used much even when it was added. Most users opted to do desktop scaling for multi images.
The scale option is designed to scale down from a high resolution image on the desktop. You don't want/need that.
You don't need to edit the file. Just make sure to turn on the XML team mode and make sure your images use the right file names. Then once you save the images will appear in the resource file.
I suggest adding a multi-image using the standard method of add in the menu. Then replacing all the generated images with your copies and reopening the file, then saving again (the last save is important as it will override the res file).

Creating Usable Toolbar for High Resolution Screen

High resolution screens are old news, but for some reason we (and the Eclipse guys) ignored them until now. Well, we can't any longer.
What we want to do is create Eclipse applications that work for "normal" displays, but for high resolution ones, too. Right now the icons are way to small to see or click.
This bug links to this (rather sparse) documentation states we only need to use a new constructor for Image. Okay, so we need to create our own implementation of ImageDataProvider.
While that might work for the images we created ourselves, it does not work for the main tool bar icons.
So let's say we'll start a completely new application from scratch: how would we set up everything to make the toolbar work with the new API and so with all kinds of screens?
(There is a similar question, but it's from the perspective of an Eclipse user, while this question is from the perspective of a developer of an Eclipse application.)
When HiDPI mode scaling is in use anything using ImageDescriptor.createFromURL to load images will look for a image with #2x or #1.5x appended to the name depending on the current scaling (so, for example, remove.png and remove#2x.png). This is used to create an ImageDataProvider.
Eclipse will use this for the tool bar images and many other things.

layout-small not being recognized/not working

I made a layout-small xml file to fit smaller screen sizes for my activity. I was told that if you create a folder, named layout-small(with the XML inside it, of course) inside the res folder, android would recognize that the phones screen size is small and would automatically use the layout-small XML file.
I used the 3.2" HVGA Slider AVD to test the program, but it still used the normal layout. I hope this make sense, as I couldn't find another question similar to this.
If you need any additonal information or have any questions, let me know.
Thanks.
According to this page your AVD device has a screen size of "normal", so you will not pick up the definition for "small".
Device Definitions
The platform includes the following device definitions for use in creating Android Virtual Devices in the AVD Manager:
...
• 3.2" HVGA slider ADP1 (320 x 480, Normal mdpi screen)
If you want to target your AVD with a different layout, take a look at ways to specify an alternative.

OpenLayers map shows an extra tile on top of map

I have an Windows Phone 8 app made with PhoneGap framework to show a map of OpenLayers. Sometimes, although very rarely, I surf between views (jQuery Mobile is used) and suddenly when I am back on Map it shows an extra tile on the center of map. Tile is as wide as the map and starts some 20% before top and ends some 20% from bottom. It does disappear only when restarting the app.
I am trying to show up the phenomenon on dev mode of Google on browser, but so far no success.
No error is shown on console of wp8 sdk, I was testing it on device connected to visual studio.
What may cause that thing and could it be fixed somehow?
edit1: It may be possible I trigger a swipe event while moving the screen fast and that may make the Openlayers in error state.
First try:
I added this line:
-ms-scroll-chaining: chained;
to the div containing the map.
I used jQuery / HTML5 / gwt app for WP8 (Lumia 920) device: vertical css scroll fix to attach another things to same place, so I added it there.
UPDATE
This was not the fix, problem stayed. See below the correct answer:
The real answer:
https://github.com/openlayers/openlayers/issues/929 tells this is known issue of openlayers, that is already fixed in the latest version.
So, please update version of OpenLayers!

Screen optimization for tablets

I have optimized my app for just about all Android phones. The way my app is set up, I have a 16dp padding on the left and right side of it and a 65dp padding on top and bottom (see screenshot below). On a phone it looks beautiful.
But on a tablet, it looks terrible. 65dp on a phone is a whole lot different that 65dp on a tablet. On a tablet, the black border around the question runs off the side of the scroll background and stuff is on the roll at the top and bottom of the scroll background.
What are my options to fix this? Is there a percentage/weight option for padding? I think that would solve it completely but there is nothing like that that I know of.
You can create multiple resource files tailored for different display sizes. Android will automatically choose the correct resource file for you. Using this technique, you can specify padding values for any screen size, or even completely unique layouts, to be automatically selected for you by Android.
Please refer to Designing for Multiple Screens.
Using multiple dimension resource files would make the task of changing the padding based on screen size very simple. See More Resource Types.

Categories

Resources