#7 Refactored google auth code
parent
89cfedd798
commit
48f79be691
|
@ -57,7 +57,7 @@ public class LoginActivity extends AppCompatActivity implements
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Log.v(TAG, "Created...");
|
||||
Log.v(TAG, "created");
|
||||
|
||||
// Set up layout
|
||||
setContentView(R.layout.activity_login);
|
||||
|
@ -81,11 +81,11 @@ public class LoginActivity extends AppCompatActivity implements
|
|||
.build();
|
||||
|
||||
// Set up buttons
|
||||
SignInButton signInButton = (SignInButton) findViewById(R.id.google_sign_in_button);
|
||||
signInButton.setStyle(SignInButton.SIZE_WIDE, SignInButton.COLOR_AUTO);
|
||||
// SignInButton signInButton = (SignInButton) findViewById(R.id.login_button_google);
|
||||
// signInButton.setStyle(SignInButton.SIZE_WIDE, SignInButton.COLOR_AUTO);
|
||||
|
||||
// Button listeners
|
||||
findViewById(R.id.google_sign_in_button).setOnClickListener(this);
|
||||
findViewById(R.id.login_button_google).setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -265,7 +265,7 @@ public class LoginActivity extends AppCompatActivity implements
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.google_sign_in_button:
|
||||
case R.id.login_button_google:
|
||||
signIn();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
|
||||
<!-- Google -->
|
||||
<ImageButton
|
||||
android:id="@+id/login_button_google"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -75,6 +76,7 @@
|
|||
|
||||
<!-- Facebook -->
|
||||
<ImageButton
|
||||
android:id="@+id/login_button_facebook"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -85,6 +87,7 @@
|
|||
|
||||
<!-- Twitter -->
|
||||
<ImageButton
|
||||
android:id="@+id/login_button_twitter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
|
|
Loading…
Reference in New Issue