Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3be4828
Fixed some bugs. Starting using API amICreator of event.
tomomoto Jun 25, 2025
0af8efe
Inverting component dependencies.
tomomoto Jun 25, 2025
5b7f8ed
Extract singletons factories.
tomomoto Jun 25, 2025
e3c357c
Raw approach for viewModel factories.
tomomoto Jun 26, 2025
c237f65
Small refactoring.
tomomoto Jun 26, 2025
af5227a
Small refactoring.
tomomoto Jun 26, 2025
3eb9569
Small refactoring.
tomomoto Jun 26, 2025
f91a5f3
Profile assisted factory, not full covered.
tomomoto Jun 26, 2025
aca03af
Profile assisted factory, not full covered.
tomomoto Jun 26, 2025
dcc58be
Profile assisted factory, full covered.
tomomoto Jun 26, 2025
62d8f9d
Assisted factory for user module
tomomoto Jun 26, 2025
452075b
Simplified code
tomomoto Jun 26, 2025
b96dbca
Moved old classes
tomomoto Jun 26, 2025
af40d38
Refactoring
tomomoto Jun 26, 2025
ac6d035
Refactoring
tomomoto Jun 26, 2025
fcea199
Refactoring.
tomomoto Jun 26, 2025
b7983b1
Refactoring.
tomomoto Jun 26, 2025
985c06b
Binders generalization.
tomomoto Jun 26, 2025
49d1369
Binders generalization.
tomomoto Jun 26, 2025
12b9102
Assisted factory types.
tomomoto Jun 27, 2025
7ba4fcc
Refactoring.
tomomoto Jun 27, 2025
4cb8ef2
Refactoring.
tomomoto Jun 27, 2025
b735b33
Fixed bug for profile activity rotation changes.
tomomoto Jun 27, 2025
8ab48df
CreateNewEvent refactoring.
tomomoto Jun 28, 2025
8ef42b3
CreateNewEvent refactoring.
tomomoto Jun 28, 2025
7eb0715
CreateEvent refactoring.
tomomoto Jun 28, 2025
26abe43
CreateEvent refactoring.
tomomoto Jun 28, 2025
86bba76
CreateEvent refactoring.
tomomoto Jun 28, 2025
5306c43
CreateEvent refactoring.
tomomoto Jun 28, 2025
f4c5491
CreateEvent refactoring.
tomomoto Jun 28, 2025
bb9ca62
SocketIOService is now foreground.
tomomoto Jun 28, 2025
bb5be5b
Update lint.
tomomoto Jun 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 103 additions & 125 deletions AndroidClient/lint-baseline.xml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions AndroidClient/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />

<!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />-->
<uses-permission
Expand Down Expand Up @@ -94,6 +97,7 @@
<activity android:name=".context.user.activity.UserSubscriptionsActivity" />
<activity android:name=".context.image.activity.UploadUserImageActivity" />
<activity android:name=".context.image.activity.UploadEventImageActivity" />
<activity android:name=".context.profile.activity.NewEventOnMapActivity" />

<meta-data
android:name="com.google.android.gms.version"
Expand All @@ -105,6 +109,7 @@
<service
android:name=".context.network.service.SocketIOService"
android:enabled="true"
android:foregroundServiceType="remoteMessaging"
android:exported="false" />
<service
android:name=".context.gps.service.LocationTrackerService"
Expand Down
43 changes: 5 additions & 38 deletions AndroidClient/src/main/java/com/tom/meeter/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
import com.tom.meeter.context.auth.DaggerAuthComponent;
import com.tom.meeter.context.event.DaggerEventComponent;
import com.tom.meeter.context.event.EventComponent;
import com.tom.meeter.context.image.DaggerImageComponent;
import com.tom.meeter.context.image.ImageComponent;
import com.tom.meeter.context.token.DaggerTokenComponent;
import com.tom.meeter.context.token.TokenComponent;
import com.tom.meeter.context.user.DaggerUserComponent;
import com.tom.meeter.context.user.UserComponent;

