How do you toggle between Dimens/Strings id vs their actual value? - android

This question is kind of difficult to put in words, but I want to know how to toggle between the dimens/strings id's vs their actual values. The IDE is IntelliJ. An image should make it a bit more clear what I'm asking:
Upper image is actual values, lower image is with full id displayed. If you click on the 60dp, it will then display the full id. I'm interested in how to then revert it back to the original 60dp. I've spent some time trying to find it online and but couldn't find anything. I know that I could always just do a "go to declaration" on the id and find the actual value in strings.xml, but it would be significantly faster to just read it on the spot. Any other useful IntelliJ/Android tips someone could think of would be welcome too. If you could help me I'd be very happy.

On Windows press Ctrl+> to both expand and collapse when the cursor is within the value/code you want to perform Folding on or just use Ctrl++ or Ctrl+-.
This is called code folding and can also be found under the contextual menu (when you right click on the code) then Folding (See image below)

Related

calabash-android: click on image by name

Is that possible to click on image to open the dialog box. because I want to open dialog box by clicking on image which has only name, there is no other property associated with that image.
To get this issue I tried with x,y co-ordinate method as well, but again the issue is when I changed the phones the screen size matters. so I did not able to use that too. other than this I did not get any other option to resolve the issue. I do not get much about this on web.
Does anybody know the solution, that will be helpful?
Kind Regards,
Vaibhav
I'm not really sure what you mean by 'has only name', but if there is no other way to locate the image view, you could use the index.
To find the index,
query "* ImageView" and see which one matches.
Then you can interact with it like so:
tap "ImageView index:0" #or whatever index
Note: If it was actually ID'd somehow (e.g. had a ContentDescription), you could do
tap "ImageView marked:'<whatever ID>'"

How to hide saved keyword lists from SearchView?

As you can see below, whenever I am about to enter something to SearchView, it displays a suggested list of keywords. Actually these are the saved keywords I entered long time ago.
On Nexus 4, I see this list. But on Samsung Galaxy series, the list doesn't show up.
How can I make sure that the list doesn't show up?
I read the doc here
http://developer.android.com/reference/android/widget/SearchView.html
but couldn't find a method like setSuggestionEnabled() or so..
Any suggestions? Thanks!
You need to create a SearchRecentSuggestionsProvider, the Android documentation describes how to do it, it is pretty fast to setup:
http://developer.android.com/guide/topics/search/adding-recent-query-suggestions.html
They also describe how to add the possibility to clear the history.
EDIT:
From the documentation:
Prevent the suggestion from being copied into a shortcut at all.
Provide a value of SUGGEST_NEVER_MAKE_SHORTCUT in the SUGGEST_COLUMN_SHORTCUT_ID column. In this case, the suggestion is never copied into a shortcut. This should only be necessary if you absolutely do not want the previously copied suggestion to appear. (Recall that if you provide a normal value for the column, then the suggestion shortcut appears only until the refresh query returns.)
From here: http://developer.android.com/guide/topics/search/adding-custom-suggestions.html#ManagingShortcuts

xml for dropdown text

I have used this forum when I didn't know how to do something, but now I have decided to begin participating in it.
I would like to know how could I do a dropdown text (maybe it has a specific name and that's why I don't find any results on the internet). I mean, I have some tags in the screen (About, Company, Contact, ...). Each of these tags has a down arrow on the right side, and when I click it, it has to display (and hide if it's clicked again).
Here are the links with the images of what I want to do.
http://i45.tinypic.com/4fzoso.png
http://i47.tinypic.com/2u5886q.png
Thank you in advance!
You should use an ExpandableListView component.
There is a tutorial for it here.
Finally I did it with ImageViews and TextViews using the property android:visibility. Now that it's a static version is working properly. I hope that it continues working well when taking the information from the DB

Navigating Textviews using arrow keys

My application has a simple 'About' box.
It has a few clickable TextViews (email addresses, phone nos, addresses) all contained within a relative layout within a ScrollView (To accommodate low res screens).
The device I am testing with (Motorola Charm O.S ver 2.1 update 1) has a regular QWERTY keyboard. The problem I am facing is with the use of the arrow keys.
I want the cursor to move predictably from one clickable field to the next and this is where I need help. On the fields that don't need focus I have set the android:cursorVisible="false".I tried using the android:nextFocus* properties but still don't get the desired behavior.
The cursor gets stuck in the first field and overall the behavior is a bit unpredictable. Any ideas on how to get this done. Right now trapping the keys using code seems to be the only option.
TextView.setMovementMethod(LinkMovementMethod.getInstance())
The documentation is a little terse but it's basically what you are looking for.

numeric choice field:How to let the user set a value by incrementing/decrementing the displayed value

I have a range say,1-100 and i want the user to select a value from this range.Ofcourse showing this with a spinner will be awful.I want to use the functionality of date widget,where we can pick a date by pressing a +/- sign,the longer the press ,higher the iteration speed.
I found numberpicker.java that has the code the date widget uses to get this functionality, but do i have to paste that entire code to achieve this functionality!
Here is a tutorial on how to pull out NumberPicker; I've followed it myself: http://www.quietlycoding.com/?p=5
I found numberpicker.java that has the
code the date widget uses to get this
functionality, but do i have to paste
that entire code to achieve this
functionality!
Unfortunately, yes, plus perhaps some resources as well (I have not looked at that code recently). I am not aware of anyone who has pulled that out to make a reusable component, and it is not a widget in the SDK.
Sorry!

Categories

Resources