From 88a9da5f47f44a092856728bba98f306e0c01671 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Wed, 20 Feb 2019 20:31:56 +0400 Subject: [PATCH] Small refactoring. (New package "adapters" and small changes (edit comments)) --- .../{ => adapters}/FullscreenImagePagerAdapter.java | 7 +++++-- .../additional/{ => adapters}/ImagePagerAdapter.java | 2 +- .../additional/{ => adapters}/PropertiesListAdapter.java | 2 +- .../ru/volgorobot/vrcatalog/presenters/ItemPresenter.java | 3 --- .../java/ru/volgorobot/vrcatalog/view/DetailActivity.java | 7 ++----- .../volgorobot/vrcatalog/view/FullScreenImageActivity.java | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) rename app/src/main/java/ru/volgorobot/vrcatalog/additional/{ => adapters}/FullscreenImagePagerAdapter.java (94%) rename app/src/main/java/ru/volgorobot/vrcatalog/additional/{ => adapters}/ImagePagerAdapter.java (98%) rename app/src/main/java/ru/volgorobot/vrcatalog/additional/{ => adapters}/PropertiesListAdapter.java (96%) diff --git a/app/src/main/java/ru/volgorobot/vrcatalog/additional/FullscreenImagePagerAdapter.java b/app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/FullscreenImagePagerAdapter.java similarity index 94% rename from app/src/main/java/ru/volgorobot/vrcatalog/additional/FullscreenImagePagerAdapter.java rename to app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/FullscreenImagePagerAdapter.java index b237edf..49e5aac 100644 --- a/app/src/main/java/ru/volgorobot/vrcatalog/additional/FullscreenImagePagerAdapter.java +++ b/app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/FullscreenImagePagerAdapter.java @@ -1,4 +1,4 @@ -package ru.volgorobot.vrcatalog.additional; +package ru.volgorobot.vrcatalog.additional.adapters; import android.content.Context; import android.support.annotation.NonNull; @@ -16,7 +16,7 @@ import com.squareup.picasso.Picasso; public class FullscreenImagePagerAdapter extends PagerAdapter { /** - * This class is designed to control the ViewPager (images of item) in the activity of viewing details of items (DetailActivity). + * This class is designed to control the ViewPager (images of item) in FullscreenImageActivity. */ private Context context; @@ -64,6 +64,9 @@ public class FullscreenImagePagerAdapter extends PagerAdapter { container.removeView((View) object); } + /** + * Listener for hiding the actionbar when you click on the picture + */ private class PhotoTapListener implements OnPhotoTapListener, View.OnSystemUiVisibilityChangeListener { @Override public void onPhotoTap(ImageView view, float x, float y) { diff --git a/app/src/main/java/ru/volgorobot/vrcatalog/additional/ImagePagerAdapter.java b/app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/ImagePagerAdapter.java similarity index 98% rename from app/src/main/java/ru/volgorobot/vrcatalog/additional/ImagePagerAdapter.java rename to app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/ImagePagerAdapter.java index befb9fb..506f8eb 100644 --- a/app/src/main/java/ru/volgorobot/vrcatalog/additional/ImagePagerAdapter.java +++ b/app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/ImagePagerAdapter.java @@ -1,4 +1,4 @@ -package ru.volgorobot.vrcatalog.additional; +package ru.volgorobot.vrcatalog.additional.adapters; import android.content.Context; import android.content.Intent; diff --git a/app/src/main/java/ru/volgorobot/vrcatalog/additional/PropertiesListAdapter.java b/app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/PropertiesListAdapter.java similarity index 96% rename from app/src/main/java/ru/volgorobot/vrcatalog/additional/PropertiesListAdapter.java rename to app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/PropertiesListAdapter.java index 15941d7..d4dcb8e 100644 --- a/app/src/main/java/ru/volgorobot/vrcatalog/additional/PropertiesListAdapter.java +++ b/app/src/main/java/ru/volgorobot/vrcatalog/additional/adapters/PropertiesListAdapter.java @@ -1,4 +1,4 @@ -package ru.volgorobot.vrcatalog.additional; +package ru.volgorobot.vrcatalog.additional.adapters; import android.view.LayoutInflater; import android.view.View; diff --git a/app/src/main/java/ru/volgorobot/vrcatalog/presenters/ItemPresenter.java b/app/src/main/java/ru/volgorobot/vrcatalog/presenters/ItemPresenter.java index 0c898b6..8bcdb04 100644 --- a/app/src/main/java/ru/volgorobot/vrcatalog/presenters/ItemPresenter.java +++ b/app/src/main/java/ru/volgorobot/vrcatalog/presenters/ItemPresenter.java @@ -22,9 +22,6 @@ import ru.volgorobot.vrcatalog.model.CoreModel; import ru.volgorobot.vrcatalog.model.ImageItemModel; public class ItemPresenter implements MainContract.ItemPresenter { - - // TODO - private MainContract.ItemView mView; private Context context; private MainContract.MainModel coreModel; diff --git a/app/src/main/java/ru/volgorobot/vrcatalog/view/DetailActivity.java b/app/src/main/java/ru/volgorobot/vrcatalog/view/DetailActivity.java index 8a007d0..98b3870 100644 --- a/app/src/main/java/ru/volgorobot/vrcatalog/view/DetailActivity.java +++ b/app/src/main/java/ru/volgorobot/vrcatalog/view/DetailActivity.java @@ -10,9 +10,6 @@ import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ListAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; @@ -22,8 +19,8 @@ import java.util.LinkedHashMap; import ru.volgorobot.vrcatalog.presenters.ItemPresenter; import ru.volgorobot.vrcatalog.MainContract; import ru.volgorobot.vrcatalog.R; -import ru.volgorobot.vrcatalog.additional.ImagePagerAdapter; -import ru.volgorobot.vrcatalog.additional.PropertiesListAdapter; +import ru.volgorobot.vrcatalog.additional.adapters.ImagePagerAdapter; +import ru.volgorobot.vrcatalog.additional.adapters.PropertiesListAdapter; public class DetailActivity extends AppCompatActivity implements MainContract.ItemView { private MainContract.ItemPresenter mPresenter; diff --git a/app/src/main/java/ru/volgorobot/vrcatalog/view/FullScreenImageActivity.java b/app/src/main/java/ru/volgorobot/vrcatalog/view/FullScreenImageActivity.java index ff9cacd..a897e65 100644 --- a/app/src/main/java/ru/volgorobot/vrcatalog/view/FullScreenImageActivity.java +++ b/app/src/main/java/ru/volgorobot/vrcatalog/view/FullScreenImageActivity.java @@ -15,7 +15,7 @@ import android.view.Window; import android.view.WindowManager; import ru.volgorobot.vrcatalog.R; -import ru.volgorobot.vrcatalog.additional.FullscreenImagePagerAdapter; +import ru.volgorobot.vrcatalog.additional.adapters.FullscreenImagePagerAdapter; public class FullScreenImageActivity extends AppCompatActivity { private Toolbar mToolbar;