Pārlūkot izejas kodu

[FAQ][Common] PUSH 알림 설정 레이아웃 추가

Hasemi 7 gadi atpakaļ
vecāks
revīzija
78e26f938e

+ 19 - 0
app/src/main/java/kr/co/zumo/app/lifeplus/view/fragment/faq/FAQWriteFragment.java

@@ -6,12 +6,15 @@ import android.support.annotation.Nullable;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.CompoundButton;
+import android.widget.Switch;
 
 import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
 import kr.co.zumo.app.lifeplus.model.BlankModel;
 import kr.co.zumo.app.lifeplus.view.IView;
 import kr.co.zumo.app.lifeplus.view.fragment.FragmentBase;
+import kr.co.zumo.app.lifeplus.view.fragment.setting.SwitchTrackTextDrawable;
 import kr.co.zumo.app.lifeplus.view.presenter.FAQWritePresenter;
 
 /**
@@ -26,6 +29,8 @@ import kr.co.zumo.app.lifeplus.view.presenter.FAQWritePresenter;
  */
 public class FAQWriteFragment extends FragmentBase<FAQWritePresenter> implements IView {
 
+  private Switch switchPushOnOff;
+
   @Override
   public void onCreate(@Nullable Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
@@ -40,6 +45,20 @@ public class FAQWriteFragment extends FragmentBase<FAQWritePresenter> implements
 
   @Override
   protected void onAfterActivityCreated(Bundle savedInstanceState) {
+    switchPushOnOff = findViewById(R.id.switch_push_on_off);
+    switchPushOnOff.setTrackDrawable(new SwitchTrackTextDrawable(getActivity(), R.string.on, R.string.off, false));
+
+    switchPushOnOff.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+      @Override
+      public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
+        if (isChecked) {
+          switchPushOnOff.setTrackDrawable(new SwitchTrackTextDrawable(getActivity(), R.string.on, R.string.off, true));
+        }
+        else {
+          switchPushOnOff.setTrackDrawable(new SwitchTrackTextDrawable(getActivity(), R.string.on, R.string.off, false));
+        }
+      }
+    });
 
   }
 

+ 243 - 203
app/src/main/res/layout/fragment_my_faq_write.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
+<ScrollView
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
@@ -9,247 +9,287 @@
   <LinearLayout
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:layout_marginStart="25dp"
-    android:layout_marginTop="32dp"
-    android:layout_marginEnd="25dp"
-    android:layout_marginBottom="23dp"
     android:orientation="vertical">
 
-    <RadioGroup
-      android:id="@+id/radio_group_my_faq_category"
+    <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
-      android:orientation="horizontal">
+      android:layout_marginStart="25dp"
+      android:layout_marginTop="32dp"
+      android:layout_marginEnd="25dp"
+      android:layout_marginBottom="23dp"
+      android:orientation="vertical">
 
-      <RadioButton
-        android:id="@+id/radio_button_user"
-        android:layout_width="wrap_content"
+      <RadioGroup
+        android:id="@+id/radio_group_my_faq_category"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginEnd="25dp"
-        android:background="@null"
-        android:button="@null"
-        android:drawableLeft="@drawable/my_faq_radio_selector"
-        android:drawablePadding="8dp"
-        android:lineSpacingExtra="6sp"
-        android:text="@string/user"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="14sp"
-        />
+        android:orientation="horizontal">
 
-      <RadioButton
-        android:id="@+id/radio_button_coupon"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="25dp"
-        android:background="@null"
-        android:button="@null"
-        android:drawableLeft="@drawable/my_faq_radio_selector"
-        android:drawablePadding="8dp"
-        android:lineSpacingExtra="6sp"
-        android:text="@string/coupon"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="14sp"
-        />
+        <RadioButton
+          android:id="@+id/radio_button_user"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:layout_marginEnd="25dp"
+          android:background="@null"
+          android:button="@null"
+          android:drawableLeft="@drawable/my_faq_radio_selector"
+          android:drawablePadding="8dp"
+          android:lineSpacingExtra="6sp"
+          android:text="@string/user"
+          android:textColor="@drawable/my_faq_radio_text_selector"
+          android:textSize="14sp"
+          />
 
