I somehow can only view the first 100 of my array in the Watches window. The three dots likely represent that there is more to be shown but I cannot find out how to expand the window. As you can see the size = 10000 so there really are more objects to be shown.
So how do I show these objects?
The IntelliJ IDEA only shows the first 100 by default. It is possible to adjust the range on the fly at any moment by right-clicking the collection in the Watches window and choose Adjust Range. Fill in two of the three field to specify the elements you want to show up. The range values persist until removed from the watch list.
Related
I am developing an accessibility service on android and I want to check the space between on-screen elements. Currently I am already using AccessibilityNodeInfo and its getBoundsInScreen() method to read the touch target size of clicked elements.
Do you know if there is a way to retrieve the margin of an element?
There is not. Anything that you came up with would be a hack.
You could compare the on screen coordinates of elements. But, then you're not going to get a "margin" just the space between them. There is no way to get a "margin" property.
The android developer page gives the following information on the variable option for peek cards:
When this peek mode is selected, peek cards will be as tall as needed, while maintaining enough space at the top to draw the system time and status icons.
How can one tell the card how much space it has?
I ask because my cards seem to be displaying as short but the face adjusts to the size of the cards and two lined cards are desired.
EDIT: I did not get the behavior that I was looking for because I used the wrong method to change the settings. Since the integers being called had meanings for the function, the program operated.
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE)
.setPeekOpacityMode(WatchFaceStyle.PEEK_OPACITY_MODE_TRANSLUCENT
PEEK_OPACITY_MODE_TRANSLUCENT is the same value (1) as PEEK_MODE_SHORT so the second line over rode the first.
The correct code is:
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE)
.setPeekOpacityMode(WatchFaceStyle.PEEK_OPACITY_MODE_TRANSLUCENT)
The card may cover a significant portion of the screen, depending on the system UI style. Your watch face should adapt to these situations by ensuring that users can still tell the time while the notification card is present.
To determine the free space above the peek card so you can adapt your watch face, use the WatchFaceService.Engine.getPeekCardPosition() method.
Watch faces should not interfere with system UI elements, as described in Accommodate System UI Elements. If your watch face has a light background or shows information near the bottom of the screen, you may have to configure the size of notification cards or enable background protection.
#Override
public void onCreate(SurfaceHolder holder) {
super.onCreate(holder);
// configure the system UI
setWatchFaceStyle(new WatchFaceStyle.Builder(AnalogWatchFaceService.this)
.setCardPeekMode(WatchFaceStyle.PEEK_MODE_SHORT)
.setBackgroundVisibility(WatchFaceStyle
.BACKGROUND_VISIBILITY_INTERRUPTIVE)
.setShowSystemUiTime(false)
.build());
...
}
The code snippet above configures peeking cards to be a single line tall, the background of a peeking card to show only briefly and only for interruptive notifications, and the system time not to be shown.
Update
Or you can use relative measurements, we all know that devices has different sizes and resolutions.
Must get the width and height by using Canvas.getWidth() and 'Canvas.getHeight()` methods ans set the positions of your graphic elements using values that are fraction of the detected screen size. If you resize the elements of your watch face in response to a peek card, use values that are some fraction of the remaining space above the card to redraw your watch face.
Be sure to use .setCardPeekMode() for the height of the card and
.setPeekOpacityMode() for translucency.
Because the same integer values are called for height and opacity, it is possible to use WatchFaceStyle.PEEK_OPACITY_MODE_OPAQUE in setCardPeekMood and WatchFaceStyle.PEEK_OPACITY_MODE_TRANSLUCENT in setPeekOpacityMode(). This can cause undesired effects.
I have a scenario where I have to show a huge report which consists of about 16 fields, and the last field consists of a radio group. I've taken a Table layout for this. But the problem is, I don't know the size of each field. I mean, there could be 50 characters in one, and 2 in another, and I have to adjust the width and height basing on that without loosing the look and feel criteria. For example,the first column is a Serial No which may contain 4 digits max, the second column contains an ID which may be a 20 digit number and so on. I can use Wrap Content, but its making the page clumsy! So, my question is, is there any possibility that my fields can automatically set their width and height basing on the length of the characters.Thanks in advance! Any help will be appreciated!
When I drag a gridview into the graphical layout screen in Android Eclipse, and give it wrap content, then it fills the height of the screen with 24 placeholders.
How can I limit its length? Note this is fine when I actually run the application because my adapter adds 6 items and it isn't very long. I simple want a way of telling eclipse that in an absence of real data that it should draw something with say 6 placeholder items
I don't think it's possible to set the number of items just for the aesthetic purposes of the graphical view in xml builder. If you must do it, you could set the height to look acceptable in the XML via a literal value such as 100dp, then set the layout params for height to Wrap Content when you assign and initialize it in your onCreate(). That way, it will look the height you require in the graphical interface editor, but will wrap the number of elements you add to it when it's running on the device.
http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html
I agree this is not the most elegant solution, but it would probably work.
I'm trying to get the graph view horizontally centered inside my layout, but I'm not able to "remove" that left bar, which is actually where the "range" settings are.
This is a screenshot from the official demo app, showing this undesired effect which I'm also getting on my app.
Any ideas how to completely remove this?
Try:
plot.getGraphWidget().setMarginLeft(0);
That should actually get rid of everything on the left including the area where the range labels are currently being drawn so you may need to play with it to find the value that looks good with your range values / range font configuration.
Nick