Quellcode durchsuchen

[검색][New] API 적용 중

hyodong.min vor 7 Jahren
Ursprung
Commit
7ebe93a72b

+ 7 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/search/ISearchView.java

@@ -21,5 +21,12 @@ import kr.co.zumo.app.lifeplus.view.IView;
 public interface ISearchView extends IView {
 
   void render(List<TagBean> tagBeans);
+
   void setBoldGuideHash(boolean isBold);
+
+  void setLatestTag(List<TagBean> tagBeans);
+
+  void setPopularTag(List<TagBean> tagBeans);
+
+  void setResultTag(List<TagBean> tagBeans);
 }

+ 16 - 3
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/search/SearchFragment.java

@@ -7,6 +7,7 @@ import android.graphics.Typeface;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
+import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
 import android.text.TextWatcher;
 import android.view.LayoutInflater;
@@ -39,6 +40,13 @@ public class SearchFragment extends FragmentBase<SearchPresenter> implements ISe
   private ClearEditText editSearch;
   private TextView textHash;
 
+  private View containerLatestTag;
+  private View containerPopularTag;
+  private View containerResult;
+  private RecyclerView recyclerViewLatestTag;
+  private RecyclerView recyclerViewPopularTag;
+  private RecyclerView recyclerViewResult;
+
   @Override
   protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
     return inflater.inflate(R.layout.fragment_search, container, false);
@@ -49,6 +57,7 @@ public class SearchFragment extends FragmentBase<SearchPresenter> implements ISe
 
     getView().setPadding(0, ResourceUtil.getStatusBarHeightManual(), 0, 0);
 
+    // navigation var setting
     ((ViewGroup) findViewById(R.id.container_navigation_bar))
       .addView(
         new NavigationBar.Builder(getContext())
@@ -60,12 +69,16 @@ public class SearchFragment extends FragmentBase<SearchPresenter> implements ISe
 
     editSearch = findViewById(R.id.edit_search);
     textHash = findViewById(R.id.text_hash);
+    containerLatestTag = findViewById(R.id.container_latest_search_tag);
+    containerPopularTag = findViewById(R.id.container_papular_tag);
+    containerResult = findViewById(R.id.container_result);
+    recyclerViewLatestTag = findViewById(R.id.recycler_view_latest_tage);
+    recyclerViewPopularTag = findViewById(R.id.recycler_view_popular_tag);
+    recyclerViewResult = findViewById(R.id.recycler_view_result);
 
     editSearch.addTextChangedListener(new TextWatcher() {
       @Override
-      public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-
-      }
+      public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
 
       @Override
       public void onTextChanged(CharSequence s, int start, int before, int count) {

+ 73 - 1
app/src/main/res/layout/fragment_search.xml

@@ -9,7 +9,9 @@
   <android.support.constraint.ConstraintLayout
     android:id="@+id/container_top"
     android:layout_width="match_parent"
-    android:layout_height="52dp">
+    android:layout_height="52dp"
+    app:layout_constraintTop_toTopOf="parent"
+    >
 
     <android.support.constraint.ConstraintLayout
       android:id="@+id/container_navigation_bar"
@@ -58,5 +60,75 @@
 
   </android.support.constraint.ConstraintLayout>
 
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/container_latest_search_tag"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    app:layout_constraintBottom_toTopOf="@id/container_papular_tag"
+    app:layout_constraintTop_toBottomOf="@+id/container_top"
+    >
+
+    <TextView
+      android:id="@+id/text_latest_tag"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginStart="25dp"
+      android:layout_marginTop="30dp"
+      android:text="@string/search_latest_search_tag"
+      android:textColor="@color/C000000"
+      android:textSize="15sp"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+    <android.support.v7.widget.RecyclerView
+      android:id="@+id/recycler_view_latest_tage"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:paddingTop="4dp"
+      app:layout_constraintTop_toBottomOf="@+id/text_latest_tag"/>
+
+  </android.support.constraint.ConstraintLayout>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/container_papular_tag"
+    android:layout_width="match_parent"
+    android:layout_height="0dp"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintTop_toBottomOf="@id/container_latest_search_tag"
+    >
 
+    <TextView
+      android:id="@+id/text_popular_tag"
+      android:layout_width="wrap_content"
+      android:layout_height="wrap_content"
+      android:layout_marginStart="25dp"
+      android:layout_marginTop="30dp"
+      android:text="@string/search_popular_tag"
+      android:textColor="@color/C000000"
+      android:textSize="15sp"
+      app:layout_constraintStart_toStartOf="parent"
+      app:layout_constraintTop_toTopOf="parent"/>
+
+    <android.support.v7.widget.RecyclerView
+      android:id="@+id/recycler_view_popular_tag"
+      android:layout_width="match_parent"
+      android:layout_height="0dp"
+      android:paddingTop="4dp"
+      app:layout_constraintBottom_toBottomOf="parent"
+      app:layout_constraintTop_toBottomOf="@+id/text_popular_tag"/>
+  </android.support.constraint.ConstraintLayout>
+
+  <android.support.constraint.ConstraintLayout
+    android:id="@+id/container_result"
+    android:layout_width="match_parent"
+    android:layout_height="0dp"
+    app:layout_constraintBottom_toBottomOf="parent"
+    app:layout_constraintTop_toBottomOf="@id/container_top"
+    tools:visibility="gone">
+
+    <android.support.v7.widget.RecyclerView
+      android:id="@+id/recycler_view_result"
+      android:layout_width="match_parent"
+      android:layout_height="match_parent"/>
+  </android.support.constraint.ConstraintLayout>
 </android.support.constraint.ConstraintLayout>

+ 5 - 3
app/src/main/res/values/strings.xml

@@ -753,9 +753,6 @@
 
   <string name="order_info_update"><u>주분정보수정</u></string>
 
-  <string name="search_hint">" 키워드를 입력해 주세요"</string>
-  <string name="search_hint_hash">#</string>
-
   <string name="event_pop_up_title">꼭 확인하세요!</string>
 
   <!--이벤트 참여-->
@@ -787,6 +784,11 @@
   <string name="agree_all">전체동의</string>
 
 
+  <!--검색 -->
+  <string name="search_hint">" 키워드를 입력해 주세요"</string>
+  <string name="search_hint_hash">#</string>
+  <string name="search_latest_search_tag">최근 검색 태그</string>
+  <string name="search_popular_tag">인기 태그</string>
 
 
   <!-- 임의 추가 문자열 : 시작 -->