[android] Customized the google button in auth dialog

This commit is contained in:
Александр Зацепин 2018-04-15 13:45:49 +03:00 committed by Arsentiy Milchakov
parent d2b81dc0fc
commit b08f15ad6a
8 changed files with 28 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/button_small_corner_radius"/>
<solid android:color="@android:color/transparent"/>
<stroke android:color="@color/divider" android:width="@dimen/divider_width"/>
</shape>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
@ -20,19 +21,33 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half_plus_eight"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:text="@string/profile_authorization_message"
/>
<com.google.android.gms.common.SignInButton
android:text="@string/profile_authorization_message"/>
<TextView
android:id="@+id/google_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?clickableBackground"
android:background="@drawable/button_transparent_with_border"
android:drawableStart="@drawable/ic_google"
android:drawableLeft="@drawable/ic_google"
android:paddingLeft="@dimen/margin_half_plus"
android:paddingStart="@dimen/margin_half_plus"
android:paddingRight="@dimen/margin_base_plus"
android:paddingEnd="@dimen/margin_base_plus"
android:textAppearance="@style/MwmTextAppearance.Body3.Primary"
android:fontFamily="@string/robotoMedium"
android:text="@string/google"
android:gravity="center"
android:minHeight="@dimen/height_primary_button"
android:layout_marginTop="@dimen/margin_base"/>
android:layout_marginTop="@dimen/margin_base"
tools:targetApi="jelly_bean"/>
<com.facebook.login.widget.LoginButton
xmlns:fb="http://schemas.android.com/apk/res-auto"
android:id="@+id/facebook_button"
android:layout_width="match_parent"
android:layout_height="@dimen/height_primary_button"
android:layout_height="wrap_content"
android:minHeight="@dimen/height_primary_button"
android:foreground="?clickableBackground"
android:layout_marginTop="@dimen/margin_base"
android:textSize="@dimen/text_size_body_3"
fb:com_facebook_login_text="@string/facebook"
@ -52,6 +67,7 @@
android:textAppearance="@style/MwmTextAppearance.Button"
android:textColor="?accentButtonTextColor"
android:background="?accentButtonBackground"
android:foreground="?clickableBackground"
android:gravity="center"
android:text="@string/phone_number"/>
</LinearLayout>

View file

@ -22,7 +22,6 @@ import com.facebook.login.widget.LoginButton;
import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.common.SignInButton;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.PrivateVariables;
import com.mapswithme.maps.R;
@ -117,7 +116,7 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment
{
View view = inflater.inflate(R.layout.fragment_auth_passport_dialog, container, false);
SignInButton googleButton = view.findViewById(R.id.google_button);
View googleButton = view.findViewById(R.id.google_button);
googleButton.setOnClickListener(mGoogleClickListener);
LoginButton facebookButton = view.findViewById(R.id.facebook_button);