From 0d7ea1c2766ff796565be25d53af4fe550d1c6d5 Mon Sep 17 00:00:00 2001 From: Arya Date: Sun, 21 Oct 2018 21:18:08 -0400 Subject: [PATCH 1/6] changed button txt --- app/src/main/res/layout/activity_main.xml | 1 + app/src/main/res/values/strings.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 3079f2c..bae175c 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -68,6 +68,7 @@ android:layout_marginBottom="8dp" android:background="@color/colorPrimaryDark" android:text="@string/btn_login" + android:textAllCaps="false" android:textColor="@color/white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2a4484d..8dd43a8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,6 +2,6 @@ TrainingApp Enter Password Enter Email - Submit + Login Register From 8b65c11532360baaca92266d261fff84490125d7 Mon Sep 17 00:00:00 2001 From: Arya Date: Sun, 21 Oct 2018 22:47:40 -0400 Subject: [PATCH 2/6] changed colors --- app/src/main/res/layout/activity_home.xml | 4 ++++ app/src/main/res/layout/activity_main.xml | 12 ++++++------ app/src/main/res/values/colors.xml | 3 +++ app/src/main/res/values/styles.xml | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index 9bff8b8..3125fb6 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -44,6 +44,8 @@ android:layout_marginRight="8dp" android:layout_marginBottom="8dp" android:text="Training" + android:textAllCaps="false" + android:background="@color/coverosPrimary" app:layout_constraintBottom_toTopOf="@+id/testingButton" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -60,6 +62,8 @@ android:layout_marginRight="8dp" android:layout_marginBottom="8dp" android:text="Testing" + android:textAllCaps="false" + android:background="@color/coverosPrimary" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index bae175c..18f9518 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -17,13 +17,13 @@ android:layout_marginEnd="8dp" android:layout_marginRight="8dp" android:layout_marginBottom="8dp" - android:background="@color/colorPrimaryDark" + android:background="@color/coverosPrimary" android:hint="@string/hint_account" android:inputType="textEmailAddress" android:padding="10dp" android:singleLine="true" android:textColor="@color/white" - android:textColorHint="#ffff25e6" + android:textColorHint="@color/white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" @@ -41,13 +41,13 @@ android:layout_marginEnd="8dp" android:layout_marginRight="8dp" android:layout_marginBottom="8dp" - android:background="@color/colorPrimaryDark" + android:background="@color/coverosPrimary" android:hint="@string/hint_password" android:inputType="textPassword" android:padding="10dp" android:singleLine="true" android:textColor="@color/white" - android:textColorHint="#ffff25e6" + android:textColorHint="@color/white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" @@ -66,7 +66,7 @@ android:layout_marginEnd="8dp" android:layout_marginRight="8dp" android:layout_marginBottom="8dp" - android:background="@color/colorPrimaryDark" + android:background="@color/coverosPrimary" android:text="@string/btn_login" android:textAllCaps="false" android:textColor="@color/white" @@ -88,7 +88,7 @@ android:layout_marginLeft="8dp" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" - android:background="@color/colorPrimaryDark" + android:background="@color/coverosPrimary" android:text="@string/btn_link_to_register" android:textAllCaps="false" android:textColor="@color/white" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index accfc2d..ef9fb3c 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -4,4 +4,7 @@ #2e0057 #D81B60 #ffffffff + #276bcf + #ffff25e6 + #837f82 \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 5e404d9..097b286 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -3,8 +3,8 @@ From b42e75dd897bf36dcd8dde705907e9d8fc0f61b0 Mon Sep 17 00:00:00 2001 From: Arya Date: Tue, 23 Oct 2018 15:15:49 -0400 Subject: [PATCH 3/6] initialized buttons --- .../coveros/com/trainingapp/HomeActivity.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/src/main/java/coveros/com/trainingapp/HomeActivity.java b/app/src/main/java/coveros/com/trainingapp/HomeActivity.java index 779e91b..1bdd247 100644 --- a/app/src/main/java/coveros/com/trainingapp/HomeActivity.java +++ b/app/src/main/java/coveros/com/trainingapp/HomeActivity.java @@ -6,6 +6,8 @@ import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; +import android.view.View; +import android.widget.Button; import android.widget.TextView; import com.google.firebase.auth.FirebaseAuth; @@ -14,6 +16,8 @@ public class HomeActivity extends AppCompatActivity { private FirebaseAuth mAuth; private TextView welcomeText; + private Button trainingButton; + private Button testingButton; @Override @@ -23,6 +27,10 @@ protected void onCreate(Bundle savedInstanceState) { Toolbar myToolbar = findViewById(R.id.my_toolbar); setSupportActionBar(myToolbar); + + trainingButton = findViewById(R.id.trainingButton); + testingButton = findViewById(R.id.testingButton); + mAuth = FirebaseAuth.getInstance(); welcomeText = findViewById(R.id.welcome_text); FirebaseUser user = mAuth.getCurrentUser(); @@ -32,6 +40,19 @@ protected void onCreate(Bundle savedInstanceState) { } + trainingButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //TODO add button event + } + }); + + testingButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //TODO add button event + } + }); } @Override public boolean onOptionsItemSelected(MenuItem item) { From 1eb601d039aa3aab62de19ca9a79c7cedb4d42d3 Mon Sep 17 00:00:00 2001 From: Arya Date: Tue, 23 Oct 2018 15:22:21 -0400 Subject: [PATCH 4/6] added intents to go to new page --- app/src/main/AndroidManifest.xml | 4 +++- .../java/coveros/com/trainingapp/HomeActivity.java | 8 ++++++-- .../java/coveros/com/trainingapp/TestingPage.java | 13 +++++++++++++ .../java/coveros/com/trainingapp/TrainingPage.java | 13 +++++++++++++ app/src/main/res/layout/activity_testing_page.xml | 9 +++++++++ app/src/main/res/layout/activity_training_page.xml | 9 +++++++++ 6 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 app/src/main/java/coveros/com/trainingapp/TestingPage.java create mode 100644 app/src/main/java/coveros/com/trainingapp/TrainingPage.java create mode 100644 app/src/main/res/layout/activity_testing_page.xml create mode 100644 app/src/main/res/layout/activity_training_page.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b05a6ca..1ea92aa 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,7 +16,9 @@ - + + + \ No newline at end of file diff --git a/app/src/main/java/coveros/com/trainingapp/HomeActivity.java b/app/src/main/java/coveros/com/trainingapp/HomeActivity.java index 1bdd247..e566699 100644 --- a/app/src/main/java/coveros/com/trainingapp/HomeActivity.java +++ b/app/src/main/java/coveros/com/trainingapp/HomeActivity.java @@ -43,14 +43,18 @@ protected void onCreate(Bundle savedInstanceState) { trainingButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - //TODO add button event + //Go to training page + Intent test = new Intent(HomeActivity.this, TrainingPage.class); + startActivity(test); } }); testingButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - //TODO add button event + //Go to testing page + Intent train = new Intent(HomeActivity.this, TestingPage.class); + startActivity(train); } }); } diff --git a/app/src/main/java/coveros/com/trainingapp/TestingPage.java b/app/src/main/java/coveros/com/trainingapp/TestingPage.java new file mode 100644 index 0000000..69e0490 --- /dev/null +++ b/app/src/main/java/coveros/com/trainingapp/TestingPage.java @@ -0,0 +1,13 @@ +package coveros.com.trainingapp; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +public class TestingPage extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_testing_page); + } +} diff --git a/app/src/main/java/coveros/com/trainingapp/TrainingPage.java b/app/src/main/java/coveros/com/trainingapp/TrainingPage.java new file mode 100644 index 0000000..be9f55a --- /dev/null +++ b/app/src/main/java/coveros/com/trainingapp/TrainingPage.java @@ -0,0 +1,13 @@ +package coveros.com.trainingapp; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; + +public class TrainingPage extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_training_page); + } +} diff --git a/app/src/main/res/layout/activity_testing_page.xml b/app/src/main/res/layout/activity_testing_page.xml new file mode 100644 index 0000000..9600537 --- /dev/null +++ b/app/src/main/res/layout/activity_testing_page.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_training_page.xml b/app/src/main/res/layout/activity_training_page.xml new file mode 100644 index 0000000..352a568 --- /dev/null +++ b/app/src/main/res/layout/activity_training_page.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file From a3d2b970aa32619f4b84e68ea7fccc0aea086ad6 Mon Sep 17 00:00:00 2001 From: Arya Date: Wed, 24 Oct 2018 23:05:52 -0400 Subject: [PATCH 5/6] added simple layout to testing page --- .../coveros/com/trainingapp/HomeActivity.java | 8 ++++ .../coveros/com/trainingapp/MainActivity.java | 2 +- .../coveros/com/trainingapp/TestingPage.java | 39 +++++++++++++++++++ .../main/res/layout/activity_testing_page.xml | 10 +++++ 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/coveros/com/trainingapp/HomeActivity.java b/app/src/main/java/coveros/com/trainingapp/HomeActivity.java index e566699..5911814 100644 --- a/app/src/main/java/coveros/com/trainingapp/HomeActivity.java +++ b/app/src/main/java/coveros/com/trainingapp/HomeActivity.java @@ -12,6 +12,7 @@ import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.auth.UserProfileChangeRequest; public class HomeActivity extends AppCompatActivity { private FirebaseAuth mAuth; @@ -37,6 +38,13 @@ protected void onCreate(Bundle savedInstanceState) { if(user != null){ String welcome = user.getEmail().toString(); welcomeText.setText("Welcome "+welcome); + + //TODO updates display name to provided string if you want to add name fields +// UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder() +// .setDisplayName("Arya").build(); +// +// user.updateProfile(profileUpdates); +// String welcome = user.getDisplayName(); } diff --git a/app/src/main/java/coveros/com/trainingapp/MainActivity.java b/app/src/main/java/coveros/com/trainingapp/MainActivity.java index 28a1c0c..afc87de 100644 --- a/app/src/main/java/coveros/com/trainingapp/MainActivity.java +++ b/app/src/main/java/coveros/com/trainingapp/MainActivity.java @@ -15,6 +15,7 @@ import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; +import com.google.firebase.auth.UserProfileChangeRequest; public class MainActivity extends AppCompatActivity { @@ -133,7 +134,6 @@ public void onStart() { private void updateUI(FirebaseUser currentUser) { if(currentUser != null){ - //TODO Intent homePage = new Intent(this,HomeActivity.class); startActivity(homePage); } diff --git a/app/src/main/java/coveros/com/trainingapp/TestingPage.java b/app/src/main/java/coveros/com/trainingapp/TestingPage.java index 69e0490..8900bd2 100644 --- a/app/src/main/java/coveros/com/trainingapp/TestingPage.java +++ b/app/src/main/java/coveros/com/trainingapp/TestingPage.java @@ -1,13 +1,52 @@ package coveros.com.trainingapp; +import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.support.v7.widget.Toolbar; +import android.view.Menu; +import android.view.MenuItem; + +import com.google.firebase.auth.FirebaseAuth; public class TestingPage extends AppCompatActivity { + private FirebaseAuth mAuth; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_testing_page); + + Toolbar myToolbar = findViewById(R.id.my_toolbar2); + setSupportActionBar(myToolbar); + + mAuth = FirebaseAuth.getInstance(); + + + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.signOut: + // User chose the "Settings" item, show the app settings UI... + mAuth.signOut(); + Intent signIn = new Intent(this, MainActivity.class); + startActivity(signIn); + finish(); + return true; + + default: + // If we got here, the user's action was not recognized. + // Invoke the superclass to handle it. + return super.onOptionsItemSelected(item); + + } + } + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.action_items, menu); + return true; } } diff --git a/app/src/main/res/layout/activity_testing_page.xml b/app/src/main/res/layout/activity_testing_page.xml index 9600537..cc773a4 100644 --- a/app/src/main/res/layout/activity_testing_page.xml +++ b/app/src/main/res/layout/activity_testing_page.xml @@ -4,6 +4,16 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" + android:background="@color/white" tools:context=".TestingPage"> + + \ No newline at end of file From d39098427874a57f03f4c660df525a7a03037206 Mon Sep 17 00:00:00 2001 From: Arya Date: Sun, 28 Oct 2018 23:54:08 -0400 Subject: [PATCH 6/6] added credentials and dependencies for google calendar --- app/build.gradle | 4 +++- .../java/coveros/com/trainingapp/TrainingClass.java | 12 ++++++++++++ app/src/main/res/credentials.json | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/coveros/com/trainingapp/TrainingClass.java create mode 100644 app/src/main/res/credentials.json diff --git a/app/build.gradle b/app/build.gradle index d55530a..38e209b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,6 +35,8 @@ dependencies { implementation 'com.google.firebase:firebase-auth:16.0.4' implementation 'com.google.android.gms:play-services-auth:16.0.1' implementation 'com.google.firebase:firebase-core:16.0.4' - + implementation 'com.google.api-client:google-api-client:1.23.0' + implementation 'com.google.oauth-client:google-oauth-client-jetty:1.23.0' + implementation 'com.google.apis:google-api-services-calendar:v3-rev305-1.23.0' } diff --git a/app/src/main/java/coveros/com/trainingapp/TrainingClass.java b/app/src/main/java/coveros/com/trainingapp/TrainingClass.java new file mode 100644 index 0000000..2cdd1c0 --- /dev/null +++ b/app/src/main/java/coveros/com/trainingapp/TrainingClass.java @@ -0,0 +1,12 @@ +package coveros.com.trainingapp; + +public class TrainingClass { + private String description; + private String name; + private String location; + private String date; //String or Date object? + + public TrainingClass(){ + + } +} diff --git a/app/src/main/res/credentials.json b/app/src/main/res/credentials.json new file mode 100644 index 0000000..b637f1a --- /dev/null +++ b/app/src/main/res/credentials.json @@ -0,0 +1 @@ +{"installed":{"client_id":"318510870027-58v56uv4c82c0lmnl88drtj8mo1j9vdr.apps.googleusercontent.com","project_id":"trainingapp-3af3f","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://www.googleapis.com/oauth2/v3/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"o3Gzmfw2MxjfaDaIuUkMbiix","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}} \ No newline at end of file