diff --git a/README.md b/README.md index fd198991..89839b10 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ It is recommended you use Android Studio 3.0.0. * Create a new project in the [Google Cloud Console](https://console.cloud.google.com) * Under the APIs and Services tab, enable the Google Places API for Android, Google Maps Directions API, Google Maps Android API, and Google Maps Geocoding API * Under the Credentials tab, create an API key - * Paste your API key into [secret.xml](app/src/main/res/values/secret.xml) and [google-services.json](app/google-services.json) + * Paste your API key into [secret.xml](app/src/main/res/values/secret.xml) * We've configured this repository so that the application pulls from our sandbox backend, which just returns test data. If you would like access to our production backend API, please [contact us](#contact). ## Contributing [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/asuc-octo/berkeley-mobile-android/issues) diff --git a/app/build.gradle b/app/build.gradle index 2945b7f6..54d74ad4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'io.fabric' android { compileSdkVersion 25 - buildToolsVersion '26.0.2' + buildToolsVersion '28.0.3' defaultConfig { applicationId "com.asuc.asucmobile" @@ -18,6 +18,19 @@ android { dexOptions { javaMaxHeapSize "4g" } + + packagingOptions { + exclude 'META-INF/DEPENDENCIES' + exclude 'META-INF/LICENSE' + exclude 'META-INF/LICENSE.md' + exclude 'META-INF/LICENSE-notice.md' + exclude 'META-INF/LICENSE.txt' + exclude 'META-INF/license.txt' + exclude 'META-INF/NOTICE' + exclude 'META-INF/NOTICE.txt' + exclude 'META-INF/notice.txt' + exclude 'META-INF/ASL2.0' + } } repositories { @@ -27,48 +40,64 @@ repositories { dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'mbanje.kurt:fabbutton:1.2.4@aar' - compile 'com.dmitrymalkovich.android:progress-fab:1.6' - compile 'com.wang.avi:library:2.1.3' - compile 'com.chabbal:slidingdotsplash:1.0.2' - compile 'com.android.support:multidex:1.0.1' + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'mbanje.kurt:fabbutton:1.2.4@aar' + implementation 'com.dmitrymalkovich.android:progress-fab:1.6' + implementation 'com.wang.avi:library:2.1.3' + implementation 'com.chabbal:slidingdotsplash:1.0.2' + implementation 'com.android.support:multidex:1.0.1' - compile 'com.google.code.gson:gson:2.8.0' + implementation 'com.google.code.gson:gson:2.8.0' - compile 'com.google.android.gms:play-services:11.8.0' - compile 'com.google.android.gms:play-services-location:11.8.0' - compile 'com.crashlytics.sdk.android:crashlytics:2.9.1' + implementation 'com.google.android.gms:play-services:11.8.0' + implementation 'com.google.android.gms:play-services-location:11.8.0' + implementation 'com.crashlytics.sdk.android:crashlytics:2.9.1' - //compile 'com.getbase:floatingactionbutton:1.10.1' - compile 'com.github.clans:fab:1.6.4' + //implementation 'com.getbase:floatingactionbutton:1.10.1' + implementation 'com.github.clans:fab:1.6.4' - compile 'com.github.bumptech.glide:glide:3.7.0' - compile 'com.android.support:appcompat-v7:25.3.0' - compile 'com.android.support:design:25.3.0' - compile 'com.android.support:support-v4:25.3.0' - compile 'com.android.support:support-v13:25.3.0' - compile 'com.android.support:cardview-v7:25.3.0' + implementation 'com.github.bumptech.glide:glide:3.7.0' + implementation 'com.android.support:appcompat-v7:25.3.0' + implementation 'com.android.support:design:25.3.0' + implementation 'com.android.support:support-v4:25.3.0' + implementation 'com.android.support:support-v13:25.3.0' + implementation 'com.android.support:cardview-v7:25.3.0' - compile 'com.squareup.picasso:picasso:2.5.2' + implementation 'com.squareup.picasso:picasso:2.5.2' - compile 'com.pushwoosh:pushwoosh:4.6.2' - compile 'com.squareup.retrofit2:retrofit:2.1.0' - compile 'com.squareup.retrofit2:converter-gson:2.1.0' + implementation 'com.pushwoosh:pushwoosh:4.6.2' + implementation 'com.squareup.retrofit2:retrofit:2.1.0' + implementation 'com.squareup.retrofit2:converter-gson:2.1.0' - compile 'com.jakewharton:butterknife:8.5.1' - compile 'com.github.bumptech.glide:glide:3.7.0' + implementation 'com.jakewharton:butterknife:8.5.1' + implementation 'com.github.bumptech.glide:glide:3.7.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1' - compile 'com.android.support.constraint:constraint-layout:1.0.2' + implementation 'com.android.support.constraint:constraint-layout:1.0.2' + + implementation 'noman.weekcalendar:weekcalendar:1.0.6' + + // maps + implementation 'com.google.android.gms:play-services-maps:16.0.0' + implementation 'com.google.android.gms:play-services-places:16.0.0' + implementation 'com.google.android.gms:play-services-location:16.0.0' - compile 'noman.weekcalendar:weekcalendar:1.0.6' + // firebase + implementation 'com.google.firebase:firebase-core:16.0.4' + implementation 'com.google.firebase:firebase-firestore:17.1.1' + implementation 'com.google.firebase:firebase-messaging:17.3.3' + implementation 'com.firebase:firebase-jobdispatcher:0.7.0' - compile 'com.google.firebase:firebase-messaging:11.8.0' - compile 'com.firebase:firebase-jobdispatcher:0.7.0' + // dagger 2 + implementation 'com.google.dagger:dagger:2.17' + annotationProcessor 'com.google.dagger:dagger-compiler:2.17' + // Required -- JUnit 4 framework + testImplementation 'junit:junit:4.12' + // Optional -- Mockito framework + testImplementation 'org.mockito:mockito-core:1.10.19' } apply plugin: 'com.google.gms.google-services' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9ac4b252..cec9e8eb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -46,7 +46,7 @@ android:label="@string/app_name" android:theme="@style/AppTheme" android:largeHeap="true" - android:name="android.support.multidex.MultiDexApplication"> + android:name="com.asuc.asucmobile.GlobalApplication"> filter; private ArrayList mClasses; private HashMap clickTracker; @@ -72,6 +80,8 @@ public class GymFragment extends Fragment { public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + GlobalApplication.getRetrofitComponent().inject(this); + NavigationGenerator.closeMenu(getActivity()); mClasses = new ArrayList<>(); @@ -262,8 +272,8 @@ private void initClassTable() { */ private void refresh() { - gymsCall = BMRetrofitController.bmapi.callGymsList(); - gymClassesCall = BMRetrofitController.bmapi.callGymClasses(); + gymsCall = bmService.callGymsList(); + gymClassesCall = bmService.callGymClasses(); gymClassView.setVisibility(View.GONE); mRefreshWrapper.setVisibility(View.GONE); @@ -293,17 +303,27 @@ public void onFailure(Call call, Throwable t) { }); } + /** + * Prevent adding null gym classes to list + * @param gymClasses + */ + private void addGymClasses(List gymClasses) { + if (gymClasses != null) { + mClasses.addAll(gymClasses); + } + } + private void getGymClasses(){ gymClassesCall.enqueue(new retrofit2.Callback() { @Override public void onResponse(Call call, Response response) { - mClasses.addAll(response.body().getAllAround()); - mClasses.addAll(response.body().getAqua()); - mClasses.addAll(response.body().getCardio()); - mClasses.addAll(response.body().getCore()); - mClasses.addAll(response.body().getDance()); - mClasses.addAll(response.body().getMindBody()); - mClasses.addAll(response.body().getStrength()); + addGymClasses(response.body().getAllAround()); + addGymClasses(response.body().getAqua()); + addGymClasses(response.body().getCardio()); + addGymClasses(response.body().getCore()); + addGymClasses(response.body().getDance()); + addGymClasses(response.body().getMindBody()); + addGymClasses(response.body().getStrength()); Collections.sort(mClasses); initClassTable(); } diff --git a/app/src/main/java/com/asuc/asucmobile/fragments/LibraryFragment.java b/app/src/main/java/com/asuc/asucmobile/fragments/LibraryFragment.java index 7bfcd28f..0de50095 100644 --- a/app/src/main/java/com/asuc/asucmobile/fragments/LibraryFragment.java +++ b/app/src/main/java/com/asuc/asucmobile/fragments/LibraryFragment.java @@ -4,43 +4,41 @@ import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.SearchView; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; -import android.widget.EditText; -import android.widget.Filter; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.Toast; +import com.asuc.asucmobile.GlobalApplication; import com.asuc.asucmobile.R; import com.asuc.asucmobile.adapters.LibraryAdapter; +import com.asuc.asucmobile.services.BMService; import com.asuc.asucmobile.main.ListOfFavorites; import com.asuc.asucmobile.main.OpenLibraryActivity; -import com.asuc.asucmobile.models.Library; import com.asuc.asucmobile.models.responses.LibrariesResponse; -import com.asuc.asucmobile.controllers.BMRetrofitController; import com.asuc.asucmobile.utilities.CustomComparators; import com.asuc.asucmobile.utilities.NavigationGenerator; import com.asuc.asucmobile.utilities.SerializableUtilities; import com.google.firebase.analytics.FirebaseAnalytics; -import java.util.ArrayList; import java.util.Collections; +import javax.inject.Inject; + import retrofit2.Call; import retrofit2.Response; public class LibraryFragment extends Fragment { + @Inject + BMService bmService; + private ListView mLibraryList; private ProgressBar mProgressBar; private LinearLayout mRefreshWrapper; @@ -53,6 +51,8 @@ public class LibraryFragment extends Fragment { @SuppressWarnings("deprecation") public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + GlobalApplication.getRetrofitComponent().inject(this); + mFirebaseAnalytics = FirebaseAnalytics.getInstance(this.getContext()); Bundle bundle = new Bundle(); mFirebaseAnalytics.logEvent("opened_library_screen", bundle); @@ -109,7 +109,7 @@ private void refresh() { mRefreshWrapper.setVisibility(View.GONE); mProgressBar.setVisibility(View.VISIBLE); - BMRetrofitController.bmapi.callLibrariesList().enqueue(new retrofit2.Callback() { + bmService.callLibrariesList().enqueue(new retrofit2.Callback() { @Override public void onResponse(Call call, Response response) { mLibraryList.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/com/asuc/asucmobile/fragments/MapsFragment.java b/app/src/main/java/com/asuc/asucmobile/fragments/MapsFragment.java index 1dac3923..52ace6f3 100644 --- a/app/src/main/java/com/asuc/asucmobile/fragments/MapsFragment.java +++ b/app/src/main/java/com/asuc/asucmobile/fragments/MapsFragment.java @@ -36,8 +36,8 @@ import android.widget.Toast; +import com.asuc.asucmobile.GlobalApplication; import com.asuc.asucmobile.R; -import com.asuc.asucmobile.controllers.BMRetrofitController; import com.asuc.asucmobile.controllers.BusController; import com.asuc.asucmobile.controllers.Controller; import com.asuc.asucmobile.controllers.LiveBusController; @@ -53,6 +53,7 @@ import com.asuc.asucmobile.models.Stop; import com.asuc.asucmobile.models.responses.LibrariesResponse; import com.asuc.asucmobile.models.responses.MapIconResponse; +import com.asuc.asucmobile.services.BMService; import com.asuc.asucmobile.utilities.Callback; import com.asuc.asucmobile.utilities.CustomComparators; import com.asuc.asucmobile.utilities.JSONUtilities; @@ -92,6 +93,8 @@ import java.util.Timer; import java.util.TimerTask; +import javax.inject.Inject; + import mbanje.kurt.fabbutton.FabButton; import retrofit2.Call; import retrofit2.Response; @@ -105,6 +108,9 @@ public class MapsFragment extends Fragment GoogleMap.OnMapLoadedCallback { private static final String TAG = "MapsFragment"; + + @Inject BMService bmService; + private GoogleMap mMap; Gson gson = new Gson(); final LatLng BERKELEY = new LatLng(37.8716, -122.2727); @@ -118,6 +124,22 @@ public class MapsFragment extends Fragment FabButton navigation_button; FloatingActionMenu FABmenu; + private boolean bottlesShown = false; + private boolean sleepShown = false; + private boolean microwavesShown = false; + + public boolean isBottlesShown() { + return bottlesShown; + } + + public boolean isSleepShown() { + return sleepShown; + } + + public boolean isMicrowavesShown() { + return microwavesShown; + } + ArrayList markers_sleepPods = new ArrayList<>(); ArrayList markers_waterbottles = new ArrayList<>(); ArrayList markers_microwave = new ArrayList<>(); @@ -145,6 +167,9 @@ public static MapsFragment getInstance() { @Override @SuppressWarnings("all") public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + + bmService = GlobalApplication.getRetrofitComponent().bmapi(); + if (layout != null) { ViewGroup parent = (ViewGroup) layout.getParent(); if (parent != null) @@ -231,21 +256,21 @@ public void onClick(View v) { bundle.putString("Category", "nappod"); mFirebaseAnalytics.logEvent("map_icon_clicked", bundle); updateLocation(v); - for (Marker marker : markers_sleepPods) { - - marker.setVisible(true); + for (Marker marker : markers_sleepPods) { + marker.setVisible(!sleepShown); } + sleepShown = !sleepShown; for (Marker marker : markers_waterbottles) { marker.setVisible(false); - } + bottlesShown = false; for (Marker marker : markers_microwave) { marker.setVisible(false); - } + microwavesShown = false; } }); @@ -258,22 +283,22 @@ public void onClick(View v) { bundle.putString("Category", "waterbottles"); mFirebaseAnalytics.logEvent("map_icon_clicked", bundle); updateLocation(v); - for (Marker marker : markers_waterbottles) { - marker.setVisible(true); + for (Marker marker : markers_waterbottles) { + marker.setVisible(!bottlesShown); } + bottlesShown = !bottlesShown; for (Marker marker : markers_sleepPods) { - marker.setVisible(false); - } + sleepShown = false; for (Marker marker : markers_microwave) { marker.setVisible(false); - } + microwavesShown = false; } @@ -290,20 +315,18 @@ public void onClick(View v) { //updateLocation(v); for (Marker marker : markers_waterbottles) { marker.setVisible(false); - } + bottlesShown = false; for (Marker marker : markers_sleepPods) { - marker.setVisible(false); - } - + sleepShown = false; for (Marker marker : markers_microwave) { - marker.setVisible(true); - + marker.setVisible(!microwavesShown); } + microwavesShown = !microwavesShown; } @@ -396,7 +419,7 @@ public void onMapReady(GoogleMap googleMap) { @Override public void onMapClick(LatLng latLng) { if (originWrapper == null || busRouteWrapper == null || navigation_button == null) { - originWrapper = (LinearLayout) layout.findViewById(R.id.origin_bar_wrapper); + originWrapper = (LinearLayout) layout.findViewById(R.id.origin_bar); navigation_button = (FabButton) layout.findViewById(R.id.determinate); } @@ -411,7 +434,7 @@ public void onMapClick(LatLng latLng) { mMap.setOnMarkerClickListener(this); mMap.setOnMapLoadedCallback(this); - BMRetrofitController.bmapi.callIconList().enqueue(new retrofit2.Callback() { + bmService.callIconList().enqueue(new retrofit2.Callback() { @Override public void onResponse(Call call, Response response) { mapHash.put("Microwave", response.body().getMicrowaves()); diff --git a/app/src/main/java/com/asuc/asucmobile/fragments/OriginFragment.java b/app/src/main/java/com/asuc/asucmobile/fragments/OriginFragment.java index 6823f8e6..83af24c3 100644 --- a/app/src/main/java/com/asuc/asucmobile/fragments/OriginFragment.java +++ b/app/src/main/java/com/asuc/asucmobile/fragments/OriginFragment.java @@ -75,8 +75,8 @@ public class OriginFragment extends PlaceAutocompleteFragment implements private static GoogleApiClient mGoogleApiClient; private PlaceArrayAdapter mPlaceArrayAdapter; - private static final LatLngBounds BOUNDS_MOUNTAIN_VIEW = new LatLngBounds( - new LatLng(37.851532, -122.232216), new LatLng(37.902479, -122.313240)); + private static final LatLngBounds BOUNDS_BERKELEY = new LatLngBounds( + new LatLng(37.854866, -122.269154), new LatLng(37.883038, -122.245781)); private LatLng origin; @@ -195,7 +195,7 @@ public void onClick(View v) { new AutocompleteFilter.Builder().setCountry("US").build(); mPlaceArrayAdapter = new PlaceArrayAdapter(getContext(), R.layout.maps_autocomplete_list_item, R.id.text1, - BOUNDS_MOUNTAIN_VIEW, filter); + BOUNDS_BERKELEY, filter); mAutocompleteTextView.setAdapter(mPlaceArrayAdapter); //mAutocompleteTextView.setText("Current Location"); //origin = MapsFragment.getInstance().getCurrLocation(); diff --git a/app/src/main/java/com/asuc/asucmobile/fragments/ResourceFragment.java b/app/src/main/java/com/asuc/asucmobile/fragments/ResourceFragment.java index d5756004..8593d676 100644 --- a/app/src/main/java/com/asuc/asucmobile/fragments/ResourceFragment.java +++ b/app/src/main/java/com/asuc/asucmobile/fragments/ResourceFragment.java @@ -21,12 +21,13 @@ import android.widget.ProgressBar; import android.widget.Toast; +import com.asuc.asucmobile.GlobalApplication; import com.asuc.asucmobile.R; import com.asuc.asucmobile.adapters.ResourceAdapter; +import com.asuc.asucmobile.services.BMService; import com.asuc.asucmobile.main.ListOfFavorites; import com.asuc.asucmobile.main.OpenResourceActivity; import com.asuc.asucmobile.models.responses.ResourcesResponse; -import com.asuc.asucmobile.controllers.BMRetrofitController; import com.asuc.asucmobile.utilities.CustomComparators; import com.asuc.asucmobile.utilities.NavigationGenerator; import com.asuc.asucmobile.utilities.SerializableUtilities; @@ -34,11 +35,16 @@ import java.util.Collections; +import javax.inject.Inject; + import retrofit2.Call; import retrofit2.Response; public class ResourceFragment extends Fragment { + @Inject + BMService bmService; + private ListView mResourceList; private ProgressBar mProgressBar; private LinearLayout mRefreshWrapper; @@ -51,6 +57,8 @@ public class ResourceFragment extends Fragment { @SuppressWarnings("deprecation") public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + GlobalApplication.getRetrofitComponent().inject(this); + mFirebaseAnalytics = FirebaseAnalytics.getInstance(this.getContext()); Bundle bundle = new Bundle(); mFirebaseAnalytics.logEvent("opened_resource_screen", bundle); @@ -155,7 +163,7 @@ private void refresh() { mRefreshWrapper.setVisibility(View.GONE); mProgressBar.setVisibility(View.VISIBLE); - BMRetrofitController.bmapi.callResourcesList().enqueue(new retrofit2.Callback() { + bmService.callResourcesList().enqueue(new retrofit2.Callback() { @Override public void onResponse(Call call, Response response) { mResourceList.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/com/asuc/asucmobile/main/OpenLibraryActivity.java b/app/src/main/java/com/asuc/asucmobile/main/OpenLibraryActivity.java index ab8b9d14..ab3a6834 100644 --- a/app/src/main/java/com/asuc/asucmobile/main/OpenLibraryActivity.java +++ b/app/src/main/java/com/asuc/asucmobile/main/OpenLibraryActivity.java @@ -216,7 +216,7 @@ private void setUpHours() { // weekly library hours should already be set up when you open the page hours.setText(setUpWeeklyHoursLeft()); hoursParams = hoursLayout.getLayoutParams(); - hoursLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, 0.2f)); + hoursLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, 0.2f)); hours_expand.setText(setUpWeeklyHoursRight()); } diff --git a/app/src/main/java/com/asuc/asucmobile/main/SplashActivity.java b/app/src/main/java/com/asuc/asucmobile/main/SplashActivity.java index f5fb8eee..86988426 100644 --- a/app/src/main/java/com/asuc/asucmobile/main/SplashActivity.java +++ b/app/src/main/java/com/asuc/asucmobile/main/SplashActivity.java @@ -6,14 +6,10 @@ import android.util.Log; import android.view.Window; import android.view.WindowManager; -import android.provider.Settings; import com.asuc.asucmobile.R; -import com.asuc.asucmobile.controllers.BMAPI; -import com.asuc.asucmobile.controllers.BMRetrofitController; -import com.crashlytics.android.Crashlytics; - -import io.fabric.sdk.android.Fabric; +import com.asuc.asucmobile.services.BMService; +import com.google.firebase.firestore.FirebaseFirestore; public class SplashActivity extends Activity { @@ -34,8 +30,6 @@ protected void onCreate(Bundle savedInstanceState) { Fabric.with(this, new Crashlytics()); }*/ - // launch network stuff - BMRetrofitController.create(this, BMAPI.class); // Start timer and launch main activity IntentLauncher launcher = new IntentLauncher(); diff --git a/app/src/main/java/com/asuc/asucmobile/controllers/BMAPI.java b/app/src/main/java/com/asuc/asucmobile/services/BMService.java similarity index 95% rename from app/src/main/java/com/asuc/asucmobile/controllers/BMAPI.java rename to app/src/main/java/com/asuc/asucmobile/services/BMService.java index 997a3ab9..f1234dd6 100644 --- a/app/src/main/java/com/asuc/asucmobile/controllers/BMAPI.java +++ b/app/src/main/java/com/asuc/asucmobile/services/BMService.java @@ -1,4 +1,4 @@ -package com.asuc.asucmobile.controllers; +package com.asuc.asucmobile.services; import com.asuc.asucmobile.models.responses.CafesResponse; import com.asuc.asucmobile.models.responses.DiningHallsResponse; @@ -16,7 +16,7 @@ * Created by rustie on 2/10/18. */ -public interface BMAPI { +public interface BMService { @Headers("Cache-Control: max-age=640000") @GET("dining_halls") diff --git a/app/src/main/java/com/asuc/asucmobile/tests/BMAPITest.java b/app/src/main/java/com/asuc/asucmobile/tests/BMAPITest.java deleted file mode 100644 index 5a5d946e..00000000 --- a/app/src/main/java/com/asuc/asucmobile/tests/BMAPITest.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.asuc.asucmobile.tests; - -import java.io.IOException; - -/** - * Created by rustie on 2/10/18. - */ - -public class BMAPITest { - - public static final String TAG = "BMAPI TEST"; - - - - public static void main(String[] args) throws IOException { -// BMAPI bmapi = ServiceGenerator.createService(BMAPI.class); -// Call call = bmapi.diningHallList(); -// call.enqueue(new Callback() { -// @Override -// public void onResponse(Call call, Response response) { -// Log.d(TAG, String.valueOf(response.body().getDining_halls().get(0))); -// } -// -// @Override -// public void onFailure(Call call, Throwable t) { -// -// } -// }); - } -} diff --git a/app/src/main/java/com/asuc/asucmobile/tests/Test.java b/app/src/main/java/com/asuc/asucmobile/tests/Test.java deleted file mode 100644 index 66e9e24b..00000000 --- a/app/src/main/java/com/asuc/asucmobile/tests/Test.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.asuc.asucmobile.tests; - -import java.util.Date; - -public class Test { - - @SuppressWarnings("all") - public static void runTests() { - - // Library/Gym Test - Date currentTime = new Date(); - - Date opening1 = new Date(); - opening1.setTime(currentTime.getTime() - 1000000); - Date closing1 = new Date(); - closing1.setTime(currentTime.getTime() + 1000000); -// Library testLibrary1 = -// new Library(0, "Library", "Location", "000-000-0000", opening1, closing1, null, -// null, 0, 0, false, null, 0); - - Date opening2 = new Date(); - opening2.setTime(currentTime.getTime() + 1000000); - Date closing2 = new Date(); - closing2.setTime(currentTime.getTime() - 1000000); -// Gym testGym1 = -// new Gym(0, "Library", "Location", opening2, closing2, ""); - -// Library testLibrary2 = -// new Library(1, "Library", "Location", "000-000-0000", null, null, null, null, 0, 0, -// false, null, 0); - -// if (!testLibrary1.isOpen()) { -// System.out.println("Open library reported as closed"); -// } - -// if (testGym1.isOpen()) { -// System.out.println("Closed gym reported as open"); -// } - -// if (testLibrary2.isOpen()) { -// System.out.println("Library with null hours reported as open"); -// } - - // Name Abbreviation Test - /* Stop stop1 = new Stop(0, "Moffitt Library; Memorial Glade Side", new LatLng(0, 0)); - Stop stop2 = new Stop(0, "Li Ka Shing: West Crescent Side", new LatLng(0, 0)); - Stop stop3 = new Stop(0, "ASUC: Bancroft Way; Telegraph Avenue", new LatLng(0, 0)); - Stop stop4 = new Stop(0, "ASUC; Bancroft Way: Telegraph Avenue", new LatLng(0, 0)); - - if (!stop1.getAbbreviatedName().equals("Moffitt Library")) { - System.out.println( - "EXPECTED \"Moffitt Library\", but got: " + stop1.getAbbreviatedName()); - } - - if (!stop2.getAbbreviatedName().equals("Li Ka Shing")) { - System.out.println("EXPECTED \"Li Ka Shing\", but got: " + stop2.getAbbreviatedName()); - } - - if (!stop3.getAbbreviatedName().equals("ASUC")) { - System.out.println("EXPECTED \"ASUC\", but got: " + stop3.getAbbreviatedName()); - } - - if (!stop4.getAbbreviatedName().equals("ASUC")) { - System.out.println("EXPECTED \"ASUC\", but got: " + stop4.getAbbreviatedName()); - } -*/ - System.out.println("Tests completed. Check above for any errors."); - } - -} diff --git a/app/src/main/res/layout/activity_maps.xml b/app/src/main/res/layout/activity_maps.xml index 6be561ff..b322e550 100644 --- a/app/src/main/res/layout/activity_maps.xml +++ b/app/src/main/res/layout/activity_maps.xml @@ -30,37 +30,25 @@ android:layout_below="@id/toolbar" android:layout_centerHorizontal="true" android:layout_marginTop="20dp" - android:background="@color/transparent" - android:orientation="horizontal" - android:weightSum="1"> + android:background="@color/white" + android:elevation="10dp" + android:orientation="horizontal"> - - - - - + tools:layout="@layout/origin_fragment" /> - /> - - diff --git a/app/src/main/res/layout/activity_open_library.xml b/app/src/main/res/layout/activity_open_library.xml index 05fede6d..2536a9f6 100644 --- a/app/src/main/res/layout/activity_open_library.xml +++ b/app/src/main/res/layout/activity_open_library.xml @@ -75,7 +75,7 @@ diff --git a/app/src/main/res/layout/origin_fragment.xml b/app/src/main/res/layout/origin_fragment.xml index 006257cb..97143ea4 100644 --- a/app/src/main/res/layout/origin_fragment.xml +++ b/app/src/main/res/layout/origin_fragment.xml @@ -4,7 +4,7 @@ android:layout_width="300dp" android:layout_height="70dp" android:layout_marginTop="5dp" - android:background="@color/holo_white" + android:background="@color/white" android:orientation="vertical"> diff --git a/app/src/test/java/com/asuc/asucmobile/fragments/MapsFragmentTest.java b/app/src/test/java/com/asuc/asucmobile/fragments/MapsFragmentTest.java new file mode 100644 index 00000000..cc63f9cb --- /dev/null +++ b/app/src/test/java/com/asuc/asucmobile/fragments/MapsFragmentTest.java @@ -0,0 +1,17 @@ +package com.asuc.asucmobile.fragments; + +import com.asuc.asucmobile.fragments.MapsFragment; + +import org.junit.Test; +import static junit.framework.Assert.assertEquals; + +public class MapsFragmentTest { + + @Test + public void markers_are_false() throws Exception { + MapsFragment mp = new MapsFragment(); + assertEquals(mp.isBottlesShown(), false); + assertEquals(mp.isSleepShown(), false); + assertEquals(mp.isMicrowavesShown(), false); + } +} diff --git a/build.gradle b/build.gradle index 2abf824e..086953cf 100644 --- a/build.gradle +++ b/build.gradle @@ -10,10 +10,10 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' - classpath 'com.google.gms:google-services:3.1.0' + classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.google.gms:google-services:4.1.0' - classpath 'io.fabric.tools:gradle:1.25.1' + classpath 'io.fabric.tools:gradle:1.25.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2c9f6b3d..f8ea5b40 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Apr 16 18:39:18 PDT 2018 +#Mon Oct 15 01:59:33 PDT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/whatsnew-en-US b/whatsnew-en-US new file mode 100644 index 00000000..9e24783e --- /dev/null +++ b/whatsnew-en-US @@ -0,0 +1,3 @@ + +- Bug fixes and performance improvements + \ No newline at end of file