[android-developers] Event passing to sibling on clicking a view
I have a simple LinearLayout(horizontal) with 3 TextViews. The background of these TextViews are set to a drawable that has two states, state_pressed and default. I simply change the background of each TextView to red on state_pressed. But when i click one TextView, its click listener is invoked but background of all 3 changes to red. This is happening on Android 2.x and working fine on Android 4.0+. LinearLayout android:id=@+id/back android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=horizontal android:paddingLeft=@dimen/swipe_list_leftoffest android:descendantFocusability=blocksDescendants android:background=@color/list_swipe_back android:clickable=false android:focusable=false android:focusableInTouchMode=false android:weightSum=3 android:tag=back TextView android:layout_width=wrap_content android:layout_height=wrap_content android:textSize=14sp android:clickable=true android:layout_weight=1 android:gravity=center android:id=@+id/amenities_view android:padding=@dimen/padding_large android:background=@drawable/swipe_view_background android:drawablePadding=@dimen/padding_large android:textColor=@color/white android:text=@string/amenities_text android:drawableTop=@drawable/ic_amenities / TextView android:layout_width=wrap_content android:layout_height=wrap_content android:textSize=14sp android:layout_weight=1 android:clickable=true android:gravity=center android:ellipsize=end android:singleLine=true android:id=@+id/cancpolicy_view android:padding=@dimen/padding_large android:background=@drawable/swipe_view_background android:drawablePadding=@dimen/padding_large android:textColor=@color/white android:text=@string/canc_policy_text android:drawableTop=@drawable/ic_cancellation_policy / TextView android:layout_width=wrap_content android:layout_height=wrap_content android:textSize=14sp android:layout_weight=1 android:gravity=center android:clickable=true android:padding=@dimen/padding_large android:id=@+id/reviews_view android:background=@drawable/swipe_view_background android:drawablePadding=@dimen/padding_large android:textColor=@color/white android:text=@string/reviews_text android:drawableTop=@drawable/ic_reviews / /LinearLayout Tried putting focusable and focusableInTouchMode false for each of the TextViews, but that didnt help. -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] indoor maps
hi all, i am exploring to do indoor maps in my android app. i am ok if it does not sense any magnetic or electric devices. what i am interested in is, create an indoor map (such as a an office space with cubicles and conference rooms ) where all sections are identifiable through some unique coordinate and show navigation way programmatically i see that qgis does it , but how can that be programmed in android ? any other apps or tools which does not cost me should be good. ialso saw indoor atlas, but that saves data in cloud and hence am not comf Thanks and regards jagat -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Event passing to sibling on clicking a view
Hi, works fine for me on Genymotion Google Nexus S (Android 2.3.7). Thank you, Alex On Thursday, December 11, 2014 10:03:27 AM UTC+1, Rahul Raja wrote: I have a simple LinearLayout(horizontal) with 3 TextViews. The background of these TextViews are set to a drawable that has two states, state_pressed and default. I simply change the background of each TextView to red on state_pressed. But when i click one TextView, its click listener is invoked but background of all 3 changes to red. This is happening on Android 2.x and working fine on Android 4.0+. LinearLayout android:id=@+id/back android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=horizontal android:paddingLeft=@dimen/swipe_list_leftoffest android:descendantFocusability=blocksDescendants android:background=@color/list_swipe_back android:clickable=false android:focusable=false android:focusableInTouchMode=false android:weightSum=3 android:tag=back TextView android:layout_width=wrap_content android:layout_height=wrap_content android:textSize=14sp android:clickable=true android:layout_weight=1 android:gravity=center android:id=@+id/amenities_view android:padding=@dimen/padding_large android:background=@drawable/swipe_view_background android:drawablePadding=@dimen/padding_large android:textColor=@color/white android:text=@string/amenities_text android:drawableTop=@drawable/ic_amenities / TextView android:layout_width=wrap_content android:layout_height=wrap_content android:textSize=14sp android:layout_weight=1 android:clickable=true android:gravity=center android:ellipsize=end android:singleLine=true android:id=@+id/cancpolicy_view android:padding=@dimen/padding_large android:background=@drawable/swipe_view_background android:drawablePadding=@dimen/padding_large android:textColor=@color/white android:text=@string/canc_policy_text android:drawableTop=@drawable/ic_cancellation_policy / TextView android:layout_width=wrap_content android:layout_height=wrap_content android:textSize=14sp android:layout_weight=1 android:gravity=center android:clickable=true android:padding=@dimen/padding_large android:id=@+id/reviews_view android:background=@drawable/swipe_view_background android:drawablePadding=@dimen/padding_large android:textColor=@color/white android:text=@string/reviews_text android:drawableTop=@drawable/ic_reviews / /LinearLayout Tried putting focusable and focusableInTouchMode false for each of the TextViews, but that didnt help. -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Yet another case of not getting BTLE notifications
I figured this out and hope some of you are going to laugh. I did not understand the way this all works. Keep in mind that I already implemented all of this for iOS, so some of my thinking is influenced by the way iOS does things. On iOS the same callback is used for the response to a read request and the response to an update notification for data. Getting a change in a characteristic value is handled the same. Any time it changes whether that is from a Read or a Notification it comes in the same iOS callback. I assumed Android was the same way. So I was expecting to get my data update in the onCharacteristicRead response. Those who have experience with all of this probably know right off that notification updates come in the onCharacteristicChanged callback. Once I added that everything is now working. On Mon, Dec 8, 2014 at 11:13 PM, Tony Pitman t...@shatalmic.com wrote: I have read several posting on this same thing and tried all of the suggestions. I am able to discover and connect to my BTLE device (it is actually an iOS device). My Android device is 4.4 and has BTLE. After I connect and get all the services and characteristics I try to read the one I am using and it works fine. If I update the value on the iOS device and do another read I get the new value as I would expect. I use this code: protected static final UUID CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID = UUID.fromString( 2902--1000-8000-00805f9b34fb); if (gatt.setCharacteristicNotification(characteristic, true)) { BluetoothGattDescriptor descriptor = characteristic.getDescriptor(CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID); if (descriptor != null) { descriptor.setValue(enabled ? BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE); if (gatt.writeDescriptor(descriptor)) { // success } else { // failed } } } It reaches the // success line so it seems to be doing what I want I just never get the notifications. I know that this characteristic I am trying to subscribe to has the notification flag set on it. I do that in the iOS application. Unless something is going wrong there I guess. How can I debug this to figure out what is going on? Should I get something in the onDescriptor callback maybe? Where do I look and how do I diagnose? -- 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 --- You received this message because you are subscribed to a topic in the Google Groups Android Developers group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-developers/qwALaq3SwuQ/unsubscribe . To unsubscribe from this group and all its topics, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Yet another case of not getting BTLE notifications
I figured this out and hope some of you are going to laugh. I did not understand the way this all works. Keep in mind that I already implemented all of this for iOS, so some of my thinking is influenced by the way iOS does things. On iOS the same callback is used for the response to a read request and the response to an update notification for data. Getting a change in a characteristic value is handled the same. Any time it changes whether that is from a Read or a Notification it comes in the same iOS callback. I assumed Android was the same way. So I was expecting to get my data update in the onCharacteristicRead response. Those who have experience with all of this probably know right off that notification updates come in the onCharacteristicChanged callback. Once I added that everything is now working. On Monday, December 8, 2014 11:13:45 PM UTC-7, Tony Pitman wrote: I have read several posting on this same thing and tried all of the suggestions. I am able to discover and connect to my BTLE device (it is actually an iOS device). My Android device is 4.4 and has BTLE. After I connect and get all the services and characteristics I try to read the one I am using and it works fine. If I update the value on the iOS device and do another read I get the new value as I would expect. I use this code: protected static final UUID CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID = UUID.fromString( 2902--1000-8000-00805f9b34fb); if (gatt.setCharacteristicNotification(characteristic, true)) { BluetoothGattDescriptor descriptor = characteristic.getDescriptor(CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID); if (descriptor != null) { descriptor.setValue(enabled ? BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE); if (gatt.writeDescriptor(descriptor)) { // success } else { // failed } } } It reaches the // success line so it seems to be doing what I want I just never get the notifications. I know that this characteristic I am trying to subscribe to has the notification flag set on it. I do that in the iOS application. Unless something is going wrong there I guess. How can I debug this to figure out what is going on? Should I get something in the onDescriptor callback maybe? Where do I look and how do I diagnose? -- 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.