-      <RadioButton
-        android:id="@+id/radio_benefit"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="25dp"
-        android:background="@null"
-        android:button="@null"
-        android:drawableLeft="@drawable/my_faq_radio_selector"
-        android:drawablePadding="8dp"
-        android:lineSpacingExtra="6sp"
-        android:text="@string/benefit"
-        android:textColor="@drawable/my_faq_radio_text_selector"
-        android:textSize="14sp"
-        />
+        <RadioButton
+          android:id="@+id/radio_button_coupon"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:layout_marginEnd="25dp"
+          android:background="@null"
+          android:button="@null"
+          android:drawableLeft="@drawable/my_faq_radio_selector"
+          android:drawablePadding="8dp"
+          android:lineSpacingExtra="6sp"
+          android:text="@string/coupon"
+          android:textColor="@drawable/my_faq_radio_text_selector"
+          android:textSize="14sp"
+          />
 
-      <RadioButton
-        android:id="@+id/radio_button_other"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        <RadioButton
+          android:id="@+id/radio_benefit"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:layout_marginEnd="25dp"
+          android:background="@null"
+          android:button="@null"
+          android:drawableLeft="@drawable/my_faq_radio_selector"
+          android:drawablePadding="8dp"
+          android:lineSpacingExtra="6sp"
+          android:text="@string/benefit"
+          android:textColor="@drawable/my_faq_radio_text_selector"
+          android:textSize="14sp"
+          />
+
+        <RadioButton
+          android:id="@+id/radio_button_other"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:background="@null"
+          android:button="@null"
+          android:drawableLeft="@drawable/my_faq_radio_selector"
+          android:drawablePadding="8dp"
+          android:lineSpacingExtra="6sp"
+          android:text="@string/other"
+          android:textColor="@drawable/my_faq_radio_text_selector"
+          android:textSize="14sp"
+          />
+      </RadioGroup>
+
+    </LinearLayout>
+
+    <LinearLayout
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginStart="25dp"
+      android:layout_marginEnd="25dp"
+      android:background="@drawable/faq_text_border"
+      android:orientation="vertical">
+
+      <EditText
+        android:id="@+id/edit_text_my_faq_write_contents"
+        android:layout_width="match_parent"
+        android:layout_height="209dp"
         android:background="@null"
-        android:button="@null"
-        android:drawableLeft="@drawable/my_faq_radio_selector"
-        android:drawablePadding="8dp"
+        android:gravity="top"
+        android:inputType="textMultiLine"
         android:lineSpacingExtra="6sp"
-        android:text="@string/other"
-        android:textColor="@drawable/my_faq_radio_text_selector"
+        android:maxLength="2000"
+        android:padding="13dp"
         android:textSize="14sp"
         />
-    </RadioGroup>
 
-  </LinearLayout>
+      <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
 
-  <LinearLayout
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:layout_marginStart="25dp"
-    android:layout_marginEnd="25dp"
-    android:background="@drawable/faq_text_border"
-    android:orientation="vertical">
+        <TextView
+          android:id="@+id/text_view_faq_write_current_character"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:layout_alignParentEnd="true"
+          android:layout_marginEnd="56dp"
+          android:layout_marginBottom="10dp"
+          android:gravity="center"
+          android:textColor="@color/CF27824"
+          android:textSize="12sp"
+          tools:text="51"/>
 
-    <EditText
-      android:id="@+id/edit_text_my_faq_write_contents"
-      android:layout_width="match_parent"
-      android:layout_height="209dp"
-      android:background="@null"
-      android:gravity="top"
-      android:inputType="textMultiLine"
-      android:lineSpacingExtra="6sp"
-      android:maxLength="2000"
-      android:padding="13dp"
-      android:textSize="14sp"
-      />
+        <TextView
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:layout_alignParentEnd="true"
+          android:layout_marginEnd="13dp"
+          android:layout_marginBottom="10dp"
+          android:gravity="end"
+          android:text="@string/my_faq_write_character"
+          android:textColor="@color/C999999"
+          android:textSize="12sp"/>
+
+      </RelativeLayout>
+
+      <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@color/CE5E5E5"
+        android:orientation="vertical">
+
+        <TextView
+          android:layout_width="match_parent"
+          android:layout_height="wrap_content"
+          android:layout_marginStart="13dp"
+          android:layout_marginTop="13dp"
+          android:layout_marginBottom="13dp"
+          android:lineSpacingExtra="4sp"
+          android:text="@string/my_faq_device_information"
+          android:textColor="@color/C666666"
+          android:textSize="12sp"
+          />
+      </LinearLayout>
+
+    </LinearLayout>
 
     <RelativeLayout
       android:layout_width="match_parent"
