[android-developers] Re: ImageButton onClick or onKeyDown?
On Mar 28, 3:02 pm, Paolo wrote: > is it possible to use onKeyDown() for an ImageButton instead of > onClick() to capture the user's click on this imagebutton? > > what's the difference? Difference #1: Press (->onKeyDown()), hold a while then release (->onClick()). Difference #2: Press (->onKeyDown()), drag then release (no onClick()). -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
[android-developers] Re: howto extend LinearLayout?
I finally foudn the answer myself. The parameters to layout are relative to the parent and should hence not be passed down to the children. The following works fine: @Override protected void onLayout( boolean changed, int l, int t, int r, int b ) { int len = getChildCount(); int w = ((r-l)-(len-1)*PADDING)/len; int pos = 0; for( int i=0; ihttp://groups.google.com/group/android-developers?hl=en
[android-developers] howto extend LinearLayout?
Hi there, I'm am trying to learn how to create LayoutGroups. For a start, I created MyLinearLayout which is supposed to force all children into same width (yes, there is layout_weight, but that's beside the point :-) However, the children won't show up. What am I missing here? public class MyLinearLayout extends LinearLayout { public MyLinearLayout(Context context) { super(context); } public MyLinearLayout(Context context, AttributeSet attrs) { super(context, attrs); } private final static int PADDING = 2; @Override protected void onLayout( boolean changed, int l, int t, int r, int b ) { //super.onLayout( changed, l, t, r, b ); //if( !changed ) return; int len = getChildCount(); int w = ((r-l)-(len-1)*PADDING)/len; int pos = l; for( int i=0; ihttp://groups.google.com/group/android-developers?hl=en
[android-developers] Re: TableLayout, Rotating
While I am at it: How can I enforce equal width on table columns? Is there a way to do in in layout/*.xml or do I have to render the content of my table programatically (getting screen dimensions, and creating the content of the table calls with computed width) Regards, Holger -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] TableLayout, Rotating
Hi there, I am new to Android development and I stumbled across two questions: 1.) How can I span a TableCell across two rows in order to achieve the following Layout (XX shall be one cell)? 1 2 X X 3 4 5 6 X X 7 8 9 0 1 2 3 4 2.) The emulator switches properly from portrait to landscape via (NumPad+Home) but it does not switch back. Is this a bug in the emulator? The app has no special code regarding screen changes beside two layout*/main.xml files. (Android 2.1 in Eclipse Linux/i386) Regards, Holger -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en