Skip to content

Commit 7898d41

Browse files
committed
flutter 호환을 위한 리팩토링
1 parent 15e40e0 commit 7898d41

File tree

10 files changed

+33
-220
lines changed

10 files changed

+33
-220
lines changed

bootpay/src/main/java/kr/co/bootpay/bio/BootpayBioDialog.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import kr.co.bootpay.rest.BootpayBioRestImplement;
4747
import kr.co.bootpay.rest.model.ResDefault;
4848

49+
@Deprecated
4950
public class BootpayBioDialog extends androidx.fragment.app.DialogFragment implements BootpayBioRestImplement {
5051

5152
private Context context;

bootpay/src/main/java/kr/co/bootpay/bio/BootpayBioPayLayout.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import kr.co.bootpay.model.bio.BioPrice;
2525
import kr.co.bootpay.model.bio.BioWalletData;
2626

27+
@Deprecated
2728
public class BootpayBioPayLayout extends LinearLayout {
2829
HorizontalScrollView scrollView;
2930
private BootpayBioDialog bootpayBioDialog;
@@ -64,7 +65,7 @@ public void initView(final BootpayBioDialog bootpayBioDialog, FragmentManager fm
6465
msg = layout.findViewById(R.id.msg);
6566
card_pager = layout.findViewById(R.id.card_pager);
6667
cardPagerAdapter = new CardPagerAdapter(fm, this.context);
67-
cardPagerAdapter.setDialog(bootpayBioDialog);
68+
// cardPagerAdapter.setDialog(bootpayBioDialog);
6869
card_pager.setAdapter(cardPagerAdapter);
6970
card_pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
7071
@Override
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package kr.co.bootpay.bio;
2+
3+
import android.webkit.JavascriptInterface;
4+
5+
import kr.co.bootpay.model.bio.BioDeviceUse;
6+
import kr.co.bootpay.model.bio.BioWallet;
7+
8+
9+
public interface IBioActivityFunction {
10+
void startBioPay(BioDeviceUse user, BioWallet bioWallet);
11+
void goNewCardActivity();
12+
void goOtherActivity();
13+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import kr.co.bootpay.R;
4848
import kr.co.bootpay.api.ApiService;
4949
import kr.co.bootpay.bio.BootpayBioPayLayout;
50+
import kr.co.bootpay.bio.IBioActivityFunction;
5051
import kr.co.bootpay.bio.api.BioApiPresenter;
5152
import kr.co.bootpay.bio.memory.CurrentBioRequest;
5253
import kr.co.bootpay.bio.pager.CardPagerAdapter;
@@ -72,7 +73,7 @@
7273
import static androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS;
7374

7475

75-
public class BootpayBioActivity extends FragmentActivity implements BootpayBioRestImplement {
76+
public class BootpayBioActivity extends FragmentActivity implements BootpayBioRestImplement, IBioActivityFunction {
7677

7778
private Context context;
7879
private Request request;

bootpay/src/main/java/kr/co/bootpay/bio/pager/CardFragment.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
import androidx.fragment.app.Fragment;
1515

1616
import kr.co.bootpay.R;
17-
import kr.co.bootpay.bio.BootpayBioDialog;
1817
import kr.co.bootpay.bio.CardCode;
19-
import kr.co.bootpay.bio.activity.BootpayBioActivity;
20-
import kr.co.bootpay.bio.memory.CurrentBioRequest;
18+
import kr.co.bootpay.bio.IBioActivityFunction;
2119
import kr.co.bootpay.model.bio.BioDeviceUse;
2220
import kr.co.bootpay.model.bio.BioWallet;
2321

@@ -33,9 +31,10 @@ public class CardFragment extends Fragment {
3331

3432
ImageView new_card;
3533
TextView other;
36-
BootpayBioActivity parent;
34+
IBioActivityFunction parent;
35+
// BootpayBioActivity parent;
3736

38-
public static CardFragment newInstance(BootpayBioActivity parent, BioDeviceUse user, BioWallet bioWallet, Context context) {
37+
public static CardFragment newInstance(IBioActivityFunction parent, BioDeviceUse user, BioWallet bioWallet, Context context) {
3938
CardFragment fragment = new CardFragment();
4039
fragment.bioWallet = bioWallet;
4140
fragment.context = context;
@@ -137,9 +136,9 @@ void goCardClick() {
137136

138137
// void goVerify
139138

140-
void verifyPassword () {
141-
if(parent != null) parent.goVeiryPassword();
142-
}
139+
// void verifyPassword () {
140+
// if(parent != null) parent.goVeiryPassword();
141+
// }
143142

144143
void goNewCard() {
145144
if(parent != null) parent.goNewCardActivity();

bootpay/src/main/java/kr/co/bootpay/bio/pager/CardPagerAdapter.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.ArrayList;
1111

1212
import kr.co.bootpay.bio.BootpayBioDialog;
13+
import kr.co.bootpay.bio.IBioActivityFunction;
1314
import kr.co.bootpay.bio.activity.BootpayBioActivity;
1415
import kr.co.bootpay.model.bio.BioDeviceUse;
1516
import kr.co.bootpay.model.bio.BioWallet;
@@ -20,8 +21,8 @@ public class CardPagerAdapter extends FragmentStatePagerAdapter {
2021

2122
private Context context;
2223
private BioWalletData data;
23-
private BootpayBioDialog bootpayBioDialog;
24-
private BootpayBioActivity parent;
24+
// private BootpayBioDialog bootpayBioDialog;
25+
private IBioActivityFunction parent;
2526

2627
public CardPagerAdapter(FragmentManager fm, Context context) {
2728
super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
@@ -53,11 +54,11 @@ void addWallet(int walletType) {
5354
data.wallets.card.add(bioWallet);
5455
}
5556

56-
public void setDialog(BootpayBioDialog bootpayBioDialog) {
57-
this.bootpayBioDialog = bootpayBioDialog;
58-
}
57+
// public void setDialog(BootpayBioDialog bootpayBioDialog) {
58+
// this.bootpayBioDialog = bootpayBioDialog;
59+
// }
5960

60-
public void setParent(BootpayBioActivity parent) {
61+
public void setParent(IBioActivityFunction parent) {
6162
this.parent = parent;
6263
}
6364

sample/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<activity android:name=".WebAppActivity" android:screenOrientation="portrait"/>
2828
<activity android:name=".LocalHtmlActivity" android:screenOrientation="portrait"/>
2929
<activity android:name=".App2AppActivity" android:screenOrientation="portrait"/>
30-
<activity android:name=".FlutterActivity" android:screenOrientation="portrait"/>
3130
<activity android:name=".BioActivity" android:screenOrientation="portrait"/>
3231
</application>
3332

sample/src/main/java/bootpay/co/kr/samplepayment/FlutterActivity.java

Lines changed: 0 additions & 112 deletions
This file was deleted.

sample/src/main/java/bootpay/co/kr/samplepayment/MainActivity.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,6 @@ public void goBioActivity(View v) {
249249
// startActivity(intent);
250250
// }
251251

252-
public void goFlutterActivity(View v) {
253-
Intent intent = new Intent(this, FlutterActivity.class);
254-
startActivity(intent);
255-
}
256-
257252
// public void goRemoteLink(View v) {
258253
// BootUser bootUser = new BootUser().setPhone("010-1234-5678");
259254
// BootExtra bootExtra = new BootExtra().setQuotas(new int[] {0,2,3});

sample/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -153,93 +153,8 @@
153153
android:layout_width="match_parent"
154154
android:layout_height="40dp" />
155155

156-
<Button
157-
android:id="@+id/btn_flutter"
158-
android:text="Flutter"
159-
android:layout_weight="1"
160-
android:onClick="goFlutterActivity"
161-
android:layout_width="match_parent"
162-
android:layout_height="40dp" />
156+
163157
</LinearLayout>
164-
<!-- <LinearLayout-->
165-
<!-- android:layout_marginTop="20dp"-->
166-
<!-- android:layout_width="match_parent"-->
167-
<!-- android:layout_height="wrap_content"-->
168-
<!-- android:orientation="horizontal">-->
169-
170-
<!-- <Button-->
171-
<!-- android:text="Retmote Link"-->
172-
<!-- android:layout_weight="1"-->
173-
<!-- android:background="#4529e5"-->
174-
<!-- android:textColor="#fff"-->
175-
<!-- android:onClick="goRemoteLink"-->
176-
<!-- android:layout_width="match_parent"-->
177-
<!-- android:layout_height="40dp" />-->
178-
<!-- <Button-->
179-
<!-- android:text="Remote Form"-->
180-
<!-- android:layout_weight="1"-->
181-
<!-- android:onClick="goRemoteForm"-->
182-
<!-- android:layout_marginRight="5dp"-->
183-
<!-- android:layout_marginLeft="5dp"-->
184-
<!-- android:background="#4529e5"-->
185-
<!-- android:textColor="#fff"-->
186-
<!-- android:layout_width="match_parent"-->
187-
<!-- android:layout_height="40dp" />-->
188-
<!-- <Button-->
189-
<!-- android:text="Remote Pre"-->
190-
<!-- android:layout_weight="1"-->
191-
<!-- android:onClick="goRemotePre"-->
192-
<!-- android:background="#4529e5"-->
193-
<!-- android:textColor="#fff"-->
194-
<!-- android:layout_width="match_parent"-->
195-
<!-- android:layout_height="40dp" />-->
196-
<!-- </LinearLayout>-->
197158
</LinearLayout>
198159
</ScrollView>
199-
200-
201-
202-
203-
204-
205-
<!--<Button-->
206-
<!--android:id="@+id/btn_native"-->
207-
<!--android:layout_width="match_parent"-->
208-
<!--android:layout_height="wrap_content"-->
209-
<!--android:layout_weight="1"-->
210-
<!--android:onClick="goNativeActivity"-->
211-
<!--android:text="Native 연동"/>-->
212-
213-
<!--<Button-->
214-
<!--android:id="@+id/btn_local"-->
215-
<!--android:layout_width="match_parent"-->
216-
<!--android:layout_height="wrap_content"-->
217-
<!--android:layout_weight="1"-->
218-
<!--android:onClick="goLocalActivity"-->
219-
<!--android:text="LocalHtml 연동"/>-->
220-
221-
<!--<Button-->
222-
<!--android:id="@+id/btn_webapp"-->
223-
<!--android:layout_width="match_parent"-->
224-
<!--android:layout_height="wrap_content"-->
225-
<!--android:layout_weight="1"-->
226-
<!--android:onClick="goWebAppActivity"-->
227-
<!--android:text="WebApp 결제연동"/>-->
228-
229-
<!--<Button-->
230-
<!--android:id="@+id/btn_app2app"-->
231-
<!--android:layout_width="match_parent"-->
232-
<!--android:layout_height="wrap_content"-->
233-
<!--android:layout_weight="1"-->
234-
<!--android:onClick="goCameraActivity"-->
235-
<!--android:text="앱투앱 결제연동"/>-->
236-
237-
<!--<Button-->
238-
<!--android:id="@+id/btn_camera"-->
239-
<!--android:layout_width="match_parent"-->
240-
<!--android:layout_height="wrap_content"-->
241-
<!--android:layout_weight="1"-->
242-
<!--android:onClick="goCameraActivity"-->
243-
<!--android:text="카메라 결제연동"/>-->
244-
245160
</LinearLayout>

0 commit comments

Comments
 (0)