Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiLostAndFound
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
MUTTINENI NAVYA
InstiLostAndFound
Commits
cbb45e4d
Commit
cbb45e4d
authored
Oct 29, 2019
by
MUTTINENI NAVYA
Browse files
Options
Browse Files
Download
Plain Diff
merge conflicts resolved
parents
c34a628d
8b32ffc8
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
658 additions
and
133 deletions
+658
-133
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+9
-0
app/src/main/java/com/example/instilostandfound/CreateFoundObject.java
...java/com/example/instilostandfound/CreateFoundObject.java
+106
-0
app/src/main/java/com/example/instilostandfound/FoundItem.java
...rc/main/java/com/example/instilostandfound/FoundItem.java
+172
-8
app/src/main/java/com/example/instilostandfound/MainActivity.java
...main/java/com/example/instilostandfound/MainActivity.java
+1
-4
app/src/main/java/com/example/instilostandfound/createDemo.java
...c/main/java/com/example/instilostandfound/createDemo.java
+92
-0
app/src/main/res/layout/activity_found_item.xml
app/src/main/res/layout/activity_found_item.xml
+1
-0
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/activity_main.xml
+25
-63
app/src/main/res/layout/content_found_item.xml
app/src/main/res/layout/content_found_item.xml
+36
-21
app/src/main/res/layout/content_lost_item.xml
app/src/main/res/layout/content_lost_item.xml
+26
-13
app/src/main/res/layout/content_main.xml
app/src/main/res/layout/content_main.xml
+188
-23
app/src/main/res/values/colors.xml
app/src/main/res/values/colors.xml
+1
-0
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+1
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
cbb45e4d
...
@@ -2,6 +2,15 @@
...
@@ -2,6 +2,15 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.example.instilostandfound"
>
package=
"com.example.instilostandfound"
>
<uses-permission
android:name=
"android.permission.CAMERA"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion=
"18"
/>
<uses-feature
android:name=
"android.hardware.camera"
android:required=
"false"
/>
<application
<application
android:allowBackup=
"true"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:icon=
"@mipmap/ic_launcher"
...
...
app/src/main/java/com/example/instilostandfound/CreateFoundObject.java
0 → 100644
View file @
cbb45e4d
package
com.example.instilostandfound
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.database.Exclude
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
public
class
CreateFoundObject
{
//private String mLDAPID;
private
String
mImageUrl
;
private
String
mKey
;
private
String
mTitle
;
private
String
mDate
;
private
String
mLDAP
;
private
String
mDescription
;
private
String
mLocation
;
private
String
mCategory
;
private
Date
mDateFound
;
public
CreateFoundObject
()
{
}
public
CreateFoundObject
(
String
LDAPID
,
String
title
,
String
imageUrl
,
String
location
,
String
desc
,
String
category
,
Date
datefound
)
{
if
(
LDAPID
.
trim
().
equals
(
""
))
{
mLDAP
=
"No Name"
;
}
//mLDAPID = LDAPID;
mImageUrl
=
imageUrl
;
mLDAP
=
FirebaseAuth
.
getInstance
().
getCurrentUser
().
getEmail
();
mDescription
=
desc
;
mLocation
=
location
;
mDateFound
=
datefound
;
mCategory
=
category
;
mTitle
=
title
;
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"dd-MMM-yyyy"
);
Date
date
=
new
Date
();
mDate
=
df
.
format
(
date
);
}
public
String
getLDAP
()
{
return
mLDAP
;
}
public
void
setLDAP
(
String
LDAP
)
{
mLDAP
=
LDAP
;
}
public
String
getmTitle
()
{
return
mTitle
;
}
public
void
setmTitle
(
String
mTitle
)
{
this
.
mTitle
=
mTitle
;
}
public
String
getImageUrl
()
{
return
mImageUrl
;
}
public
void
setImageUrl
(
String
imageUrl
)
{
mImageUrl
=
imageUrl
;
}
public
String
getmCategory
()
{
return
mCategory
;
}
public
void
setmCategory
(
String
category
)
{
mCategory
=
category
;
}
public
Date
getmDateFound
()
{
return
mDateFound
;
}
public
void
setmDateFound
(
Date
dateFound
)
{
mDateFound
=
dateFound
;
}
public
String
getmDescription
()
{
return
mDescription
;
}
public
void
setmDescription
(
String
desc
)
{
mDescription
=
desc
;
}
public
String
getmLocation
()
{
return
mLocation
;}
public
void
setmLocation
(
String
location
)
{
mLocation
=
location
;}
@Exclude
public
String
getKey
()
{
return
mKey
;
}
@Exclude
public
void
setKey
(
String
key
)
{
mKey
=
key
;
}
public
String
getDate
()
{
return
mDate
;
}
public
void
setDate
(
String
date
)
{
mDate
=
date
;
}
}
app/src/main/java/com/example/instilostandfound/FoundItem.java
View file @
cbb45e4d
package
com.example.instilostandfound
;
package
com.example.instilostandfound
;
import
com.example.instilostandfound.R
;
import
com.example.instilostandfound.R
;
import
com.google.android.gms.tasks.OnFailureListener
;
import
com.google.android.gms.tasks.OnSuccessListener
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.database.DatabaseReference
;
import
com.google.firebase.database.DatabaseReference
;
import
com.google.firebase.database.FirebaseDatabase
;
import
com.google.firebase.database.FirebaseDatabase
;
...
@@ -8,35 +10,197 @@ import com.google.firebase.storage.OnProgressListener;
...
@@ -8,35 +10,197 @@ import com.google.firebase.storage.OnProgressListener;
import
com.google.firebase.storage.StorageReference
;
import
com.google.firebase.storage.StorageReference
;
import
com.google.firebase.storage.StorageTask
;
import
com.google.firebase.storage.StorageTask
;
import
com.google.firebase.storage.UploadTask
;
import
com.google.firebase.storage.UploadTask
;
import
android.Manifest
;
import
android.app.Activity
;
import
android.content.ContentResolver
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.graphics.Bitmap
;
import
android.icu.text.SimpleDateFormat
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
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.firebase.auth.FirebaseAuth
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.RequiresApi
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.core.content.FileProvider
;
import
android.os.Environment
;
import
android.os.Handler
;
import
android.provider.MediaStore
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
android.webkit.MimeTypeMap
;
import
android.widget.ArrayAdapter
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.Spinner
;
import
android.widget.Toast
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Date
;
//import static android.app.Activity.RESULT_OK;
//import com.squareup.picasso.Picasso;
public
class
FoundItem
extends
AppCompatActivity
{
public
class
FoundItem
extends
AppCompatActivity
implements
View
.
OnClickListener
{
//private FirebaseAuth mAuth;
EditText
title
;
EditText
place
;
EditText
desc
;
EditText
date
;
Spinner
category
;
String
username
;
ImageView
camera
;
String
[]
items
=
new
String
[]{
"Others"
,
"Electronic"
,
"2"
,
"three"
};
static
final
int
REQUEST_IMAGE_CAPTURE
=
1
;
private
static
final
int
REQUEST_CAMERARESULT
=
201
;
private
static
final
int
PICK_IMAGE_REQUEST
=
1
;
private
static
final
int
CAMERA_REQUEST
=
1888
;
private
ImageView
imageView
;
private
static
final
int
MY_CAMERA_PERMISSION_CODE
=
100
;
private
DatabaseReference
mDatabase
;
private
DatabaseReference
mDatabase
;
// ...
private
Uri
mImageUri
;
// ...
//mDatabase = FirebaseDatabase.getInstance().getReference();
//mDatabase = FirebaseDatabase.getInstance().getReference();
// ...
FirebaseDatabase
database
=
FirebaseDatabase
.
getInstance
();
//DatabaseReference myRef = database.getReference("/FoundData/");
DatabaseReference
myRef
=
FirebaseDatabase
.
getInstance
().
getReference
(
"FoundData"
);
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_found_item
);
setContentView
(
R
.
layout
.
activity_found_item
);
Toolbar
toolbar
=
findViewById
(
R
.
id
.
toolbar
);
Toolbar
toolbar
=
findViewById
(
R
.
id
.
toolbar
);
setSupportActionBar
(
toolbar
);
setSupportActionBar
(
toolbar
);
username
=
getIntent
().
getStringExtra
(
"username"
);
title
=
findViewById
(
R
.
id
.
title
);
place
=
findViewById
(
R
.
id
.
place
);
desc
=
findViewById
(
R
.
id
.
desc
);
date
=
findViewById
(
R
.
id
.
date
);
category
=
findViewById
(
R
.
id
.
category
);
camera
=
findViewById
(
R
.
id
.
camera
);
camera
.
setOnClickListener
(
this
);
/* findViewById(R.id.camera).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openFileChooser();
}
});*/
findViewById
(
R
.
id
.
submit
).
setOnClickListener
(
this
);
ArrayAdapter
<
String
>
adapter
=
new
ArrayAdapter
<>(
this
,
android
.
R
.
layout
.
simple_spinner_dropdown_item
,
items
);
category
.
setAdapter
(
adapter
);
}
private
void
SubmitFound
()
{
String
Title
=
title
.
getText
().
toString
().
trim
();
String
Place
=
place
.
getText
().
toString
().
trim
();
String
Desc
=
desc
.
getText
().
toString
().
trim
();
String
Date
=
date
.
getText
().
toString
().
trim
();
if
(
title
.
getText
().
toString
().
trim
().
isEmpty
())
{
title
.
setError
(
"Please enter title"
);
title
.
requestFocus
();
return
;
}
if
(
place
.
toString
().
trim
().
isEmpty
())
{
place
.
setError
(
"Please enter location"
);
place
.
requestFocus
();
return
;
}
createDemo
upload
=
new
createDemo
(
username
,
Title
,
Desc
,
Place
,
Date
);
String
uploadId
=
myRef
.
push
().
getKey
();
Log
.
v
(
"UploadID"
,
uploadId
);
myRef
.
child
(
uploadId
).
setValue
(
upload
);
title
.
setText
(
""
);
place
.
setText
(
""
);
desc
.
setText
(
""
);
Toast
.
makeText
(
FoundItem
.
this
,
"SUBMIT SUCCESSFUL"
,
Toast
.
LENGTH_LONG
).
show
();
}
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
@NonNull
String
[]
permissions
,
@NonNull
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
if
(
requestCode
==
MY_CAMERA_PERMISSION_CODE
)
{
if
(
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
Toast
.
makeText
(
this
,
"camera permission granted"
,
Toast
.
LENGTH_LONG
).
show
();
Intent
cameraIntent
=
new
Intent
(
android
.
provider
.
MediaStore
.
ACTION_IMAGE_CAPTURE
);
startActivityForResult
(
cameraIntent
,
CAMERA_REQUEST
);
}
else
{
Toast
.
makeText
(
this
,
"camera permission denied"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
}
FloatingActionButton
fab
=
findViewById
(
R
.
id
.
fab
);
fab
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
)
{
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
Snackbar
.
make
(
view
,
"Replace with your own action"
,
Snackbar
.
LENGTH_LONG
)
{
.
setAction
(
"Action"
,
null
).
show
();
if
(
requestCode
==
CAMERA_REQUEST
&&
resultCode
==
Activity
.
RESULT_OK
)
{
Bitmap
photo
=
(
Bitmap
)
data
.
getExtras
().
get
(
"data"
);
camera
.
setImageBitmap
(
photo
);
}
}
@RequiresApi
(
api
=
Build
.
VERSION_CODES
.
N
)
public
void
onClick
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
submit
:
SubmitFound
();
break
;
case
R
.
id
.
camera
:
if
(
checkSelfPermission
(
Manifest
.
permission
.
CAMERA
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
CAMERA
},
MY_CAMERA_PERMISSION_CODE
);
}
else
{
Intent
cameraIntent
=
new
Intent
(
android
.
provider
.
MediaStore
.
ACTION_IMAGE_CAPTURE
);
startActivityForResult
(
cameraIntent
,
CAMERA_REQUEST
);
}
/* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if(FoundItem.this.checkSelfPermission(Manifest.permission.CAMERA)== PackageManager.PERMISSION_GRANTED){
///method to get Images
dispatchTakePictureIntent();
}else{
if(shouldShowRequestPermissionRationale(Manifest.permission.CAMERA)){
Toast.makeText(FoundItem.this,"Your Permission is needed to get access the camera",Toast.LENGTH_LONG).show();
}
requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.CAMERA}, REQUEST_CAMERARESULT);
}
}else{
dispatchTakePictureIntent();
}*/
break
;
}
}
});
}
}
}
}
app/src/main/java/com/example/instilostandfound/MainActivity.java
View file @
cbb45e4d
package
com.example.instilostandfound
;
package
com.example.instilostandfound
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
com.google.android.gms.tasks.OnCompleteListener
;
import
com.google.android.gms.tasks.OnCompleteListener
;
import
com.google.android.gms.tasks.Task
;
import
com.google.android.gms.tasks.Task
;
import
com.google.android.material.snackbar.Snackbar
;
import
com.google.firebase.auth.AuthResult
;
import
com.google.firebase.auth.AuthResult
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.auth.FirebaseAuth
;
...
@@ -91,7 +88,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
...
@@ -91,7 +88,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
}
}
mAuth
.
signInWithEmailAndPassword
(
id
,
password
).
addOnCompleteListener
(
new
OnCompleteListener
<
AuthResult
>()
{
mAuth
.
signInWithEmailAndPassword
(
id
,
password
).
addOnCompleteListener
(
new
OnCompleteListener
<
AuthResult
>()
{
@Override
@Override
public
void
onComplete
(
@NonNull
Task
<
AuthResult
>
task
)
{
public
void
onComplete
(
Task
<
AuthResult
>
task
)
{
if
(
task
.
isSuccessful
())
if
(
task
.
isSuccessful
())
{
{
Toast
.
makeText
(
MainActivity
.
this
,
"LOGIN SUCCESSFUL"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
MainActivity
.
this
,
"LOGIN SUCCESSFUL"
,
Toast
.
LENGTH_LONG
).
show
();
...
...
app/src/main/java/com/example/instilostandfound/createDemo.java
0 → 100644
View file @
cbb45e4d
package
com.example.instilostandfound
;
import
com.google.firebase.auth.FirebaseAuth
;
import
com.google.firebase.database.Exclude
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
public
class
createDemo
{
//private String mImageUrl;
private
String
mKey
;
private
String
mTitle
;
private
String
mDate
;
private
String
mLDAP
;
private
String
mDescription
;
private
String
mLocation
;
// private String mCategory;
private
String
mDateFound
;
public
createDemo
()
{
}
public
createDemo
(
String
LDAPID
,
String
title
,
String
desc
,
String
location
,
String
datefound
)
{
if
(
LDAPID
.
trim
().
equals
(
""
))
{
mLDAP
=
"No Name"
;
}
//mLDAPID = LDAPID;
//mImageUrl = imageUrl;
mLDAP
=
LDAPID
;
mDescription
=
desc
;
mLocation
=
location
;
mDateFound
=
datefound
;
//mCategory = category;
mTitle
=
title
;
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"dd-MMM-yyyy"
);
Date
date
=
new
Date
();
mDate
=
df
.
format
(
date
);
}
public
String
getLDAP
()
{
return
mLDAP
;
}
public
void
setLDAP
(
String
LDAP
)
{
mLDAP
=
LDAP
;
}
public
String
getmTitle
()
{
return
mTitle
;
}
public
void
setmTitle
(
String
mTitle
)
{
this
.
mTitle
=
mTitle
;
}
public
String
getmDateFound
()
{
return
mDateFound
;
}
public
void
setmDateFound
(
String
dateFound
)
{
mDateFound
=
dateFound
;
}
public
String
getmDescription
()
{
return
mDescription
;
}
public
void
setmDescription
(
String
desc
)
{
mDescription
=
desc
;
}
public
String
getmLocation
()
{
return
mLocation
;}
public
void
setmLocation
(
String
location
)
{
mLocation
=
location
;}
@Exclude
public
String
getKey
()
{
return
mKey
;
}
@Exclude
public
void
setKey
(
String
key
)
{
mKey
=
key
;
}
public
String
getDate
()
{
return
mDate
;
}
public
void
setDate
(
String
date
)
{
mDate
=
date
;
}
}
app/src/main/res/layout/activity_found_item.xml
View file @
cbb45e4d
...
@@ -30,4 +30,5 @@
...
@@ -30,4 +30,5 @@
android:layout_margin=
"@dimen/fab_margin"
android:layout_margin=
"@dimen/fab_margin"
app:srcCompat=
"@android:drawable/ic_dialog_email"
/>
app:srcCompat=
"@android:drawable/ic_dialog_email"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
cbb45e4d
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android =
"http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools =
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_height =
"match_parent"
xmlns:tools=
"http://schemas.android.com/tools"
android:paddingLeft=
"@dimen/activity_horizontal_margin"
android:layout_width=
"match_parent"
android:paddingRight =
"@dimen/activity_horizontal_margin"
android:layout_height=
"match_parent"
android:paddingTop =
"@dimen/activity_vertical_margin"
tools:context=
".MainActivity"
>
android:paddingBottom =
"@dimen/activity_vertical_margin"
tools:context =
".MainActivity"
>
<TextView
android:text =
"@string/login"
<com.google.android.material.appbar.AppBarLayout
android:layout_width=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_height =
"wrap_content"
android:layout_height=
"wrap_content"
android:id =
"@+id/textView"
android:theme=
"@style/AppTheme.AppBarOverlay"
>
android:textSize =
"20sp"
android:layout_below =
"@+id/imageView"
android:textColor=
"@color/colorPrimary"
android:paddingTop =
"@dimen/activity_vertical_margin"
/>
<EditText
<androidx.appcompat.widget.Toolbar
android:layout_width =
"wrap_content"
android:id=
"@+id/toolbar"
android:layout_height =
"wrap_content"
android:layout_width=
"match_parent"
android:id =
"@+id/LDAP_ID"
android:layout_height=
"?attr/actionBarSize"
android:hint =
"@string/ldap_id"
android:background=
"?attr/colorPrimary"
android:focusable =
"true"
app:popupTheme=
"@style/AppTheme.PopupOverlay"
/>
android:textColorHighlight =
"#ff7eff15"
android:textColorHint =
"#ffff25e6"
android:layout_marginTop =
"20dp"
android:layout_below =
"@+id/textView"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentEnd =
"true"
/>
<ImageView
</com.google.android.material.appbar.AppBarLayout>
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/imageView"
android:src=
"@drawable/download"
android:paddingTop =
"100dp"
android:layout_centerHorizontal=
"true"
/>
<include
layout=
"@layout/content_main"
/>
<
EditText
<
com.google.android.material.floatingactionbutton.FloatingActionButton
android:id=
"@+id/
LDAP_PASSWORD
"
android:id=
"@+id/
fab
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/LDAP_ID"
android:layout_gravity=
"bottom|end"
android:layout_alignEnd=
"@+id/LDAP_ID"
android:layout_margin=
"@dimen/fab_margin"
android:layout_alignLeft=
"@+id/LDAP_ID"
app:srcCompat=
"@android:drawable/ic_dialog_email"
/>
android:layout_alignParentStart=
"true"
android:layout_alignParentLeft=
"true"
android:ems=
"10"
android:hint=
"@string/password"
android:inputType=
"textPassword"
android:textColorHint=
"#ffff299f"
/>
<Button
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"@string/login"
android:id=
"@+id/login_btn"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:background=
"@color/colorPrimary"
android:layout_marginBottom =
"40dp"
/>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
app/src/main/res/layout/content_found_item.xml
View file @
cbb45e4d
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
...
@@ -14,26 +15,41 @@
...
@@ -14,26 +15,41 @@
android:paddingBottom =
"@dimen/activity_vertical_margin"
android:paddingBottom =
"@dimen/activity_vertical_margin"
>
>
<ImageView
<ImageView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/
imageView
"
android:id=
"@+id/
camera
"
android:src=
"@drawable/camera"
android:src=
"@drawable/camera"
android:minWidth=
"80dp"
android:minWidth=
"80dp"
android:minHeight=
"80dp"
android:minHeight=
"80dp"
android:layout_marginTop =
"
4
0dp"
android:layout_marginTop =
"
3
0dp"
android:layout_marginLeft=
"
4
0dp"
android:layout_marginLeft=
"
3
0dp"
/>
/>
<Spinner
android:id=
"@+id/category"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below =
"@+id/camera"
android:background=
"@android:drawable/btn_dropdown"
android:spinnerMode=
"dropdown"
android:layout_marginTop =
"15dp"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentEnd =
"true"
/>
<EditText
<EditText
android:layout_width =
"wrap_content"
android:layout_width =
"wrap_content"
android:layout_height =
"wrap_content"
android:layout_height =
"wrap_content"
android:id =
"@+id/
editText
"
android:id =
"@+id/
title
"
android:hint =
"@string/title"
android:hint =
"@string/title"
android:focusable =
"true"
android:focusable =
"true"
android:textColorHighlight =
"#ff7eff15"
android:textColorHighlight =
"#ff7eff15"
android:textColorHint =
"
#ffff25e6
"
android:textColorHint =
"
@color/hint_color
"
android:layout_marginTop =
"
20
dp"
android:layout_marginTop =
"
15
dp"
android:layout_below =
"@+id/
imageView
"
android:layout_below =
"@+id/
category
"
android:layout_alignParentLeft =
"true"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentRight =
"true"
...
@@ -42,13 +58,13 @@
...
@@ -42,13 +58,13 @@
<EditText
<EditText
android:layout_width =
"wrap_content"
android:layout_width =
"wrap_content"
android:layout_height =
"wrap_content"
android:layout_height =
"wrap_content"
android:id =
"@+id/
editText1
"
android:id =
"@+id/
place
"
android:hint =
"@string/place"
android:hint =
"@string/place"
android:focusable =
"true"
android:focusable =
"true"
android:textColorHighlight =
"#ff7eff15"
android:textColorHighlight =
"#ff7eff15"
android:textColorHint =
"
#ffff25e6
"
android:textColorHint =
"
@color/hint_color
"
android:layout_marginTop =
"
20
dp"
android:layout_marginTop =
"
15
dp"
android:layout_below =
"@+id/
editText
"
android:layout_below =
"@+id/
title
"
android:layout_alignParentLeft =
"true"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentRight =
"true"
...
@@ -56,16 +72,16 @@
...
@@ -56,16 +72,16 @@
<EditText
<EditText
android:layout_width =
"wrap_content"
android:layout_width =
"wrap_content"
android:layout_height =
"wrap_content"
android:layout_height =
"wrap_content"
android:id =
"@+id/
editText2
"
android:id =
"@+id/
desc
"
android:hint =
"@string/desc"
android:hint =
"@string/desc"
android:focusable =
"true"
android:focusable =
"true"
android:ems=
"10"
android:ems=
"10"
android:gravity=
"start|top"
android:gravity=
"start|top"
android:inputType=
"textMultiLine"
android:inputType=
"textMultiLine"
android:textColorHighlight =
"#ff7eff15"
android:textColorHighlight =
"#ff7eff15"
android:textColorHint =
"
#ffff25e6
"
android:textColorHint =
"
@color/hint_color
"
android:layout_marginTop =
"
20
dp"
android:layout_marginTop =
"
15
dp"
android:layout_below =
"@+id/
editText1
"
android:layout_below =
"@+id/
place
"
android:layout_alignParentLeft =
"true"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentRight =
"true"
...
@@ -75,25 +91,24 @@
...
@@ -75,25 +91,24 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/submit"
android:text=
"@string/submit"
android:id=
"@+id/
button
"
android:id=
"@+id/
submit
"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:background=
"@color/colorPrimary"
android:background=
"@color/colorPrimary"
android:layout_marginBottom =
"40dp"
/>
/>
<EditText
<EditText
android:id=
"@+id/
editText6
"
android:id=
"@+id/
date
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:inputType=
"date"
android:inputType=
"date"
android:hint =
"@string/date"
android:hint =
"@string/date"
android:layout_below =
"@+id/
editText2
"
android:layout_below =
"@+id/
desc
"
android:layout_marginTop =
"
20
dp"
android:layout_marginTop =
"
15
dp"
android:layout_alignParentLeft =
"true"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentEnd =
"true"
/>
android:layout_alignParentEnd =
"true"
/>
</RelativeLayout>
</RelativeLayout>
app/src/main/res/layout/content_lost_item.xml
View file @
cbb45e4d
...
@@ -14,26 +14,39 @@
...
@@ -14,26 +14,39 @@
android:paddingBottom =
"@dimen/activity_vertical_margin"
android:paddingBottom =
"@dimen/activity_vertical_margin"
>
>
<ImageView
<ImageView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/
imageView
"
android:id=
"@+id/
camera
"
android:src=
"@drawable/camera"
android:src=
"@drawable/camera"
android:minWidth=
"80dp"
android:minWidth=
"80dp"
android:minHeight=
"80dp"
android:minHeight=
"80dp"
android:layout_marginTop =
"40dp"
android:layout_marginTop =
"40dp"
android:layout_marginLeft=
"40dp"
android:layout_marginLeft=
"40dp"
/>
/>
<Spinner
android:id=
"@+id/category"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below =
"@+id/camera"
android:background=
"@android:drawable/btn_dropdown"
android:spinnerMode=
"dropdown"
android:layout_marginTop =
"20dp"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentEnd =
"true"
/>
<EditText
<EditText
android:layout_width =
"wrap_content"
android:layout_width =
"wrap_content"
android:layout_height =
"wrap_content"
android:layout_height =
"wrap_content"
android:id =
"@+id/
editText
"
android:id =
"@+id/
TITLE
"
android:hint =
"@string/title"
android:hint =
"@string/title"
android:focusable =
"true"
android:focusable =
"true"
android:textColorHighlight =
"#ff7eff15"
android:textColorHighlight =
"#ff7eff15"
android:textColorHint =
"
#ffff25e6
"
android:textColorHint =
"
@color/hint_color
"
android:layout_marginTop =
"20dp"
android:layout_marginTop =
"20dp"
android:layout_below =
"@+id/
imageView
"
android:layout_below =
"@+id/
category
"
android:layout_alignParentLeft =
"true"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentRight =
"true"
...
@@ -42,13 +55,13 @@
...
@@ -42,13 +55,13 @@
<EditText
<EditText
android:layout_width =
"wrap_content"
android:layout_width =
"wrap_content"
android:layout_height =
"wrap_content"
android:layout_height =
"wrap_content"
android:id =
"@+id/
editText1
"
android:id =
"@+id/
PLACE
"
android:hint =
"@string/place"
android:hint =
"@string/place"
android:focusable =
"true"
android:focusable =
"true"
android:textColorHighlight =
"#ff7eff15"
android:textColorHighlight =
"#ff7eff15"
android:textColorHint =
"
#ffff25e6
"
android:textColorHint =
"
@color/hint_color
"
android:layout_marginTop =
"20dp"
android:layout_marginTop =
"20dp"
android:layout_below =
"@+id/
editText
"
android:layout_below =
"@+id/
TITLE
"
android:layout_alignParentLeft =
"true"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentRight =
"true"
...
@@ -56,16 +69,16 @@
...
@@ -56,16 +69,16 @@
<EditText
<EditText
android:layout_width =
"wrap_content"
android:layout_width =
"wrap_content"
android:layout_height =
"wrap_content"
android:layout_height =
"wrap_content"
android:id =
"@+id/
editText2
"
android:id =
"@+id/
DESC
"
android:hint =
"@string/desc"
android:hint =
"@string/desc"
android:focusable =
"true"
android:focusable =
"true"
android:ems=
"10"
android:ems=
"10"
android:gravity=
"start|top"
android:gravity=
"start|top"
android:inputType=
"textMultiLine"
android:inputType=
"textMultiLine"
android:textColorHighlight =
"#ff7eff15"
android:textColorHighlight =
"#ff7eff15"
android:textColorHint =
"
#ffff25e6
"
android:textColorHint =
"
@color/hint_color
"
android:layout_marginTop =
"20dp"
android:layout_marginTop =
"20dp"
android:layout_below =
"@+id/
editText1
"
android:layout_below =
"@+id/
PLACE
"
android:layout_alignParentLeft =
"true"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentRight =
"true"
...
@@ -75,7 +88,7 @@
...
@@ -75,7 +88,7 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/submit"
android:text=
"@string/submit"
android:id=
"@+id/
button
"
android:id=
"@+id/
submit
"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:background=
"@color/colorPrimary"
android:background=
"@color/colorPrimary"
...
@@ -83,12 +96,12 @@
...
@@ -83,12 +96,12 @@
/>
/>
<EditText
<EditText
android:id=
"@+id/
editText6
"
android:id=
"@+id/
DATE
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:inputType=
"date"
android:inputType=
"date"
android:hint =
"@string/date"
android:hint =
"@string/date"
android:layout_below =
"@+id/
editText2
"
android:layout_below =
"@+id/
DESC
"
android:layout_marginTop =
"20dp"
android:layout_marginTop =
"20dp"
android:layout_alignParentLeft =
"true"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentStart =
"true"
...
...
app/src/main/res/layout/content_main.xml
View file @
cbb45e4d
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
androidx.constraintlayout.widget.Constraint
Layout
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
...
@@ -7,36 +7,201 @@
...
@@ -7,36 +7,201 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
tools:showIn=
"@layout/activity_main"
tools:showIn=
"@layout/activity_main"
android:layout_margin=
"15dp"
tools:context=
".MainActivity"
>
tools:context=
".MainActivity"
>
<TextView
android:text =
"@string/login"
android:layout_width=
"wrap_content"
android:layout_height =
"wrap_content"
android:id =
"@+id/textView"
android:textSize =
"20sp"
android:layout_below =
"@+id/imageView"
android:textColor=
"@color/colorPrimary"
android:paddingTop =
"@dimen/activity_vertical_margin"
/>
<EditText
android:layout_width =
"wrap_content"
android:layout_height =
"wrap_content"
android:id =
"@+id/LDAP_ID"
android:hint =
"@string/ldap_id"
android:focusable =
"true"
android:textColorHighlight =
"#ff7eff15"
android:textColorHint =
"@color/hint_color"
android:layout_marginTop =
"20dp"
android:layout_below =
"@+id/textView"
android:layout_alignParentLeft =
"true"
android:layout_alignParentStart =
"true"
android:layout_alignParentRight =
"true"
android:layout_alignParentEnd =
"true"
/>
<ImageView
android:layout_width=
"150dp"
android:layout_height=
"150dp"
android:id=
"@+id/imageView"
android:src=
"@drawable/download"
android:paddingTop =
"10dp"
android:layout_centerHorizontal=
"true"
android:layout_marginTop =
"30dp"
/>
<Button
android:id=
"@+id/button"
android:layout_width=
"282dp"
android:layout_height=
"38dp"
android:text=
"Login"
tools:layout_editor_absoluteX=
"75dp"
tools:layout_editor_absoluteY=
"535dp"
/>
<EditText
<EditText
android:id=
"@+id/editText"
android:id=
"@+id/LDAP_PASSWORD"
android:layout_width=
"282dp"
android:layout_width=
"wrap_content"
android:layout_height=
"42dp"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/LDAP_ID"
android:layout_alignEnd=
"@+id/LDAP_ID"
android:layout_alignLeft=
"@+id/LDAP_ID"
android:layout_alignRight=
"@+id/LDAP_ID"
android:layout_alignParentStart=
"true"
android:layout_alignParentLeft=
"true"
android:ems=
"10"
android:ems=
"10"
android:layout_marginTop =
"20dp"
android:hint=
"@string/password"
android:hint=
"@string/password"
android:focusable =
"true"
android:inputType=
"textPassword"
android:inputType=
"textPassword"
tools:layout_editor_absoluteX=
"75dp"
android:textColorHint=
"@color/hint_color"
/>
tools:layout_editor_absoluteY=
"452dp"
/>
<EditText
<Button
android:id=
"@+id/editText4"
android:layout_width=
"match_parent"
android:layout_width=
"281dp"
android:layout_height=
"wrap_content"
android:layout_height=
"42dp"
android:text=
"@string/login"
android:ems=
"10"
android:id=
"@+id/login_btn"
android:hint=
"@string/ldap_id"
android:layout_centerHorizontal=
"true"
android:inputType=
"textPersonName"
android:layout_marginTop =
"20dp"
tools:layout_editor_absoluteX=
"71dp"
android:background=
"@color/colorPrimary"
tools:layout_editor_absoluteY=
"365dp"
/>
android:layout_below=
"@+id/LDAP_PASSWORD"
/>
</RelativeLayout>
<!--
<LinearLayout 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:orientation="vertical"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageView
android:layout_width="85dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@drawable/download"
android:contentDescription="TODO" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorPrimary">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:textColorHint="@color/colorAccent2"
android:focusable="true"
android:focusableInTouchMode="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/editTextEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints=""
android:hint="@string/email"
android:inputType="textEmailAddress"
android:paddingBottom="15dp" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:textColorHint="@color/colorAccent2"
app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/editTextPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:inputType="textPassword"
android:paddingBottom="15dp" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/buttonLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="7dp"
android:background="@drawable/common_google_signin_btn_icon_dark"
android:elevation="4dp"
android:text="@string/login"
android:textAllCaps="false"
android:textColor="@color/colorPrimary" />
<TextView
android:id="@+id/textView_forgotPass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp"
android:text="@string/password"
android:textAlignment="center"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
android:textColor="@color/colorPrimary" />
<TextView
android:id="@+id/textViewSignup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="15dp"
android:text="@string/ldap_id"
android:textAlignment="center"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
android:textColor="@color/colorAccent" />
</LinearLayout>
<ProgressBar
android:id="@+id/progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ No newline at end of file
-->
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
cbb45e4d
...
@@ -3,4 +3,5 @@
...
@@ -3,4 +3,5 @@
<color
name=
"colorPrimary"
>
#008577
</color>
<color
name=
"colorPrimary"
>
#008577
</color>
<color
name=
"colorPrimaryDark"
>
#00574B
</color>
<color
name=
"colorPrimaryDark"
>
#00574B
</color>
<color
name=
"colorAccent"
>
#D81B60
</color>
<color
name=
"colorAccent"
>
#D81B60
</color>
<color
name=
"hint_color"
>
#989898
</color>
</resources>
</resources>
app/src/main/res/values/strings.xml
View file @
cbb45e4d
...
@@ -18,5 +18,5 @@
...
@@ -18,5 +18,5 @@
<string
name=
"close_navigation"
>
Close Navigation
</string>
<string
name=
"close_navigation"
>
Close Navigation
</string>
<string
name=
"my_posts"
>
My Posts
</string>
<string
name=
"my_posts"
>
My Posts
</string>
<string
name=
"logout"
>
Logout
</string>
<string
name=
"logout"
>
Logout
</string>
<string
name=
"title_activity_camera"
>
Camera
</string>
</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