-      android:layout_height="wrap_content">
+      android:layout_height="wrap_content"
+      android:layout_marginStart="25dp"
+      android:layout_marginTop="15dp"
+      android:layout_marginEnd="25dp"
+      android:orientation="horizontal"
+      >
+
+      <ImageView
+        android:layout_width="2dp"
+        android:layout_height="2dp"
+        android:layout_alignParentStart="true"
+        android:layout_alignParentTop="true"
+        android:layout_marginStart="0dp"
+        android:layout_marginTop="8dp"
+        android:layout_marginRight="5dp"
+        android:src="@drawable/rectangle"/>
 
       <TextView
-        android:id="@+id/text_view_faq_write_current_character"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignParentEnd="true"
-        android:layout_marginEnd="56dp"
-        android:layout_marginBottom="10dp"
-        android:gravity="center"
-        android:textColor="@color/CF27824"
+        android:layout_alignParentStart="true"
+        android:layout_alignParentTop="true"
+        android:layout_marginStart="6dp"
+        android:layout_marginTop="0dp"
+        android:lineSpacingExtra="3sp"
+        android:text="@string/my_faq_notice1"
+        android:textColor="#999999"
         android:textSize="12sp"
-        tools:text="51"/>
+        />
+    </RelativeLayout>
+
+    <RelativeLayout
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content"
+      android:layout_marginStart="25dp"
+      android:layout_marginTop="8dp"
+      android:layout_marginEnd="25dp"
+      android:orientation="horizontal"
+      >
+
+      <ImageView
+        android:layout_width="2dp"
+        android:layout_height="2dp"
+        android:layout_alignParentStart="true"
+        android:layout_alignParentTop="true"
+        android:layout_marginStart="0dp"
+        android:layout_marginTop="8dp"
+        android:layout_marginRight="5dp"
+        android:src="@drawable/rectangle"/>
 
       <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignParentEnd="true"
-        android:layout_marginEnd="13dp"
-        android:layout_marginBottom="10dp"
-        android:gravity="end"
-        android:text="@string/my_faq_write_character"
-        android:textColor="@color/C999999"
-        android:textSize="12sp"/>
-
+        android:layout_alignParentStart="true"
+        android:layout_alignParentTop="true"
+        android:layout_marginStart="6dp"
+        android:layout_marginTop="0dp"
+        android:lineSpacingExtra="3sp"
+        android:text="@string/my_faq_notice2"
+        android:textColor="#999999"
+        android:textSize="12sp"
+        />
     </RelativeLayout>
 
     <LinearLayout
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
-      android:background="@color/CE5E5E5"
-      android:orientation="vertical">
+      android:layout_marginStart="25dp"
+      android:layout_marginTop="35dp"
+      android:layout_marginEnd="25dp"
+      android:layout_marginBottom="25dp"
+      android:orientation="horizontal"
+      android:weightSum="4">
 
-      <TextView
-        android:layout_width="match_parent"
+      <Button
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginStart="13dp"
-        android:layout_marginTop="13dp"
-        android:layout_marginBottom="13dp"
-        android:lineSpacingExtra="4sp"
-        android:text="@string/my_faq_device_information"
-        android:textColor="@color/C666666"
-        android:textSize="12sp"
+        android:layout_gravity="bottom"
+        android:layout_marginEnd="4dp"
+        android:layout_weight="2"
+        android:background="@drawable/input_black_border"
+        android:text="@string/cancel"
         />
-    </LinearLayout>
 
-  </LinearLayout>
-
-  <RelativeLayout
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:layout_marginStart="25dp"
-    android:layout_marginTop="15dp"
-    android:layout_marginEnd="25dp"
-    android:orientation="horizontal"
-    >
-
-    <ImageView
-      android:layout_width="2dp"
-      android:layout_height="2dp"
-      android:layout_alignParentStart="true"
-      android:layout_alignParentTop="true"
-      android:layout_marginStart="0dp"
-      android:layout_marginTop="8dp"
-      android:layout_marginRight="5dp"
-      android:src="@drawable/rectangle"/>
+      <Button
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom"
+        android:layout_marginStart="4dp"
+        android:layout_weight="2"
+        android:background="@color/C000000"
+        android:lineSpacingExtra="6sp"
+        android:text="@string/registration"
+        android:textColor="@color/CFFFFFF"
+        android:textSize="15sp"
+        />
+    </LinearLayout>
 
