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
c8d55efd
Commit
c8d55efd
authored
Oct 30, 2019
by
MUTTINENI NAVYA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added redirectPosts
parent
72cb1b37
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
147 additions
and
21 deletions
+147
-21
app/app.iml
app/app.iml
+2
-0
app/build.gradle
app/build.gradle
+1
-0
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
app/src/main/java/com/example/instilostandfound/MyPosts.java
app/src/main/java/com/example/instilostandfound/MyPosts.java
+55
-19
app/src/main/java/com/example/instilostandfound/Navigation.java
...c/main/java/com/example/instilostandfound/Navigation.java
+2
-1
app/src/main/java/com/example/instilostandfound/RedirectMyPosts.java
...n/java/com/example/instilostandfound/RedirectMyPosts.java
+39
-0
app/src/main/res/drawable/myposts_bg.jpg
app/src/main/res/drawable/myposts_bg.jpg
+0
-0
app/src/main/res/layout/activity_redirect_my_posts.xml
app/src/main/res/layout/activity_redirect_my_posts.xml
+37
-0
app/src/main/res/values-w820dp/dimens.xml
app/src/main/res/values-w820dp/dimens.xml
+6
-0
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+3
-0
No files found.
app/app.iml
View file @
c8d55efd
...
...
@@ -114,6 +114,7 @@
<orderEntry
type=
"library"
name=
"Gradle: androidx.appcompat:appcompat:1.0.2@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: com.google.firebase:firebase-database:19.2.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: com.google.firebase:firebase-storage:19.1.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: androidx.legacy:legacy-support-v4:1.0.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: com.google.firebase:firebase-auth:19.1.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: com.google.firebase:firebase-auth-interop:18.0.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: com.google.android.gms:play-services-base:17.1.0@aar"
level=
"project"
/>
...
...
@@ -127,6 +128,7 @@
<orderEntry
type=
"library"
name=
"Gradle: androidx.legacy:legacy-support-core-utils:1.0.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: androidx.vectordrawable:vectordrawable:1.0.1@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: androidx.transition:transition:1.0.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: androidx.media:media:1.0.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: androidx.loader:loader:1.0.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: androidx.viewpager:viewpager:1.0.0@aar"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Gradle: androidx.coordinatorlayout:coordinatorlayout:1.0.0@aar"
level=
"project"
/>
...
...
app/build.gradle
View file @
c8d55efd
...
...
@@ -27,6 +27,7 @@ dependencies {
implementation
'com.google.firebase:firebase-auth:19.1.0'
implementation
'com.google.firebase:firebase-database:19.2.0'
implementation
'com.google.firebase:firebase-storage:19.1.0'
implementation
'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test.ext:junit:1.1.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.1.1'
...
...
app/src/main/AndroidManifest.xml
View file @
c8d55efd
...
...
@@ -18,7 +18,8 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".ItemDetails"
></activity>
<activity
android:name=
".RedirectMyPosts"
></activity>
<activity
android:name=
".ItemDetails"
/>
<activity
android:name=
".MyPosts"
/>
<activity
android:name=
".Navigation"
...
...
app/src/main/java/com/example/instilostandfound/MyPosts.java
View file @
c8d55efd
...
...
@@ -23,7 +23,7 @@ public class MyPosts extends AppCompatActivity {
setContentView
(
R
.
layout
.
activity_my_posts
);
final
List
<
Map
<
String
,
String
>>
of
=
new
ArrayList
<
Map
<
String
,
String
>>();
List
<
Map
<
String
,
String
>>
ol
=
new
ArrayList
<
Map
<
String
,
String
>>();
final
List
<
Map
<
String
,
String
>>
ol
=
new
ArrayList
<
Map
<
String
,
String
>>();
Map
<
String
,
String
>
of1
=
new
HashMap
<
String
,
String
>();
of1
.
put
(
"key"
,
"123"
);
of1
.
put
(
"category"
,
"electronics"
);
...
...
@@ -40,33 +40,69 @@ public class MyPosts extends AppCompatActivity {
of2
.
put
(
"name"
,
"wallet"
);
of2
.
put
(
"description"
,
"green colour baggit"
);
of2
.
put
(
"date"
,
"28th Oct 2019"
);
of2
.
put
(
"type"
,
"
found
"
);
of2
.
put
(
"type"
,
"
lost
"
);
of2
.
put
(
"place"
,
"sic201"
);
of
.
add
(
of2
);
ol
.
add
(
of2
);
String
of_names
[]
=
new
String
[
of
.
size
()];
for
(
int
i
=
0
;
i
<
of
.
size
();
i
++){
of_names
[
i
]
=
of
.
get
(
i
).
get
(
"name"
);
}
final
Intent
intent
=
getIntent
();
ListView
listView
=
(
ListView
)
findViewById
(
R
.
id
.
listviewlost
);
ArrayAdapter
<
String
>
adaptor
=
new
ArrayAdapter
<
String
>(
this
,
android
.
R
.
layout
.
simple_list_item_1
,
of_names
);
listView
.
setAdapter
(
adaptor
);
if
(
intent
.
getStringExtra
(
"type"
).
equals
(
"lost"
)){
String
ol_names
[]
=
new
String
[
ol
.
size
()];
for
(
int
i
=
0
;
i
<
ol
.
size
();
i
++){
ol_names
[
i
]
=
ol
.
get
(
i
).
get
(
"name"
);
}
ArrayAdapter
<
String
>
adaptor
=
new
ArrayAdapter
<
String
>(
this
,
android
.
R
.
layout
.
simple_list_item_1
,
ol_names
);
listView
.
setAdapter
(
adaptor
);
}
else
if
(
intent
.
getStringExtra
(
"type"
).
equals
(
"found"
)){
String
of_names
[]
=
new
String
[
of
.
size
()];
for
(
int
i
=
0
;
i
<
of
.
size
();
i
++){
of_names
[
i
]
=
of
.
get
(
i
).
get
(
"name"
);
}
ArrayAdapter
<
String
>
adaptor
=
new
ArrayAdapter
<
String
>(
this
,
android
.
R
.
layout
.
simple_list_item_1
,
of_names
);
listView
.
setAdapter
(
adaptor
);
}
listView
.
setOnItemClickListener
(
new
AdapterView
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
AdapterView
<?>
parent
,
View
view
,
int
position
,
long
id
)
{
Intent
intent
=
new
Intent
(
MyPosts
.
this
,
ItemDetails
.
class
);
intent
.
putExtra
(
"category"
,
"Electronics"
);
intent
.
putExtra
(
"name"
,
of
.
get
(
position
).
get
(
"name"
));
intent
.
putExtra
(
"place"
,
of
.
get
(
position
).
get
(
"place"
));
intent
.
putExtra
(
"description"
,
of
.
get
(
position
).
get
(
"description"
));
intent
.
putExtra
(
"date"
,
of
.
get
(
position
).
get
(
"date"
));
intent
.
putExtra
(
"key"
,
of
.
get
(
position
).
get
(
"key"
));
intent
.
putExtra
(
"type"
,
of
.
get
(
position
).
get
(
"type"
));
startActivity
(
intent
);
Intent
intent1
=
new
Intent
(
MyPosts
.
this
,
ItemDetails
.
class
);
if
(
intent
.
getStringExtra
(
"type"
).
equals
((
"found"
))){
intent1
.
putExtra
(
"category"
,
"Electronics"
);
intent1
.
putExtra
(
"name"
,
of
.
get
(
position
).
get
(
"name"
));
intent1
.
putExtra
(
"place"
,
of
.
get
(
position
).
get
(
"place"
));
intent1
.
putExtra
(
"description"
,
of
.
get
(
position
).
get
(
"description"
));
intent1
.
putExtra
(
"date"
,
of
.
get
(
position
).
get
(
"date"
));
intent1
.
putExtra
(
"key"
,
of
.
get
(
position
).
get
(
"key"
));
intent1
.
putExtra
(
"type"
,
of
.
get
(
position
).
get
(
"type"
));
}
else
if
(
intent
.
getStringExtra
(
"type"
).
equals
((
"lost"
))){
intent1
.
putExtra
(
"category"
,
"Electronics"
);
intent1
.
putExtra
(
"name"
,
ol
.
get
(
position
).
get
(
"name"
));
intent1
.
putExtra
(
"place"
,
ol
.
get
(
position
).
get
(
"place"
));
intent1
.
putExtra
(
"description"
,
ol
.
get
(
position
).
get
(
"description"
));
intent1
.
putExtra
(
"date"
,
ol
.
get
(
position
).
get
(
"date"
));
intent1
.
putExtra
(
"key"
,
ol
.
get
(
position
).
get
(
"key"
));
intent1
.
putExtra
(
"type"
,
ol
.
get
(
position
).
get
(
"type"
));
}
startActivity
(
intent1
);
}
});
}
}
app/src/main/java/com/example/instilostandfound/Navigation.java
View file @
c8d55efd
...
...
@@ -71,7 +71,8 @@ public class Navigation extends AppCompatActivity implements NavigationView.OnNa
startActivity
(
getIntent
());
break
;
case
R
.
id
.
my_posts
:
intent
=
new
Intent
(
this
,
MyPosts
.
class
);
intent
=
new
Intent
(
this
,
RedirectMyPosts
.
class
);
intent
.
putExtra
(
"username"
,
username
);
startActivity
(
intent
);
break
;
case
R
.
id
.
logout
:
...
...
app/src/main/java/com/example/instilostandfound/RedirectMyPosts.java
0 → 100644
View file @
c8d55efd
package
com.example.instilostandfound
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
public
class
RedirectMyPosts
extends
AppCompatActivity
implements
View
.
OnClickListener
{
String
username
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_redirect_my_posts
);
Intent
i
=
getIntent
();
username
=
i
.
getStringExtra
(
"username"
);
findViewById
(
R
.
id
.
lost_button
).
setOnClickListener
(
this
);
findViewById
(
R
.
id
.
found_button
).
setOnClickListener
(
this
);
}
@Override
public
void
onClick
(
View
v
)
{
switch
(
v
.
getId
()){
case
R
.
id
.
lost_button
:
Intent
intent
=
new
Intent
(
RedirectMyPosts
.
this
,
MyPosts
.
class
);
intent
.
putExtra
(
"type"
,
"lost"
);
intent
.
putExtra
(
"username"
,
username
);
startActivity
(
intent
);
break
;
case
R
.
id
.
found_button
:
intent
=
new
Intent
(
RedirectMyPosts
.
this
,
MyPosts
.
class
);
intent
.
putExtra
(
"username"
,
username
);
intent
.
putExtra
(
"type"
,
"found"
);
startActivity
(
intent
);
break
;
}
}
}
app/src/main/res/drawable/myposts_bg.jpg
0 → 100644
View file @
c8d55efd
60.1 KB
app/src/main/res/layout/activity_redirect_my_posts.xml
0 → 100644
View file @
c8d55efd
<?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"
tools:context=
".RedirectMyPosts"
android:background=
"@drawable/myposts_bg"
>
<!--app:layout_constraintTop_toTopOf="parent" -->
<![CDATA[/>
]]>
<Button
android:id=
"@+id/lost_button"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"150dp"
android:layout_marginBottom=
"100dp"
android:background=
"@color/colorPrimary"
android:textColor=
"@color/cardview_light_background"
android:text=
"Lost"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
<Button
android:id=
"@+id/found_button"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"140dp"
android:layout_marginBottom=
"24dp"
android:text=
"Found"
android:background=
"@color/colorPrimary"
android:textColor=
"@color/cardview_light_background"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values-w820dp/dimens.xml
0 → 100644
View file @
c8d55efd
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen
name=
"activity_horizontal_margin"
>
64dp
</dimen>
</resources>
app/src/main/res/values/strings.xml
View file @
c8d55efd
...
...
@@ -19,4 +19,7 @@
<string
name=
"my_posts"
>
My Posts
</string>
<string
name=
"logout"
>
Logout
</string>
<string
name=
"title_activity_camera"
>
Camera
</string>
<!-- TODO: Remove or change this placeholder text -->
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
</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