Skip to content

Commit

Permalink
Firebase offline persistence removed
Browse files Browse the repository at this point in the history
  • Loading branch information
divya21raj committed Mar 30, 2018
1 parent ff5b338 commit 95235ef
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 48 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
applicationId 'garbagecollectors.com.unipool'
minSdkVersion 16
targetSdkVersion 27
versionCode 4
versionName "1.04"
versionCode 6
versionName "1.06"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

multiDexEnabled true //important
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name=".UniPool">
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyB8Ik3P9bFz_prcjauv0oGMM_4gQmK2U_I" />
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/java/garbagecollectors/com/unipool/UniPool.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ protected void onCreate(Bundle savedInstanceState)
userDatabaseReference = FirebaseDatabase.getInstance().getReference("users/" + finalCurrentUser.getUserId());
userMessageDatabaseReference = FirebaseDatabase.getInstance().getReference("messages/" + finalCurrentUser.getUserId());

entryDatabaseReference.keepSynced(true);
pairUpDatabaseReference.keepSynced(true);
userDatabaseReference.keepSynced(true);
userMessageDatabaseReference.keepSynced(true);

MessageDBTask.addOnCompleteListener(task ->
{
DataSnapshot messageData = (DataSnapshot) MessageDBTask.getResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ protected void onCreate(Bundle savedInstanceState)
drawerLayout = findViewById(R.id.home_layout);

noEntryRelativeLayout = findViewById(R.id.no_entry_message);
noEntryRelativeLayout.setVisibility(View.INVISIBLE);

navDrawerStateListener();

Expand All @@ -60,6 +59,12 @@ protected void onCreate(Bundle savedInstanceState)

recycle = findViewById(R.id.recycle);

if(tripEntryList.isEmpty())
noEntryRelativeLayout.setVisibility(View.VISIBLE);

else
noEntryRelativeLayout.setVisibility(View.INVISIBLE);

recyclerAdapter = new HomeActivityTEA(tripEntryList,HomeActivity.this);
RecyclerView.LayoutManager layoutManager = new GridLayoutManager(HomeActivity.this,1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ protected void onCreate(Bundle savedInstanceState)
DatabaseReference userMessageDatabaseReference = FirebaseDatabase.getInstance().
getReference("messages/" + BaseActivity.getFinalCurrentUser().getUserId());

userMessageDatabaseReference.keepSynced(true);

userMessageDatabaseReference.addChildEventListener(new ChildEventListener()
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,28 @@ public void onTimeSet(TimePicker view, int hourOfDay, int minute)
};

public void findSource(View view)
{
showPlaceAutocomplete(1);
}

public void findDestination(View view)
{
showPlaceAutocomplete(2);
}

private void showPlaceAutocomplete(int i)
{
try
{
Intent intent =
new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY)
.build(this);
startActivityForResult(intent, 1);
startActivityForResult(intent, i);

} catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e)
{
Toast.makeText(this, "Google Play Service Error!", Toast.LENGTH_SHORT).show();
}

}

// A place has been received; use requestCode to track the request.
Expand Down Expand Up @@ -251,19 +260,6 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data)
}
}

public void findDestination(View view)
{
try
{
Intent intent = new PlaceAutocomplete.IntentBuilder(PlaceAutocomplete.MODE_OVERLAY)
.build(this);
startActivityForResult(intent, 2);
} catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e)
{
Toast.makeText(this, "Google Play Service Error!", Toast.LENGTH_SHORT).show();
}
}

public void finalSave(View view) throws ParseException
{
switch (checkInvalidEntry())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ protected void onCreate(Bundle savedInstanceState)

messageDatabaseReference = FirebaseDatabase.getInstance().getReference("messages/" + currentUser.getUid());

userDatabaseReference.keepSynced(true);
messageDatabaseReference.keepSynced(true);
entryDatabaseReference.keepSynced(true);


new Handler().postDelayed(() -> delaySource.setResult(null), 2350);

userDatabaseReference.addListenerForSingleValueEvent(new ValueEventListener()
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,19 @@
android:onClick="onClickAbout"
android:text="@string/saurabh_gangadharan"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/version"
android:text="v1.06"
android:layout_above="@id/githubLayout"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"/>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/githubLayout"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp">
Expand Down

0 comments on commit 95235ef

Please sign in to comment.