-    <TextView
-      android:layout_width="wrap_content"
+    <RelativeLayout
+      android:layout_width="match_parent"
       android:layout_height="wrap_content"
-      android:layout_alignParentStart="true"
-      android:layout_alignParentTop="true"
-      android:layout_marginStart="6dp"
-      android:layout_marginTop="0dp"
-      android:lineSpacingExtra="3sp"
-      android:text="@string/my_faq_notice1"
-      android:textColor="#999999"
-      android:textSize="12sp"
-      />
-  </RelativeLayout>
-
-  <RelativeLayout
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:layout_marginStart="25dp"
-    android:layout_marginTop="8dp"
-    android:layout_marginEnd="25dp"
-    android:orientation="horizontal"
-    >
-
-    <ImageView
-      android:layout_width="2dp"
-      android:layout_height="2dp"
-      android:layout_alignParentStart="true"
-      android:layout_alignParentTop="true"
-      android:layout_marginStart="0dp"
-      android:layout_marginTop="8dp"
-      android:layout_marginRight="5dp"
-      android:src="@drawable/rectangle"/>
+      android:background="@color/CF8F8F8"
+      android:gravity="bottom">
 
-    <TextView
-      android:layout_width="wrap_content"
-      android:layout_height="wrap_content"
-      android:layout_alignParentStart="true"
-      android:layout_alignParentTop="true"
-      android:layout_marginStart="6dp"
-      android:layout_marginTop="0dp"
-      android:lineSpacingExtra="3sp"
-      android:text="@string/my_faq_notice2"
-      android:textColor="#999999"
-      android:textSize="12sp"
-      />
-  </RelativeLayout>
+      <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="25dp"
+        android:layout_marginTop="19dp"
+        android:layout_marginBottom="19dp"
+        android:lineSpacingExtra="4sp"
+        android:text="@string/my_faq_push_setting"
+        android:textColor="@color/C999999"
+        android:textSize="12sp"
+        />
 
-  <LinearLayout
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:layout_marginStart="25dp"
-    android:layout_marginEnd="25dp"
-    android:layout_marginBottom="25dp"
-    android:orientation="horizontal"
-    android:weightSum="4">
-
-    <Button
-      android:layout_width="0dp"
-      android:layout_height="wrap_content"
-      android:layout_gravity="bottom"
-      android:layout_marginEnd="4dp"
-      android:layout_weight="2"
-      android:background="@drawable/input_black_border"
-      android:text="@string/cancel"
-      />
-
-    <Button
-      android:layout_width="0dp"
-      android:layout_height="wrap_content"
-      android:layout_gravity="bottom"
-      android:layout_marginStart="4dp"
-      android:layout_weight="2"
-      android:background="@color/C000000"
-      android:lineSpacingExtra="6sp"
-      android:text="@string/registration"
-      android:textColor="@color/CFFFFFF"
-      android:textSize="15sp"
-      />
+      <Switch
+        android:id="@+id/switch_push_on_off"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentEnd="true"
+        android:layout_marginTop="19dp"
+        android:layout_marginEnd="25dp"
+        android:layout_marginBottom="22dp"
+        android:background="@drawable/switch_track_selector"
+        android:switchMinWidth="46dp"
+        android:thumb="@drawable/switch_thumb_selector"
+        />
+
+    </RelativeLayout>
   </LinearLayout>
-</LinearLayout>
+</ScrollView>

+ 2 - 0
app/src/main/res/values/strings.xml

@@ -308,6 +308,8 @@
   <string name="my_faq_notice1">문의하신 내용의 답변은 회원정보에 등록하신 이메일 및 이용\n안내/문의에서 확인가능합니다.</string>
   <string name="my_faq_notice2">접수 순서대로 답변해 드리며, 문의가 많을 경우 답변이\n지연될 수 있습니다.</string>
   <string name="my_faq_write_character">/ 2,000</string>
+  <string name="my_faq_push_setting">문의 답변 알림 받기</string>
+
 
   <string name="user">회원</string>
   <string name="coupon">쿠폰</string>