Layout Google Sign In Button - Android

前端 未结 3 560
难免孤独
难免孤独 2021-01-03 04:54

I\'m searching everywhere and not finding what I want, I\'m starting to think that this is impossible.

Here\'s the question: I have a google button for sign in, it\'

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-03 05:20

    There's no need to use Google Sign-In button, if it doesn't fit in your layout. You can simply create your own Button with your own design and in OnClick method just create Google sign in intent.

    Button myGoogleBtn = (Button) findViewById(R.id.loginGoogle);
    myGoogleBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
           Intent signInIntent = mGoogleSignInClient.getSignInIntent();
           startActivityForResult(signInIntent, RC_SIGN_IN); 
        }
    });
    

提交回复
热议问题