瀏覽代碼

[공통][Bug] 튜토리얼 화면 버튼 클릭 이벤트 수정

Hasemi 7 年之前
父節點
當前提交
7e50270208

+ 2 - 10
app/src/main/java/kr/co/zumo/app/lifeplus/activity/TutorialActivity.java

@@ -48,7 +48,6 @@ public class TutorialActivity extends ActivityBase<TutorialPresenter> implements
     buttonTutorial1 = (TextView) view.findViewById(R.id.button1_tutorial);
     buttonTutorial2 = (TextView) view.findViewById(R.id.button2_tutorial);
 
-
     viewPager = findViewById(R.id.tutorial_view_pager);
     tabLayout = findViewById(R.id.tutorial_tab_layout);
 
@@ -56,19 +55,12 @@ public class TutorialActivity extends ActivityBase<TutorialPresenter> implements
     tutorialPagerAdapter = new TutorialPagerAdapter(this);
     tutorialPagerAdapter.setPresenter(presenter);
     tutorialPagerAdapter.setBottomView(view);
+
     tabLayout.setupWithViewPager(viewPager, true);
     viewPager.setAdapter(tutorialPagerAdapter);
 
-
     buttonTutorial1.setOnClickListener(v -> presenter.onEvent(new Event.Builder(Event.TUTORIAL_CLOSE).build()));
-
-    if (buttonTutorial2.getText().equals("다음")) {
-      buttonTutorial2.setOnClickListener(v -> presenter.onEvent(new Event.Builder(Event.TUTORIAL_NEXT).build()));
-    }
-    else {
-      buttonTutorial2.setOnClickListener(v -> presenter.onEvent(new Event.Builder(Event.TUTORIAL_CLOSE).build()));
-
-    }
+    buttonTutorial2.setOnClickListener(v -> presenter.onEvent(new Event.Builder(Event.TUTORIAL_NEXT).build()));
 
   }
 

+ 14 - 5
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/tutorial/TutorialPagerAdapter.java

@@ -3,13 +3,16 @@ package kr.co.zumo.app.lifeplus.view.fragment.tutorial;
 import android.content.Context;
 import android.support.annotation.NonNull;
 import android.support.v4.view.PagerAdapter;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.TextView;
 
 import kr.co.zumo.app.R;
+import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
 
 /**
@@ -87,30 +90,35 @@ public class TutorialPagerAdapter extends PagerAdapter {
     ImageView imageViewTutorial = (ImageView) view.findViewById(R.id.image_view_tutorial);
     TextView textViewTitle = (TextView) view.findViewById(R.id.text_view_tutorial_title);
     TextView textViewDetail = (TextView) view.findViewById(R.id.text_view_tutorial_detail);
+    bottomView.setVisibility(View.VISIBLE);
 
     switch (position) {
       case 0:
-        bottomView.setVisibility(View.VISIBLE);
         imageViewTutorial.setImageResource(R.drawable.tutorial_image1);
         textViewTitle.setText(R.string.tutorial_title1);
         textViewDetail.setText(R.string.tutorial_title1_message);
         break;
       case 1:
-        bottomView.setVisibility(View.VISIBLE);
         imageViewTutorial.setImageResource(R.drawable.tutorial_image2);
+        textViewTitle.setText(R.string.tutorial_title2);
+        textViewDetail.setText(R.string.tutorial_title2_message);
         break;
       case 2:
-        bottomView.setVisibility(View.VISIBLE);
         imageViewTutorial.setImageResource(R.drawable.tutorial_image3);
+        textViewTitle.setText(R.string.tutorial_title3);
+        textViewDetail.setText(R.string.tutorial_title3_message);
         break;
       case 3:
-        bottomView.setVisibility(View.VISIBLE);
         imageViewTutorial.setImageResource(R.drawable.tutorial_image4);
+        textViewTitle.setText(R.string.tutorial_title4);
+        textViewDetail.setText(R.string.tutorial_title4_message);
         break;
       case 4:
         //하단 바 사라짐
-        view = layoutInflater.inflate(R.layout.tutorial_last, container, false);
         bottomView.setVisibility(View.GONE);
+        view = layoutInflater.inflate(R.layout.tutorial_last, container, false);
+        Button buttonStart = view.findViewById(R.id.button_start_main);
+        buttonStart.setOnClickListener(v -> presenter.onEvent(new Event.Builder(Event.TUTORIAL_CLOSE).build()));
         break;
       default:
         break;
@@ -129,6 +137,7 @@ public class TutorialPagerAdapter extends PagerAdapter {
    */
   @Override
   public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
+    Log.e("APP#  TutorialPagerAdapter | destroyItem", "|" + position);
     container.removeView((View) object);
   }
 

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

@@ -51,6 +51,7 @@
     android:orientation="vertical">
 
     <Button
+      android:id="@+id/button_start_main"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:background="@color/white"

+ 1 - 1
app/src/main/res/layout/tutorial_layout.xml

@@ -24,7 +24,7 @@
   <LinearLayout
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
-    android:layout_marginLeft="103dp"
+    android:layout_marginLeft="98dp"
     android:layout_marginTop="8dp"
     android:orientation="vertical">
 

+ 6 - 1
app/src/main/res/values/strings.xml

@@ -2,7 +2,12 @@
   <string name="empty_string" translatable="false"/>
   <string name="tutorial_title1">트렌디하게, 콘텐츠</string>
   <string name="tutorial_title1_message">소소한 일상부터 화제의 이슈까지 \n 다양하게 경험해보세요.</string>
-
+  <string name="tutorial_title2">쏠쏠하게, 코인 쿠폰</string>
+  <string name="tutorial_title2_message">콘텐츠만 봐도, 이벤트만 참여해도 \n 적립되는 코인을 쿠폰으로 교환하세요.</string>
+  <string name="tutorial_title3">의미있게, 버킷리스트</string>
+  <string name="tutorial_title3_message">언젠가 이루고 싶으 나만의 \n 인생 버킷을 차곡차곡 쌓아보세요.</string>
+  <string name="tutorial_title4">현명하게, 구매 예약</string>
+  <string name="tutorial_title4_message">합리적인 가격으로 제휴 쇼핑하고 \n 코인도 획득하세요.</string>
 
   <string name="sign_up_hello_text">Lifeplus만의 \n 다양한 혜택을 이용해 보세요.</string>
   <string name="sign_up_need_id">Lifeplus만의 혜택을 이용하기 위해서는 \n 본인인증 과정이 필요해요.</string>