Skip to content

Commit b013256

Browse files
committed
함수명 수정
1 parent 01e8e02 commit b013256

File tree

7 files changed

+141
-10
lines changed

7 files changed

+141
-10
lines changed

bootpay/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ dependencies {
6060
implementation 'dev.samstevens.totp:totp:1.7'
6161
implementation 'androidx.biometric:biometric:1.0.1'
6262
implementation "androidx.constraintlayout:constraintlayout:2.0.0"
63+
64+
implementation "com.github.skydoves:powerspinner:1.1.5"
6365
}
6466

6567
repositories {

bootpay/src/main/java/kr/co/bootpay/BootpayBuilder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,14 @@ public void requestBio() {
447447
if(context == null) {
448448
throw new IllegalStateException("context cannot be null from " + request.getUX().toString());
449449
}
450+
final long current = System.currentTimeMillis();
451+
CurrentBioRequest.getInstance().start_window_time = current;
450452
Handler handler = new Handler(Looper.getMainLooper());
451453
handler.post(new Runnable() {
452454
@Override
453455
public void run() {
454-
long current = System.currentTimeMillis();
455-
if(current - CurrentBioRequest.getInstance().start_window_time > 1000) {
456-
CurrentBioRequest.getInstance().start_window_time = current;
456+
457+
if(current - CurrentBioRequest.getInstance().start_window_time > 2000) {
457458
requestBioDialog();
458459
}
459460
}

bootpay/src/main/java/kr/co/bootpay/bio/activity/BootpayBioActivity.java

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.content.Context;
55
import android.content.DialogInterface;
66
import android.content.Intent;
7+
import android.graphics.Typeface;
78
import android.os.Bundle;
89
import android.os.Handler;
910
import android.os.Looper;
@@ -25,8 +26,11 @@
2526
import androidx.viewpager.widget.ViewPager;
2627

2728
import com.google.gson.Gson;
29+
import com.skydoves.powerspinner.PowerSpinnerView;
2830

2931
import java.text.DecimalFormat;
32+
import java.util.ArrayList;
33+
import java.util.List;
3034
import java.util.concurrent.Executor;
3135

3236
import dev.samstevens.totp.code.CodeGenerator;
@@ -82,6 +86,9 @@ public class BootpayBioActivity extends FragmentActivity implements BootpayBioRe
8286
BioWalletData data;
8387
CardViewPager card_pager;
8488
CardPagerAdapter cardPagerAdapter;
89+
PowerSpinnerView quota_spinner;
90+
LinearLayout quota_layout;
91+
View quota_line;
8592
int currentIndex = 0;
8693

8794
@Override
@@ -102,6 +109,28 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
102109
initBiometricAuth();
103110
setNameViews();
104111
setPriceViews();
112+
setQuotaValue();
113+
}
114+
115+
void setQuotaValue() {
116+
if(request == null) return;
117+
quota_layout.setVisibility(request.getPrice() < 50000 ? View.GONE : View.VISIBLE);
118+
quota_line.setVisibility(request.getPrice() < 50000 ? View.GONE : View.VISIBLE);
119+
if(request.getPrice() < 50000) return;
120+
List<String> array = getQuotaList();
121+
if(array == null) return;
122+
quota_spinner.setItems(array);
123+
quota_spinner.selectItemByIndex(0);
124+
}
125+
126+
List<String> getQuotaList() {
127+
List<String> result = new ArrayList<>();
128+
if(request.getBootExtra(this) == null || request.getBootExtra(this).getQuotas() == null) return null;
129+
for(Integer i : request.getBootExtra(this).getQuotas()) {
130+
if(i == 0) result.add("일시불");
131+
else result.add((i+1) + "개월");
132+
}
133+
return result;
105134
}
106135

107136
@Override
@@ -124,6 +153,9 @@ void initView() {
124153
prices = findViewById(R.id.prices);
125154
msg = findViewById(R.id.msg);
126155
card_pager = findViewById(R.id.card_pager);
156+
quota_layout = findViewById(R.id.quota_layout);
157+
quota_spinner = findViewById(R.id.quota_spinner);
158+
quota_line = findViewById(R.id.quota_line);
127159
cardPagerAdapter = new CardPagerAdapter(getSupportFragmentManager(), this.context);
128160
cardPagerAdapter.setParent(this);
129161
// cardPagerAdapter.setDialog(bootpayBioDialog);
@@ -219,11 +251,37 @@ private void setPriceViews() {
219251
layout.addView(right);
220252
prices.addView(layout);
221253
}
254+
255+
LinearLayout layout = new LinearLayout(context);
256+
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
257+
layout.setOrientation(LinearLayout.HORIZONTAL);
258+
layout.setLayoutParams(params);
259+
260+
261+
TextView left = new TextView(context);
262+
LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);
263+
left.setLayoutParams(params1);
264+
left.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
265+
left.setTypeface(left.getTypeface(), Typeface.BOLD);
266+
left.setText("총 결제금액");
267+
left.setTextColor(getResources().getColor(R.color.black, null));
268+
layout.addView(left);
269+
270+
TextView right = new TextView(context);
271+
LinearLayout.LayoutParams params2 = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);
272+
right.setLayoutParams(params2);
273+
right.setTextAlignment(TEXT_ALIGNMENT_TEXT_END);
274+
right.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
275+
right.setTypeface(left.getTypeface(), Typeface.BOLD);
276+
right.setText(getComma(request.getPrice()));
277+
right.setTextColor(getResources().getColor(R.color.black, null));
278+
layout.addView(right);
279+
prices.addView(layout);
222280
}
223281

224282
private String getComma(double value) {
225283
DecimalFormat myFormatter = new DecimalFormat("###,###");
226-
return myFormatter.format(value);
284+
return myFormatter.format(value) + "원";
227285
}
228286

229287
public void setCardPager(final BioWalletData data) {

bootpay/src/main/java/kr/co/bootpay/bio/memory/CurrentBioRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class CurrentBioRequest {
2727
public int type = -1;
2828
public String token;
2929

30-
public long start_window_time = System.currentTimeMillis() - 2000;
30+
public long start_window_time = System.currentTimeMillis() - 3000;
3131

3232
public static final int REQUEST_TYPE_NONE = -1;
3333
public static final int REQUEST_TYPE_VERIFY_PASSWORD = 1; // 생체인식 활성화용도

bootpay/src/main/java/kr/co/bootpay/model/BootExtra.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import com.google.gson.Gson;
66

7+
import java.util.ArrayList;
8+
import java.util.Arrays;
9+
import java.util.List;
710
import java.util.Locale;
811

912
import kr.co.bootpay.Bootpay;
@@ -37,6 +40,16 @@ public final String getApp_scheme() {
3740
return this.app_scheme;
3841
}
3942

43+
public List<Integer> getQuotas() {
44+
if(quotas == null) return null;
45+
46+
List<Integer> intList = new ArrayList<Integer>(quotas.length);
47+
for (int i : quotas) {
48+
intList.add(i);
49+
}
50+
return intList;
51+
}
52+
4053
public final void setApp_scheme(String value) {
4154
this.app_scheme = value;
4255
}
@@ -82,6 +95,8 @@ public final BootExtra setQuotas(int[] value) {
8295
this.quotas = value;
8396
return this;
8497
}
98+
99+
85100

86101
public final BootExtra setAppScheme(String value) {
87102
this.app_scheme = value;

bootpay/src/main/res/layout/layout_bio_pay.xml

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout
3-
xmlns:android="http://schemas.android.com/apk/res/android"
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
43
android:layout_width="match_parent"
54
android:layout_height="match_parent"
5+
xmlns:app="http://schemas.android.com/apk/res-auto"
66
android:orientation="vertical">
77

88
<LinearLayout
@@ -92,7 +92,6 @@
9292
<LinearLayout
9393
android:layout_width="0dp"
9494
android:layout_height="wrap_content"
95-
android:orientation="vertical"
9695
android:layout_weight="1"/>
9796

9897
<LinearLayout
@@ -106,6 +105,62 @@
106105
android:layout_width="match_parent"
107106
android:background="@color/bg_dialog"
108107
android:layout_height="0.5dp"/>
108+
109+
<LinearLayout
110+
android:id="@+id/quota_layout"
111+
android:orientation="horizontal"
112+
android:paddingLeft="20dp"
113+
android:paddingRight="20dp"
114+
android:paddingTop="15dp"
115+
android:paddingBottom="15dp"
116+
android:gravity="center"
117+
android:layout_width="match_parent"
118+
android:layout_height="wrap_content">
119+
120+
<LinearLayout
121+
android:layout_width="0dp"
122+
android:layout_height="wrap_content"
123+
android:layout_weight="1"/>
124+
125+
<TextView
126+
android:text="카드할부"
127+
android:textColor="@color/black"
128+
android:textSize="14sp"
129+
android:layout_width="0dp"
130+
android:layout_weight="1"
131+
android:layout_height="wrap_content"/>
132+
133+
<com.skydoves.powerspinner.PowerSpinnerView
134+
android:id="@+id/quota_spinner"
135+
android:layout_width="0dp"
136+
android:layout_height="wrap_content"
137+
android:layout_weight="3"
138+
android:background="@color/black80"
139+
android:gravity="center"
140+
android:hint="Question 1"
141+
android:padding="10dp"
142+
android:textColor="@color/black"
143+
android:textColorHint="@color/black"
144+
android:textSize="14sp"
145+
app:spinner_arrow_tint="@color/black"
146+
app:spinner_arrow_gravity="end"
147+
app:spinner_arrow_padding="8dp"
148+
app:spinner_divider_color="@color/black"
149+
app:spinner_divider_show="true"
150+
app:spinner_divider_size="0.4dp"
151+
app:spinner_popup_animation="dropdown"
152+
app:spinner_popup_background="@color/bg_white"
153+
app:spinner_popup_elevation="14dp" />
154+
155+
156+
157+
</LinearLayout>
158+
159+
<View
160+
android:id="@+id/quota_line"
161+
android:layout_width="match_parent"
162+
android:background="@color/bg_dialog"
163+
android:layout_height="0.5dp"/>
109164
<LinearLayout
110165
android:orientation="vertical"
111166
android:paddingTop="15dp"
@@ -130,8 +185,7 @@
130185
android:text="이 카드로 결제합니다"
131186
android:textSize="14sp"
132187
android:textColor="@color/black"
133-
android:layout_marginTop="5dp"
134-
android:layout_marginBottom="20dp"
188+
android:layout_marginBottom="15dp"
135189
android:layout_width="wrap_content"
136190
android:layout_height="wrap_content"/>
137191

bootpay/src/main/res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<color name="colorAccent">#FF4081</color>
66
<color name="white">#FFFFFF</color>
77
<color name="black">#000000</color>
8+
<color name="black80">#20000000</color>
89
<color name="transparent">#00ffffff</color>
910
<color name="bg_white">#FAFAFA</color>
1011
<color name="bg_dialog">#99000000</color>

0 commit comments

Comments
 (0)