Expand All @@ -21,8 +17,6 @@ public class App extends Application {
private static final String TAG = App.class.getCanonicalName();
private AppComponent component;
private AuthComponent authComponent;
private TokenComponent tokenComponent;
private ImageComponent imageComponent;
private EventComponent eventComponent;
private UserComponent userComponent;

Expand All @@ -31,16 +25,15 @@ public void onCreate() {
super.onCreate();
logMethod(TAG, this);

component = buildComponent();

/* Independent */
tokenComponent = buildTokenComponent();
authComponent = buildAuthComponent();
imageComponent = buildImageComponent();

/* Dependent */
eventComponent = buildEventComponent();
userComponent = buildUserComponent();

component = buildComponent();

createNotificationChannel(this);
}
Expand All @@ -53,46 +46,28 @@ public void onTerminate() {

protected AppComponent buildComponent() {
return DaggerAppComponent.builder()
.tokenComponent(tokenComponent)
.imageComponent(imageComponent)
.authComponent(authComponent)
.eventComponent(eventComponent)
.userComponent(userComponent)
.application(this)
.build();
}

protected AuthComponent buildAuthComponent() {
return DaggerAuthComponent.builder()
.application(this)
.build();
}

protected TokenComponent buildTokenComponent() {
return DaggerTokenComponent.builder()
.application(this)
.build();
}

protected ImageComponent buildImageComponent() {
return DaggerImageComponent.builder()
.application(this)
.appComponent(component)
.build();
}

protected EventComponent buildEventComponent() {
return DaggerEventComponent.builder()
.application(this)
.tokenComponent(tokenComponent)
.imageComponent(imageComponent)
.appComponent(component)
.build();
}

protected UserComponent buildUserComponent() {
return DaggerUserComponent.builder()
.application(this)
.tokenComponent(tokenComponent)
.imageComponent(imageComponent)
.appComponent(component)
.build();
}

Expand All @@ -104,18 +79,10 @@ public AuthComponent getAuthComponent() {
return authComponent;
}

public TokenComponent getTokenComponent() {
return tokenComponent;
}

public EventComponent getEventComponent() {
return eventComponent;
}

public ImageComponent getImageComponent() {
return imageComponent;
}

public UserComponent getUserComponent() {
return userComponent;
}
Expand Down
53 changes: 28 additions & 25 deletions AndroidClient/src/main/java/com/tom/meeter/AppComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,58 @@

import android.app.Application;

import com.tom.meeter.context.auth.AuthComponent;
import com.tom.meeter.context.event.EventComponent;
import com.tom.meeter.context.image.ImageComponent;
import com.tom.meeter.context.event.service.EventService;
import com.tom.meeter.context.image.ImageDownloader;
import com.tom.meeter.context.image.activity.BaseUploadActivity;
import com.tom.meeter.context.launcher.Launcher;
import com.tom.meeter.context.profile.activity.ProfileActivity;
import com.tom.meeter.context.profile.activity.SettingsActivity;
import com.tom.meeter.context.profile.activity.SubscribersActivity;
import com.tom.meeter.context.profile.activity.SubscriptionsActivity;
import com.tom.meeter.context.profile.fragment.ActiveEventsFragment;
import com.tom.meeter.context.profile.fragment.CreateEventFragment;
import com.tom.meeter.context.profile.fragment.GoogleMapsFragment;
import com.tom.meeter.context.profile.fragment.ProfileEventsFragment;
import com.tom.meeter.context.profile.fragment.ProfileFragment;
import com.tom.meeter.context.token.TokenComponent;
import com.tom.meeter.context.user.UserComponent;
import com.tom.meeter.infrastructure.injection.viewmodel.ViewModelModule;
import com.tom.meeter.context.token.service.TokenService;
import com.tom.meeter.context.user.service.UserService;

import javax.inject.Singleton;

import dagger.BindsInstance;
import dagger.Component;

@Component(
modules = {
AppModule.class,
ViewModelModule.class
},
dependencies = {
TokenComponent.class,
AuthComponent.class,
ImageComponent.class,

EventComponent.class,
UserComponent.class
TokenModule.class,
ImageModule.class,
UserModule.class,
EventModule.class
})
@AppScope
@Singleton
public interface AppComponent {

@Component.Builder
interface Builder {
TokenService provideTokenService();

@BindsInstance
Builder application(Application application);
ImageDownloader provideImageDownloader();

Builder authComponent(AuthComponent authComponent);
UserService provideUserService();

Builder tokenComponent(TokenComponent tokenComponent);
EventService provideEventService();

Builder eventComponent(EventComponent eventComponent);

Builder imageComponent(ImageComponent imageComponent);
@Component.Builder
interface Builder {

Builder userComponent(UserComponent userComponent);
@BindsInstance
Builder application(Application application);

AppComponent build();
}

void inject(Launcher launcher);

void inject(ProfileActivity profileActivity);

void inject(SettingsActivity settingsActivity);
Expand All @@ -71,4 +70,8 @@ interface Builder {

void inject(SubscriptionsActivity subscriptionsActivity);

void inject(BaseUploadActivity baseUploadActivity);

void inject(CreateEventFragment createEventFragment);

}
26 changes: 14 additions & 12 deletions AndroidClient/src/main/java/com/tom/meeter/AppModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.tom.meeter.context.profile.event.database.EventDao;
import com.tom.meeter.context.profile.event.database.EventDatabase;
import com.tom.meeter.context.profile.repository.event.database.EventDao;
import com.tom.meeter.context.profile.repository.event.database.EventDatabase;
import com.tom.meeter.context.profile.repository.user.database.UserDao;
import com.tom.meeter.context.profile.repository.user.database.UserDatabase;
import com.tom.meeter.context.profile.service.ProfileService;
import com.tom.meeter.context.profile.settings.service.SettingsService;
import com.tom.meeter.context.profile.user.database.UserDao;
import com.tom.meeter.context.profile.user.database.UserDatabase;
import com.tom.meeter.infrastructure.http.HttpClient;

import java.util.TimeZone;
Expand All @@ -27,6 +27,8 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;
Expand All @@ -41,7 +43,7 @@ public AppModule() {
Log.d(TAG, "Configuring AppModule...");
}

@AppScope
@Singleton
@NonNull
@Provides
public ProfileService provideProfileService(Application app) {
Expand All @@ -59,7 +61,7 @@ public ProfileService provideProfileService(Application app) {
.create(ProfileService.class);
}

@AppScope
@Singleton
@NonNull
@Provides
public UserDatabase provideUserDb(Application app) {
Expand All @@ -68,22 +70,22 @@ public UserDatabase provideUserDb(Application app) {
.build();
}

@AppScope
@Singleton
@NonNull
@Provides
public UserDao provideUserDao(UserDatabase userDatabase) {
return userDatabase.userDao();
}

@AppScope
@Singleton
@NonNull
@Provides
public Executor provideExecutor() {
return new ThreadPoolExecutor(4, 8, 1000, TimeUnit.SECONDS,
new ArrayBlockingQueue<>(15, false));
}

@AppScope
@Singleton
@NonNull
@Provides
public EventDatabase provideEventDb(Application app) {
Expand All @@ -92,14 +94,14 @@ public EventDatabase provideEventDb(Application app) {
.build();
}

@AppScope
@Singleton
@NonNull
@Provides
public EventDao provideEventDao(EventDatabase eventDatabase) {
return eventDatabase.eventDao();
}

@AppScope
@Singleton
@NonNull
@Provides
public SettingsService provideSettingsService(Application app) {
Expand All @@ -111,7 +113,7 @@ public SettingsService provideSettingsService(Application app) {
.create(SettingsService.class);
}

@AppScope
@Singleton
@NonNull
@Provides
public HttpClient provideHttpClient(Application app) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tom.meeter.context.event;
package com.tom.meeter;

import static com.tom.meeter.infrastructure.common.Globals.getServerPath;
import static com.tom.meeter.infrastructure.common.InfrastructureHelper.logMethod;
Expand All @@ -16,6 +16,8 @@

import java.util.TimeZone;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;
Expand All @@ -30,7 +32,7 @@ public EventModule() {
logMethod(TAG, this);
}

@EventScope
@Singleton
@NonNull
@Provides
public EventService provideEventService(Application app) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tom.meeter.context.image;
package com.tom.meeter;

import static com.tom.meeter.infrastructure.common.Globals.getServerPath;
import static com.tom.meeter.infrastructure.common.InfrastructureHelper.logMethod;
Expand All @@ -7,6 +7,7 @@

import androidx.annotation.NonNull;

import com.tom.meeter.context.image.ImageDownloader;
import com.tom.meeter.context.image.service.ImageService;

import javax.inject.Singleton;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tom.meeter.context.token;
package com.tom.meeter;

import static com.tom.meeter.infrastructure.common.Globals.getServerPath;
import static com.tom.meeter.infrastructure.common.InfrastructureHelper.logMethod;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tom.meeter.context.user;
package com.tom.meeter;

import static com.tom.meeter.infrastructure.common.Globals.getServerPath;
import static com.tom.meeter.infrastructure.common.InfrastructureHelper.logMethod;
Expand All @@ -14,6 +14,8 @@

import java.util.TimeZone;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;
Expand All @@ -28,7 +30,7 @@ public UserModule() {
logMethod(TAG, this);
}

@UserScope
@Singleton
@NonNull
@Provides
public UserService provideUserService(Application app) {
Expand Down
Loading