Commit 77baf646 authored by Paded's avatar Paded

add login activity

parent 369e5bf3
......@@ -10,25 +10,21 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
>
<activity android:name=".MainActivity"
android:windowSoftInputMode="adjustResize"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".CreateAccountActivity">
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:windowSoftInputMode="adjustResize"></activity>
<activity android:name=".CreateAccountActivity"></activity>
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginActivity"></activity>
</application>
</manifest>
\ No newline at end of file
......@@ -43,6 +43,7 @@ public class CreateAccountActivity extends AppCompatActivity {
btnCreateAccount = (Button)findViewById(R.id.btn_create_account);
btnResetPassword = (Button)findViewById(R.id.btn_reset_password);
btnLogin = (Button)findViewById(R.id.btnLogin);
btnCreateAccount.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -97,6 +98,15 @@ public class CreateAccountActivity extends AppCompatActivity {
}
});
btnLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(CreateAccountActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
});
}
public void insertData(String uid, String name){
......
package ubontransitdriver.paded.com.ubontransitdriver;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
public class LoginActivity extends AppCompatActivity {
private Button createPage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login_layout);
createPage = (Button)findViewById(R.id.create_button);
createPage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(LoginActivity.this, CreateAccountActivity.class);
startActivity(intent);
finish();
}
});
}
}
......@@ -2,16 +2,20 @@ package ubontransitdriver.paded.com.ubontransitdriver;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
MaterialShadowContainerView shadowView =
(MaterialShadowContainerView) findViewById(R.id.shadow_item_container);
......@@ -19,5 +23,7 @@ public class MainActivity extends AppCompatActivity {
shadowView.setShadowTranslationZ(density * 2.0f); // 2.0 dp
shadowView.setShadowElevation(density * 4.0f); // 4.0 dp
}
}
package ubontransitdriver.paded.com.ubontransitdriver;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class SplashActivity extends AppCompatActivity {
private FirebaseAuth auth;
private String TAG = "SPLASH2";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Get Firebase auth instance
auth = FirebaseAuth.getInstance();
FirebaseUser user = auth.getCurrentUser();
updateUI(user);
}
private void updateUI(FirebaseUser user) {
if (user != null) {
// Intent intent = new Intent(this, MainActivity.class);
// startActivity(intent);
// finish();
} else {
Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent);
finish();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@drawable/bg_add_bus_clicked" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@drawable/bg_add_bus_clicked" />
<item android:drawable="@drawable/bg_add_bus_normal" />
</selector>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/off_gray" >
</solid>
<!--<stroke-->
<!--android:width="2dp"-->
<!--android:color="#C4CDE0" >-->
<!--</stroke>-->
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="360dp" >
</corners>
</shape>
\ No newline at end of file
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid
android:color="@color/gray" >
</solid>
<!--<stroke-->
<!--android:width="2dp"-->
<!--android:color="#C4CDE0" >-->
<!--</stroke>-->
<padding
android:left="5dp"
android:top="5dp"
android:right="5dp"
android:bottom="5dp" >
</padding>
<corners
android:radius="360dp" >
</corners>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#FFFFFF" />
<solid android:color="@color/off_white" />
<corners android:radius="8dp" />
<padding
android:bottom="7dip"
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/off_white" />
<item>
<bitmap android:src="@drawable/ic_bus"
android:gravity="center" />
</item>
</layer-list>
\ No newline at end of file
......@@ -7,15 +7,23 @@
tools:context=".CreateAccountActivity">
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="25dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/create_account_label"
android:layout_above="@+id/input_name"
android:textSize="40dp"
android:textStyle="bold"
android:textColor="@color/blue"
android:layout_marginBottom="15dp"
/>
<com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
android:id="@+id/shadow_item_container"
style="@style/ms9_DefaultShadowStyle"
......@@ -24,13 +32,12 @@
app:ms9_shadowElevation="4dp"
app:ms9_shadowTranslationZ="2dp">
<RelativeLayout
android:id="@+id/input_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
android:layout_height="wrap_content">
<EditText
android:id="@+id/input_name"
......@@ -70,6 +77,22 @@
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/input_busline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/input_password"
android:layout_marginTop="20dp"
android:drawableLeft="@drawable/ic_plus"
android:drawablePadding="10dp"
android:background="@drawable/bg_add_bus"
android:padding="15dp"
android:gravity="left|center_vertical"
style="?android:attr/borderlessButtonStyle"
android:text="@string/create_account_btn_txt_ENG"
android:textColor="@color/blue" />
</RelativeLayout>
</com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView>
......@@ -96,6 +119,19 @@
android:textAllCaps="false"
android:textColor="@color/blue" />
<!-- Link to Login Screen -->
<Button
android:id="@+id/btnLogin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/btn_reset_password"
android:background="@null"
android:text="@string/btn_login"
android:textAllCaps="false"
android:textColor="@color/green"
android:textSize="15dp" />
<ProgressBar
android:id="@+id/progressBar"
......@@ -106,7 +142,7 @@
android:layout_marginBottom="20dp"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".LoginActivity">
<Button
android:id="@+id/create_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@null"
android:text="@string/btn_login"
android:textAllCaps="false"
android:textColor="@color/green"
android:textSize="15dp" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
......@@ -8,11 +8,12 @@
<color name="off_white">#fafAFA</color>
<color name="blue">#007aff</color>
<color name="off_blue">#0075f5</color>
<color name="off_blue">#006ee7</color>
<color name="green">#4cd964</color>
<color name="red">#ff2d55</color>
<color name="black">#000000</color>
<color name="gray">#ceced2</color>
<color name="gray">#ececec</color>
<color name="off_gray">#e1e1e1</color>
......
......@@ -5,5 +5,7 @@
<string name="create_account_btn_txt_ENG">Create Account</string>
<string name="btn_forgot_password">Forgot Your Password?</string>
<string name="btn_login">Already registered. Login Me!</string>
<string name="create_account_label">Create your account</string>
</resources>
......@@ -8,4 +8,8 @@
<item name="android:windowLightStatusBar">true</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/bg_splash</item>
</style>
</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