#7 Refactored google auth code
parent
89cfedd798
commit
48f79be691
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue