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
a059f3b0
Commit
a059f3b0
authored
Nov 04, 2019
by
MUTTINENI NAVYA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fetching data from db in myposts
parent
9243683f
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
132 additions
and
5 deletions
+132
-5
.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml
...ries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml
+13
-0
.idea/libraries/Gradle__com_google_firebase_firebase_common_19_2_0_aar.xml
...radle__com_google_firebase_firebase_common_19_2_0_aar.xml
+14
-0
.idea/libraries/Gradle__com_google_firebase_firebase_database_19_2_0_aar.xml
...dle__com_google_firebase_firebase_database_19_2_0_aar.xml
+14
-0
.idea/libraries/Gradle__com_google_firebase_firebase_database_collection_17_0_0_aar.xml
...ogle_firebase_firebase_database_collection_17_0_0_aar.xml
+12
-0
.idea/libraries/Gradle__com_google_firebase_firebase_storage_19_1_0_aar.xml
...adle__com_google_firebase_firebase_storage_19_1_0_aar.xml
+14
-0
app/src/main/AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
app/src/main/java/com/example/instilostandfound/MyPostsFoundRV.java
...in/java/com/example/instilostandfound/MyPostsFoundRV.java
+59
-0
app/src/main/java/com/example/instilostandfound/RedirectMyPosts.java
...n/java/com/example/instilostandfound/RedirectMyPosts.java
+1
-1
app/src/main/res/layout/activity_my_posts_found_rv.xml
app/src/main/res/layout/activity_my_posts_found_rv.xml
+1
-1
local.properties
local.properties
+2
-2
No files found.
.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0_jar.xml
0 → 100644
View file @
a059f3b0
<component
name=
"libraryTable"
>
<library
name=
"Gradle: androidx.annotation:annotation:1.1.0@jar"
>
<CLASSES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation/1.1.0/e3a6fb2f40e3a3842e6b7472628ba4ce416ea4c8/annotation-1.1.0.jar!/"
/>
</CLASSES>
<JAVADOC>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation/1.1.0/408af38ec57369afe3fd6466e1c4bfdd5f15fc92/annotation-1.1.0-javadoc.jar!/"
/>
</JAVADOC>
<SOURCES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/androidx.annotation/annotation/1.1.0/8b7bdc00eb4d998bfbc76767b098620990f2a805/annotation-1.1.0-sources.jar!/"
/>
</SOURCES>
</library>
</component>
\ No newline at end of file
.idea/libraries/Gradle__com_google_firebase_firebase_common_19_2_0_aar.xml
0 → 100644
View file @
a059f3b0
<component
name=
"libraryTable"
>
<library
name=
"Gradle: com.google.firebase:firebase-common:19.2.0@aar"
>
<CLASSES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/61c47ccf880e44b6c829a8c9a48ba20d/firebase-common-19.2.0/jars/classes.jar!/"
/>
<root
url=
"file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/61c47ccf880e44b6c829a8c9a48ba20d/firebase-common-19.2.0/res"
/>
</CLASSES>
<JAVADOC>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.firebase/firebase-common/19.2.0/c40d2fb997bcb31bc7666513543aa0ec3e698461/firebase-common-19.2.0-javadoc.jar!/"
/>
</JAVADOC>
<SOURCES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.firebase/firebase-common/19.2.0/63c13ebb4ad7b1a2e0c317ae843eb342e4041511/firebase-common-19.2.0-sources.jar!/"
/>
</SOURCES>
</library>
</component>
\ No newline at end of file
.idea/libraries/Gradle__com_google_firebase_firebase_database_19_2_0_aar.xml
0 → 100644
View file @
a059f3b0
<component
name=
"libraryTable"
>
<library
name=
"Gradle: com.google.firebase:firebase-database:19.2.0@aar"
>
<CLASSES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/463da60977420e86b3b59aa784a805a0/firebase-database-19.2.0/jars/classes.jar!/"
/>
<root
url=
"file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/463da60977420e86b3b59aa784a805a0/firebase-database-19.2.0/res"
/>
</CLASSES>
<JAVADOC>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.firebase/firebase-database/19.2.0/bda77c37621ef4a9268924be507dc28e5328598c/firebase-database-19.2.0-javadoc.jar!/"
/>
</JAVADOC>
<SOURCES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.firebase/firebase-database/19.2.0/7ecd17c12939ca0a6e20f902c3f726d914fb3aa1/firebase-database-19.2.0-sources.jar!/"
/>
</SOURCES>
</library>
</component>
\ No newline at end of file
.idea/libraries/Gradle__com_google_firebase_firebase_database_collection_17_0_0_aar.xml
0 → 100644
View file @
a059f3b0
<component
name=
"libraryTable"
>
<library
name=
"Gradle: com.google.firebase:firebase-database-collection:17.0.0@aar"
>
<CLASSES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/a1c42ee6a43c1fec1cd0f12b759d080b/firebase-database-collection-17.0.0/jars/classes.jar!/"
/>
<root
url=
"file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/a1c42ee6a43c1fec1cd0f12b759d080b/firebase-database-collection-17.0.0/res"
/>
</CLASSES>
<JAVADOC>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.firebase/firebase-database-collection/17.0.0/e4dd7ee66b776966452b4760ca297fe1ea256bad/firebase-database-collection-17.0.0-javadoc.jar!/"
/>
</JAVADOC>
<SOURCES
/>
</library>
</component>
\ No newline at end of file
.idea/libraries/Gradle__com_google_firebase_firebase_storage_19_1_0_aar.xml
0 → 100644
View file @
a059f3b0
<component
name=
"libraryTable"
>
<library
name=
"Gradle: com.google.firebase:firebase-storage:19.1.0@aar"
>
<CLASSES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1db2d38b309a85c11f57219f5bbd1ccf/firebase-storage-19.1.0/jars/classes.jar!/"
/>
<root
url=
"file://$USER_HOME$/.gradle/caches/transforms-2/files-2.1/1db2d38b309a85c11f57219f5bbd1ccf/firebase-storage-19.1.0/res"
/>
</CLASSES>
<JAVADOC>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.firebase/firebase-storage/19.1.0/db75b30525f2fd559b56fd1a275c66f183969147/firebase-storage-19.1.0-javadoc.jar!/"
/>
</JAVADOC>
<SOURCES>
<root
url=
"jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.firebase/firebase-storage/19.1.0/553c23659c39b1e6375f76b308e8dcdd3522e570/firebase-storage-19.1.0-sources.jar!/"
/>
</SOURCES>
</library>
</component>
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
a059f3b0
...
@@ -18,7 +18,8 @@
...
@@ -18,7 +18,8 @@
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=
".RedirectMyPosts"
></activity>
<activity
android:name=
".MyPostsFoundRV"
/>
<activity
android:name=
".RedirectMyPosts"
/>
<activity
android:name=
".ItemDetails"
/>
<activity
android:name=
".ItemDetails"
/>
<activity
android:name=
".MyPosts"
/>
<activity
android:name=
".MyPosts"
/>
<activity
<activity
...
...
app/src/main/java/com/example/instilostandfound/MyPosts
_rv
.java
→
app/src/main/java/com/example/instilostandfound/MyPosts
FoundRV
.java
View file @
a059f3b0
package
com.example.instilostandfound
;
package
com.example.instilostandfound
;
import
androidx.annotation.NonNull
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.widget.Toast
;
import
com.google.firebase.database.DataSnapshot
;
import
com.google.firebase.database.DatabaseError
;
import
com.google.firebase.database.DatabaseReference
;
import
com.google.firebase.database.DatabaseReference
;
import
com.google.firebase.database.FirebaseDatabase
;
import
com.google.firebase.database.FirebaseDatabase
;
import
com.google.firebase.database.ValueEventListener
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
public
class
MyPosts
_rv
extends
AppCompatActivity
{
public
class
MyPosts
FoundRV
extends
AppCompatActivity
{
private
RecyclerView
mrecyclerView
;
private
RecyclerView
mrecyclerView
;
private
MyPostsAdaptor
m
yPosts
Adaptor
;
private
MyPostsAdaptor
mAdaptor
;
private
DatabaseReference
mDatabaseRef
;
private
DatabaseReference
mDatabaseRef
;
private
List
<
CreateFoundObject
>
mPosts
;
private
List
<
CreateFoundObject
>
mPosts
;
...
@@ -22,7 +27,7 @@ public class MyPosts_rv extends AppCompatActivity {
...
@@ -22,7 +27,7 @@ public class MyPosts_rv extends AppCompatActivity {
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_my_posts_rv
);
setContentView
(
R
.
layout
.
activity_my_posts_
found_
rv
);
mrecyclerView
=
findViewById
(
R
.
id
.
my_posts_rv
);
mrecyclerView
=
findViewById
(
R
.
id
.
my_posts_rv
);
mrecyclerView
.
setHasFixedSize
(
true
);
mrecyclerView
.
setHasFixedSize
(
true
);
...
@@ -31,5 +36,24 @@ public class MyPosts_rv extends AppCompatActivity {
...
@@ -31,5 +36,24 @@ public class MyPosts_rv extends AppCompatActivity {
mPosts
=
new
ArrayList
<>();
mPosts
=
new
ArrayList
<>();
mDatabaseRef
=
FirebaseDatabase
.
getInstance
().
getReference
(
"FoundItems"
);
mDatabaseRef
=
FirebaseDatabase
.
getInstance
().
getReference
(
"FoundItems"
);
mDatabaseRef
.
addValueEventListener
(
new
ValueEventListener
()
{
@Override
public
void
onDataChange
(
@NonNull
DataSnapshot
dataSnapshot
)
{
for
(
DataSnapshot
postSnapShot
:
dataSnapshot
.
getChildren
()){
CreateFoundObject
post
=
postSnapShot
.
getValue
(
CreateFoundObject
.
class
);
mPosts
.
add
(
post
);
}
mAdaptor
=
new
MyPostsAdaptor
(
MyPostsFoundRV
.
this
,
mPosts
);
mrecyclerView
.
setAdapter
(
mAdaptor
);
}
@Override
public
void
onCancelled
(
@NonNull
DatabaseError
databaseError
)
{
Toast
.
makeText
(
MyPostsFoundRV
.
this
,
databaseError
.
getMessage
(),
Toast
.
LENGTH_SHORT
).
show
();
}
});
}
}
}
}
app/src/main/java/com/example/instilostandfound/RedirectMyPosts.java
View file @
a059f3b0
...
@@ -29,7 +29,7 @@ public class RedirectMyPosts extends AppCompatActivity implements View.OnClickLi
...
@@ -29,7 +29,7 @@ public class RedirectMyPosts extends AppCompatActivity implements View.OnClickLi
startActivity
(
intent
);
startActivity
(
intent
);
break
;
break
;
case
R
.
id
.
found_button
:
case
R
.
id
.
found_button
:
intent
=
new
Intent
(
RedirectMyPosts
.
this
,
MyPosts
.
class
);
intent
=
new
Intent
(
RedirectMyPosts
.
this
,
MyPosts
FoundRV
.
class
);
intent
.
putExtra
(
"username"
,
username
);
intent
.
putExtra
(
"username"
,
username
);
intent
.
putExtra
(
"type"
,
"found"
);
intent
.
putExtra
(
"type"
,
"found"
);
startActivity
(
intent
);
startActivity
(
intent
);
...
...
app/src/main/res/layout/activity_my_posts_rv.xml
→
app/src/main/res/layout/activity_my_posts_
found_
rv.xml
View file @
a059f3b0
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".MyPosts
_rv
"
>
tools:context=
".MyPosts
FoundRV
"
>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/my_posts_rv"
android:id=
"@+id/my_posts_rv"
...
...
local.properties
View file @
a059f3b0
...
@@ -4,5 +4,5 @@
...
@@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# For customization when using a Version Control System, please read the
# header note.
# header note.
#
Tue Oct 29 18:25:40
IST 2019
#
Mon Nov 04 22:52:49
IST 2019
sdk.dir
=
/home/
chikki
/Android/Sdk
sdk.dir
=
/home/
navya
/Android/Sdk
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