Skip to content

Commit

Permalink
fix: Update prefix of IntroActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
EdricChan03 committed Dec 13, 2017
1 parent 183535a commit 23f1f5e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions app/src/main/java/com/edricchan/studybuddy/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.StringJoiner;

import static java.lang.System.out;

Expand All @@ -65,12 +66,12 @@ public class MainActivity extends AppCompatActivity implements GoogleApiClient.O
private int testInt, RC_SIGN_IN;
private FirebaseAuth mAuth;
private GoogleApiClient mGoogleApiClient;

private String userName;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
view = (View) findViewById(R.id.content);
view = (View) findViewById(R.id.todo_content);
// Declare a new thread to do a preference check
Thread t = new Thread(new Runnable() {
@Override
Expand All @@ -86,7 +87,7 @@ public void run() {
if (isFirstStart) {

// Launch app intro
final Intent i = new Intent(MainActivity.this, IntroActivity.class);
final Intent i = new Intent(MainActivity.this, MyIntroActivity.class);

runOnUiThread(new Runnable() {
@Override
Expand Down Expand Up @@ -197,8 +198,16 @@ public void onClick(View view) {
signInDialog.show();
} else {
// Logged in
// TODO: Add database
// TODO: Add firestore
Log.d("Tag", "Successfully logged in!");
String emailAddr = currentUser.getEmail();
String[] userNameDots = emailAddr.substring(0, emailAddr.lastIndexOf("@"))
.split(".");
StringJoiner joiner = new StringJoiner("");
for (String string:userNameDots) joiner.add(string);
userName = joiner.toString();
out.println(userName);
// userName = userNameDots.join("");
}
}

Expand Down Expand Up @@ -226,7 +235,7 @@ public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Log.d("Tag", "signInWithCredential:success");
FirebaseUser user = mAuth.getCurrentUser();
// FirebaseUser user = mAuth.getCurrentUser();
// AlertDialog.Builder builder = new AlertDialog.Builder(context);
// builder.setMessage(user.toString())
// .setPositiveButton("Close", new DialogInterface.OnClickListener() {
Expand Down

0 comments on commit 23f1f5e

Please sign in to comment.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy