|
|
@@ -6,6 +6,7 @@ import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.constraint.ConstraintLayout;
|
|
|
+import android.support.design.widget.AppBarLayout;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
import android.util.Log;
|
|
|
@@ -50,9 +51,11 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
|
|
|
private LinearLayout layoutTagContents;
|
|
|
private RecyclerView recyclerViewEventList;
|
|
|
private ConstraintLayout layoutNothing;
|
|
|
+ private ConstraintLayout layoutSelectBucket;
|
|
|
private LayoutInflater inflater;
|
|
|
private HorizontalScrollView scrollTag;
|
|
|
private EventRecommendTagAdapter adapter;
|
|
|
+ private AppBarLayout appBarLayout;
|
|
|
|
|
|
|
|
|
@Override
|
|
|
@@ -68,9 +71,11 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
|
|
|
textViewSelectTitle = findViewById(R.id.text_view_select_title);
|
|
|
layoutNothing = findViewById(R.id.layout_nothing);
|
|
|
layoutTagContents = findViewById(R.id.layout_contents);
|
|
|
+ layoutSelectBucket = findViewById(R.id.layout_select_bucket);
|
|
|
scrollTag = findViewById(R.id.scroll_tag);
|
|
|
recyclerViewEventList = findViewById(R.id.recycler_view_event_list_detail);
|
|
|
layoutNothing = findViewById(R.id.layout_nothing);
|
|
|
+ appBarLayout = findViewById(R.id.app_bar_layout);
|
|
|
inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
|
|
|
|
recyclerViewEventList.addItemDecoration(new RecyclerView.ItemDecoration() {
|
|
|
@@ -81,7 +86,7 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
|
|
|
}
|
|
|
});
|
|
|
recyclerViewEventList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
-
|
|
|
+ layoutSelectBucket.setPadding(0, ResourceUtil.getStatusBarHeightManual(), 0, 0);
|
|
|
OverScrollDecoratorHelper.setUpOverScroll(recyclerViewEventList, OverScrollDecoratorHelper.ORIENTATION_VERTICAL);
|
|
|
}
|
|
|
|
|
|
@@ -124,6 +129,7 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
|
|
|
|
|
|
textViewEventTitle.setText(title);
|
|
|
textViewSelectTitle.setText(subTitle);
|
|
|
+ addAppbarLayoutScrollChange();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -134,15 +140,17 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
|
|
|
else {
|
|
|
int len = beans.size();
|
|
|
EventTagBean bean;
|
|
|
+ StringBuffer stringBuffer = new StringBuffer();
|
|
|
View view;
|
|
|
+ String tag = "";
|
|
|
LayoutInflater inflater = LayoutInflater.from(getContext());
|
|
|
for (int i = 0; i < len; ++i) {
|
|
|
bean = beans.get(i);
|
|
|
view = inflater.inflate(R.layout.tag, layoutTagContents, false);
|
|
|
CheckBox checkBox = view.findViewById(R.id.check_box);
|
|
|
checkBox.setText(String.format("#%s", bean.getTagName()));
|
|
|
-
|
|
|
final int index = i;
|
|
|
+
|
|
|
// 추천 컨텐츠가 아닌 경우에만 이벤트 등록
|
|
|
if (bean.isRecommed()) {
|
|
|
checkBox.setChecked(true);
|
|
|
@@ -154,11 +162,12 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
|
|
|
presenter.onEvent(new Event.Builder(Event.TAG).index(index).bool(checkBox.isChecked()).build());
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
layoutTagContents.addView(view);
|
|
|
+ stringBuffer.append(String.format("#%s", bean.getTagName()) + " ");
|
|
|
}
|
|
|
|
|
|
+ Log.e("APP# EventRecommendTagFragment | drawTag", "| tag" + stringBuffer.toString());
|
|
|
+ textViewSelectTitle.setText(stringBuffer.toString());
|
|
|
// OverScrollDecoratorHelper.setUpStaticOverScroll(scrollTag, OverScrollDecoratorHelper.ORIENTATION_HORIZONTAL);
|
|
|
}
|
|
|
}
|
|
|
@@ -198,4 +207,25 @@ public class EventRecommendTagFragment extends FragmentBase<EventRecommendPresen
|
|
|
Log.e("APP# EventRecommendTagFragment | setCheckedTag", "|" + "Tag 가 모자랍니다.");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void addAppbarLayoutScrollChange() {
|
|
|
+ appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
|
|
|
+ @Override
|
|
|
+ public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
|
|
|
+ if (Math.abs(verticalOffset) > (appBarLayout.getTotalScrollRange() >> 1)) {
|
|
|
+ // 줄어든 상태
|
|
|
+ textViewEventTitle.setVisibility(View.GONE);
|
|
|
+ textViewSelectTitle.setTextColor(getResources().getColor(R.color.CFFFFFF));
|
|
|
+ textViewSelectTitle.setTextSize(15);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // 커진 상태
|
|
|
+ textViewEventTitle.setVisibility(View.VISIBLE);
|
|
|
+ textViewSelectTitle.setVisibility(View.VISIBLE);
|
|
|
+ textViewSelectTitle.setTextColor(getResources().getColor(R.color.CC3C3C3));
|
|
|
+ textViewSelectTitle.setTextSize(14);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|