瀏覽代碼

[메인][Bug] 날씨 클릭 영역 조절

hyodong.min 7 年之前
父節點
當前提交
ae45250646

+ 5 - 4
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/main/MainContentsWeatherHolder.java

@@ -79,16 +79,14 @@ public class MainContentsWeatherHolder extends MainContentsHolder /*implements V
   private ViewGroup weather;
 
   private TextView textTopView;
-  private TextView textBottomView;
   private ImageView weatherIcon;
   private ViewGroup layoutWeatherBottom;
 
   @Override
   public void init(int index, MainContentsBean bean, IEventListener listener) {
     weather = itemView.findViewById(R.id.layout_container_weather);
-    textTopView = itemView.findViewById(R.id.text_weather_top);
-    textBottomView = itemView.findViewById(R.id.text_weather_bottom);
     weatherIcon = itemView.findViewById(R.id.icon_weather);
+    textTopView = itemView.findViewById(R.id.text_weather_top);
     layoutWeatherBottom = itemView.findViewById(R.id.layout_weather_bottom);
 
     int statusBarHeight = ResourceUtil.getStatusBarHeightManual();
@@ -101,7 +99,9 @@ public class MainContentsWeatherHolder extends MainContentsHolder /*implements V
     initWeatherY = ResourceUtil.getDimension(R.dimen.main_contents_weather_margin_top) + statusBarHeight;
     itemView.setPadding(itemView.getPaddingLeft(), (int) initWeatherY, itemView.getPaddingRight(), itemView.getPaddingBottom());
     initY = 0; //itemView.getY(); //getScreenY(itemView);
-    weather.setOnClickListener(view -> {listener.onEvent(new Event.Builder(Event.CLICK).build());});
+    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());});
     Log.i("APP# MainContentsWeatherHolder | init", "|" + " initY: " + initY + " initWeatherY: " + initWeatherY + ", this: " + this);
 
     animate();
@@ -113,6 +113,7 @@ public class MainContentsWeatherHolder extends MainContentsHolder /*implements V
 //    Keyframe kf2 = Keyframe.ofFloat(1f, 0f);
 //    PropertyValuesHolder pvhRotation = PropertyValuesHolder.ofKeyframe("rotation", kf0, kf1, kf2);
 //    ObjectAnimator rotationAnim = ObjectAnimator.ofPropertyValuesHolder(weatherIcon, pvhRotation);
+    
     ObjectAnimator rotationAnim = ObjectAnimator.ofFloat(weatherIcon, "rotation", 0f, 360f);
     rotationAnim.setDuration(17000);
     rotationAnim.setInterpolator(new LinearInterpolator());

+ 2 - 1
app/src/main/res/layout/main_contents_weather.xml

@@ -12,7 +12,7 @@
   <LinearLayout
     android:id="@+id/layout_container_weather"
     android:layout_width="wrap_content"
-    android:layout_height="200dp"
+    android:layout_height="100dp"
     android:gravity="top"
     android:orientation="horizontal"
     android:paddingStart="30dp">
@@ -24,6 +24,7 @@
       app:srcCompat="@drawable/ic_icon_weather_sunny_copy"/>
 
     <LinearLayout
+      android:id="@+id/layout_text"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:orientation="vertical">