|
|
@@ -3,21 +3,16 @@ package kr.co.zumo.app.lifeplus.view.screen.contents.series;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
-import android.support.v7.widget.LinearLayoutManager;
|
|
|
-import android.support.v7.widget.RecyclerView;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
-import android.widget.ImageView;
|
|
|
-import android.widget.TextView;
|
|
|
-
|
|
|
-import com.bumptech.glide.Glide;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.SeriesItemBean;
|
|
|
import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
|
|
|
+import kr.co.zumo.app.lifeplus.view.custom.contents.series.CustomContentsSeriesView;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
|
|
|
/**
|
|
|
@@ -32,26 +27,16 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
*/
|
|
|
public class ContentsSeriesFragment extends FragmentBase<ContentsSeriesPresenter> implements IContentsSeriesView {
|
|
|
|
|
|
- private RecyclerView recyclerViewCategoryMainSeries;
|
|
|
- private TextView textViewTitle;
|
|
|
- private TextView textViewSubTitle;
|
|
|
- private ContentsSeriesAdapter adapter;
|
|
|
- private ImageView imageBackground;
|
|
|
+ private CustomContentsSeriesView seriesView;
|
|
|
|
|
|
@Override
|
|
|
protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
- return inflater.inflate(R.layout.fragment_category_main_series, container, false);
|
|
|
+ return inflater.inflate(R.layout.fragment_contents_series, container, false);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void onAfterActivityCreated(Bundle savedInstanceState) {
|
|
|
-
|
|
|
- textViewSubTitle = findViewById(R.id.text_view_sub_title);
|
|
|
- textViewTitle = findViewById(R.id.text_view_title);
|
|
|
- imageBackground = findViewById(R.id.image_view_series);
|
|
|
-
|
|
|
- recyclerViewCategoryMainSeries = findViewById(R.id.recycler_view_series);
|
|
|
-
|
|
|
+ seriesView = findViewById(R.id.contents_series);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -70,7 +55,6 @@ public class ContentsSeriesFragment extends FragmentBase<ContentsSeriesPresenter
|
|
|
|
|
|
@Override
|
|
|
protected void onAfterDestroyView() {
|
|
|
- Glide.with(imageBackground).clear(imageBackground);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -94,42 +78,38 @@ public class ContentsSeriesFragment extends FragmentBase<ContentsSeriesPresenter
|
|
|
|
|
|
@Override
|
|
|
public void setSeriesTitle(String title) {
|
|
|
- textViewTitle.setText(title);
|
|
|
+ seriesView.setSeriesTitle(title);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void setSeriesSubTitle(String subTitle) {
|
|
|
- textViewSubTitle.setText(subTitle);
|
|
|
+ seriesView.setSeriesSubTitle(subTitle);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void setSeriesBackgroundUrl(String url) {
|
|
|
- Glide.with(imageBackground).load(url).into(imageBackground);
|
|
|
+ seriesView.setSeriesBackgroundUrl(url);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void draw(List<SeriesItemBean> list) {
|
|
|
-
|
|
|
- adapter = new ContentsSeriesAdapter(getActivity(), list, event -> {
|
|
|
+ seriesView.draw(list, event -> {
|
|
|
presenter.onEvent(event);
|
|
|
});
|
|
|
-
|
|
|
- recyclerViewCategoryMainSeries.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
- recyclerViewCategoryMainSeries.setAdapter(adapter);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void setLiked(boolean isChecked) {
|
|
|
- adapter.notifyDataSetChanged();
|
|
|
+ seriesView.setLiked(isChecked);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void setBookmarked(boolean isChecked) {
|
|
|
- adapter.notifyDataSetChanged();
|
|
|
+ seriesView.setBookmarked(isChecked);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void updateContents() {
|
|
|
- adapter.notifyDataSetChanged();
|
|
|
+ seriesView.updateContents();
|
|
|
}
|
|
|
}
|