I am programming a dictionary which has Instant lookup function. I wanna when I selected text and copy it, a popup is displayed (display this text and meaning of it). Firstly, I wanna display selected text.
Any idea and advice.
You can view this apps: QuickDict
I really like it,
If you are using API level 11 (3.0) or above, then you can use addPrimaryClipChangedListener which is documented click here and there is some example usage click here.
Related
[Question about android style]
I was wondering what is a good way to make clear that you can click on a telephone number and immediately call someone without copying & pasting the phone number.
How can I persuade a user to click on a phone number ?
ps: my question is not about how to call someone when clicking on a phone number, but about how to style the phone number to show that it is clickable.
Maybe putting small phone icon beside number would be clear for user.
Usually when the number is underlined like a HTML link, they understand right away.
TextView numberText = (TextView) findViewById(R.id.event_number);
numberText.setText("123-456-7890");
Linkify.addLinks(numberText, Linkify.PHONE_NUMBERS);
Checked the official documentation but there is no such standard defined for the same. So it is now upto you.
Underlining the number is fine but does not go well with text blocks.
Using a different font color for the number will suit well. Using Blue is the trend;-)
But in the end it is about the design and color scheme of your app too. Seeing a number in different text color is enough a indicator that you can use it as a link
My Android app contains a custom slider control based on the SeekBar, and I want to attach a custom text phrase to my control to explain its use for Accessibility.
I have done this successfully using View.setContentDescription(text), and TalkBack correctly speaks the phrase when I request focus on my slider control from Activity.onCreate.
So far, so good. However, when I touch the control, which I believe sets the AccessibilityFocus on my Android API 16 test device, extra words are being added to the spoken phrase, i.e. '...seek control. 0 per cent'. I want to remove these additional words.
I have tried to eliminate them using event.getText().clear() in View.onInitializeAccessibilityEvent(event) without success. Echoing the event to LogCat reports the correct phrase in event.contentDescription and no entries in event.text, but the extra words appear both in the audio output from the device hardware and in the on-screen debug text displayed by Menu->Settings->Accessibility->TalkBack->Settings->Developer Settings->Display Speech Output.
Please can anyone suggest where the extra words are being added, and how to eliminate them?
Any constructive suggestions would be welcomed. Thanks.
Update
I can see that some Explore By Touch (initial single-tap) event on my custom control does not pass through either its onInitializeAccessibilityEvent or dispatchPopulateAccessibilityEvent methods as I am deliberately calling event.setContentDescription(null). Despite this, there is an AccessibilityEvent being generated with my custom control's ContentDescription, set in Activity.onCreate in code, plus the extra words I'm trying to eliminate.
I've also set an AccessibilityDelegate on my custom control's parent ViewGroup to give visibility of its onRequestSendAccessibilityEvent calls. This confirms that no event containing my ContentDescription is passing through.
This is very puzzling, and happens on both the emulator and real hardware with API 16. Any ideas?
You also need to override http://developer.android.com/reference/android/view/View.html#onInitializeAccessibilityNodeInfo(android.view.accessibility.AccessibilityNodeInfo)
and set the contentDescription there.
If you want to remove the 0%, I would try to change the class in AccessibilityNodeInfo/AccessibilityEvent:
http://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html#setClassName(java.lang.CharSequence)
I believe that this is a bug in TalkBack, and have raised Google Eyes-Free issue #375, including example code.
Update: Google have now archived this. Link moved to: http://code.google.com/archive/p/eyes-free/issues/375
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
I am developing a chat application. And i want to have pop up window with smileys in it so that when user clicks on one of smileys it will be inserted to edit text box.
Does anyone know sample code for it?
I wanted code for both pop up window and code to embbed smileys in an application.
(same as in case of yahoo which has smileys.how to code for it and how to store them in database and all)
Take a look at the PopupWindow. You'll want to use it in similar fashion to this tutorial here: http://www.mobilemancer.com/2011/01/08/popup-window-in-android/.
I would populate it with your drawable images, and then attach to each image you create a onClickListener that would insert the smiley into whatever text window your using.
I'm not an Android expert, and I'm still learning myself, but this is one approach I would investigate.
i am using default android spinner for drop down selection from multiple items array ,but i see the ui in Iphone it looks cool then android then is it possible to make like iphone ui picker view in android means a dropdown would be open with bottom to top animation with a "done" button on upper side of picker view and when i choose one and press "done" then that item should be selected as in iphone...
i think android must have this feature bcoz android is more better then Iphone as in cost and newer version of android capture the whole market ,
so pls any one help me..
thanks in advance
Check the following: http://android-devblog.blogspot.com/2010/05/wheel-ui-contol-backgrounds.html
Introduction to the Wheel control
The Wheel control layouts
Scrolling the wheel control
Ideas for the future
Do not forget to check "See Also"
Usually they use Spinner in Android
If you want a wheel thingy like in iPhone use this