Merge remote-tracking branch 'origin/marijn-appje' into niels-profile
This commit is contained in:
@@ -30,6 +30,7 @@ dependencies {
|
||||
compile 'com.google.firebase:firebase-auth:10.0.1'
|
||||
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
||||
compile 'com.android.support:support-v4:25.3.1'
|
||||
compile 'com.google.firebase:firebase-storage:10.0.1'
|
||||
testCompile 'junit:junit:4.12'
|
||||
}
|
||||
|
||||
@@ -42,4 +43,5 @@ dependencies {
|
||||
|
||||
|
||||
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
@@ -14,6 +14,14 @@
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "1078950034345-k3mcuf1bkf9ehg7vi09cp16lcdrrpf3a.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "nl.myhyvesbookplus.tagram",
|
||||
"certificate_hash": "02b894113a27cc0c4b6025a382c826477fc8543a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "1078950034345-dmsbu0066sfqgqthn2mldlauvdef98u9.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
@@ -29,8 +37,13 @@
|
||||
"status": 1
|
||||
},
|
||||
"appinvite_service": {
|
||||
"status": 1,
|
||||
"other_platform_oauth_client": []
|
||||
"status": 2,
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "1078950034345-dmsbu0066sfqgqthn2mldlauvdef98u9.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"ads_service": {
|
||||
"status": 2
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package nl.myhyvesbookplus.tagram;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.PersistableBundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
@@ -18,7 +19,7 @@ import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
import com.google.firebase.auth.UserProfileChangeRequest;
|
||||
|
||||
public class LoginActivity extends AppCompatActivity {
|
||||
public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
public static final String TAG = "Login";
|
||||
|
||||
/// Views ///
|
||||
@@ -38,6 +39,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
mAuth = FirebaseAuth.getInstance();
|
||||
|
||||
findViews();
|
||||
bindOnClick();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,14 +65,42 @@ public class LoginActivity extends AppCompatActivity {
|
||||
emailField = (EditText) findViewById(R.id.email);
|
||||
}
|
||||
|
||||
protected void bindOnClick() {
|
||||
registerButton.setOnClickListener(this);
|
||||
backToLoginButton.setOnClickListener(this);
|
||||
goToRegisterButton.setOnClickListener(this);
|
||||
logInButton.setOnClickListener(this);
|
||||
}
|
||||
|
||||
/// OnClick ///
|
||||
|
||||
/**
|
||||
* Performs the logon action.
|
||||
* Called when a view has been clicked.
|
||||
*
|
||||
* @param view
|
||||
* @param v The view that was clicked.
|
||||
*/
|
||||
public void logInOnClick(View view) {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()) {
|
||||
case R.id.register_button:
|
||||
registerOnClick();
|
||||
break;
|
||||
case R.id.go_to_register_button:
|
||||
goToRegisterOnClick();
|
||||
break;
|
||||
case R.id.login_button:
|
||||
logInOnClick();
|
||||
break;
|
||||
case R.id.back_to_login_button:
|
||||
backToLoginOnClick();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the logon action.
|
||||
*/
|
||||
public void logInOnClick() {
|
||||
String emailSting = emailField.getText().toString();
|
||||
String passwordSting = passwordField.getText().toString();
|
||||
|
||||
@@ -79,9 +109,8 @@ public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
/**
|
||||
* Performs the register action.
|
||||
* @param view
|
||||
*/
|
||||
public void registerOnClick(View view) {
|
||||
public void registerOnClick() {
|
||||
Log.d(TAG, "registerOnClick: ");
|
||||
|
||||
if (passwordField.getText().toString().equals(passwordConfirmField.getText().toString())) {
|
||||
@@ -98,9 +127,8 @@ public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
/**
|
||||
* Changes the Activity for registering.
|
||||
* @param view
|
||||
*/
|
||||
public void goToRegisterOnClick(View view) {
|
||||
public void goToRegisterOnClick() {
|
||||
passwordConfirmField.setVisibility(View.VISIBLE);
|
||||
passwordConfirmLabel.setVisibility(View.VISIBLE);
|
||||
registerButton.setVisibility(View.VISIBLE);
|
||||
@@ -114,9 +142,8 @@ public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
/**
|
||||
* Changes the Activity for logging in.
|
||||
* @param view
|
||||
*/
|
||||
public void backToLoginOnClick(View view) {
|
||||
public void backToLoginOnClick() {
|
||||
passwordConfirmField.setVisibility(View.GONE);
|
||||
passwordConfirmLabel.setVisibility(View.GONE);
|
||||
registerButton.setVisibility(View.GONE);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M3,5v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2L5,3c-1.11,0 -2,0.9 -2,2zM15,9c0,1.66 -1.34,3 -3,3s-3,-1.34 -3,-3 1.34,-3 3,-3 3,1.34 3,3zM6,17c0,-2 4,-3.1 6,-3.1s6,1.1 6,3.1v1L6,18v-1z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
|
||||
</vector>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -16,9 +16,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/logo_text"
|
||||
android:cropToPadding="false"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/logo" />
|
||||
android:paddingEnd="@dimen/activity_horizontal_margin"
|
||||
android:paddingStart="@dimen/activity_horizontal_margin"
|
||||
android:src="@drawable/logo_new" />
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -78,7 +80,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:onClick="logInOnClick"
|
||||
android:text="@string/login_button" />
|
||||
|
||||
<Button
|
||||
@@ -87,7 +88,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:onClick="goToRegisterOnClick"
|
||||
android:text="@string/register" />
|
||||
|
||||
<Button
|
||||
@@ -96,7 +96,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:onClick="registerOnClick"
|
||||
android:text="@string/register"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -106,7 +105,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:onClick="backToLoginOnClick"
|
||||
android:text="@string/back_to_login"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_camera"
|
||||
android:icon="@drawable/ic_dashboard_black_24dp"
|
||||
android:icon="@drawable/ic_photo_camera_black_24dp"
|
||||
android:title="@string/title_dashboard" />
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_profile"
|
||||
android:icon="@drawable/ic_notifications_black_24dp"
|
||||
android:icon="@drawable/ic_account_box_black_24dp"
|
||||
android:title="@string/title_notifications" />
|
||||
|
||||
</menu>
|
||||
|
||||
@@ -12,4 +12,5 @@
|
||||
<string name="title_notifications">Profiel</string>
|
||||
<string name="username">Gebruikersnaam</string>
|
||||
<string name="confirm_password_hint">bevestig wachtwoord</string>
|
||||
<string name="logo_text">MyHyvesBookPlusTagram logo</string>
|
||||
</resources>
|
||||
@@ -17,4 +17,5 @@
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
<string name="hello_camera">Hello Camera</string>
|
||||
<string name="logo_text">MyHyvesBookPlusTagram logo</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user