Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
5
5711403296
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paded
5711403296
Commits
77baf646
Commit
77baf646
authored
Jan 17, 2018
by
Paded
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add login activity
parent
369e5bf3
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
237 additions
and
25 deletions
+237
-25
build_file_checksums.ser
.idea/caches/build_file_checksums.ser
+0
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+10
-13
CreateAccountActivity.java
...er/paded/com/ubontransitdriver/CreateAccountActivity.java
+10
-0
LoginActivity.java
...nsitdriver/paded/com/ubontransitdriver/LoginActivity.java
+28
-0
MainActivity.java
...ansitdriver/paded/com/ubontransitdriver/MainActivity.java
+6
-0
SplashActivity.java
...sitdriver/paded/com/ubontransitdriver/SplashActivity.java
+34
-0
bg_add_bus.xml
app/src/main/res/drawable/bg_add_bus.xml
+9
-0
bg_add_bus_clicked.xml
app/src/main/res/drawable/bg_add_bus_clicked.xml
+26
-0
bg_add_bus_normal.xml
app/src/main/res/drawable/bg_add_bus_normal.xml
+26
-0
bg_edittext_focused.xml
app/src/main/res/drawable/bg_edittext_focused.xml
+1
-1
bg_splash.xml
app/src/main/res/drawable/bg_splash.xml
+12
-0
create_account_layout.xml
app/src/main/res/layout/create_account_layout.xml
+45
-9
login_layout.xml
app/src/main/res/layout/login_layout.xml
+21
-0
colors.xml
app/src/main/res/values/colors.xml
+3
-2
strings.xml
app/src/main/res/values/strings.xml
+2
-0
styles.xml
app/src/main/res/values/styles.xml
+4
-0
No files found.
.idea/caches/build_file_checksums.ser
View file @
77baf646
No preview for this file type
app/src/main/AndroidManifest.xml
View file @
77baf646
...
@@ -10,25 +10,21 @@
...
@@ -10,25 +10,21 @@
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
android:theme=
"@style/AppTheme"
>
<activity
>
android:name=
".MainActivity"
<activity
android:name=
".MainActivity"
android:windowSoftInputMode=
"adjustResize"
></activity>
android:windowSoftInputMode=
"adjustResize"
<activity
android:name=
".CreateAccountActivity"
></activity>
>
<activity
<intent-filter>
android:name=
".SplashActivity"
<action
android:name=
"android.intent.action.MAIN"
/>
android:theme=
"@style/SplashTheme"
>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".CreateAccountActivity"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</intent-filter>
</activity>
</activity>
<activity
android:name=
".LoginActivity"
></activity>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
app/src/main/java/ubontransitdriver/paded/com/ubontransitdriver/CreateAccountActivity.java
View file @
77baf646
...
@@ -43,6 +43,7 @@ public class CreateAccountActivity extends AppCompatActivity {
...
@@ -43,6 +43,7 @@ public class CreateAccountActivity extends AppCompatActivity {
btnCreateAccount
=
(
Button
)
findViewById
(
R
.
id
.
btn_create_account
);
btnCreateAccount
=
(
Button
)
findViewById
(
R
.
id
.
btn_create_account
);
btnResetPassword
=
(
Button
)
findViewById
(
R
.
id
.
btn_reset_password
);
btnResetPassword
=
(
Button
)
findViewById
(
R
.
id
.
btn_reset_password
);
btnLogin
=
(
Button
)
findViewById
(
R
.
id
.
btnLogin
);
btnCreateAccount
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
btnCreateAccount
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
...
@@ -97,6 +98,15 @@ public class CreateAccountActivity extends AppCompatActivity {
...
@@ -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
){
public
void
insertData
(
String
uid
,
String
name
){
...
...
app/src/main/java/ubontransitdriver/paded/com/ubontransitdriver/LoginActivity.java
0 → 100644
View file @
77baf646
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
();
}
});
}
}
app/src/main/java/ubontransitdriver/paded/com/ubontransitdriver/MainActivity.java
View file @
77baf646
...
@@ -2,16 +2,20 @@ package ubontransitdriver.paded.com.ubontransitdriver;
...
@@ -2,16 +2,20 @@ package ubontransitdriver.paded.com.ubontransitdriver;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.widget.Button
;
import
com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
;
import
com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
;
public
class
MainActivity
extends
AppCompatActivity
{
public
class
MainActivity
extends
AppCompatActivity
{
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
main_layout
);
setContentView
(
R
.
layout
.
main_layout
);
MaterialShadowContainerView
shadowView
=
MaterialShadowContainerView
shadowView
=
(
MaterialShadowContainerView
)
findViewById
(
R
.
id
.
shadow_item_container
);
(
MaterialShadowContainerView
)
findViewById
(
R
.
id
.
shadow_item_container
);
...
@@ -19,5 +23,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -19,5 +23,7 @@ public class MainActivity extends AppCompatActivity {
shadowView
.
setShadowTranslationZ
(
density
*
2.0f
);
// 2.0 dp
shadowView
.
setShadowTranslationZ
(
density
*
2.0f
);
// 2.0 dp
shadowView
.
setShadowElevation
(
density
*
4.0f
);
// 4.0 dp
shadowView
.
setShadowElevation
(
density
*
4.0f
);
// 4.0 dp
}
}
}
}
app/src/main/java/ubontransitdriver/paded/com/ubontransitdriver/SplashActivity.java
0 → 100644
View file @
77baf646
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
();
}
}
}
app/src/main/res/drawable/bg_add_bus.xml
0 → 100644
View file @
77baf646
<?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
app/src/main/res/drawable/bg_add_bus_clicked.xml
0 → 100644
View file @
77baf646
<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
app/src/main/res/drawable/bg_add_bus_normal.xml
0 → 100644
View file @
77baf646
<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
app/src/main/res/drawable/bg_edittext_focused.xml
View file @
77baf646
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"
#FFFFFF
"
/>
<solid
android:color=
"
@color/off_white
"
/>
<corners
android:radius=
"8dp"
/>
<corners
android:radius=
"8dp"
/>
<padding
<padding
android:bottom=
"7dip"
android:bottom=
"7dip"
...
...
app/src/main/res/drawable/bg_splash.xml
0 → 100644
View file @
77baf646
<?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
app/src/main/res/layout/create_account_layout.xml
View file @
77baf646
...
@@ -7,15 +7,23 @@
...
@@ -7,15 +7,23 @@
tools:context=
".CreateAccountActivity"
>
tools:context=
".CreateAccountActivity"
>
<
Relative
Layout
<
Linear
Layout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:orientation=
"vertical"
android:padding=
"25dp"
>
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
<com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
android:id=
"@+id/shadow_item_container"
android:id=
"@+id/shadow_item_container"
style=
"@style/ms9_DefaultShadowStyle"
style=
"@style/ms9_DefaultShadowStyle"
...
@@ -24,13 +32,12 @@
...
@@ -24,13 +32,12 @@
app:ms9_shadowElevation=
"4dp"
app:ms9_shadowElevation=
"4dp"
app:ms9_shadowTranslationZ=
"2dp"
>
app:ms9_shadowTranslationZ=
"2dp"
>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/input_layout"
android:id=
"@+id/input_layout"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
>
>
<EditText
<EditText
android:id=
"@+id/input_name"
android:id=
"@+id/input_name"
...
@@ -70,6 +77,22 @@
...
@@ -70,6 +77,22 @@
android:ems=
"10"
android:ems=
"10"
android:inputType=
"textPassword"
/>
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>
</RelativeLayout>
</com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView>
</com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView>
...
@@ -96,6 +119,19 @@
...
@@ -96,6 +119,19 @@
android:textAllCaps=
"false"
android:textAllCaps=
"false"
android:textColor=
"@color/blue"
/>
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
<ProgressBar
android:id=
"@+id/progressBar"
android:id=
"@+id/progressBar"
...
@@ -106,7 +142,7 @@
...
@@ -106,7 +142,7 @@
android:layout_marginBottom=
"20dp"
android:layout_marginBottom=
"20dp"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
</
Relative
Layout>
</
Linear
Layout>
...
...
app/src/main/res/layout/login_layout.xml
0 → 100644
View file @
77baf646
<?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
app/src/main/res/values/colors.xml
View file @
77baf646
...
@@ -8,11 +8,12 @@
...
@@ -8,11 +8,12 @@
<color
name=
"off_white"
>
#fafAFA
</color>
<color
name=
"off_white"
>
#fafAFA
</color>
<color
name=
"blue"
>
#007aff
</color>
<color
name=
"blue"
>
#007aff
</color>
<color
name=
"off_blue"
>
#00
75f5
</color>
<color
name=
"off_blue"
>
#00
6ee7
</color>
<color
name=
"green"
>
#4cd964
</color>
<color
name=
"green"
>
#4cd964
</color>
<color
name=
"red"
>
#ff2d55
</color>
<color
name=
"red"
>
#ff2d55
</color>
<color
name=
"black"
>
#000000
</color>
<color
name=
"black"
>
#000000
</color>
<color
name=
"gray"
>
#ceced2
</color>
<color
name=
"gray"
>
#ececec
</color>
<color
name=
"off_gray"
>
#e1e1e1
</color>
...
...
app/src/main/res/values/strings.xml
View file @
77baf646
...
@@ -5,5 +5,7 @@
...
@@ -5,5 +5,7 @@
<string
name=
"create_account_btn_txt_ENG"
>
Create Account
</string>
<string
name=
"create_account_btn_txt_ENG"
>
Create Account
</string>
<string
name=
"btn_forgot_password"
>
Forgot Your Password?
</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>
</resources>
app/src/main/res/values/styles.xml
View file @
77baf646
...
@@ -8,4 +8,8 @@
...
@@ -8,4 +8,8 @@
<item
name=
"android:windowLightStatusBar"
>
true
</item>
<item
name=
"android:windowLightStatusBar"
>
true
</item>
</style>
</style>
<style
name=
"SplashTheme"
parent=
"Theme.AppCompat.Light.NoActionBar"
>
<item
name=
"android:windowBackground"
>
@drawable/bg_splash
</item>
</style>
</resources>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment