[android-developers] Use Editexts in NestedScrollView preventing NestedView to Scroll

2015-07-15 Thread Himanshu Mistri
I have following Layout which use NestedScrollView as i want Scrolling 
Technique of Material Design so i have to use NestedScrollview

android.support.v4.widget.NestedScrollView
android:layout_width=match_parent
android:layout_height=match_parent
android:background=@color/app_base_color
app:layout_behavior=@string/appbar_scrolling_view_behavior
android:id=@+id/nested_view_editprofile
android:focusable=true




LinearLayout
android:layout_width=match_parent
android:layout_height=match_parent
android:orientation=vertical


LinearLayout
android:layout_width=match_parent
android:layout_height=wrap_content
android:background=@color/app_base_color
android:weightSum=3

LinearLayout
android:layout_width=match_parent
android:layout_height=match_parent
android:layout_weight=1

TextView
android:id=@+id/txtvEditProfileUserName
android:layout_width=match_parent
android:layout_height=wrap_content
android:layout_weight=0.7
android:gravity=center
android:paddingBottom=10dp
android:paddingLeft=3dp
android:paddingTop=10dp
android:textColor=@color/orange /

/LinearLayout

LinearLayout
android:layout_width=match_parent
android:layout_height=match_parent
android:layout_weight=0.85
android:orientation=vertical

LinearLayout
android:layout_width=match_parent
android:layout_height=wrap_content
android:orientation=horizontal
android:paddingBottom=5dp
android:paddingTop=10dp
android:weightSum=2

TextView
android:id=@+id/txvEditProfileEntertainer
android:layout_width=match_parent
android:layout_height=wrap_content
android:layout_weight=1.3
android:gravity=right
android:text=0
android:textColor=@color/orange /

TextView
android:layout_width=match_parent
android:layout_height=wrap_content
android:layout_weight=0.7
android:paddingLeft=3dp
android:singleLine=true
android:text=Entertainers
android:textColor=@color/cement_grey /

/LinearLayout

LinearLayout
android:layout_width=match_parent
android:layout_height=wrap_content
android:orientation=horizontal
android:paddingBottom=10dp
android:paddingTop=5dp
android:weightSum=2

TextView
android:id=@+id/txvEditProfileSpectator
android:layout_width=match_parent
android:layout_height=wrap_content
android:layout_weight=1.3
android:gravity=right
android:text=0
android:textColor=@color/orange /

TextView
android:layout_width=match_parent
android:layout_height=wrap_content
android:layout_weight=0.7
android:paddingLeft=3dp
android:singleLine=true
android:text=Spectators
android:textColor=@color/cement_grey /

/LinearLayout

/LinearLayout

LinearLayout
android:layout_width=match_parent
android:layout_height=match_parent
android:layout_weight=1.15
android:gravity=center
android:orientation=vertical

ImageButton
android:id=@+id/imgbtnEditProfileSpactate
android:layout_width=wrap_content
android:layout_height=wrap_content
android:background=@android:color/transparent
android:paddingBottom=5dp

[android-developers] Re: How to stop ActionBar getting focus

2015-07-15 Thread Simon Giddings
Ok, here is my solution ...

When the pedal keyEvent is processed in dispatchKeyEvent, send a message to 
the same activity to call requestFocus on the main content view.

Le mardi 14 juillet 2015 17:29:49 UTC+2, Simon Giddings a écrit :

 I have integrated the use of Bluetooth pedals, which declare themselves as 
 being a keyboard.

 When the pedal is pressed, my activity gets the keypress and, in 
 dispatchKeyEvent, I return true to indicate that I have consumed the 
 event.
 However, the ActionBar is still responding to the keypress by highlighting 
 the title button - I have already set setDisplayHomeAsUpEnabled as true.

 I then captured the corresponding area in the action bar and removed 
 focusable like this -
 int iActionBarTitle = 
 getResources().getIdentifier(action_bar_title, id, android);
 View v = findViewById(iActionBarTitle);
 v = (View)v.getParent().getParent();
 v.setFocusable(false);

 However, this just moved the focus to the first action item.

 I do not want to do a lot of hacking so as to avoid further difficulties 
 down the line.
 Not sure of how I can overcome this problem correctly.

 Can anyone guide me with this ?


-- 
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.