Focusable

Difference between focusable and focusableInTouchMode?

独自空忆成欢 提交于 2019-12-18 10:08:51
问题 I want to know the actual difference between them... When should each be used, how should each be used, and in which situations is each helpful? Give some examples and explain them in detail. 回答1: It is explained in the Android Developers Blog: http://android-developers.blogspot.co.at/2008/12/touch-mode.html The following quotes should make it clear: By itself, the touch mode is something very easy to understand as it simply indicates whether the last user interaction was performed with the

Android EditText text entry causing scroll

孤街浪徒 提交于 2019-12-14 02:35:35
问题 This is a similar problem to what I posted earlier - but different. I have a HorizontalScrollView which contains 3 "pages". When my app starts up, I tell the scrollview to scroll one screen width so that the middle page is always displayed first. See below: +------+------+------+ + ET + + + +------+ + + + + + + + + + + +------+------+------+ ^ ^ ET above represents an EditText view. In order to stop my scrollview from automatically scrolling to the leftmost page, I call setFocusable(false) on

KeyListener isn't working?

给你一囗甜甜゛ 提交于 2019-12-11 11:05:01
问题 Ok, so I have this key listener for my game and it isn't working but when I made a new project just to test does it work at all for me it did? So here's some code of my game: public class GameKeyListener implements KeyListener { private void pressMainWeapon() { Constants.MAIN_WEAPON_PRESSED = Constants.MAIN_WEAPON_PRESSED ? true : false; } private void pressSecondaryWeapon() { Constants.SECONDARY_WEAPON_PRESSED = Constants.SECONDARY_WEAPON_PRESSED ? true : false; } private void

How to setFocusable true after setting it to false?

橙三吉。 提交于 2019-12-10 23:32:17
问题 here is my code: mEditText.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View view, int i, KeyEvent keyEvent) { mEditText.setFocusable(false); mEditText.setCursorVisible(false); } }); Now i want to enter some text into edittext.for which i have to setFocuable to true.i already tried to setFocusable(true) in onClick , setOnClickListener , setOnTouchListener but nothing is working...help me guys;(... 回答1: after searching for hours.i came up with solution- Xml Code:

Android layout - ImageView focused, but doesn't show anything on screen (no highlight)

元气小坏坏 提交于 2019-12-08 06:45:38
问题 If I set my ImageView to be both clickable and focusable, it works, but I have no way to tell which image is focused. What's the best way to get it to draw an orange border around the view so the user knows it's currently in focus? I tried dropping it in a LinearLayout and setting that to be focusable and clickable instead, but didn't have any luck. Even when I put a margin on it, there's nothing to indicate that it was selected. 回答1: You can use a drawable with a selector as the background.

AWTK 控件焦点相关问题

。_饼干妹妹 提交于 2019-12-05 02:34:28
控件焦点相关问题 一、启用焦点停留 (tab stop) 除了 edit 控件外,其它控件如果需要焦点停留功能,可以指定控件的 focusable 属性为 true 来实现。 在 XML 中,可以这样指定: <button ... focusable="true"/> 在 C 代码中,可以这样指定: widget_set_prop_bool(widget, WIDGET_PROP_FOCUSABLE, TRUE); 如果指定了 fucusable 属性为 true,请确保控件的 style 中定义了 focused 状态的数据,否则会因为 focused 状态没有 style 数据而无法显示。如: <style name="default" border_color="#a0a0a0" text_color="black"> <normal bg_color="#f0f0f0" /> <pressed bg_color="#c0c0c0" x_offset="1" y_offset="1"/> <over bg_color="#e0e0e0" /> <focused bg_color="#e0e0e0" /> <disable bg_color="gray" text_color="#d0d0d0" /> </style> <focused bg_color="#e0e0e0" /

Making a single component full screen

眉间皱痕 提交于 2019-12-01 13:25:28
I'm trying to make a JPanel go full screen when you click a button, and back again when you press escape. I've managed to get the window to go full screen, but because of the whole thing about adding components removing them from other containers, I end up with a blank JPanel. I chose to make a separate JFrame to render full screen, the class of which is as follows (note that this is an inner class, so myPanel refers to a panel that already exists in MyJFrame): public class FullScreen extends JFrame { private static final long serialVersionUID = 1L; private GraphicsDevice device; private

Dialog/DialogFragment宽度高度修改/全屏,自定义样式

妖精的绣舞 提交于 2019-11-30 12:57:17
其实Dialog, DialogFragment, Activity 能看到的界面,都是基于Window显示的; 也就是修改样式, 都是在修改window的样式; 所以,本质上方法都是一样的,唯一不同的就是获取window对象的方法不一样; Dialog 通过, getWindow() 获取; Activity 也是通过, getWindow() 获取; DialogFragment 则是getDialog().getWindow()获取; 有了window对象, 就可以开始本文了: 1:修改Dialog中window宽度和高度 //public static final int FILL_PARENT = -1; //public static final int MATCH_PARENT = -1; //public static final int WRAP_CONTENT = -2; dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));//注意此处 dialog.setContentView(textView, new ViewGroup.LayoutParams(-2, -2)); dialog.getWindow().setLayout(-1, -2);/

Difference between focusable and focusableInTouchMode?

十年热恋 提交于 2019-11-29 20:07:11
I want to know the actual difference between them... When should each be used, how should each be used, and in which situations is each helpful? Give some examples and explain them in detail. It is explained in the Android Developers Blog: http://android-developers.blogspot.co.at/2008/12/touch-mode.html The following quotes should make it clear: By itself, the touch mode is something very easy to understand as it simply indicates whether the last user interaction was performed with the touch screen. For example, if you are using a G1 phone, selecting a widget with the trackball will take you

focusable row inside table android

时光总嘲笑我的痴心妄想 提交于 2019-11-27 08:09:34
i have in xml a ScrollView which includes one TableLayout. My question is if it's possible to have a focusable row every time i click on it. Here is my xml code: <ScrollView android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TableLayout android:id="@+id/table2" android:layout_width="wrap_content" android:layout_height="wrap_content" > <TableRow> <RelativeLayout android:id="@+id/rowlayout" android:layout_width="wrap_content" android:layout_height="fill_parent" android:background="@drawable/rowbackground2" > <ImageView android:id="@+id/icon"