|
2 | 2 |
|
3 | 3 | import android.annotation.SuppressLint; |
4 | 4 | import android.content.Context; |
5 | | - |
6 | | -import java.lang.reflect.Proxy; |
7 | | -import java.util.ArrayList; |
8 | | -import java.util.List; |
9 | | - |
10 | | -import javax.inject.Inject; |
11 | | -import javax.inject.Named; |
12 | | -import javax.inject.Singleton; |
13 | | - |
14 | 5 | import fr.free.nrw.commons.R; |
15 | 6 | import fr.free.nrw.commons.category.CategoriesModel; |
16 | 7 | import fr.free.nrw.commons.contributions.Contribution; |
17 | 8 | import fr.free.nrw.commons.filepicker.UploadableFile; |
18 | 9 | import fr.free.nrw.commons.kvstore.JsonKvStore; |
19 | 10 | import fr.free.nrw.commons.nearby.Place; |
20 | 11 | import fr.free.nrw.commons.settings.Prefs; |
| 12 | +import fr.free.nrw.commons.utils.CustomProxy; |
21 | 13 | import fr.free.nrw.commons.utils.StringUtils; |
22 | 14 | import io.reactivex.Observable; |
23 | 15 | import io.reactivex.android.schedulers.AndroidSchedulers; |
24 | 16 | import io.reactivex.disposables.CompositeDisposable; |
25 | 17 | import io.reactivex.schedulers.Schedulers; |
| 18 | +import java.util.ArrayList; |
| 19 | +import java.util.List; |
| 20 | +import javax.inject.Inject; |
| 21 | +import javax.inject.Named; |
| 22 | +import javax.inject.Singleton; |
26 | 23 | import timber.log.Timber; |
27 | 24 |
|
28 | 25 | import static fr.free.nrw.commons.upload.UploadModel.UploadItem; |
|
38 | 35 | @Singleton |
39 | 36 | public class UploadPresenter { |
40 | 37 |
|
41 | | - private static final UploadView DUMMY = (UploadView) Proxy.newProxyInstance(UploadView.class.getClassLoader(), |
42 | | - new Class[]{UploadView.class}, (proxy, method, methodArgs) -> null); |
| 38 | + private static final UploadView DUMMY = |
| 39 | + (UploadView) CustomProxy.newInstance(UploadView.class.getClassLoader(), |
| 40 | + new Class[] { UploadView.class }); |
| 41 | + |
43 | 42 | private UploadView view = DUMMY; |
44 | 43 |
|
45 | | - private static final SimilarImageInterface SIMILAR_IMAGE = (SimilarImageInterface) Proxy.newProxyInstance(SimilarImageInterface.class.getClassLoader(), |
46 | | - new Class[]{SimilarImageInterface.class}, (proxy, method, methodArgs) -> null); |
| 44 | + private static final SimilarImageInterface SIMILAR_IMAGE = |
| 45 | + (SimilarImageInterface) CustomProxy.newInstance( |
| 46 | + SimilarImageInterface.class.getClassLoader(), |
| 47 | + new Class[] { SimilarImageInterface.class }); |
47 | 48 | private SimilarImageInterface similarImageInterface = SIMILAR_IMAGE; |
48 | 49 |
|
49 | 50 | @UploadView.UploadPage |
|
0 commit comments