Skip to content

Commit ffffeee

Browse files
refactor: Package by feature (fossasia#2275)
1 parent 0468cdd commit ffffeee

File tree

207 files changed

+1027
-1522
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+1027
-1522
lines changed

android/app/src/androidTest/java/org/fossasia/openevent/APITest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import android.test.AndroidTestCase;
44

5-
import org.fossasia.openevent.api.APIClient;
5+
import org.fossasia.openevent.common.api.APIClient;
66
import org.fossasia.openevent.data.Event;
77
import org.fossasia.openevent.data.Microlocation;
88
import org.fossasia.openevent.data.Session;
@@ -17,10 +17,6 @@
1717
import retrofit2.Callback;
1818
import retrofit2.Response;
1919

20-
/**
21-
* User: mohit
22-
* Date: 25/5/15
23-
*/
2420
public class APITest extends AndroidTestCase {
2521
public void testSpeakerAPIResponse() throws Exception {
2622
final CountDownLatch latch = new CountDownLatch(1);

android/app/src/androidTest/java/org/fossasia/openevent/helper/IOUtils.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
import timber.log.Timber;
1212

13-
/**
14-
* User: mohit
15-
* Date: 25/1/16
16-
*/
1713
public final class IOUtils {
1814
private IOUtils() {
1915
}

android/app/src/fdroid/java/org/fossasia/openevent/fragments/OSMapFragment.java renamed to android/app/src/fdroid/java/org/fossasia/openevent/core/location/OSMapFragment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
import org.fossasia.openevent.BuildConfig;
2020
import org.fossasia.openevent.R;
21+
import org.fossasia.openevent.common.ConstantStrings;
22+
import org.fossasia.openevent.common.utils.SharedPreferencesUtil;
2123
import org.fossasia.openevent.data.Event;
2224
import org.fossasia.openevent.data.Microlocation;
2325
import org.fossasia.openevent.data.Session;
24-
import org.fossasia.openevent.dbutils.RealmDataRepository;
25-
import org.fossasia.openevent.utils.ConstantStrings;
26-
import org.fossasia.openevent.utils.SharedPreferencesUtil;
26+
import org.fossasia.openevent.data.repository.RealmDataRepository;
2727
import org.osmdroid.DefaultResourceProxyImpl;
2828
import org.osmdroid.tileprovider.constants.OpenStreetMapTileProviderConstants;
2929
import org.osmdroid.util.GeoPoint;

android/app/src/fdroid/java/org/fossasia/openevent/modules/MapModuleFactory.java renamed to android/app/src/fdroid/java/org/fossasia/openevent/core/location/modules/MapModuleFactory.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
package org.fossasia.openevent.modules;
1+
package org.fossasia.openevent.core.location.modules;
22

3-
/**
4-
* User: mohit
5-
* Date: 13/6/15
6-
*/
73
public class MapModuleFactory implements MapModuleProvider {
84

95
/**

android/app/src/fdroid/java/org/fossasia/openevent/modules/OSMapModule.java renamed to android/app/src/fdroid/java/org/fossasia/openevent/core/location/modules/OSMapModule.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
package org.fossasia.openevent.modules;
1+
package org.fossasia.openevent.core.location.modules;
22

33
import android.support.v4.app.Fragment;
44

55
import org.fossasia.openevent.fragments.OSMapFragment;
66

7-
8-
/**
9-
* User: mohit
10-
* Date: 13/6/15
11-
*/
127
public class OSMapModule implements MapModule {
138
@Override
149
public Fragment provideMapFragment() {

android/app/src/googleplay/java/org/fossasia/openevent/utils/map/ClusterRenderer.java renamed to android/app/src/googleplay/java/org/fossasia/openevent/core/location/ClusterRenderer.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.fossasia.openevent.utils.map;
1+
package org.fossasia.openevent.core.location;
22

33
import android.content.Context;
44
import android.os.Handler;
@@ -13,9 +13,6 @@
1313

1414
import org.fossasia.openevent.R;
1515

16-
/**
17-
* Created by rohanagarwal94 on 4/7/17.
18-
*/
1916
public class ClusterRenderer extends DefaultClusterRenderer<MicrolocationClusterWrapper> implements ClusterManager.OnClusterItemClickListener<MicrolocationClusterWrapper>, GoogleMap.OnMapClickListener {
2017

2118
private Context context;

android/app/src/googleplay/java/org/fossasia/openevent/utils/map/ImageUtils.java renamed to android/app/src/googleplay/java/org/fossasia/openevent/core/location/ImageUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.fossasia.openevent.utils.map;
1+
package org.fossasia.openevent.core.location;
22

33
import android.content.Context;
44
import android.graphics.Bitmap;
@@ -12,9 +12,6 @@
1212
import com.google.android.gms.maps.model.BitmapDescriptor;
1313
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
1414

15-
/**
16-
* Created by rohanagarwal94 on 6/7/17.
17-
*/
1815
public class ImageUtils {
1916

2017
public static BitmapDescriptor vectorToBitmap(Context context, @DrawableRes int id, int color) {
@@ -27,4 +24,5 @@ public static BitmapDescriptor vectorToBitmap(Context context, @DrawableRes int
2724
vectorDrawable.draw(canvas);
2825
return BitmapDescriptorFactory.fromBitmap(bitmap);
2926
}
27+
3028
}

android/app/src/googleplay/java/org/fossasia/openevent/fragments/MapsFragment.java renamed to android/app/src/googleplay/java/org/fossasia/openevent/core/location/MapsFragment.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package org.fossasia.openevent.fragments;
1+
package org.fossasia.openevent.core.location;
22

33
import android.content.Context;
44
import android.location.Location;
55
import android.location.LocationListener;
66
import android.os.Bundle;
7+
import android.support.annotation.NonNull;
78
import android.support.v4.app.Fragment;
8-
import android.support.v4.view.MenuItemCompat;
99
import android.support.v7.widget.SearchView;
1010
import android.view.LayoutInflater;
1111
import android.view.Menu;
@@ -27,14 +27,11 @@
2727
import com.google.maps.android.clustering.ClusterManager;
2828

2929
import org.fossasia.openevent.R;
30+
import org.fossasia.openevent.common.ConstantStrings;
31+
import org.fossasia.openevent.common.utils.Utils;
3032
import org.fossasia.openevent.data.Event;
3133
import org.fossasia.openevent.data.Microlocation;
32-
import org.fossasia.openevent.dbutils.RealmDataRepository;
33-
import org.fossasia.openevent.utils.ConstantStrings;
34-
import org.fossasia.openevent.utils.Utils;
35-
import org.fossasia.openevent.utils.map.ClusterRenderer;
36-
import org.fossasia.openevent.utils.map.ImageUtils;
37-
import org.fossasia.openevent.utils.map.MicrolocationClusterWrapper;
34+
import org.fossasia.openevent.data.repository.RealmDataRepository;
3835

3936
import java.util.ArrayList;
4037
import java.util.HashMap;
@@ -62,7 +59,7 @@ public class MapsFragment extends Fragment implements LocationListener, OnMapRea
6259
private SearchView.SearchAutoComplete mSearchAutoComplete;
6360

6461
@Override
65-
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
62+
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
6663

6764
if (getArguments() != null) {
6865
isFragmentFromMainActivity = getArguments().getBoolean(ConstantStrings.IS_MAP_FRAGMENT_FROM_MAIN_ACTIVITY);
@@ -191,7 +188,7 @@ private void handleClusterEvents() {
191188
}
192189

193190
@Override
194-
public void onSaveInstanceState(Bundle bundle) {
191+
public void onSaveInstanceState(@NonNull Bundle bundle) {
195192
if (isAdded() && searchView != null) {
196193
bundle.putString(SEARCH, searchText);
197194
}
@@ -225,11 +222,11 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
225222

226223
inflater.inflate(R.menu.menu_map, menu);
227224
MenuItem item = menu.findItem(R.id.action_search_map);
228-
searchView = (SearchView) MenuItemCompat.getActionView(item);
229-
mSearchAutoComplete = (SearchView.SearchAutoComplete) searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
225+
searchView = (SearchView) item.getActionView();
226+
mSearchAutoComplete = searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
230227
mSearchAutoComplete.setDropDownBackgroundResource(R.drawable.background_white);
231228
mSearchAutoComplete.setDropDownAnchor(R.id.action_search_map);
232-
mSearchAutoComplete.setThreshold(0);
229+
// mSearchAutoComplete.setThreshold(0); TODO: Access is private: Inspect
233230
}
234231

235232
@Override

android/app/src/googleplay/java/org/fossasia/openevent/utils/map/MicrolocationClusterWrapper.java renamed to android/app/src/googleplay/java/org/fossasia/openevent/core/location/MicrolocationClusterWrapper.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
package org.fossasia.openevent.utils.map;
1+
package org.fossasia.openevent.core.location;
22

33
import com.google.android.gms.maps.model.LatLng;
44
import com.google.android.gms.maps.model.Marker;
55
import com.google.maps.android.clustering.ClusterItem;
66

77
import org.fossasia.openevent.data.Microlocation;
88

9-
/**
10-
* Created by rohanagarwal94 on 6/7/17.
11-
*/
129
public class MicrolocationClusterWrapper implements ClusterItem {
1310

1411
private LatLng latLng;

android/app/src/googleplay/java/org/fossasia/openevent/modules/GoogleMapModule.java renamed to android/app/src/googleplay/java/org/fossasia/openevent/core/location/modules/GoogleMapModule.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
package org.fossasia.openevent.modules;
1+
package org.fossasia.openevent.core.location.modules;
22

33
import android.support.v4.app.Fragment;
44

5-
import org.fossasia.openevent.fragments.MapsFragment;
5+
import org.fossasia.openevent.core.location.MapsFragment;
66

7-
/**
8-
* User: mohit
9-
* Date: 13/6/15
10-
*/
117
public class GoogleMapModule implements MapModule {
128
/**
139
* This guy should not really cache anything

android/app/src/googleplay/java/org/fossasia/openevent/modules/MapModuleFactory.java renamed to android/app/src/googleplay/java/org/fossasia/openevent/core/location/modules/MapModuleFactory.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
package org.fossasia.openevent.modules;
1+
package org.fossasia.openevent.core.location.modules;
22

3-
/**
4-
* User: mohit
5-
* Date: 13/6/15
6-
*/
73
public class MapModuleFactory implements MapModuleProvider {
84

95
/**

android/app/src/main/AndroidManifest.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<meta-data android:name="io.branch.sdk.BranchKey" android:value="@string/branch_key_live" />
2323

2424
<activity
25-
android:name=".activities.MainActivity"
25+
android:name=".core.main.MainActivity"
2626
android:label="@string/app_name"
2727
android:theme="@style/SplashTheme"
2828
android:configChanges="orientation|screenSize|keyboardHidden">
@@ -42,33 +42,33 @@
4242
android:value=".activities.SearchActivity" />
4343
</activity>
4444
<activity
45-
android:name=".activities.auth.UserProfileActivity"
45+
android:name=".core.auth.profile.UserProfileActivity"
4646
android:label="@string/title_activity_user_profile"
4747
android:configChanges="orientation|screenSize|keyboardHidden"/>
4848
<activity
49-
android:name=".activities.auth.EditProfileActivity"
49+
android:name=".core.auth.profile.EditProfileActivity"
5050
android:label="@string/title_activity_edit_profile"
5151
android:configChanges="orientation|screenSize|keyboardHidden"/>
5252
<activity
5353
android:name="com.yalantis.ucrop.UCropActivity"
5454
android:screenOrientation="portrait"
5555
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
5656
<activity
57-
android:name=".activities.auth.ChangePasswordActivity"
57+
android:name=".core.auth.ChangePasswordActivity"
5858
android:configChanges="orientation|screenSize|keyboardHidden"
5959
android:label="@string/title_activity_change_password" />
6060
<activity
61-
android:name=".activities.auth.SignUpActivity"
61+
android:name=".core.auth.SignUpActivity"
6262
android:label="@string/title_activity_sign_up"
6363
android:theme="@style/AppTheme.NoActionBar.Alternate"
6464
android:configChanges="orientation|screenSize|keyboardHidden"/>
6565
<activity
66-
android:name=".activities.auth.LoginActivity"
66+
android:name=".core.auth.LoginActivity"
6767
android:label="@string/title_activity_login"
6868
android:theme="@style/AppTheme.NoActionBar.Alternate"
6969
android:configChanges="orientation|screenSize|keyboardHidden"/>
7070
<activity
71-
android:name=".activities.SettingsActivity"
71+
android:name=".core.settings.SettingsActivity"
7272
android:label="@string/action_settings"
7373
android:exported="false"
7474
android:theme="@style/AppTheme.NoActionBar.Alternate"
@@ -79,23 +79,23 @@
7979
</intent-filter>
8080
</activity>
8181
<activity
82-
android:name=".activities.TrackSessionsActivity"
82+
android:name=".core.track.session.TrackSessionsActivity"
8383
android:label="@string/title_section_tracks"
8484
android:theme="@style/AppTheme.NoActionBar.Alternate"
8585
android:configChanges="orientation|screenSize|keyboardHidden"/>
8686
<activity
87-
android:name=".activities.LocationActivity"
87+
android:name=".core.location.LocationActivity"
8888
android:label="@string/title_section_location"
8989
android:theme="@style/AppTheme.NoActionBar.Alternate"
9090
android:configChanges="orientation|screenSize|keyboardHidden"/>
9191
<activity
92-
android:name=".activities.SpeakerDetailsActivity"
92+
android:name=".core.speaker.SpeakerDetailsActivity"
9393
android:label="@string/title_section_speakerlist"
9494
android:theme="@style/AppTheme.NoActionBar"
9595
android:configChanges="orientation|screenSize|keyboardHidden"/>
9696

9797
<activity
98-
android:name=".activities.SessionDetailActivity"
98+
android:name=".core.track.session.SessionDetailActivity"
9999
android:label="@string/session"
100100
android:theme="@style/AppTheme.NoActionBar"
101101
android:configChanges="orientation|screenSize|keyboardHidden">
@@ -104,7 +104,7 @@
104104
android:resource="@xml/searchable" />
105105
</activity>
106106
<activity
107-
android:name=".activities.SearchActivity"
107+
android:name=".core.search.SearchActivity"
108108
android:launchMode="singleTop"
109109
android:label="Search App">
110110
<intent-filter>
@@ -116,13 +116,13 @@
116116
</activity>
117117

118118
<service
119-
android:name=".services.BookmarkAlarmService"
119+
android:name=".core.bookmark.BookmarkAlarmService"
120120
android:enabled="true" />
121121

122-
<receiver android:name=".receivers.NotificationAlarmReceiver" />
122+
<receiver android:name=".common.notification.NotificationAlarmReceiver" />
123123

124124
<receiver
125-
android:name=".widget.BookmarkWidgetProvider"
125+
android:name=".core.bookmark.BookmarkWidgetProvider"
126126
android:enabled="true"
127127
android:label="Bookmarks">
128128
<intent-filter>
@@ -136,7 +136,7 @@
136136
</receiver>
137137

138138
<service
139-
android:name=".widget.BookmarkWidgetRemoteViewsService"
139+
android:name=".core.bookmark.BookmarkWidgetRemoteViewsService"
140140
android:enabled="true"
141141
android:exported="false"
142142
android:permission="android.permission.BIND_REMOTEVIEWS" />

android/app/src/main/java/org/fossasia/openevent/FakeCrashLibrary.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package org.fossasia.openevent;
22

3-
/**
4-
* User: mohit
5-
* Date: 31/1/16
6-
*/
73
public final class FakeCrashLibrary {
84

95
/**

android/app/src/main/java/org/fossasia/openevent/OpenEventApp.java

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
import com.squareup.picasso.Picasso;
2424
import com.uphyca.stetho_realm.RealmInspectorModulesProvider;
2525

26-
import org.fossasia.openevent.activities.MainActivity;
27-
import org.fossasia.openevent.api.Urls;
28-
import org.fossasia.openevent.dbutils.RealmDatabaseMigration;
29-
import org.fossasia.openevent.events.ConnectionCheckEvent;
30-
import org.fossasia.openevent.events.ShowNetworkDialogEvent;
31-
import org.fossasia.openevent.modules.MapModuleFactory;
32-
import org.fossasia.openevent.receivers.NetworkConnectivityChangeReceiver;
33-
import org.fossasia.openevent.utils.ConstantStrings;
34-
import org.fossasia.openevent.utils.DateConverter;
35-
import org.fossasia.openevent.utils.SharedPreferencesUtil;
36-
import org.fossasia.openevent.utils.Utils;
26+
import org.fossasia.openevent.core.main.MainActivity;
27+
import org.fossasia.openevent.common.api.Urls;
28+
import org.fossasia.openevent.data.repository.RealmDatabaseMigration;
29+
import org.fossasia.openevent.common.events.ConnectionCheckEvent;
30+
import org.fossasia.openevent.common.events.ShowNetworkDialogEvent;
31+
import org.fossasia.openevent.core.location.modules.MapModuleFactory;
32+
import org.fossasia.openevent.common.network.NetworkConnectivityChangeReceiver;
33+
import org.fossasia.openevent.common.ConstantStrings;
34+
import org.fossasia.openevent.common.date.DateConverter;
35+
import org.fossasia.openevent.common.utils.SharedPreferencesUtil;
36+
import org.fossasia.openevent.common.utils.Utils;
3737
import org.json.JSONException;
3838
import org.json.JSONObject;
3939

@@ -50,10 +50,6 @@
5050
import okhttp3.OkHttpClient;
5151
import timber.log.Timber;
5252

53-
/**
54-
* User: MananWason
55-
* Date: 02-06-2015
56-
*/
5753
public class OpenEventApp extends MultiDexApplication {
5854

5955
public static final String API_LINK = "api-link";
@@ -126,7 +122,7 @@ public void onCreate() {
126122
Realm.init(this);
127123
RealmConfiguration config = new RealmConfiguration.Builder()
128124
.schemaVersion(RealmDatabaseMigration.DB_VERSION) // Must be bumped when the schema changes
129-
//TODO: Re-add migration once DB is locked/finilized
125+
//TODO: Re-add migration once DB is locked/finalized
130126
.deleteRealmIfMigrationNeeded()
131127
.build();
132128

android/app/src/main/java/org/fossasia/openevent/utils/ConstantStrings.java renamed to android/app/src/main/java/org/fossasia/openevent/common/ConstantStrings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.fossasia.openevent.utils;
1+
package org.fossasia.openevent.common;
22

33
public class ConstantStrings {
44

0 commit comments

Comments
 (0)