|
|
|
|
@@ -11,24 +11,22 @@ import android.view.animation.AccelerateInterpolator;
|
|
|
|
|
import android.view.animation.DecelerateInterpolator;
|
|
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
|
import androidx.fragment.app.FragmentPagerAdapter;
|
|
|
|
|
import androidx.viewpager.widget.ViewPager;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
|
|
|
|
import com.yunbao.common.utils.MobclickAgent;
|
|
|
|
|
import com.yunbao.common.CommonAppConfig;
|
|
|
|
|
import com.yunbao.common.activity.AbsActivity;
|
|
|
|
|
import com.yunbao.common.fragment.LoadingDialog;
|
|
|
|
|
import com.yunbao.common.http.CommonHttpUtil;
|
|
|
|
|
import com.yunbao.common.http.HttpCallback;
|
|
|
|
|
import com.yunbao.common.manager.IMLoginManager;
|
|
|
|
|
import com.yunbao.common.pay.google.GooglePlay;
|
|
|
|
|
import com.yunbao.common.pay.hw.HwBuilder;
|
|
|
|
|
import com.yunbao.common.pay.samsung.SamsungUtil;
|
|
|
|
|
import com.yunbao.common.utils.GoogleUtils;
|
|
|
|
|
import com.yunbao.common.utils.L;
|
|
|
|
|
import com.yunbao.common.utils.MobclickAgent;
|
|
|
|
|
import com.yunbao.common.utils.RouteUtil;
|
|
|
|
|
import com.yunbao.common.utils.ToastUtil;
|
|
|
|
|
import com.yunbao.main.R;
|
|
|
|
|
@@ -45,24 +43,20 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTit
|
|
|
|
|
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
|
|
|
|
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
|
|
|
|
|
|
|
|
|
|
import org.json.JSONArray;
|
|
|
|
|
import org.json.JSONException;
|
|
|
|
|
import org.json.JSONObject;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Locale;
|
|
|
|
|
|
|
|
|
|
@Route(path = RouteUtil.PATH_COIN)
|
|
|
|
|
public class MyWalletActivity extends AbsActivity {
|
|
|
|
|
ViewPager vp_content;
|
|
|
|
|
static MyWalletActivity mw;
|
|
|
|
|
Fragment[] fragments = null;
|
|
|
|
|
private Handler payHandler = new Handler();
|
|
|
|
|
public static String orderId;
|
|
|
|
|
|
|
|
|
|
HwBuilder hwBuilder;
|
|
|
|
|
GoogleUtils googleUtils;
|
|
|
|
|
GooglePlay googlePlay;
|
|
|
|
|
|
|
|
|
|
LoadingDialog loadingDialog;
|
|
|
|
|
SamsungUtil samsungUtil;
|
|
|
|
|
@@ -72,26 +66,53 @@ public class MyWalletActivity extends AbsActivity {
|
|
|
|
|
return R.layout.activity_my_wallet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void main() {
|
|
|
|
|
private WalletFragment getWalletFragment(String url) {
|
|
|
|
|
WalletFragment walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", url);
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
return walletFragment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private GoogleFragment getGoogleFragment(String url) {
|
|
|
|
|
GoogleFragment fragment = new GoogleFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", url);
|
|
|
|
|
fragment.setArguments(bundle);
|
|
|
|
|
return fragment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private HuaWeiFragment getHuaWeiFragment(String url) {
|
|
|
|
|
HuaWeiFragment fragment = new HuaWeiFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", url);
|
|
|
|
|
fragment.setArguments(bundle);
|
|
|
|
|
return fragment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private SamsungFragment getSamsungFragment(String url) {
|
|
|
|
|
SamsungFragment fragment = new SamsungFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", url);
|
|
|
|
|
fragment.setArguments(bundle);
|
|
|
|
|
return fragment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void main() {
|
|
|
|
|
super.main();
|
|
|
|
|
mw = MyWalletActivity.this;
|
|
|
|
|
setTitle(mContext.getString(R.string.wallet));
|
|
|
|
|
|
|
|
|
|
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
|
|
|
|
googleUtils = new GoogleUtils(mContext);
|
|
|
|
|
googleUtils.initGooglePay();
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
|
|
|
|
if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
|
|
|
|
hwBuilder = new HwBuilder(MyWalletActivity.this);
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
|
|
|
|
samsungUtil = SamsungUtil.newInstance(mContext);
|
|
|
|
|
samsungUtil.init();
|
|
|
|
|
}else{
|
|
|
|
|
googleUtils = new GoogleUtils(mContext);
|
|
|
|
|
googleUtils.initGooglePay();
|
|
|
|
|
} else {
|
|
|
|
|
googlePlay = GooglePlay.getInstance();
|
|
|
|
|
//消耗所有商品
|
|
|
|
|
googlePlay.consumeAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vp_content = (ViewPager) findViewById(R.id.vp_content);
|
|
|
|
|
TextView rView = (TextView) findViewById(R.id.rView);
|
|
|
|
|
findViewById(R.id.redPacketMain).setVisibility(View.VISIBLE);
|
|
|
|
|
@@ -102,52 +123,9 @@ public class MyWalletActivity extends AbsActivity {
|
|
|
|
|
loadingDialog = new LoadingDialog();
|
|
|
|
|
loadingDialog.show(getSupportFragmentManager(), "LoadingDialog");
|
|
|
|
|
loadingDialog.setShowText(getString(R.string.order_query));
|
|
|
|
|
|
|
|
|
|
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
|
|
|
|
googleUtils.setQueryPurchaseListener(mContext, new GoogleUtils.QueryPurchasesListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onResult(JSONObject obj) {
|
|
|
|
|
try {
|
|
|
|
|
int code = obj.getInt("querySize");
|
|
|
|
|
if (code == 0) {
|
|
|
|
|
payHandler.post(runnable1);
|
|
|
|
|
payHandler.postDelayed(runnable2, 1000);
|
|
|
|
|
} else {
|
|
|
|
|
JSONArray tokenList = obj.getJSONArray("tokenList");
|
|
|
|
|
JSONArray orderList = obj.getJSONArray("orderList");
|
|
|
|
|
String tradeNo = obj.getString("tradeNo");
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < tokenList.length(); i++) {
|
|
|
|
|
int finalI = i;
|
|
|
|
|
payHandler.post(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
//谷歌掉单处理
|
|
|
|
|
try {
|
|
|
|
|
CommonHttpUtil.Google_sec_pay(tokenList.getString(finalI), orderList.getString(finalI), tradeNo, new HttpCallback() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSuccess(int code, String msg, String[] info) {
|
|
|
|
|
if (finalI == tokenList.length() - 1) {
|
|
|
|
|
loadingDialog.setShowText(getString(R.string.order_query_success));
|
|
|
|
|
loadingDialog.dismiss();
|
|
|
|
|
}
|
|
|
|
|
ToastUtil.show("充值已到账");
|
|
|
|
|
finish();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} catch (JSONException e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (JSONException e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
googleUtils.queryPurchasesAsync();
|
|
|
|
|
//消耗所有商品
|
|
|
|
|
googlePlay.consumeAll();
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
|
|
|
|
hwBuilder.consume();
|
|
|
|
|
payHandler.post(runnable1);
|
|
|
|
|
@@ -162,168 +140,36 @@ public class MyWalletActivity extends AbsActivity {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
WalletFragment walletFragment = null;
|
|
|
|
|
|
|
|
|
|
GoogleFragment googleFragment1 = null;
|
|
|
|
|
GoogleFragment googleFragment2 = null;
|
|
|
|
|
|
|
|
|
|
HuaWeiFragment huaWeiFragment1 = null;
|
|
|
|
|
HuaWeiFragment huaWeiFragment2 = null;
|
|
|
|
|
|
|
|
|
|
SamsungFragment samsungFragment1 = null;
|
|
|
|
|
SamsungFragment samsungFragment2 = null;
|
|
|
|
|
|
|
|
|
|
WalletFragment walletFragment;
|
|
|
|
|
Fragment fragment1;
|
|
|
|
|
Fragment fragment2;
|
|
|
|
|
final String[] titles = {mContext.getString(R.string.diamond), mContext.getString(R.string.coins), mContext.getString(R.string.golden_beans)};
|
|
|
|
|
if (getIntent().getStringExtra("tag") != null) {
|
|
|
|
|
Log.i("tss", "首充");
|
|
|
|
|
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
|
|
|
|
//google
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
|
|
|
|
|
googleFragment1 = new GoogleFragment();
|
|
|
|
|
Bundle bundle1 = new Bundle();
|
|
|
|
|
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
googleFragment1.setArguments(bundle1);
|
|
|
|
|
|
|
|
|
|
googleFragment2 = new GoogleFragment();
|
|
|
|
|
Bundle bundle2 = new Bundle();
|
|
|
|
|
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
googleFragment2.setArguments(bundle2);
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
|
|
|
|
//华为
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
|
|
|
|
|
huaWeiFragment1 = new HuaWeiFragment();
|
|
|
|
|
Bundle bundle1 = new Bundle();
|
|
|
|
|
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
|
|
|
|
huaWeiFragment1.setArguments(bundle1);
|
|
|
|
|
|
|
|
|
|
huaWeiFragment2 = new HuaWeiFragment();
|
|
|
|
|
Bundle bundle2 = new Bundle();
|
|
|
|
|
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
|
|
|
|
huaWeiFragment2.setArguments(bundle2);
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
|
|
|
|
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
|
|
|
|
|
samsungFragment1 = new SamsungFragment();
|
|
|
|
|
Bundle bundle1 = new Bundle();
|
|
|
|
|
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
samsungFragment1.setArguments(bundle1);
|
|
|
|
|
|
|
|
|
|
samsungFragment2 = new SamsungFragment();
|
|
|
|
|
Bundle bundle2 = new Bundle();
|
|
|
|
|
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
samsungFragment2.setArguments(bundle2);
|
|
|
|
|
} else {
|
|
|
|
|
walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
|
|
|
|
|
googleFragment1 = new GoogleFragment();
|
|
|
|
|
Bundle bundle1 = new Bundle();
|
|
|
|
|
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
googleFragment1.setArguments(bundle1);
|
|
|
|
|
|
|
|
|
|
googleFragment2 = new GoogleFragment();
|
|
|
|
|
Bundle bundle2 = new Bundle();
|
|
|
|
|
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
googleFragment2.setArguments(bundle2);
|
|
|
|
|
}
|
|
|
|
|
walletFragment = getWalletFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
fragment1 = getGoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
fragment2 = getGoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
fragment1 = getHuaWeiFragment(CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
|
|
|
|
fragment2 = getHuaWeiFragment(CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
fragment1 = getSamsungFragment(CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
fragment2 = getSamsungFragment(CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
} else {
|
|
|
|
|
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
|
|
|
walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
|
|
|
|
|
googleFragment1 = new GoogleFragment();
|
|
|
|
|
Bundle bundle1 = new Bundle();
|
|
|
|
|
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaycoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
googleFragment1.setArguments(bundle1);
|
|
|
|
|
|
|
|
|
|
googleFragment2 = new GoogleFragment();
|
|
|
|
|
Bundle bundle2 = new Bundle();
|
|
|
|
|
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=googlepaygole&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
googleFragment2.setArguments(bundle2);
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
|
|
|
|
|
walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
|
|
|
|
|
huaWeiFragment1 = new HuaWeiFragment();
|
|
|
|
|
Bundle bundle1 = new Bundle();
|
|
|
|
|
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
|
|
|
|
huaWeiFragment1.setArguments(bundle1);
|
|
|
|
|
|
|
|
|
|
huaWeiFragment2 = new HuaWeiFragment();
|
|
|
|
|
Bundle bundle2 = new Bundle();
|
|
|
|
|
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/huaweipaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd");
|
|
|
|
|
huaWeiFragment2.setArguments(bundle2);
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
|
|
|
|
rView.setVisibility(View.VISIBLE);
|
|
|
|
|
walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
|
|
|
|
|
samsungFragment1 = new SamsungFragment();
|
|
|
|
|
Bundle bundle1 = new Bundle();
|
|
|
|
|
bundle1.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaycoin.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
samsungFragment1.setArguments(bundle1);
|
|
|
|
|
|
|
|
|
|
samsungFragment2 = new SamsungFragment();
|
|
|
|
|
Bundle bundle2 = new Bundle();
|
|
|
|
|
bundle2.putString("url", CommonAppConfig.HOST + "/themes/simplebootx/appapi/mall/samsungpaygole.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
samsungFragment2.setArguments(bundle2);
|
|
|
|
|
if (getIntent().getStringExtra("tag") != null) {
|
|
|
|
|
fragment1 = getGoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&first_page=1&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
fragment2 = getGoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&first_page=1&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
} else {
|
|
|
|
|
Log.i("tss", "不是首充");
|
|
|
|
|
//链接版本
|
|
|
|
|
|
|
|
|
|
walletFragment = new WalletFragment();
|
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
|
bundle.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletbean&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
walletFragment.setArguments(bundle);
|
|
|
|
|
|
|
|
|
|
googleFragment1 = new GoogleFragment();
|
|
|
|
|
Bundle bundle1 = new Bundle();
|
|
|
|
|
bundle1.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
googleFragment1.setArguments(bundle1);
|
|
|
|
|
|
|
|
|
|
googleFragment2 = new GoogleFragment();
|
|
|
|
|
Bundle bundle2 = new Bundle();
|
|
|
|
|
bundle2.putString("url", CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
googleFragment2.setArguments(bundle2);
|
|
|
|
|
fragment1 = getGoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletcoin&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
fragment2 = getGoogleFragment(CommonAppConfig.HOST + "/index.php?g=Appapi&m=Mall&a=walletgold&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&package_name=pd" + "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fragments = new Fragment[]{fragment1, fragment2, walletFragment};
|
|
|
|
|
|
|
|
|
|
if (CommonAppConfig.IS_GOOGLE_PLAY == 1) {
|
|
|
|
|
fragments = new Fragment[]{googleFragment1, googleFragment2, walletFragment};
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
|
|
|
|
fragments = new Fragment[]{huaWeiFragment1, huaWeiFragment2, walletFragment};
|
|
|
|
|
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 3) {
|
|
|
|
|
fragments = new Fragment[]{samsungFragment1, samsungFragment2, walletFragment};
|
|
|
|
|
} else {
|
|
|
|
|
fragments = new Fragment[]{googleFragment1, googleFragment2, walletFragment};
|
|
|
|
|
}
|
|
|
|
|
MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator);
|
|
|
|
|
CommonNavigator commonNavigator = new CommonNavigator(this);
|
|
|
|
|
commonNavigator.setAdjustMode(true);
|
|
|
|
|
@@ -422,16 +268,6 @@ public class MyWalletActivity extends AbsActivity {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onPause() {
|
|
|
|
|
super.onPause();
|
|
|
|
|
CommonHttpUtil.cancel("Charge.Google_sec_pay");
|
|
|
|
|
if (payHandler != null) {
|
|
|
|
|
payHandler.removeCallbacks(runnable1);
|
|
|
|
|
payHandler.removeCallbacks(runnable2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onDestroy() {
|
|
|
|
|
super.onDestroy();
|
|
|
|
|
@@ -496,8 +332,4 @@ public class MyWalletActivity extends AbsActivity {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void dis() {
|
|
|
|
|
mw.finish();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|