瀏覽代碼

[메인][New] 터치 피드백 추가 - 날씨, 더보기 등

hyodong.min 6 年之前
父節點
當前提交
fe83394796

+ 12 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainContentsWeatherHolder.java

@@ -4,9 +4,11 @@
 package kr.co.zumo.app.lifeplus.view.screen.main;
 
 import android.animation.ObjectAnimator;
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.support.v7.widget.RecyclerView;
 import android.util.Log;
+import android.util.TypedValue;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
@@ -124,10 +126,12 @@ public class MainContentsWeatherHolder extends MainContentsHolder {
 
   private ImageView weatherIcon;
   private ViewGroup layoutWeatherBottom;
+  private ViewGroup layoutText;
 
   private boolean isImagePlaying = false;
   private int drawable;
 
+  @SuppressLint("NewApi")
   @Override
   public void init(int index, MainContentsBean bean, IEventListener listener) {
     weather = itemView.findViewById(R.id.layout_container_weather);
@@ -135,6 +139,7 @@ public class MainContentsWeatherHolder extends MainContentsHolder {
     textTopView = itemView.findViewById(R.id.text_weather_top);
     textBottomView = itemView.findViewById(R.id.text_weather_bottom);
     layoutWeatherBottom = itemView.findViewById(R.id.layout_weather_bottom);
+    layoutText = itemView.findViewById(R.id.layout_text);
 
     int statusBarHeight = ResourceUtil.getStatusBarHeightManual();
 
@@ -147,8 +152,13 @@ public class MainContentsWeatherHolder extends MainContentsHolder {
     itemView.setPadding(itemView.getPaddingLeft(), (int) initWeatherY, itemView.getPaddingRight(), itemView.getPaddingBottom());
     initY = 0; //itemView.getY(); //getScreenY(itemView);
     weatherIcon.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.CLICK).build());});
-    textTopView.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.CLICK).build());});
-    layoutWeatherBottom.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.CLICK).build());});
+    layoutText.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.CLICK).build());});
+    TypedValue outValue = new TypedValue();
+    itemView.getContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
+    layoutText.setForeground(ResourceUtil.getDrawable(itemView.getContext(),outValue.resourceId));
+    weatherIcon.setForeground(ResourceUtil.getDrawable(itemView.getContext(),outValue.resourceId));
+//    textTopView.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.CLICK).build());});
+//    layoutWeatherBottom.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.CLICK).build());});
     Log.i("APP# MainContentsWeatherHolder | init", "|" + " initY: " + initY + " initWeatherY: " + initWeatherY + ", this: " + this);
 
     setWeatherGifAndText(weatherCode, dustCode);

+ 1 - 0
app/src/main/res/layout/main_contents_category.xml

@@ -32,6 +32,7 @@
       android:id="@+id/text_more"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
+      android:background="?android:attr/selectableItemBackground"
       android:paddingStart="9dp"
       android:paddingTop="9dp"
       android:paddingBottom="9dp"