1
This commit is contained in:
parent
f52e10b96f
commit
2490c6bdd1
@ -40,5 +40,17 @@
|
|||||||
android:tint="@color/textColor"
|
android:tint="@color/textColor"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/rView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@color/textColor"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:layout_marginRight="25dp"
|
||||||
|
android:text="充值未到账?"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:textStyle="bold" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
@ -15,6 +15,7 @@ import android.view.animation.DecelerateInterpolator;
|
|||||||
import android.webkit.JavascriptInterface;
|
import android.webkit.JavascriptInterface;
|
||||||
import android.webkit.WebSettings;
|
import android.webkit.WebSettings;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
@ -3,23 +3,34 @@ package com.yunbao.main.activity;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentPagerAdapter;
|
import androidx.fragment.app.FragmentPagerAdapter;
|
||||||
import androidx.viewpager.widget.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.animation.AccelerateInterpolator;
|
import android.view.animation.AccelerateInterpolator;
|
||||||
import android.view.animation.DecelerateInterpolator;
|
import android.view.animation.DecelerateInterpolator;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
|
||||||
import com.adjust.sdk.Adjust;
|
import com.adjust.sdk.Adjust;
|
||||||
import com.adjust.sdk.AdjustEvent;
|
import com.adjust.sdk.AdjustEvent;
|
||||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||||
|
import com.android.billingclient.api.Purchase;
|
||||||
|
import com.android.billingclient.api.SkuDetails;
|
||||||
|
import com.facebook.appevents.AppEventsConstants;
|
||||||
import com.yunbao.common.CommonAppConfig;
|
import com.yunbao.common.CommonAppConfig;
|
||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.utils.GoogleBillingUtil;
|
||||||
|
import com.yunbao.common.utils.OnGoogleBillingListener;
|
||||||
import com.yunbao.common.utils.RouteUtil;
|
import com.yunbao.common.utils.RouteUtil;
|
||||||
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.main.R;
|
import com.yunbao.main.R;
|
||||||
import com.yunbao.main.utils.HXLinePagerIndicator;
|
import com.yunbao.main.utils.HXLinePagerIndicator;
|
||||||
@ -37,16 +48,80 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorT
|
|||||||
import static com.yunbao.common.CommonAppContext.logger;
|
import static com.yunbao.common.CommonAppContext.logger;
|
||||||
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
@Route(path = RouteUtil.PATH_COIN)
|
@Route(path = RouteUtil.PATH_COIN)
|
||||||
public class MyWalletActivity extends AbsActivity {
|
public class MyWalletActivity extends AbsActivity {
|
||||||
|
|
||||||
ViewPager vp_content;
|
ViewPager vp_content;
|
||||||
static MyWalletActivity mw;
|
static MyWalletActivity mw;
|
||||||
Fragment[] fragments = null;
|
Fragment[] fragments = null;
|
||||||
|
String TAG = "GooglePay";
|
||||||
@Override
|
@Override
|
||||||
protected int getLayoutId() {
|
protected int getLayoutId() {
|
||||||
return R.layout.activity_my_wallet;
|
return R.layout.activity_my_wallet;
|
||||||
}
|
}
|
||||||
|
private GoogleBillingUtil googleBillingUtil;
|
||||||
|
|
||||||
|
private OnGoogleBillingListener mOnMyGoogleBillingListener=new OnGoogleBillingListener(){
|
||||||
|
@Override
|
||||||
|
public void onSetupSuccess(boolean isSelf) {
|
||||||
|
super.onSetupSuccess(isSelf);
|
||||||
|
Log.d(TAG,"内购服务初始化完成");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onQuerySuccess(@NonNull String skuType, @NonNull List<SkuDetails> list, boolean isSelf) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onPurchaseSuccess(@NonNull Purchase purchase, boolean isSelf) {
|
||||||
|
StringBuffer tempBuffer =new StringBuffer();
|
||||||
|
|
||||||
|
return true ;//自动消耗(只有当isSelf为true,并且支付状态为PURCHASED时,该值才会生效)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onRecheck(@NonNull String skuType, @NonNull Purchase purchase, boolean isSelf) {
|
||||||
|
StringBuffer tempBuffer =new StringBuffer();
|
||||||
|
tempBuffer.append("检测到未处理的订单($skuType):${purchase.sku}()");
|
||||||
|
Log.d(TAG,tempBuffer.toString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBillingServiceDisconnected() {
|
||||||
|
super.onBillingServiceDisconnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConsumeSuccess(@NonNull String purchaseToken, boolean isSelf) {
|
||||||
|
Log.d(TAG,"消耗商品成功:$purchaseToken");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAcknowledgePurchaseSuccess(boolean isSelf) {
|
||||||
|
Log.d(TAG,"确认购买商品成功");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFail(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, int responseCode, boolean isSelf) {
|
||||||
|
Log.d(TAG,"操作失败:tag=${" + tag.name() + "responseCode=" + responseCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull GoogleBillingUtil.GoogleBillingListenerTag tag, boolean isSelf) {
|
||||||
|
Log.d(TAG,"发生错误:tag="+tag.name());
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void main() {
|
protected void main() {
|
||||||
@ -59,6 +134,14 @@ public class MyWalletActivity extends AbsActivity {
|
|||||||
logger.logEvent("FB_initiated_checkout");
|
logger.logEvent("FB_initiated_checkout");
|
||||||
|
|
||||||
vp_content = (ViewPager)findViewById(R.id.vp_content);
|
vp_content = (ViewPager)findViewById(R.id.vp_content);
|
||||||
|
TextView rView = (TextView) findViewById(R.id.rView);
|
||||||
|
rView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
final String[] titles = {WordUtil.getString(R.string.diamond), WordUtil.getString(R.string.coins),WordUtil.getString(R.string.golden_beans)};
|
final String[] titles = {WordUtil.getString(R.string.diamond), WordUtil.getString(R.string.coins),WordUtil.getString(R.string.golden_beans)};
|
||||||
if(getIntent().getStringExtra("tag")!=null) {
|
if(getIntent().getStringExtra("tag")!=null) {
|
||||||
Log.i("tss","首充");
|
Log.i("tss","首充");
|
||||||
@ -67,8 +150,9 @@ public class MyWalletActivity extends AbsActivity {
|
|||||||
fragments = new Fragment[]{new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
fragments = new Fragment[]{new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
||||||
// fragments = new Fragment[]{new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
// fragments = new Fragment[]{new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new GoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
||||||
}else{
|
}else{
|
||||||
fragments = new Fragment[]{new GoogleFragment( CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()),
|
rView.setVisibility(View.VISIBLE);
|
||||||
new GoogleFragment(CommonAppConfig.HOST +"/index.php?g=Appapi&m=Mall&a=googlepaygole&uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()),
|
fragments = new Fragment[]{new GoogleFragment( CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&package_name=pd"),
|
||||||
|
new GoogleFragment(CommonAppConfig.HOST +"/index.php?g=Appapi&m=Mall&a=googlepaygole&uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()+"&package_name=pd"),
|
||||||
new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
@ -77,8 +161,9 @@ public class MyWalletActivity extends AbsActivity {
|
|||||||
//链接版本
|
//链接版本
|
||||||
fragments = new Fragment[]{new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
fragments = new Fragment[]{new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()), new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
||||||
}else{
|
}else{
|
||||||
fragments = new Fragment[]{new GoogleFragment( CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()),
|
rView.setVisibility(View.VISIBLE);
|
||||||
new GoogleFragment(CommonAppConfig.HOST +"/index.php?g=Appapi&m=Mall&a=googlepaygole&uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()),
|
fragments = new Fragment[]{new GoogleFragment( CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+"&package_name=pd"),
|
||||||
|
new GoogleFragment(CommonAppConfig.HOST +"/index.php?g=Appapi&m=Mall&a=googlepaygole&uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()+"&package_name=pd"),
|
||||||
new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
new WalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken())};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user