forked from organicmaps/organicmaps
[android] Customized the google button in auth dialog
This commit is contained in:
parent
d2b81dc0fc
commit
b08f15ad6a
8 changed files with 28 additions and 7 deletions
BIN
android/res/drawable-hdpi/ic_google.png
Normal file
BIN
android/res/drawable-hdpi/ic_google.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
android/res/drawable-mdpi/ic_google.png
Normal file
BIN
android/res/drawable-mdpi/ic_google.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
BIN
android/res/drawable-xhdpi/ic_google.png
Normal file
BIN
android/res/drawable-xhdpi/ic_google.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
BIN
android/res/drawable-xxhdpi/ic_google.png
Normal file
BIN
android/res/drawable-xxhdpi/ic_google.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
BIN
android/res/drawable-xxxhdpi/ic_google.png
Normal file
BIN
android/res/drawable-xxxhdpi/ic_google.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4 KiB |
6
android/res/drawable/button_transparent_with_border.xml
Normal file
6
android/res/drawable/button_transparent_with_border.xml
Normal 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>
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue