Commit 369e5bf3 authored by Paded's avatar Paded

add color

parent 4f25bb3b
......@@ -25,7 +25,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEA+GBL2+VdUNBR0gyp6KAOJ3z8hjG+OBfB2NDi4UhD7+BOrMqs
+ujo5lTXqENbLWOi8dv1EhcyWIJ+67hxPgK5qPWPkkG8ndwGJbezJdx2vxkgYtOn
cU5Uci6FV1GbtjjkapNiW5VuWsApvfXnTn6rdRxpHG17QkZh5aKAl+R7bAYjdDAf
4nynh7PtMJ3DlG6/7B50vgCyKi30mPan8EJCAKYMQGoGCRTgIknPQkM3mjVXzGZr
AwIHSQtIGKgdYbg1XUNYnw5lHDW0oonLflCEkyvG5L/XA3fttt6sAsIC/gotv/Zf
YTz6FAjwIDyTaA/2xqij4QTeHZ54iIbz+BasuM7FQHkuV2J0oE7cdv8F6Nsi1XKB
Jl4VqcIcCw+IMIVd6olPuf3nFSSIvO5UXvR1P/z7lC8P1FTjEK0+GUjjBfhY1GDG
HO6RoTJvZtMDMVwQTeGmrKa29jPLceoqd1N7Gdk9GH6KjEDxbgfHf0gsebjNRb9S
3ReouPZFwf57TjmHSjUhuXhm33iXTOQEThwbSxQBNNv0cTa/oINIytn4/o9vtHIO
dLb/8MJQFmSCfef4TTOI6njT4GESLNV172hglIlWkTYnZ411qPrZCcW2YQwU6R4j
NnVYOrqpzE94FdmrrZB2iJs2Pb0a1Ua30k3VOCqHxfYVzYAg9ArbCEGZLR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XNgCD0CtsIQZktGw== paded.ku.57@ubu.ac.th
package ubontransitdriver.paded.com.ubontransitdriver;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
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 com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView;
public class CreateAccountActivity extends AppCompatActivity {
private EditText inputEmail, inputPassword;
private Button btnSignIn, btnSignUp, btnResetPassword;
private EditText inputEmail, inputPassword, inputName;
private Button btnCreateAccount, btnLogin, btnResetPassword;
private ProgressBar progressBar;
private FirebaseAuth auth;
private String TAG = "TEST22";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.create_account_layout);
MaterialShadowContainerView shadowView =
(MaterialShadowContainerView) findViewById(R.id.shadow_item_container);
//Get Firebase auth instance
auth = FirebaseAuth.getInstance();
float density = getResources().getDisplayMetrics().density;
inputEmail = (EditText)findViewById(R.id.input_email);
inputPassword = (EditText)findViewById(R.id.input_password);
inputName = (EditText)findViewById(R.id.input_name);
shadowView.setShadowTranslationZ(density * 2.0f); // 2.0 dp
shadowView.setShadowElevation(density * 4.0f); // 4.0 dp
progressBar = (ProgressBar) findViewById(R.id.progressBar);
btnCreateAccount = (Button)findViewById(R.id.btn_create_account);
btnResetPassword = (Button)findViewById(R.id.btn_reset_password);
//Get Firebase auth instance
// auth = FirebaseAuth.getInstance();
//
// btnSignIn = (Button) findViewById(R.id.sign_in_button);
// btnSignUp = (Button) findViewById(R.id.sign_up_button);
// inputEmail = (EditText) findViewById(R.id.email);
// inputPassword = (EditText) findViewById(R.id.password);
// progressBar = (ProgressBar) findViewById(R.id.progressBar);
// btnResetPassword = (Button) findViewById(R.id.btn_reset_password);
btnCreateAccount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String email = inputEmail.getText().toString().trim();
String password = inputPassword.getText().toString().trim();
final String userName = inputName.getText().toString().trim();
if (TextUtils.isEmpty(email)) {
Toast.makeText(getApplicationContext(), "Enter email address!", Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(password)) {
Toast.makeText(getApplicationContext(), "Enter password!", Toast.LENGTH_SHORT).show();
return;
}
if (password.length() < 6) {
Toast.makeText(getApplicationContext(), "Password too short, enter minimum 6 characters!", Toast.LENGTH_SHORT).show();
return;
}
if (TextUtils.isEmpty(userName)) {
Toast.makeText(getApplicationContext(), "Enter name!", Toast.LENGTH_SHORT).show();
return;
}
progressBar.setVisibility(View.VISIBLE);
auth.createUserWithEmailAndPassword(email,password).addOnCompleteListener(CreateAccountActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Toast.makeText(CreateAccountActivity.this, "createUserWithEmail:onComplete:" + task.isSuccessful(), Toast.LENGTH_SHORT).show();
progressBar.setVisibility(View.GONE);
if (!task.isSuccessful()) {
Toast.makeText(CreateAccountActivity.this, "Authentication failed." + task.getException(),
Toast.LENGTH_SHORT).show();
} else {
FirebaseUser user = auth.getCurrentUser();
Log.d(TAG, "onComplete: "+user.getUid());
insertData(user.getUid(),userName);
startActivity(new Intent(CreateAccountActivity.this, MainActivity.class));
finish();
}
}
});
}
});
}
public void insertData(String uid, String name){
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("users/"+uid);
myRef.child("name").setValue(name);
myRef.child("bus_line").setValue(name);
}
@Override
protected void onResume() {
super.onResume();
progressBar.setVisibility(View.GONE);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#FFFFFF" />
<stroke
android:width="2dip"
android:color="#F6F6F6" />
<corners android:radius="2dip" />
<corners android:radius="8dp" />
<padding
android:bottom="7dip"
android:left="7dip"
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#CABBBBBB"/>
<corners android:radius="2dp" />
</shape>
</item>
<item
android:left="0dp"
android:right="0dp"
android:top="0dp"
android:bottom="2dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="2dp" />
</shape>
</item>
</layer-list>
\ No newline at end of file
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#FFFFFF" />
<corners android:radius="8dp" />
<padding
android:bottom="7dip"
android:left="7dip"
android:right="7dip"
android:top="7dip" />
</shape>
\ No newline at end of file
......@@ -11,7 +11,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="30dp">
android:padding="25dp">
<com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
......@@ -19,7 +21,6 @@
style="@style/ms9_DefaultShadowStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:ms9_shadowElevation="4dp"
app:ms9_shadowTranslationZ="2dp">
......@@ -27,18 +28,12 @@
android:id="@+id/input_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/off_blue"
android:paddingLeft="5dp"
android:paddingRight="12dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
>
<EditText
android:id="@+id/input_email"
android:id="@+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_edittext"
......@@ -46,21 +41,41 @@
android:drawablePadding="10dp"
android:ems="10"
android:hint="Your Name"
android:inputType="textEmailAddress"
android:padding="15dp" />
<EditText
android:id="@+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/input_name"
android:drawableLeft="@drawable/ic_email"
android:drawablePadding="10dp"
android:padding="15dp"
android:layout_marginTop="10dp"
android:hint="Your Email"
android:background="@drawable/bg_edittext"
android:ems="10"
android:inputType="textEmailAddress" />
<EditText
android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/input_email"
android:drawableLeft="@drawable/ic_pass_key"
android:drawablePadding="10dp"
android:padding="15dp"
android:layout_marginTop="10dp"
android:hint="Your Password"
android:background="@drawable/bg_edittext"
android:ems="10"
android:inputType="textPassword" />
</RelativeLayout>
</com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView>
<Button
android:id="@+id/create_account_btn"
android:id="@+id/btn_create_account"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/shadow_item_container"
......@@ -70,6 +85,29 @@
android:text="@string/create_account_btn_txt_ENG"
android:textColor="#ffffffff" />
<Button
android:id="@+id/btn_reset_password"
android:layout_width="fill_parent"
android:layout_below="@+id/btn_create_account"
android:layout_height="wrap_content"
android:layout_marginTop="20dip"
android:background="@null"
android:text="@string/btn_forgot_password"
android:textAllCaps="false"
android:textColor="@color/blue" />
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="158dp"
android:layout_height="30dp"
android:layout_below="@+id/btn_reset_password"
android:layout_gravity="center|bottom"
android:layout_marginBottom="20dp"
android:visibility="gone" />
</RelativeLayout>
</ScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="blue">#007aff</color>
<color name="off_blue">#0075f5</color>
<!--<color name="colorPrimaryDark">#303F9F</color>-->
<!--<color name="colorAccent">#FF4081</color>-->
<color name="white">#ffffff</color>
<color name="off_white">#fafAFA</color>
<color name="blue">#007aff</color>
<color name="off_blue">#0075f5</color>
<color name="green">#4cd964</color>
<color name="red">#ff2d55</color>
<color name="black">#000000</color>
<color name="gray">#ceced2</color>
</resources>
......@@ -4,4 +4,6 @@
<string name="create_account_btn_txt_ENG">Create Account</string>
<string name="btn_forgot_password">Forgot Your Password?</string>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment