-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Maps marker deselect and UI changes (#84) - Closed #79 Merge map fix into develop * Test structure now mirrors src structure (#85) * Dagger 2 and some bug fixes (#86) * Added initial dagger modules * Implemented dagger functionality in all legacy BMController calls, also fixed gym group_ex crash bug and general clean up * Updated gradle version and dependencies to make bitrise happy * Limited bounds of autocomplete search on BearTransit map * fixed library hours not being right justified by using changing width to match parent (#87) * Limited autocomplete search to Berkeley area for BearTransit map (#94) * Updated CONTRIBUTING.md Changed instructions to tell open source contributors to make a PR to develop instead of master * Limited bounds of autocomplete search on BearTransit map * Added release notes * Removed google-services.json from readme * Fixed bounds for Destination
- Loading branch information
Showing
28 changed files
with
362 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/asuc/asucmobile/GlobalApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.asuc.asucmobile; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
|
||
import com.asuc.asucmobile.dagger.components.DaggerRetrofitComponent; | ||
import com.asuc.asucmobile.dagger.components.RetrofitComponent; | ||
import com.asuc.asucmobile.dagger.modules.AppModule; | ||
import com.asuc.asucmobile.dagger.modules.RetrofitModule; | ||
import com.asuc.asucmobile.utilities.ServerUtils; | ||
|
||
/** | ||
* Configuration for the global application | ||
*/ | ||
public class GlobalApplication extends Application { | ||
|
||
private static Context appContext; | ||
private static RetrofitComponent retrofitComponent; | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
appContext = getApplicationContext(); | ||
|
||
retrofitComponent = DaggerRetrofitComponent.builder() | ||
.appModule(new AppModule(this)) | ||
.retrofitModule(new RetrofitModule(ServerUtils.getBaseUrl())) | ||
.build(); | ||
|
||
} | ||
|
||
public static RetrofitComponent getRetrofitComponent() { | ||
return retrofitComponent; | ||
} | ||
|
||
public static Context getAppContext() { | ||
return appContext; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/asuc/asucmobile/dagger/components/RetrofitComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.asuc.asucmobile.dagger.components; | ||
|
||
import com.asuc.asucmobile.services.BMService; | ||
import com.asuc.asucmobile.dagger.modules.AppModule; | ||
import com.asuc.asucmobile.dagger.modules.RetrofitModule; | ||
import com.asuc.asucmobile.fragments.FoodFragment; | ||
import com.asuc.asucmobile.fragments.GymFragment; | ||
import com.asuc.asucmobile.fragments.LibraryFragment; | ||
import com.asuc.asucmobile.fragments.ResourceFragment; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import dagger.Component; | ||
|
||
@Singleton | ||
@Component(modules = {RetrofitModule.class, AppModule.class}) | ||
public interface RetrofitComponent { | ||
|
||
// TODO: try a more generalized injection function | ||
|
||
void inject(FoodFragment fragment); | ||
|
||
void inject(LibraryFragment fragment); | ||
|
||
void inject(GymFragment fragment); | ||
|
||
void inject(ResourceFragment fragment); | ||
|
||
// testing? | ||
|
||
BMService bmapi(); | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/asuc/asucmobile/dagger/modules/AppModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.asuc.asucmobile.dagger.modules; | ||
|
||
import android.app.Application; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import dagger.Module; | ||
import dagger.Provides; | ||
|
||
@Module | ||
public class AppModule { | ||
Application mApplication; | ||
|
||
public AppModule(Application mApplication) { | ||
this.mApplication = mApplication; | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
Application provideApplication() { | ||
return mApplication; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/asuc/asucmobile/dagger/modules/RepositoryModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.asuc.asucmobile.dagger.modules; | ||
|
||
import com.google.firebase.firestore.FirebaseFirestore; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import dagger.Module; | ||
import dagger.Provides; | ||
|
||
@Module | ||
public class RepositoryModule { | ||
|
||
// singleton provider for Firestore instance | ||
@Provides | ||
@Singleton | ||
public FirebaseFirestore getFirestore() { | ||
return FirebaseFirestore.getInstance(); | ||
} | ||
|
||
} |
Oops, something went wrong.