First Way:
<Button
android:id="@+id/btnLogin"
style="@style/btnStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/btnFacebook"
android:layout_alignRight="@+id/btnFacebook"
android:layout_below="@id/etPassword"
android:layout_centerInParent="true"
android:onClick="goHome"
android:text="Login"/>
<Button
android:id="@+id/btnFacebook"
style="@style/btnFacebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textOR"
android:layout_marginTop="10dp"
android:onClick="facebookSignUp"
android:text=" Signup with Facebook "/>
<Button
android:id="@+id/btnGooglePlus"
style="@style/btnGoogle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/btnFacebook"
android:layout_alignRight="@+id/btnFacebook"
android:layout_below="@id/btnFacebook"/>
Second Way:
<Button
android:id="@+id/btnLogin"
style="@style/btnStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/btnFacebook"
android:layout_alignRight="@id/btnFacebook"
android:layout_below="@id/etPassword"
android:layout_centerInParent="true"
android:onClick="goHome"
android:text="Login"/>
<Button
android:id="@id/btnFacebook"
style="@style/btnFacebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textOR"
android:layout_marginTop="10dp"
android:onClick="facebookSignUp"
android:text=" Signup with Facebook "/>
<Button
android:id="@+id/btnGooglePlus"
style="@style/btnGoogle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/btnFacebook"
android:layout_alignRight="@id/btnFacebook"
android:layout_below="@id/btnFacebook"/>
Third Way:
<Button
android:id="@+id/btnLogin"
style="@style/btnStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/btnFacebook"
android:layout_alignRight="@id/btnFacebook"
android:layout_below="@id/etPassword"
android:layout_centerInParent="true"
android:onClick="goHome"
android:text="Login"/>
<Button
android:id="@+id/btnFacebook"
style="@style/btnFacebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textOR"
android:layout_marginTop="10dp"
android:onClick="facebookSignUp"
android:text=" Signup with Facebook "/>
<Button
android:id="@+id/btnGooglePlus"
style="@style/btnGoogle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/btnFacebook"
android:layout_alignRight="@id/btnFacebook"
android:layout_below="@id/btnFacebook"/>
Two questions:
btnFacebook
is same. How?
Any official documentation with explanation is appreciated. Thanks In Advance :)
order would not make any difference.
As though view will be same but third way won't work because btnFacebook is not being declared before btnLogin. So compiling error will be shown. Third way will work after slight change, see going that link. For more info