diff --git a/app/build.gradle b/app/build.gradle index 2d156ba..c6e3800 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,7 +35,6 @@ dependencies { implementation 'com.android.support:gridlayout-v7:26.1.0' implementation 'com.google.android.gms:play-services-maps:11.8.0' implementation 'com.google.android.gms:play-services-auth:11.8.0' - compile 'sun.bob:mcalendarview:1.0.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c1dda1b..a0fa487 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,10 +2,10 @@ - + - + @@ -26,16 +26,10 @@ android:name="preloaded_fonts" android:resource="@array/preloaded_fonts" /> - - - - + android:theme="@style/AppTheme.NoActionBar" /> diff --git a/app/src/main/java/org/roseacademies/hedhihelp/AccountActivity.java b/app/src/main/java/org/roseacademies/hedhihelp/AccountActivity.java deleted file mode 100755 index 31508dc..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/AccountActivity.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.roseacademies.hedhihelp; - -import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v7.app.AppCompatActivity; -import android.text.TextUtils; -import android.util.Log; -import android.util.Patterns; -import android.view.View; -import android.widget.EditText; -import android.widget.Toast; - -import org.roseacademies.hedhihelp.DataModels.AppUser; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.auth.AuthResult; -import com.google.firebase.auth.FirebaseAuth; -import com.google.firebase.auth.FirebaseUser; -import com.google.firebase.database.DatabaseReference; -import com.google.firebase.database.FirebaseDatabase; - -import static android.content.ContentValues.TAG; - -public class AccountActivity extends AppCompatActivity { - private FirebaseAuth mAuth; - private EditText mEmailField; - private EditText mPasswordField; - private EditText mConfirmPassField; - private EditText mNameField; - private EditText mAgeField; - private FirebaseDatabase fbdb; - private DatabaseReference dbref; - private FirebaseUser fuser; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_account); - - //Views - mEmailField = (EditText) findViewById(R.id.create_account_email_form); - mPasswordField = (EditText) findViewById(R.id.create_account_password_form); - mConfirmPassField = (EditText) findViewById(R.id.create_account_confirm_password_form); - mNameField = findViewById(R.id.create_account_name_form); - mAgeField = findViewById(R.id.create_account_age_form); - - //Firebase initialization - mAuth = FirebaseAuth.getInstance(); - fbdb = FirebaseDatabase.getInstance(); - //Buttons - - - } - - public static boolean isValidEmail(CharSequence target) { - return (!TextUtils.isEmpty(target) && Patterns.EMAIL_ADDRESS.matcher(target).matches()); - } - - public static boolean isValidPassword(CharSequence target) { - return (!TextUtils.isEmpty(target) && !(target.length() < 8)); - } - - public void createAccount(String email, String password) { - Toast.makeText(AccountActivity.this, "Creating account...", Toast.LENGTH_SHORT).show(); - if (!isValidEmail(email)) Toast.makeText(AccountActivity.this, "Please put in a valid email.", - Toast.LENGTH_SHORT).show(); - else if (!isValidPassword(password)) Toast.makeText(AccountActivity.this, "Password must be at least 8 characters long.",Toast.LENGTH_SHORT).show(); - else if (!mConfirmPassField.getText().toString().equals(mPasswordField.getText().toString())) Toast.makeText(AccountActivity.this, "Passwords do not match.", Toast.LENGTH_SHORT).show(); - else { - Toast.makeText(AccountActivity.this, "Creating account...", Toast.LENGTH_SHORT).show(); - mAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - if (task.isSuccessful()) { - // sign in successful -// Toast.makeText(AccountActivity.this, "UID: " + task.getResult(), Toast.LENGTH_SHORT).show(); - fuser = task.getResult().getUser(); - AppUser user = new AppUser(fuser != null ? fuser.getUid() : null, mNameField.getText().toString(), mEmailField.getText().toString(), mAgeField.getText().toString()); - fbdb.getReference().child("users").child(user.UID).setValue(user); - Log.d(TAG, "createUserWithEmail:success"); - finish(); - } else { - Toast.makeText(AccountActivity.this, "Sign in unsuccessful!", Toast.LENGTH_SHORT).show(); - } - } - }); - } - } - - public void create_account(View view) { - String email = mEmailField.getText().toString(); - String password = mPasswordField.getText().toString(); - String password2 = mPasswordField.getText().toString(); - String name = mNameField.getText().toString(); - String age = mAgeField.getText().toString(); - createAccount(email, password); -// fuser = FirebaseAuth.getInstance().getCurrentUser(); - - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/CalendarSettingsActivity.java b/app/src/main/java/org/roseacademies/hedhihelp/CalendarSettingsActivity.java deleted file mode 100644 index 0209c9c..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/CalendarSettingsActivity.java +++ /dev/null @@ -1,172 +0,0 @@ -package org.roseacademies.hedhihelp; - -import android.content.ContentValues; -import android.database.Cursor; -import android.database.sqlite.SQLiteDatabase; -import android.os.Bundle; -import android.provider.BaseColumns; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.widget.Button; -import android.widget.EditText; -import android.widget.TextView; -import android.widget.Toast; - -import org.roseacademies.hedhihelp.PeriodData.PeriodSettingsDbHelper; -import org.roseacademies.hedhihelp.PeriodData.PeriodSettingsTable; -import org.roseacademies.hedhihelp.PeriodData.Settings; - -public class CalendarSettingsActivity extends AppCompatActivity implements View.OnClickListener { - private static int DEFAULT_LENGTH = 7; - private static int DEFAULT_GAP = 28; - - PeriodSettingsDbHelper mDBHelper; - TextView settingsTitle; - EditText periodLength; - EditText lengthBetweenPeriods; - Button saveButton; - Button cancelButton; - Button restoreDefaults; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_period_settings); - - periodLength = (EditText) findViewById(R.id.period_length_form); - lengthBetweenPeriods = (EditText) findViewById(R.id.length_between_periods_form); - saveButton = (Button) findViewById(R.id.save_button); - cancelButton = (Button) findViewById(R.id.cancel_button); - restoreDefaults = (Button) findViewById(R.id.restore_defaults); - - mDBHelper = new PeriodSettingsDbHelper(this); - - SQLiteDatabase db = mDBHelper.getWritableDatabase(); -// db. -// if (!isSet(db)) { -// // Create Default Settings -// createDefaultRow(db); -// } - Settings res = getSettings(); - - - periodLength.setText(String.valueOf(res.getLength())); - lengthBetweenPeriods.setText(String.valueOf(res.getGap())); - - restoreDefaults.setOnClickListener(this); - saveButton.setOnClickListener(this); - cancelButton.setOnClickListener(this); - } - - public Settings getSettings() { - Settings result; - SQLiteDatabase db = mDBHelper.getReadableDatabase(); - - String [] projection = { - BaseColumns._ID, - PeriodSettingsTable.PeriodSettingsEntry.PERIOD_LENGTH, - PeriodSettingsTable.PeriodSettingsEntry.PERIOD_GAP, - PeriodSettingsTable.PeriodSettingsEntry.isSet - }; - String selection = PeriodSettingsTable.PeriodSettingsEntry.isSet + " = ?"; - String[]selectionArgs = {"1"}; - - Cursor cursor = db.query( - PeriodSettingsTable.PeriodSettingsEntry.TABLE_NAME, - projection, - selection, - selectionArgs, - null, - null, - null - ); - cursor.moveToNext(); - if (cursor.isAfterLast()) { - return new Settings(DEFAULT_LENGTH, DEFAULT_GAP); - } - int length = cursor.getInt(cursor.getColumnIndexOrThrow(PeriodSettingsTable.PeriodSettingsEntry.PERIOD_LENGTH)); - int gap = cursor.getInt(cursor.getColumnIndex(PeriodSettingsTable.PeriodSettingsEntry.PERIOD_GAP)); - cursor.close(); - result = new Settings(length, gap); - -// Toast.makeText(CalendarSettingsActivity.this, "Length: " + String.valueOf(result.getLength()) + " Gap: " + String.valueOf(result.getGap()), Toast.LENGTH_SHORT).show(); - - return result; - } - - public boolean isSet(SQLiteDatabase db) { - String [] projection = { - BaseColumns._ID, - PeriodSettingsTable.PeriodSettingsEntry.isSet - }; - - String selection = PeriodSettingsTable.PeriodSettingsEntry.isSet + " LIKE ?"; - String[] selectionArgs = {"1"}; - - Cursor cursor = db.query( - PeriodSettingsTable.PeriodSettingsEntry.TABLE_NAME, - projection, - selection, - selectionArgs, - null, - null, - null - ); - - cursor.moveToNext(); - boolean result = !cursor.isAfterLast(); - cursor.close(); - return result; - } - - public void createDefaultRow(SQLiteDatabase db) { - createRow(28, 7); - } - - public void createRow(int gap, int length) { - SQLiteDatabase db = mDBHelper.getReadableDatabase(); - // First we check if there is a row already there - if (isSet(db)) { - deleteRow(db); - } - // If there isn't, let's make one! Geez. - db = mDBHelper.getWritableDatabase(); - ContentValues values = new ContentValues(); - values.put(PeriodSettingsTable.PeriodSettingsEntry.PERIOD_GAP, gap); - values.put(PeriodSettingsTable.PeriodSettingsEntry.PERIOD_LENGTH, length); - values.put(PeriodSettingsTable.PeriodSettingsEntry.isSet, 1); - long newRowId = db.insert(PeriodSettingsTable.PeriodSettingsEntry.TABLE_NAME, null, values); - } - - public void deleteRow(SQLiteDatabase db) { - // If there is, we nuke it -// db = mDBHelper.getWritableDatabase(); - // clean up the db, we should only have one entry - String selection = PeriodSettingsTable.PeriodSettingsEntry.isSet + " LIKE ?"; - String[] selectionArgs = {"1"}; - int deletedRows = db.delete(PeriodSettingsTable.PeriodSettingsEntry.TABLE_NAME, selection, selectionArgs); -// Toast.makeText(CalendarSettingsActivity.this, "This many rows: " + String.valueOf(deletedRows), Toast.LENGTH_SHORT).show(); - } - - public void saveSettings() { - SQLiteDatabase db = mDBHelper.getWritableDatabase(); - deleteRow(db); - createRow(Integer.parseInt(lengthBetweenPeriods.getText().toString()), Integer.parseInt(periodLength.getText().toString())); - } - - @Override - public void onClick(View v) { - int id = v.getId(); - if (id == R.id.restore_defaults) { - periodLength.setText("7"); - lengthBetweenPeriods.setText("28"); - } - if (id == R.id.save_button) { - saveSettings(); - finish(); - } - if (id == R.id.cancel_button) { - finish(); - } - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/ClinicView.java b/app/src/main/java/org/roseacademies/hedhihelp/ClinicView.java index 76aee31..2253160 100644 --- a/app/src/main/java/org/roseacademies/hedhihelp/ClinicView.java +++ b/app/src/main/java/org/roseacademies/hedhihelp/ClinicView.java @@ -30,25 +30,25 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.clinic_info); - webview = (WebView) findViewById(R.id.myWebView); + webview = findViewById(R.id.myWebView); webview.setVisibility(View.GONE); this.selected = (Clinic) getIntent().getSerializableExtra("SelectedClinic"); - TextView mT1 = (TextView) findViewById(R.id.clinic_name); + TextView mT1 = findViewById(R.id.clinic_name); mT1.setText(selected.getName()); - TextView mT2 = (TextView) findViewById(R.id.clinic_address); + TextView mT2 = findViewById(R.id.clinic_address); mT2.setText(selected.getAddress()); - TextView mT3 = (TextView) findViewById(R.id.clinic_phone); + TextView mT3 = findViewById(R.id.clinic_phone); mT3.setText(selected.getPhone()); - mWebButton = (Button) findViewById(R.id.directions_button); + mWebButton = findViewById(R.id.directions_button); mWebButton.setVisibility(View.VISIBLE); mWebButton.setOnClickListener(this); - mHideButton = (Button) findViewById(R.id.hide_button); + mHideButton = findViewById(R.id.hide_button); mHideButton.setVisibility(View.GONE); mHideButton.setOnClickListener(this); } diff --git a/app/src/main/java/org/roseacademies/hedhihelp/ClinicsActivity.java b/app/src/main/java/org/roseacademies/hedhihelp/ClinicsActivity.java index c121d9e..1ea60d9 100644 --- a/app/src/main/java/org/roseacademies/hedhihelp/ClinicsActivity.java +++ b/app/src/main/java/org/roseacademies/hedhihelp/ClinicsActivity.java @@ -30,7 +30,7 @@ protected void onCreate(Bundle savedInstanceState) { initClinics(); ArrayAdapter adapter = new ArrayAdapter(this, R.layout.activity_clinics,R.id.textview, clinicNames); - ListView listView = (ListView) findViewById(R.id.mobile_list); + ListView listView = findViewById(R.id.mobile_list); listView.setAdapter(adapter); listView.setOnItemClickListener(this); } diff --git a/app/src/main/java/org/roseacademies/hedhihelp/DataModels/AppUser.java b/app/src/main/java/org/roseacademies/hedhihelp/DataModels/AppUser.java deleted file mode 100644 index 947f961..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/DataModels/AppUser.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.roseacademies.hedhihelp.DataModels; - -/** - * Created by SarekSoteloJimenez on 1/19/18. - */ - -public class AppUser { - public String UID; - public String name; - public String email; - public String age; - - public AppUser() { - - } - - public AppUser(String UID, String name, String email, String age) { - this.UID = UID; - this.name = name; - this.email = email; - this.age = age; - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/FullscreenActivity.java b/app/src/main/java/org/roseacademies/hedhihelp/FullscreenActivity.java index 3f65721..2e0d51e 100644 --- a/app/src/main/java/org/roseacademies/hedhihelp/FullscreenActivity.java +++ b/app/src/main/java/org/roseacademies/hedhihelp/FullscreenActivity.java @@ -32,7 +32,6 @@ public class FullscreenActivity extends AppCompatActivity implements View.OnClic // Having only these two variables will work for now but soon we should change this to a SQL // table and store whichever image they were on for each individual module protected int module_max = 10; - protected int module_count = 1; protected int image_count = 0; protected Integer images[]; @@ -118,7 +117,7 @@ protected void onCreate(Bundle savedInstanceState) { mVisible = true; mControlsView = findViewById(R.id.fullscreen_content_controls); - mContentView = (ImageView) findViewById(R.id.modules_image); + mContentView = findViewById(R.id.modules_image); Bundle bundle = getIntent().getExtras(); int moduleNum = bundle.getInt("moduleNum"); @@ -136,7 +135,7 @@ protected void onCreate(Bundle savedInstanceState) { } public void setCurrentImage() { - final ImageView imageView = (ImageView) findViewById(R.id.modules_image); + final ImageView imageView = findViewById(R.id.modules_image); imageView.setImageResource(images[image_count]); } @@ -202,16 +201,13 @@ public void onClick(View v){ DisplayMetrics displayMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); int height = displayMetrics.heightPixels; - int width = displayMetrics.widthPixels; - int i = v.getId(); if (v == findViewById(R.id.end_module)) { finish(); } if (v == mContentView) { float x = lastTouchDownXY[0]; - float y = lastTouchDownXY[1]; if (x >= (height/2)) { image_count += 1; diff --git a/app/src/main/java/org/roseacademies/hedhihelp/HomeActivity.java b/app/src/main/java/org/roseacademies/hedhihelp/HomeActivity.java index 7e4f20c..4a0c699 100755 --- a/app/src/main/java/org/roseacademies/hedhihelp/HomeActivity.java +++ b/app/src/main/java/org/roseacademies/hedhihelp/HomeActivity.java @@ -19,30 +19,23 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); - mCalendarButton = (Button) findViewById(R.id.calendar_button); + mCalendarButton = findViewById(R.id.calendar_button); mCalendarButton.setOnClickListener(this); - mAboutButton = (Button) findViewById(R.id.about_button); + mAboutButton = findViewById(R.id.about_button); mAboutButton.setOnClickListener(this); - mClinicsButton = (Button) findViewById(R.id.resources_button); + mClinicsButton = findViewById(R.id.resources_button); mClinicsButton.setOnClickListener(this); - mSurveyButton = (Button) findViewById(R.id.survey_button); + mSurveyButton = findViewById(R.id.survey_button); mSurveyButton.setOnClickListener(this); - // Get the Intent that started this activity and extract the string - Intent intent = getIntent(); - String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE); - - // Capture the layout's TextView and set the string as its text - TextView textView = findViewById(R.id.welcome_text); -// textView.setText(message); } public void sendMessage(View view) { Intent intent = new Intent(this, LessonActivity.class); - Button button = (Button) findViewById(R.id.lesson_button); + Button button = findViewById(R.id.lesson_button); String message = button.getText().toString(); intent.putExtra(EXTRA_MESSAGE, message); startActivity(intent); diff --git a/app/src/main/java/org/roseacademies/hedhihelp/MainActivity.java b/app/src/main/java/org/roseacademies/hedhihelp/MainActivity.java deleted file mode 100755 index 4c945b8..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/MainActivity.java +++ /dev/null @@ -1,206 +0,0 @@ -package org.roseacademies.hedhihelp; - -import android.app.ProgressDialog; -import android.content.Intent; -import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.VisibleForTesting; -import android.support.v7.app.AppCompatActivity; -import android.text.TextUtils; -import android.util.Log; -import android.util.Patterns; -import android.view.View; -import android.widget.Button; -import android.widget.EditText; -import android.widget.TextView; -import android.widget.Toast; - -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.auth.AuthResult; -import com.google.firebase.auth.FirebaseAuth; -import com.google.firebase.auth.FirebaseUser; - -import static android.content.ContentValues.TAG; - - -public class MainActivity extends AppCompatActivity implements View.OnClickListener{ - public static final String EXTRA_MESSAGE = "org.roseacademies.hedhihelp.MESSAGE"; - private FirebaseAuth mAuth; -// private TextView mStatusTextView; -// private TextView mDetailTextView; - private EditText mEmailField; - private EditText mPasswordField; - private TextView mSkipView; - boolean wasLoggedIn = false; - - @VisibleForTesting - public ProgressDialog mProgressDialog; - - public void showProgressDialog() { - if (mProgressDialog == null) { - mProgressDialog = new ProgressDialog(this); - mProgressDialog.setMessage(getString(R.string.loading)); - mProgressDialog.setIndeterminate(true); - } - - mProgressDialog.show(); - } - - public void hideProgressDialog() { - if (mProgressDialog != null && mProgressDialog.isShowing()){ - mProgressDialog.dismiss(); - } - } - - @Override - public void onStop() { - super.onStop(); - hideProgressDialog(); - } - - public void sendMessage(View view) { - switch (view.getId()) { - case R.id.loginbutton: - Intent intent0 = new Intent(this, HomeActivity.class); - Button button0 = findViewById(R.id.loginbutton); - String message0 = button0.getText().toString(); - intent0.putExtra(EXTRA_MESSAGE, message0); - startActivity(intent0); - break; - case R.id.create_account: - Intent intent1 = new Intent(this, AccountActivity.class); - Button button1 = findViewById(R.id.create_account); - String message1 = button1.getText().toString(); - intent1.putExtra(EXTRA_MESSAGE, message1); - startActivity(intent1); - break; - default: - break; - } - } - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - // Views -// mStatusTextView = findViewById(R.id.status); -// mEmailField = findViewById(R.id.email_form); -// mPasswordField = findViewById(R.id.password_form); -// mSkipView = (TextView) findViewById(R.id.skip_skip); - //Buttons -// findViewById(R.id.loginbutton).setOnClickListener(this); -// findViewById(R.id.create_account).setOnClickListener(this); -// findViewById(R.id.logoutbutton).setOnClickListener(this); -// mSkipView.setOnClickListener(this); - // findViewById(R.id.verify_email_button).setOnClickListener(this); //<- this might be good to have later - -// mAuth = FirebaseAuth.getInstance(); -// if (mAuth.getCurrentUser() != null) { - Intent homeIntent = new Intent(this, HomeActivity.class); -// homeIntent.putExtra(EXTRA_MESSAGE, mAuth.getCurrentUser().getUid()); - startActivity(homeIntent); -// } - } - - public static boolean isValidEmail(CharSequence target) { - return (!TextUtils.isEmpty(target) && Patterns.EMAIL_ADDRESS.matcher(target).matches()); - } - - - @Override - public void onStart() { - super.onStart(); - setContentView(R.layout.activity_main); - // Check if user is signed in (non-null) and update UI -// FirebaseUser currentUser = mAuth.getCurrentUser(); -// mEmailField = findViewById(R.id.email_form); -// mPasswordField = findViewById(R.id.password_form); - //Buttons -// findViewById(R.id.loginbutton).setOnClickListener(this); -// findViewById(R.id.create_account).setOnClickListener(this); -// findViewById(R.id.logoutbutton).setOnClickListener(this); -// if (currentUser!=null) startActivity(new Intent(this, HomeActivity.class)); -// updateUI(currentUser); - } - - public void signIn(String email, String password) { - Log.d(TAG, "signIn:"+email); - if (!isValidEmail(email)) Toast.makeText(MainActivity.this, "Invalid email", Toast.LENGTH_SHORT).show(); - else { -// Toast.makeText(MainActivity.this, "Valid inputs...", Toast.LENGTH_SHORT).show(); - mAuth.signInWithEmailAndPassword(email, password) - .addOnCompleteListener(this, new OnCompleteListener() { - @Override - public void onComplete(@NonNull Task task) { - - if (task.isSuccessful()) { - // Sign in success, update UI with the signed-in user's information - Log.d(TAG, "signInWithEmail:success"); - Toast.makeText(MainActivity.this, "Sign in success!", Toast.LENGTH_SHORT).show(); - FirebaseUser user = mAuth.getCurrentUser(); - startActivity(new Intent(MainActivity.this, HomeActivity.class)); - } else { - // If sign in fails, display a message to the user. - Log.w(TAG, "signInWithEmail:failure", task.getException()); - Toast.makeText(MainActivity.this, "Authentication failed.", - Toast.LENGTH_SHORT).show(); - updateUI(null); - } - - if (!task.isSuccessful()) { - Toast.makeText(MainActivity.this, "Sign in failed.", Toast.LENGTH_SHORT).show(); -// mStatusTextView.setText(R.string.auth_failed); - } - hideProgressDialog(); - } - }); -// if (mAuth.getCurrentUser() != null) { -// startActivity(new Intent(this, HomeActivity.class)); -// } - } - } - - - private void signOut() { - mAuth.signOut(); - updateUI(null); - } - - - private void updateUI(FirebaseUser user) { - hideProgressDialog(); - if (user != null) { -// mStatusTextView.setText(getString(R.string.google_status_fmt, user.getEmail())); -// mDetailTextView.setText(getString(R.string.firebase_status_fmt, user.getUid())); - - findViewById(R.id.loginbutton).setVisibility(View.GONE); - findViewById(R.id.logoutbutton).setVisibility(View.VISIBLE); - } else { -// mStatusTextView.setText(R.string.signed_out); -// mDetailTextView.setText(null); - - findViewById(R.id.loginbutton).setVisibility(View.VISIBLE); - findViewById(R.id.logoutbutton).setVisibility(View.GONE); - } - } - - @Override - public void onClick(View v){ - int i = v.getId(); - if (i==R.id.loginbutton) { - signIn(mEmailField.getText().toString(), mPasswordField.getText().toString()); - } else if (i == R.id.create_account) { - startActivity(new Intent(this, AccountActivity.class)); - -// createAccount(mEmailField.getText().toString(), mPasswordField.getText().toString()); - } else if (i == R.id.logoutbutton) { - signOut(); - } else if (i == R.id.skip_skip) { - startActivity(new Intent(this, HomeActivity.class)); - } - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodDbHelper.java b/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodDbHelper.java deleted file mode 100644 index 4495d72..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodDbHelper.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.roseacademies.hedhihelp.PeriodData; - - -import android.content.Context; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteOpenHelper; - -import static org.roseacademies.hedhihelp.PeriodData.PeriodTable.SQL_CREATE_ENTRIES; - -public class PeriodDbHelper extends SQLiteOpenHelper { - - - // If there is ever a change to the database schema, change the version! - public static final int DATABASE_VERSION = 1; - public static final String DATABASE_NAME = "period.db"; - - public PeriodDbHelper(Context context) { - super(context, DATABASE_NAME, null, DATABASE_VERSION); - } - - public void onCreate(SQLiteDatabase db) { - db.execSQL(SQL_CREATE_ENTRIES); - } - - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - // This database is to save period info, so hold up with this stuff - } - - public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { - // Figure this out later if this happens - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodSettingsDbHelper.java b/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodSettingsDbHelper.java deleted file mode 100644 index 89c6a15..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodSettingsDbHelper.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.roseacademies.hedhihelp.PeriodData; - -import android.content.Context; -import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteOpenHelper; - -import static org.roseacademies.hedhihelp.PeriodData.PeriodSettingsTable.PeriodSettingsEntry.SQL_CREATE_ENTRIES; - -public class PeriodSettingsDbHelper extends SQLiteOpenHelper { - - // If there is ever a change to the database schema, change the version number - public static final int DATABASE_VERSION = 1; - public static final String DATABASE_NAME = "pSettings.db"; - - public PeriodSettingsDbHelper(Context context) { - super(context, DATABASE_NAME, null, DATABASE_VERSION); - } - - public void onCreate(SQLiteDatabase db) { - db.execSQL(SQL_CREATE_ENTRIES); - } - - public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - // This database isn't there yet but maybe we should think about this later - } - - public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { - // Figure this out later if this happens - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodSettingsTable.java b/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodSettingsTable.java deleted file mode 100644 index 9cfe1f7..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodSettingsTable.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.roseacademies.hedhihelp.PeriodData; - - -import android.provider.BaseColumns; - -public class PeriodSettingsTable { - private PeriodSettingsTable() {} - - public static class PeriodSettingsEntry implements BaseColumns { - public static final String TABLE_NAME = "settings_entry"; - public static final String PERIOD_LENGTH = "period_length"; // measured in days - public static final String PERIOD_GAP = "period_gap"; - public static final String isSet = "is_set"; - - public static final String SQL_CREATE_ENTRIES = - "CREATE TABLE " + PeriodSettingsEntry.TABLE_NAME + " (" + - PeriodSettingsEntry._ID + " INTEGER PRIMARY KEY," + - PeriodSettingsEntry.PERIOD_LENGTH + " INTEGER," + - PeriodSettingsEntry.PERIOD_GAP + " INTEGER," + - PeriodSettingsEntry.isSet + " INTEGER);"; - - public static final String SQL_DELETE_ENTRIES = - "DROP TABLE IF EXISTS " + PeriodSettingsEntry.TABLE_NAME; - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodTable.java b/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodTable.java deleted file mode 100644 index f1c0832..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/PeriodTable.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.roseacademies.hedhihelp.PeriodData; - - -import android.provider.BaseColumns; - -public final class PeriodTable { - private PeriodTable() {} - - public static class PeriodEntry implements BaseColumns { - public static final String TABLE_NAME = "period_entry"; - public static final String START_DATE = "start_date"; -// public static final String START_SUBTITLE = "Period start date"; - public static final String END_DATE = "end_date"; - public static final String PERIOD_STATUS = "period_status"; - } - - public static final String SQL_CREATE_ENTRIES = - "CREATE TABLE " + PeriodEntry.TABLE_NAME + " (" + - PeriodEntry._ID + " INTEGER PRIMARY KEY," + - PeriodEntry.START_DATE + " DATE," + - PeriodEntry.END_DATE + " DATE," + - PeriodEntry.PERIOD_STATUS + " INTEGER);"; - - public static final String SQL_DELETE_ENTRIES = - "DROP TABLE IF EXISTS " + PeriodEntry.TABLE_NAME; -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/Settings.java b/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/Settings.java deleted file mode 100644 index 1baca54..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/Settings.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.roseacademies.hedhihelp.PeriodData; - -public class Settings { - private int length; - private int gap; - public Settings(int length, int gap) { - this.length = length; - this.gap = gap; - } - - public int getLength() { - return length; - } - - public int getGap() { - return gap; - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/SettingsActivity.java b/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/SettingsActivity.java deleted file mode 100644 index 63a34b0..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/PeriodData/SettingsActivity.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.roseacademies.hedhihelp.PeriodData; - -/** - * Created by acous_000 on 5/6/2018. - */ - -public class SettingsActivity { -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/SurveyActivity.java b/app/src/main/java/org/roseacademies/hedhihelp/SurveyActivity.java index deb8dd9..493e3ed 100644 --- a/app/src/main/java/org/roseacademies/hedhihelp/SurveyActivity.java +++ b/app/src/main/java/org/roseacademies/hedhihelp/SurveyActivity.java @@ -66,16 +66,13 @@ public void onClick(View view) { DisplayMetrics displayMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); int height = displayMetrics.heightPixels; - int width = displayMetrics.widthPixels; - int i = view.getId(); if (view == findViewById(R.id.end_module)) { finish(); } if (view == mContentView) { float x = lastTouchDownXY[0]; - float y = lastTouchDownXY[1]; if (x >= (height/2)) { image_count += 1; diff --git a/app/src/main/java/org/roseacademies/hedhihelp/tab1.java b/app/src/main/java/org/roseacademies/hedhihelp/tab1.java deleted file mode 100644 index f004da7..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/tab1.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.roseacademies.hedhihelp; - -import android.support.v4.app.Fragment; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -public class tab1 extends Fragment { - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - return inflater.inflate(R.layout.tab1, container, false); - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/tab2.java b/app/src/main/java/org/roseacademies/hedhihelp/tab2.java deleted file mode 100644 index 9aa07cc..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/tab2.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.roseacademies.hedhihelp; - -import android.support.v4.app.Fragment; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -public class tab2 extends Fragment { - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - return inflater.inflate(R.layout.tab2, container, false); - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/tab3.java b/app/src/main/java/org/roseacademies/hedhihelp/tab3.java deleted file mode 100644 index 7fddfb5..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/tab3.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.roseacademies.hedhihelp; - -import android.support.v4.app.Fragment; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -public class tab3 extends Fragment { - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - return inflater.inflate(R.layout.tab3, container, false); - } -} diff --git a/app/src/main/java/org/roseacademies/hedhihelp/tab4.java b/app/src/main/java/org/roseacademies/hedhihelp/tab4.java deleted file mode 100644 index 7a22937..0000000 --- a/app/src/main/java/org/roseacademies/hedhihelp/tab4.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.roseacademies.hedhihelp; - -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -public class tab4 extends Fragment { - @Nullable - @Override - public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { - return inflater.inflate(R.layout.tab4, container, false); - } -} diff --git a/app/src/main/res/drawable/arbelina.jpg b/app/src/main/res/drawable/arbelina.jpg deleted file mode 100644 index afcffbf..0000000 Binary files a/app/src/main/res/drawable/arbelina.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/brandon.jpg b/app/src/main/res/drawable/brandon.jpg deleted file mode 100644 index 1218dd5..0000000 Binary files a/app/src/main/res/drawable/brandon.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/ellie.jpg b/app/src/main/res/drawable/ellie.jpg deleted file mode 100644 index 41c4ef1..0000000 Binary files a/app/src/main/res/drawable/ellie.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/esther.jpg b/app/src/main/res/drawable/esther.jpg deleted file mode 100644 index 230daa0..0000000 Binary files a/app/src/main/res/drawable/esther.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/kelsey.jpg b/app/src/main/res/drawable/kelsey.jpg deleted file mode 100644 index df11b84..0000000 Binary files a/app/src/main/res/drawable/kelsey.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/kitty.jpg b/app/src/main/res/drawable/kitty.jpg deleted file mode 100644 index d8c4ddf..0000000 Binary files a/app/src/main/res/drawable/kitty.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/mira.jpg b/app/src/main/res/drawable/mira.jpg deleted file mode 100644 index a503a3e..0000000 Binary files a/app/src/main/res/drawable/mira.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/parker.jpg b/app/src/main/res/drawable/parker.jpg deleted file mode 100644 index ceeb4c1..0000000 Binary files a/app/src/main/res/drawable/parker.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/sarah.jpg b/app/src/main/res/drawable/sarah.jpg deleted file mode 100644 index f9cc7ea..0000000 Binary files a/app/src/main/res/drawable/sarah.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/sarek.JPG b/app/src/main/res/drawable/sarek.JPG deleted file mode 100644 index 9a18d00..0000000 Binary files a/app/src/main/res/drawable/sarek.JPG and /dev/null differ diff --git a/app/src/main/res/drawable/silvia.jpg b/app/src/main/res/drawable/silvia.jpg deleted file mode 100644 index 792d029..0000000 Binary files a/app/src/main/res/drawable/silvia.jpg and /dev/null differ diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml deleted file mode 100755 index 9fd8595..0000000 --- a/app/src/main/res/layout/activity_account.xml +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -