Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Augmented Reality Chemistry Laboratory
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-189
Augmented Reality Chemistry Laboratory
Commits
e94295ad
Commit
e94295ad
authored
Oct 16, 2021
by
Mahima Induvara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Login interface created! Google Sign option added!
parent
a7a3da24
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
568 additions
and
19 deletions
+568
-19
app/build.gradle
app/build.gradle
+7
-1
app/google-services.json
app/google-services.json
+39
-0
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+7
-4
app/src/main/java/com/example/archemistrylab/LoginActivity.java
...c/main/java/com/example/archemistrylab/LoginActivity.java
+147
-0
app/src/main/java/com/example/archemistrylab/MainActivity.java
...rc/main/java/com/example/archemistrylab/MainActivity.java
+52
-3
app/src/main/java/com/example/archemistrylab/data/LoginDataSource.java
...java/com/example/archemistrylab/data/LoginDataSource.java
+29
-0
app/src/main/java/com/example/archemistrylab/data/LoginRepository.java
...java/com/example/archemistrylab/data/LoginRepository.java
+54
-0
app/src/main/java/com/example/archemistrylab/data/Result.java
...src/main/java/com/example/archemistrylab/data/Result.java
+48
-0
app/src/main/java/com/example/archemistrylab/data/model/LoggedInUser.java
...a/com/example/archemistrylab/data/model/LoggedInUser.java
+23
-0
app/src/main/java/com/example/archemistrylab/welcome.java
app/src/main/java/com/example/archemistrylab/welcome.java
+40
-0
app/src/main/res/drawable/gradeint_background.xml
app/src/main/res/drawable/gradeint_background.xml
+2
-2
app/src/main/res/layout/activity_login.xml
app/src/main/res/layout/activity_login.xml
+61
-0
app/src/main/res/layout/activity_welcome.xml
app/src/main/res/layout/activity_welcome.xml
+41
-0
app/src/main/res/layout/content_main.xml
app/src/main/res/layout/content_main.xml
+0
-2
app/src/main/res/layout/nav_header_main.xml
app/src/main/res/layout/nav_header_main.xml
+4
-3
app/src/main/res/values/colors.xml
app/src/main/res/values/colors.xml
+1
-1
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+12
-3
build.gradle
build.gradle
+1
-0
No files found.
app/build.gradle
View file @
e94295ad
...
@@ -3,6 +3,7 @@ plugins {
...
@@ -3,6 +3,7 @@ plugins {
id
'com.chaquo.python'
id
'com.chaquo.python'
id
'kotlin-android'
id
'kotlin-android'
id
'kotlin-android-extensions'
id
'kotlin-android-extensions'
id
'com.google.gms.google-services'
}
}
apply
plugin:
'com.android.application'
apply
plugin:
'com.android.application'
...
@@ -55,7 +56,9 @@ dependencies {
...
@@ -55,7 +56,9 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'com.google.android.material:material:1.3.0'
implementation
'com.google.android.material:material:1.3.0'
implementation
'androidx.constraintlayout:constraintlayout:2.0.4'
implementation
'androidx.constraintlayout:constraintlayout:2.0.4'
//firebase
implementation
platform
(
'com.google.firebase:firebase-bom:28.4.2'
)
implementation
'com.google.android.gms:play-services-auth:19.2.0'
//retrofit
//retrofit
implementation
'com.squareup.retrofit2:retrofit:2.9.0'
implementation
'com.squareup.retrofit2:retrofit:2.9.0'
implementation
'com.squareup.retrofit2:converter-gson:2.9.0'
implementation
'com.squareup.retrofit2:converter-gson:2.9.0'
...
@@ -66,6 +69,9 @@ dependencies {
...
@@ -66,6 +69,9 @@ dependencies {
implementation
'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation
'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation
'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation
'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation
'androidx.annotation:annotation:1.1.0'
implementation
'com.google.android.gms:play-services-auth:18.0.0'
implementation
'com.google.firebase:firebase-auth:21.0.1'
testImplementation
'junit:junit:4.13.2'
testImplementation
'junit:junit:4.13.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
...
...
app/google-services.json
0 → 100644
View file @
e94295ad
{
"project_info"
:
{
"project_number"
:
"896347651222"
,
"project_id"
:
"archemistrylab-8bef8"
,
"storage_bucket"
:
"archemistrylab-8bef8.appspot.com"
},
"client"
:
[
{
"client_info"
:
{
"mobilesdk_app_id"
:
"1:896347651222:android:f4eacd7bf2aa0a5d9e16b7"
,
"android_client_info"
:
{
"package_name"
:
"com.example.archemistrylab"
}
},
"oauth_client"
:
[
{
"client_id"
:
"896347651222-00g5heg0v8r55akrantl1ol9divnp44q.apps.googleusercontent.com"
,
"client_type"
:
3
}
],
"api_key"
:
[
{
"current_key"
:
"AIzaSyD5x9E774Cev4BElq82fRiAdJQyQDKu5v8"
}
],
"services"
:
{
"appinvite_service"
:
{
"other_platform_oauth_client"
:
[
{
"client_id"
:
"896347651222-00g5heg0v8r55akrantl1ol9divnp44q.apps.googleusercontent.com"
,
"client_type"
:
3
}
]
}
}
}
],
"configuration_version"
:
"1"
}
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
e94295ad
...
@@ -10,12 +10,15 @@
...
@@ -10,12 +10,15 @@
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_main_icon_1_foreground"
android:roundIcon=
"@mipmap/ic_main_icon_1_foreground"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:usesCleartextTraffic=
"true"
android:theme=
"@style/Theme.ARChemistryLab"
android:theme=
"@style/Theme.ARChemistryLab"
>
android:usesCleartextTraffic=
"true"
>
<activity
android:name=
".ChatbotMain"
></activity>
<activity
android:name=
".LoginActivity"
/>
<activity
android:name=
".ChatbotMain"
/>
<activity
android:name=
"chatbot.MainActivity"
/>
<activity
android:name=
"chatbot.MainActivity"
/>
<activity
android:name=
".MainActivity"
/>
<activity
<activity
android:name=
".
MainActivity
"
android:name=
".
welcome
"
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:theme=
"@style/Theme.ARChemistryLab.NoActionBar"
>
android:theme=
"@style/Theme.ARChemistryLab.NoActionBar"
>
<intent-filter>
<intent-filter>
...
...
app/src/main/java/com/example/archemistrylab/LoginActivity.java
0 → 100644
View file @
e94295ad
package
com.example.archemistrylab
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.provider.ContactsContract
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.view.inputmethod.EditorInfo
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.ProgressBar
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.google.android.gms.auth.api.signin.GoogleSignIn
;
import
com.google.android.gms.auth.api.signin.GoogleSignInAccount
;
import
com.google.android.gms.auth.api.signin.GoogleSignInClient
;
import
com.google.android.gms.auth.api.signin.GoogleSignInOptions
;
import
com.google.android.gms.common.api.ApiException
;
import
com.google.android.gms.tasks.OnCompleteListener
;
import
com.google.android.gms.tasks.Task
;
import
com.google.firebase.auth.AuthCredential
;
import
com.google.firebase.auth.AuthResult
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.auth.FirebaseUser
;
import
com.google.firebase.auth.GoogleAuthProvider
;
import
androidx.annotation.NonNull
;
import
androidx.appcompat.app.AppCompatActivity
;
public
class
LoginActivity
extends
AppCompatActivity
{
private
GoogleSignInClient
mGoogleSignInClient
;
private
final
static
int
RC_SIGN_IN
=
123
;
private
FirebaseAuth
mAuth
;
@Override
protected
void
onStart
()
{
super
.
onStart
();
FirebaseUser
user
=
mAuth
.
getCurrentUser
();
if
(
user
!=
null
){
Intent
intent
=
new
Intent
(
getApplicationContext
(),
MainActivity
.
class
);
startActivity
(
intent
);
}
}
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_login
);
mAuth
=
FirebaseAuth
.
getInstance
();
createRequest
();
findViewById
(
R
.
id
.
google_signIn
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
signIn
();
}
});
}
private
void
createRequest
()
{
// Configure Google Sign In
GoogleSignInOptions
gso
=
new
GoogleSignInOptions
.
Builder
(
GoogleSignInOptions
.
DEFAULT_SIGN_IN
)
.
requestIdToken
(
getString
(
R
.
string
.
default_web_client_id
))
.
requestEmail
()
.
build
();
// Build a GoogleSignInClient with the options specified by gso.
mGoogleSignInClient
=
GoogleSignIn
.
getClient
(
this
,
gso
);
}
private
void
signIn
()
{
Intent
signInIntent
=
mGoogleSignInClient
.
getSignInIntent
();
startActivityForResult
(
signInIntent
,
RC_SIGN_IN
);
}
@Override
public
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
// Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if
(
requestCode
==
RC_SIGN_IN
)
{
Task
<
GoogleSignInAccount
>
task
=
GoogleSignIn
.
getSignedInAccountFromIntent
(
data
);
try
{
// Google Sign In was successful, authenticate with Firebase
GoogleSignInAccount
account
=
task
.
getResult
(
ApiException
.
class
);
firebaseAuthWithGoogle
(
account
);
}
catch
(
ApiException
e
)
{
// Google Sign In failed, update UI appropriately
Toast
.
makeText
(
this
,
e
.
getMessage
(),
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
private
void
firebaseAuthWithGoogle
(
GoogleSignInAccount
acct
)
{
AuthCredential
credential
=
GoogleAuthProvider
.
getCredential
(
acct
.
getIdToken
(),
null
);
mAuth
.
signInWithCredential
(
credential
)
.
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
FirebaseUser
user
=
mAuth
.
getCurrentUser
();
Intent
intent
=
new
Intent
(
getApplicationContext
(),
MainActivity
.
class
);
startActivity
(
intent
);
}
else
{
Toast
.
makeText
(
LoginActivity
.
this
,
"Sorry auth failed."
,
Toast
.
LENGTH_SHORT
).
show
();
}
// ...
}
});
}
}
app/src/main/java/com/example/archemistrylab/MainActivity.java
View file @
e94295ad
package
com.example.archemistrylab
;
package
com.example.archemistrylab
;
import
android.content.ClipData
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.MenuInflater
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.View
;
import
android.view.Menu
;
import
android.view.Menu
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -9,7 +13,10 @@ import android.widget.TextView;
...
@@ -9,7 +13,10 @@ import android.widget.TextView;
import
com.google.android.material.floatingactionbutton.FloatingActionButton
;
import
com.google.android.material.floatingactionbutton.FloatingActionButton
;
import
com.google.android.material.snackbar.Snackbar
;
import
com.google.android.material.snackbar.Snackbar
;
import
com.google.android.material.navigation.NavigationView
;
import
com.google.android.material.navigation.NavigationView
;
import
com.google.firebase.auth.FirebaseAuth
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.core.view.GravityCompat
;
import
androidx.navigation.NavController
;
import
androidx.navigation.NavController
;
import
androidx.navigation.Navigation
;
import
androidx.navigation.Navigation
;
import
androidx.navigation.ui.AppBarConfiguration
;
import
androidx.navigation.ui.AppBarConfiguration
;
...
@@ -27,8 +34,8 @@ public class MainActivity extends AppCompatActivity {
...
@@ -27,8 +34,8 @@ public class MainActivity extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
setContentView
(
R
.
layout
.
activity_main
);
Toolbar
toolbar
=
findViewById
(
R
.
id
.
toolbar
);
//
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar
(
toolbar
);
//
setSupportActionBar(toolbar);
FloatingActionButton
fab
=
findViewById
(
R
.
id
.
fab
);
FloatingActionButton
fab
=
findViewById
(
R
.
id
.
fab
);
...
@@ -50,14 +57,56 @@ public class MainActivity extends AppCompatActivity {
...
@@ -50,14 +57,56 @@ public class MainActivity extends AppCompatActivity {
NavigationUI
.
setupActionBarWithNavController
(
this
,
navController
,
mAppBarConfiguration
);
NavigationUI
.
setupActionBarWithNavController
(
this
,
navController
,
mAppBarConfiguration
);
NavigationUI
.
setupWithNavController
(
navigationView
,
navController
);
NavigationUI
.
setupWithNavController
(
navigationView
,
navController
);
}
}
@Override
public
void
onBackPressed
()
{
DrawerLayout
drawer
=
findViewById
(
R
.
id
.
drawer_layout
);
if
(
drawer
.
isDrawerOpen
(
GravityCompat
.
START
))
{
drawer
.
closeDrawer
(
GravityCompat
.
START
);
}
else
{
final
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
MainActivity
.
this
);
builder
.
setMessage
(
"Are you sure want to Exit ?"
);
builder
.
setCancelable
(
true
);
builder
.
setNegativeButton
(
"Yes"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
i
)
{
finish
();
}
});
builder
.
setPositiveButton
(
"Cancle"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
i
)
{
dialogInterface
.
cancel
();
}
});
AlertDialog
alrt
=
builder
.
create
();
alrt
.
show
();
}
}
private
void
logout
()
{
FirebaseAuth
.
getInstance
().
signOut
();
Intent
intent
=
new
Intent
(
MainActivity
.
this
,
LoginActivity
.
class
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
startActivity
(
intent
);
finish
();
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
// Handle item selection
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_settings
:
logout
();
return
true
;
default
:
return
super
.
onOptionsItemSelected
(
item
);
}
}
@Override
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
// Inflate the menu; this adds items to the action bar if it is present.
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater
().
inflate
(
R
.
menu
.
main
,
menu
);
getMenuInflater
().
inflate
(
R
.
menu
.
main
,
menu
);
return
true
;
return
true
;
}
}
@Override
@Override
public
boolean
onSupportNavigateUp
()
{
public
boolean
onSupportNavigateUp
()
{
NavController
navController
=
Navigation
.
findNavController
(
this
,
R
.
id
.
nav_host_fragment
);
NavController
navController
=
Navigation
.
findNavController
(
this
,
R
.
id
.
nav_host_fragment
);
...
...
app/src/main/java/com/example/archemistrylab/data/LoginDataSource.java
0 → 100644
View file @
e94295ad
package
com.example.archemistrylab.data
;
import
com.example.archemistrylab.data.model.LoggedInUser
;
import
java.io.IOException
;
/**
* Class that handles authentication w/ login credentials and retrieves user information.
*/
public
class
LoginDataSource
{
public
Result
<
LoggedInUser
>
login
(
String
username
,
String
password
)
{
try
{
// TODO: handle loggedInUser authentication
LoggedInUser
fakeUser
=
new
LoggedInUser
(
java
.
util
.
UUID
.
randomUUID
().
toString
(),
"Jane Doe"
);
return
new
Result
.
Success
<>(
fakeUser
);
}
catch
(
Exception
e
)
{
return
new
Result
.
Error
(
new
IOException
(
"Error logging in"
,
e
));
}
}
public
void
logout
()
{
// TODO: revoke authentication
}
}
\ No newline at end of file
app/src/main/java/com/example/archemistrylab/data/LoginRepository.java
0 → 100644
View file @
e94295ad
package
com.example.archemistrylab.data
;
import
com.example.archemistrylab.data.model.LoggedInUser
;
/**
* Class that requests authentication and user information from the remote data source and
* maintains an in-memory cache of login status and user credentials information.
*/
public
class
LoginRepository
{
private
static
volatile
LoginRepository
instance
;
private
LoginDataSource
dataSource
;
// If user credentials will be cached in local storage, it is recommended it be encrypted
// @see https://developer.android.com/training/articles/keystore
private
LoggedInUser
user
=
null
;
// private constructor : singleton access
private
LoginRepository
(
LoginDataSource
dataSource
)
{
this
.
dataSource
=
dataSource
;
}
public
static
LoginRepository
getInstance
(
LoginDataSource
dataSource
)
{
if
(
instance
==
null
)
{
instance
=
new
LoginRepository
(
dataSource
);
}
return
instance
;
}
public
boolean
isLoggedIn
()
{
return
user
!=
null
;
}
public
void
logout
()
{
user
=
null
;
dataSource
.
logout
();
}
private
void
setLoggedInUser
(
LoggedInUser
user
)
{
this
.
user
=
user
;
// If user credentials will be cached in local storage, it is recommended it be encrypted
// @see https://developer.android.com/training/articles/keystore
}
public
Result
<
LoggedInUser
>
login
(
String
username
,
String
password
)
{
// handle login
Result
<
LoggedInUser
>
result
=
dataSource
.
login
(
username
,
password
);
if
(
result
instanceof
Result
.
Success
)
{
setLoggedInUser
(((
Result
.
Success
<
LoggedInUser
>)
result
).
getData
());
}
return
result
;
}
}
\ No newline at end of file
app/src/main/java/com/example/archemistrylab/data/Result.java
0 → 100644
View file @
e94295ad
package
com.example.archemistrylab.data
;
/**
* A generic class that holds a result success w/ data or an error exception.
*/
public
class
Result
<
T
>
{
// hide the private constructor to limit subclass types (Success, Error)
private
Result
()
{
}
@Override
public
String
toString
()
{
if
(
this
instanceof
Result
.
Success
)
{
Result
.
Success
success
=
(
Result
.
Success
)
this
;
return
"Success[data="
+
success
.
getData
().
toString
()
+
"]"
;
}
else
if
(
this
instanceof
Result
.
Error
)
{
Result
.
Error
error
=
(
Result
.
Error
)
this
;
return
"Error[exception="
+
error
.
getError
().
toString
()
+
"]"
;
}
return
""
;
}
// Success sub-class
public
final
static
class
Success
<
T
>
extends
Result
{
private
T
data
;
public
Success
(
T
data
)
{
this
.
data
=
data
;
}
public
T
getData
()
{
return
this
.
data
;
}
}
// Error sub-class
public
final
static
class
Error
extends
Result
{
private
Exception
error
;
public
Error
(
Exception
error
)
{
this
.
error
=
error
;
}
public
Exception
getError
()
{
return
this
.
error
;
}
}
}
\ No newline at end of file
app/src/main/java/com/example/archemistrylab/data/model/LoggedInUser.java
0 → 100644
View file @
e94295ad
package
com.example.archemistrylab.data.model
;
/**
* Data class that captures user information for logged in users retrieved from LoginRepository
*/
public
class
LoggedInUser
{
private
String
userId
;
private
String
displayName
;
public
LoggedInUser
(
String
userId
,
String
displayName
)
{
this
.
userId
=
userId
;
this
.
displayName
=
displayName
;
}
public
String
getUserId
()
{
return
userId
;
}
public
String
getDisplayName
()
{
return
displayName
;
}
}
\ No newline at end of file
app/src/main/java/com/example/archemistrylab/welcome.java
0 → 100644
View file @
e94295ad
package
com.example.archemistrylab
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.ProgressBar
;
import
androidx.appcompat.app.AppCompatActivity
;
import
java.util.Timer
;
import
java.util.TimerTask
;
public
class
welcome
extends
AppCompatActivity
{
ProgressBar
pg
;
private
static
int
Splach_time
=
5000
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_welcome
);
pg
=
findViewById
(
R
.
id
.
progressBar2
);
new
Timer
().
schedule
(
new
TimerTask
()
{
@Override
public
void
run
()
{
startActivity
(
new
Intent
(
getApplicationContext
(),
LoginActivity
.
class
));
finish
();
}
},
2000
);
}
public
void
sendData
(
View
v
){
Intent
myintent
=
new
Intent
();
startActivity
(
myintent
);
pg
.
setVisibility
(
v
.
VISIBLE
);
}
}
app/src/main/res/drawable/gradeint_background.xml
View file @
e94295ad
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
<shape>
<shape>
<gradient
android:angle=
"90"
<gradient
android:angle=
"90"
android:startColor=
"#
00c6f
b"
android:startColor=
"#
4481e
b"
android:endColor=
"#0
05bea
"
android:endColor=
"#0
4befe
"
android:type=
"linear"
android:type=
"linear"
></gradient>
></gradient>
...
...
app/src/main/res/layout/activity_login.xml
0 → 100644
View file @
e94295ad
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id=
"@+id/container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingLeft=
"@dimen/activity_horizontal_margin"
android:paddingTop=
"@dimen/activity_vertical_margin"
android:paddingRight=
"@dimen/activity_horizontal_margin"
android:paddingBottom=
"@dimen/activity_vertical_margin"
>
<ImageView
android:id=
"@+id/imageView2"
android:layout_width=
"match_parent"
android:layout_height=
"150dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"150dp"
android:src=
"@drawable/ic_flask"
app:layout_constraintBottom_toTopOf=
"@+id/sign_text"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.742"
/>
<TextView
android:id=
"@+id/sign_text"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:shadowColor=
"#0E0E0E"
android:text=
"Sign-In with Google"
android:textAlignment=
"center"
android:textColor=
"#000000"
android:textSize=
"14sp"
app:layout_constraintBottom_toTopOf=
"@+id/google_signIn"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/imageView2"
app:layout_constraintVertical_bias=
"0.273"
/>
<Button
android:id=
"@+id/google_signIn"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"start"
android:layout_marginStart=
"48dp"
android:layout_marginEnd=
"48dp"
android:layout_marginBottom=
"208dp"
android:backgroundTint=
"#f43b47"
android:text=
"@string/action_sign_in"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.569"
app:layout_constraintStart_toStartOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_welcome.xml
0 → 100644
View file @
e94295ad
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"
android:background=
"@drawable/back"
tools:context=
".welcome"
>
<ImageView
android:id=
"@+id/imageView18"
android:layout_width=
"245dp"
android:layout_height=
"187dp"
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"8dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.471"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.373"
app:srcCompat=
"@drawable/ic_flask"
/>
<ProgressBar
android:id=
"@+id/progressBar2"
style=
"?android:attr/progressBarStyle"
android:layout_width=
"57dp"
android:layout_height=
"58dp"
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginBottom=
"8dp"
android:onClick=
"sendData"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/imageView18"
app:layout_constraintVertical_bias=
"0.271"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/content_main.xml
View file @
e94295ad
...
@@ -44,7 +44,6 @@
...
@@ -44,7 +44,6 @@
android:layout_height=
"fill_parent"
>
android:layout_height=
"fill_parent"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"230dp"
android:layout_height=
"230dp"
android:background=
"@drawable/back"
android:background=
"@drawable/back"
...
@@ -68,7 +67,6 @@
...
@@ -68,7 +67,6 @@
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"135dp"
android:layout_height=
"135dp"
android:layout_marginBottom=
"10dp"
android:layout_marginBottom=
"10dp"
...
...
app/src/main/res/layout/nav_header_main.xml
View file @
e94295ad
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
android:paddingTop=
"@dimen/activity_vertical_margin"
android:paddingTop=
"@dimen/activity_vertical_margin"
android:paddingRight=
"@dimen/activity_horizontal_margin"
android:paddingRight=
"@dimen/activity_horizontal_margin"
android:paddingBottom=
"@dimen/activity_vertical_margin"
android:paddingBottom=
"@dimen/activity_vertical_margin"
android:
theme=
"@style/ThemeOverlay.AppCompat.Dark
"
>
android:
backgroundTint=
"@color/browser_actions_bg_grey
"
>
<ImageView
<ImageView
android:id=
"@+id/imageView"
android:id=
"@+id/imageView"
...
@@ -18,13 +18,14 @@
...
@@ -18,13 +18,14 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:contentDescription=
"@string/nav_header_desc"
android:contentDescription=
"@string/nav_header_desc"
android:paddingTop=
"@dimen/nav_header_vertical_spacing"
android:paddingTop=
"@dimen/nav_header_vertical_spacing"
app:srcCompat=
"@mipmap/ic_user_main_foreground"
/>
app:srcCompat=
"@mipmap/ic_main_icon_1"
android:visibility=
"gone"
/>
<TextView
<TextView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingTop=
"@dimen/nav_header_vertical_spacing"
android:paddingTop=
"@dimen/nav_header_vertical_spacing"
android:text=
"
AR Chem
"
android:text=
"
@string/nav_header_title
"
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
android:textAppearance=
"@style/TextAppearance.AppCompat.Body1"
/>
<TextView
<TextView
...
...
app/src/main/res/values/colors.xml
View file @
e94295ad
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<resources>
<resources>
<color
name=
"purple_200"
>
#00c6fb
</color>
<color
name=
"purple_200"
>
#00c6fb
</color>
<color
name=
"purple_500"
>
#005bea
</color>
<color
name=
"purple_500"
>
#005bea
</color>
<color
name=
"purple_700"
>
#00
5bea
</color>
<color
name=
"purple_700"
>
#00
c6fb
</color>
<color
name=
"teal_200"
>
#00c6fb
</color>
<color
name=
"teal_200"
>
#00c6fb
</color>
<color
name=
"teal_700"
>
#005bea
</color>
<color
name=
"teal_700"
>
#005bea
</color>
<color
name=
"black"
>
#FF000000
</color>
<color
name=
"black"
>
#FF000000
</color>
...
...
app/src/main/res/values/strings.xml
View file @
e94295ad
...
@@ -2,12 +2,21 @@
...
@@ -2,12 +2,21 @@
<string
name=
"app_name"
>
ARChemistryLab
</string>
<string
name=
"app_name"
>
ARChemistryLab
</string>
<string
name=
"navigation_drawer_open"
>
Open navigation drawer
</string>
<string
name=
"navigation_drawer_open"
>
Open navigation drawer
</string>
<string
name=
"navigation_drawer_close"
>
Close navigation drawer
</string>
<string
name=
"navigation_drawer_close"
>
Close navigation drawer
</string>
<string
name=
"nav_header_title"
>
A
ndroid Studio
</string>
<string
name=
"nav_header_title"
>
A
ugmented Reality Chemistry
</string>
<string
name=
"nav_header_subtitle"
>
a
ndroid.studio@android.com
</string>
<string
name=
"nav_header_subtitle"
>
a
rchem.sliit.lk
</string>
<string
name=
"nav_header_desc"
>
Navigation header
</string>
<string
name=
"nav_header_desc"
>
Navigation header
</string>
<string
name=
"action_settings"
>
Settings
</string>
<string
name=
"action_settings"
>
Logout
</string>
<string
name=
"menu_home"
>
Home
</string>
<string
name=
"menu_home"
>
Home
</string>
<string
name=
"menu_gallery"
>
Settings
</string>
<string
name=
"menu_gallery"
>
Settings
</string>
<string
name=
"menu_slideshow"
>
About Us
</string>
<string
name=
"menu_slideshow"
>
About Us
</string>
<string
name=
"title_activity_login"
>
LoginActivity
</string>
<string
name=
"prompt_email"
>
Email
</string>
<string
name=
"prompt_password"
>
Password
</string>
<string
name=
"action_sign_in"
>
Sign in or register
</string>
<string
name=
"action_sign_in_short"
>
Sign in
</string>
<string
name=
"welcome"
>
"Welcome !"
</string>
<string
name=
"invalid_username"
>
Not a valid username
</string>
<string
name=
"invalid_password"
>
Password must be >5 characters
</string>
<string
name=
"login_failed"
>
"Login failed"
</string>
</resources>
</resources>
\ No newline at end of file
build.gradle
View file @
e94295ad
...
@@ -12,6 +12,7 @@ buildscript {
...
@@ -12,6 +12,7 @@ buildscript {
classpath
"com.android.tools.build:gradle:4.1.3"
classpath
"com.android.tools.build:gradle:4.1.3"
classpath
"com.chaquo.python:gradle:9.1.0"
classpath
"com.chaquo.python:gradle:9.1.0"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath
'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// in the individual module build.gradle files
...
...
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