title: Custom Facebook Login Button Android
body: <p>To Creating a facebook login button, I followed facebook documentation and after that my login is working perfectly but I want to customize my button for that I tried lot things but nothing working.</p>
  
  <p><strong>1) First I tried from xml like this:</strong></p>
  
  <pre><code>&lt;com.facebook.login.widget.LoginButton
          android:id="@+id/authButton"
          android:layout_width="match_parent"
          android:layout_height="45dp"
          android:layout_marginRight="30dp"
          android:layout_marginLeft="30dp"
          android:padding="10dp"
          android:layout_gravity="center_horizontal"
          android:layout_marginTop="30dp"
          android:textColor="@color/white"
          android:background="@drawable/fbbutton_state"
          android:textSize="15sp"
          android:text="Facebook"
          /&gt;
  </code></pre>
  
  <p><strong>2) Created custom class and extended LoginButton.</strong></p>
  
  <pre><code>public class CustomLoginButton extends LoginButton {
  
  public CustomLoginButton(Context context, AttributeSet attrs) {
      super(context, attrs)
       this.setBackgroundColor(R.color.com_facebook_likeboxcountview_border_color);
      this.setCompoundDrawablesWithIntrinsicBounds(R.drawable.my_own_icon, 0, 0, 0);
      this.setText("Facebook");
  }
  
  }
  </code></pre>
  
  <p>in this icon color changed but still text .</p>
  
  <p><strong>3)And finally I tried in facebook sdk, I changed strings and style, it must work but no result</strong></p>
  
  <pre><code>&lt;string name="com_facebook_loginview_log_in_button"&gt;Log in via Facebook&lt;/string&gt; 
  
  
  &lt;style name="com_facebook_loginview_default_style" parent="@android:style/Widget.Button"&gt;
          &lt;item name="android:layout_width"&gt;wrap_content&lt;/item&gt;
          &lt;item name="android:layout_height"&gt;45dp&lt;/item&gt;
          &lt;item name="android:background"&gt;@drawable/com_facebook_button_blue&lt;/item&gt;
          &lt;item name="android:textColor"&gt;@color/com_facebook_loginview_text_color&lt;/item&gt;
          &lt;item name="android:textSize"&gt;@dimen/com_facebook_loginview_text_size&lt;/item&gt;
          &lt;item name="android:textStyle"&gt;bold&lt;/item&gt;
          &lt;item name="android:paddingLeft"&gt;@dimen/com_facebook_loginview_padding_left&lt;/item&gt;
          &lt;item name="android:gravity"&gt;center&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>One difference I found in my login button and common SO login buttons is they are like: <code>&lt;com.facebook.widget.LoginButton</code> and mine like this: <code>&lt;com.facebook.login.widget.LoginButton</code>   but I think facebook upgraded this thing.</p>