#7 Refactored google auth code

master
Keith Irwin 2017-04-21 18:34:40 -04:00
parent 89cfedd798
commit 48f79be691
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
2 changed files with 8 additions and 5 deletions

View File

@ -57,7 +57,7 @@ public class LoginActivity extends AppCompatActivity implements
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Log.v(TAG, "Created..."); Log.v(TAG, "created");
// Set up layout // Set up layout
setContentView(R.layout.activity_login); setContentView(R.layout.activity_login);
@ -81,11 +81,11 @@ public class LoginActivity extends AppCompatActivity implements
.build(); .build();
// Set up buttons // Set up buttons
SignInButton signInButton = (SignInButton) findViewById(R.id.google_sign_in_button); // SignInButton signInButton = (SignInButton) findViewById(R.id.login_button_google);
signInButton.setStyle(SignInButton.SIZE_WIDE, SignInButton.COLOR_AUTO); // signInButton.setStyle(SignInButton.SIZE_WIDE, SignInButton.COLOR_AUTO);
// Button listeners // Button listeners
findViewById(R.id.google_sign_in_button).setOnClickListener(this); findViewById(R.id.login_button_google).setOnClickListener(this);
} }
@Override @Override
@ -265,7 +265,7 @@ public class LoginActivity extends AppCompatActivity implements
@Override @Override
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { switch (v.getId()) {
case R.id.google_sign_in_button: case R.id.login_button_google:
signIn(); signIn();
break; break;
} }

View File

@ -65,6 +65,7 @@
<!-- Google --> <!-- Google -->
<ImageButton <ImageButton
android:id="@+id/login_button_google"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -75,6 +76,7 @@
<!-- Facebook --> <!-- Facebook -->
<ImageButton <ImageButton
android:id="@+id/login_button_facebook"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -85,6 +87,7 @@
<!-- Twitter --> <!-- Twitter -->
<ImageButton <ImageButton
android:id="@+id/login_button_twitter"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="match_parent" android:layout_height="match_parent"