Skip to content
Permalink
Browse files
changes in build gradle // adding code to check if firedb is connecte…
…d to the app // adding author and isbn to library fragment // fixing email errors in book profile
  • Loading branch information
dacost13 committed Aug 31, 2021
1 parent 29af298 commit cd491a451504bce37aeae0ebf8c7e4ebffe62ad2
Show file tree
Hide file tree
Showing 12 changed files with 101 additions and 35 deletions.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

@@ -47,35 +47,50 @@ dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'

implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-auth:20.0.3'
implementation 'com.google.firebase:firebase-database:19.7.0'
implementation 'androidx.navigation:navigation-fragment:2.3.3'
implementation 'androidx.navigation:navigation-ui:2.3.3'
implementation 'com.android.support:multidex:1.0.3'

implementation 'androidx.legacy:legacy-support-v4:1.0.0'

implementation 'com.google.firebase:firebase-firestore:22.1.2'
implementation 'com.google.firebase:firebase-storage:19.2.2'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation "androidx.recyclerview:recyclerview:+"
implementation 'com.android.support:design:+'
implementation 'com.android.support:cardview-v7:+'
implementation 'com.firebaseui:firebase-ui-database:6.2.0'
implementation 'androidx.recyclerview:recyclerview-selection:+'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-location:+'
implementation 'com.sun.mail:android-mail:1.6.2'
implementation 'com.sun.mail:android-activation:1.6.2'



annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'

testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'


implementation platform('com.google.firebase:firebase-bom:28.4.0')
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-database'
implementation 'com.google.firebase:firebase-firestore'
implementation 'com.firebaseui:firebase-ui-database:8.0.0'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:8.0.0'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:8.0.0'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:8.0.0'

implementation "com.google.firebase:firebase-database:"

implementation "androidx.legacy:legacy-support-v4:"
implementation "androidx.recyclerview:recyclerview:"











}
@@ -161,7 +161,7 @@ public class BProfileActivity extends AppCompatActivity implements View.OnClickL

Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, uemail);
intent.putExtra(Intent.EXTRA_SUBJECT,pbookname.getText().toString());
intent.putExtra(Intent.EXTRA_SUBJECT,ubookname.getText().toString());
intent.putExtra(Intent.EXTRA_TEXT,message);
intent.setType("message/rfc822");
startActivity(Intent.createChooser(intent,"Choose Email Client"));
@@ -147,6 +147,8 @@ public class HomeFragment extends Fragment {
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
inforec.setLayoutManager(layoutManager);
inforec.setHasFixedSize(true);
layoutManager.setReverseLayout(true);
layoutManager.setStackFromEnd(true);


// Array list
@@ -216,7 +218,27 @@ public class HomeFragment extends Fragment {



public void database(){
DatabaseReference connectedRef = FirebaseDatabase.getInstance().getReference(".info/connected");
connectedRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
boolean connected = snapshot.getValue(Boolean.class);
if (connected) {
System.out.println("connected");
} else {
System.out.println("not connected");
}
}

@Override
public void onCancelled(DatabaseError error) {
System.err.println("Listener was cancelled");
}
});


}



@@ -227,7 +249,7 @@ public class HomeFragment extends Fragment {
public void onStart()
{
super.onStart();

database();
GetDataFromFirebase(); //onStart Called
}

@@ -156,6 +156,8 @@ public class LibraryFragment extends Fragment {
info.setPostid(dataSnapshot.child("postid").getValue().toString());
info.setUrl(dataSnapshot.child("url").getValue().toString());
info.setBookname(dataSnapshot.child("book name").getValue().toString());
info.setIsbn(dataSnapshot.child("isbn").getValue().toString());
info.setAuthor(dataSnapshot.child("author").getValue().toString());


infoList.add(info);
@@ -147,7 +147,8 @@
android:layout_marginTop="20dp"
android:background="#fff"
android:ems="10"
android:hint="If you are interested in this book, write your message to send an email to the owner"
android:hint="If you are interested in this book,
write your message to send an email to the owner"
android:inputType="text"
android:maxLength="500"
android:padding="8dp"
@@ -9,20 +9,32 @@

<!-- TODO: Update blank fragment layout -->

<RelativeLayout
android:layout_height="match_parent"
android:layout_width="match_parent">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/re_view"
<androidx.appcompat.widget.SearchView
android:id="@+id/searchview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:scrollbars="vertical"
android:layout_height="?attr/actionBarSize"
android:layout_margin="5dp"
android:padding="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/re_view"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:queryHint="Search">
</androidx.appcompat.widget.SearchView>


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/re_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/searchview"
android:padding="5dp"
android:scrollbars="vertical"
app:layout_constraintTop_toBottomOf="@+id/searchview"
tools:layout_editor_absoluteX="5dp" />
</RelativeLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
@@ -24,10 +24,10 @@

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/lib_re_view"
android:layout_width="331dp"
android:layout_width="match_parent"
android:layout_height="600dp"
android:layout_margin="36dp"
android:padding="16dp"
android:layout_margin="20dp"
android:padding="5dp"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>



<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
@@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.android.tools.build:gradle:7.0.1'
classpath 'com.google.gms:google-services:4.3.10'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

0 comments on commit cd491a4

Please sign in to comment.