Merge remote-tracking branch 'origin/master' into pdlive_samsung
# Conflicts: # config.gradle # main/src/main/java/com/yunbao/main/activity/GoogleFragment.java
This commit is contained in:
commit
9d543f2211
@ -1,8 +1,18 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
public class CoolConfig extends BaseModel {
|
||||
private int rate=1;
|
||||
private String ticketCount="0" ;
|
||||
private int rate = 1;
|
||||
private String ticketCount = "0";
|
||||
private String yuanbao = "0";
|
||||
|
||||
public String getYuanbao() {
|
||||
return yuanbao;
|
||||
}
|
||||
|
||||
public CoolConfig setYuanbao(String yuanbao) {
|
||||
this.yuanbao = yuanbao;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTicketCount() {
|
||||
return ticketCount;
|
||||
|
@ -1,24 +1,34 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import static android.content.Context.INPUT_METHOD_SERVICE;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CoolConfig;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class CinemaTicketPopupWindow extends CenterPopupView {
|
||||
private CoolConfig mCoolConfig;
|
||||
private TextView cinemaTicket, ticketsPlusMinus, quantityNeed;
|
||||
private TextView cinemaTicket, quantityNeed, quantityNeed2;
|
||||
private EditText ticketsPlusMinus;
|
||||
private int ticket = 1;
|
||||
private CinemaTicketPopupWindowCallBack mCinemaTicketPopupWindowCallBack;
|
||||
|
||||
@ -41,9 +51,30 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
|
||||
cinemaTicket = findViewById(R.id.cinema_ticket);
|
||||
ticketsPlusMinus = findViewById(R.id.tickets_plus_minus);
|
||||
quantityNeed = findViewById(R.id.quantity_need);
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
quantityNeed2 = findViewById(R.id.quantity_need2);
|
||||
cinemaTicket.setText(mCoolConfig.getTicketCount());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
quantityNeed2.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).floatValue()+"");
|
||||
quantityNeed.setText(mCoolConfig.getYuanbao());
|
||||
ticketsPlusMinus.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
if (!TextUtils.isEmpty(charSequence.toString())) {
|
||||
ticket = new BigDecimal(charSequence.toString()).intValue();
|
||||
quantityNeed2.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).floatValue()+"");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_close), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
@ -56,9 +87,8 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
|
||||
if (ticket > 1) {
|
||||
ticket = ticket - 1;
|
||||
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
quantityNeed2.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).floatValue()+"");
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -66,14 +96,14 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ticket = ticket + 1;
|
||||
cinemaTicket.setText(new BigDecimal(ticket).add(new BigDecimal(mCoolConfig.getTicketCount())).toString());
|
||||
ticketsPlusMinus.setText(String.valueOf(ticket));
|
||||
quantityNeed.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).toString());
|
||||
quantityNeed2.setText(new BigDecimal(ticket).multiply(new BigDecimal(mCoolConfig.getRate())).floatValue()+"");
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.cinema_ticket_exchange), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (ticket>=1&&ticket<=9999){
|
||||
LiveNetManager.get(getContext())
|
||||
.buyTicket(String.valueOf(ticket), new HttpCallback<String>() {
|
||||
@Override
|
||||
@ -84,6 +114,7 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
|
||||
mCinemaTicketPopupWindowCallBack.onCallBack(data);
|
||||
}
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -91,8 +122,16 @@ public class CinemaTicketPopupWindow extends CenterPopupView {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}else {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "兌換數量區間為[1 - 9999]" : "The exchange quantity range is [1-9999]");
|
||||
}
|
||||
InputMethodManager inputMethodManager = (InputMethodManager)ticketsPlusMinus.getContext().getSystemService(INPUT_METHOD_SERVICE);
|
||||
inputMethodManager.hideSoftInputFromWindow(ticketsPlusMinus.getWindowToken(), 0);
|
||||
MobclickAgent.onEvent(getContext(), "dj_exchange", "兑换按钮点");
|
||||
}
|
||||
});
|
||||
InputMethodManager inputMethodManager = (InputMethodManager)ticketsPlusMinus.getContext().getSystemService(INPUT_METHOD_SERVICE);
|
||||
inputMethodManager.hideSoftInputFromWindow(ticketsPlusMinus.getWindowToken(), 0);
|
||||
}
|
||||
|
||||
public interface CinemaTicketPopupWindowCallBack {
|
||||
|
@ -481,6 +481,7 @@ public class LiveNetManager {
|
||||
* @param liveUid
|
||||
*/
|
||||
public void leaveRoomNew(String stream, String liveUid, HttpCallback<String> callback) {
|
||||
Log.e("观看时长","leaveRoomNew-----------------------"+liveUid);
|
||||
API.get().pdLiveApi(mContext)
|
||||
.leaveRoomNew("g" + liveUid, stream)
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
@ -183,6 +183,7 @@ public class OpenAdManager {
|
||||
if (model.getShowModel() == OpenAdModel.SHOW_DIY) {
|
||||
String nextTime= String.valueOf(System.currentTimeMillis() + (Long.parseLong(model.getSection()) * 60 * 1000));
|
||||
SpUtil.setStringValue("open_ad_popup_time_" + model.getId(), nextTime);
|
||||
showMap.remove(model.getId());
|
||||
}
|
||||
if (model.getModel() == OpenAdModel.MODEL_BOTTOM) {
|
||||
new OpenAdBottomDialogPopup(CommonAppContext.getTopActivity(), model).setListener((bean, position) -> {
|
||||
|
@ -185,6 +185,19 @@ public class GoogleUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getGoogleService() {
|
||||
boolean flag;
|
||||
try {
|
||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleBillingManage");
|
||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||
flag = (boolean) googlePay.getClass().getMethod("getGoogleService").invoke(googlePay);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
public void setFirebaseTokenListener(Activity activity, FirebaseTokenListener firebaseTokenListener) {
|
||||
Timer timer = new Timer();
|
||||
TimerTask task = new TimerTask() {
|
||||
|
@ -3,6 +3,7 @@ package com.yunbao.common.views;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
@ -114,7 +115,7 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
} else if (CommonAppConfig.IS_GOOGLE_PLAY == 2) {
|
||||
//华为
|
||||
//todo
|
||||
launchAppDetail(mContext, "com.pdlive.shayu", "com.pdlive.shayu");
|
||||
launchAppDetail(mContext, "com.pdlive.shayu", "com.huawei.appmarket");
|
||||
} else {
|
||||
versionImmediateUse.setVisibility(GONE);
|
||||
updateLine.setVisibility(VISIBLE);
|
||||
@ -129,19 +130,31 @@ public class APKUpdateCustomPopup extends CenterPopupView {
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isAppStoreExist(Context context) {
|
||||
try {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
packageManager.getPackageInfo("com.huawei.appmarket", PackageManager.GET_ACTIVITIES);
|
||||
return true;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void launchAppDetail(Context mContext, String appPkg, String marketPkg) {
|
||||
try {
|
||||
if (TextUtils.isEmpty(appPkg)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Uri uri = Uri.parse("market://details?id=" + appPkg);
|
||||
if (isAppStoreExist(mContext)) {
|
||||
Uri uri = Uri.parse("appmarket://details?id=" + appPkg);
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
|
||||
if (!TextUtils.isEmpty(marketPkg)) {
|
||||
intent.setPackage(marketPkg);
|
||||
}
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:inputType="number"
|
||||
android:textColor="#DFEAFF"
|
||||
android:textSize="15sp" />
|
||||
|
||||
@ -68,12 +69,14 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
<EditText
|
||||
android:id="@+id/tickets_plus_minus"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:background="@null"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:singleLine="true"
|
||||
android:text="0"
|
||||
android:textColor="#000000"
|
||||
@ -86,6 +89,20 @@
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quantity_need2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginStart="7dp"
|
||||
android:textColor="#DFEAFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:src="@mipmap/icon_collectibles2" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -95,20 +112,23 @@
|
||||
android:layout_marginTop="13dp"
|
||||
android:gravity="center">
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/quantity_need"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/conversion_quantity_need"
|
||||
android:textColor="#DFEAFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:src="@mipmap/icon_collectibles2" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
|
@ -1388,7 +1388,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="room_sill500_m">Above 500 coins</string>
|
||||
<string name="combo">combo X</string>
|
||||
<string name="conversion_quantity">Exchange quantity:</string>
|
||||
<string name="conversion_quantity_need">Need %s</string>
|
||||
<string name="conversion_quantity_need">Balance %s</string>
|
||||
<string name="conversion_quantity_need_of_use">Exchange&Usage Rules:</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie;</string>
|
||||
|
@ -1385,9 +1385,9 @@
|
||||
<string name="room_sill500_m">500以上星幣</string>
|
||||
<string name="combo">連擊×</string>
|
||||
<string name="conversion_quantity">兌換數量:</string>
|
||||
<string name="conversion_quantity_need">需要 %s</string>
|
||||
<string name="conversion_quantity_need">余额 %s</string>
|
||||
<string name="conversion_quantity_need_of_use">兌換&使用規則:</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
<string name="conversion_quantity_need_of_use1">一、1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
</resources>
|
||||
|
@ -1159,7 +1159,7 @@
|
||||
<string name="live_vote_close_yes">是</string>
|
||||
<string name="live_vote_close_no">否</string>
|
||||
<string name="live_vote_hide_text">投票中</string>
|
||||
<string name="live_room_vote_over_tip">%s <br/> 問答框%s秒后消失</string>
|
||||
<string name="live_room_vote_over_tip">%s <br /> 問答框%s秒后消失</string>
|
||||
<string name="live_anchor_vote_tip">請完整填寫</string>
|
||||
<string name="complete_information_consumable">填寫“*”的選項可完成</string>
|
||||
<string name="love_powder">真愛粉\n頭像框(7天)</string>
|
||||
@ -1384,9 +1384,9 @@
|
||||
<string name="room_sill500_m">500以上星幣</string>
|
||||
<string name="combo">連擊×</string>
|
||||
<string name="conversion_quantity">兌換數量:</string>
|
||||
<string name="conversion_quantity_need">需要 %s</string>
|
||||
<string name="conversion_quantity_need">余额 %s</string>
|
||||
<string name="conversion_quantity_need_of_use">兌換&使用規則:</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
<string name="conversion_quantity_need_of_use1">一、1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
</resources>
|
||||
|
@ -1384,10 +1384,10 @@
|
||||
<string name="room_sill500_m">500以上星幣</string>
|
||||
<string name="combo">連擊×</string>
|
||||
<string name="conversion_quantity">兌換數量:</string>
|
||||
<string name="conversion_quantity_need">需要 %s</string>
|
||||
<string name="conversion_quantity_need">余额 %s</string>
|
||||
<string name="conversion_quantity_need_of_use">兌換&使用規則:</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">3.觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
<string name="conversion_quantity_need_of_use1">一、1星幣兌換1張觀影券,您可以根據需求自定義兌換數量,觀影券一經兌換不可撤銷,請提前確認;</string>
|
||||
<string name="conversion_quantity_need_of_use2">二、1張觀影券可觀看一集短劇,兌換成功後即可返回觀影頁面,使用觀影券繼續觀看影片;</string>
|
||||
<string name="conversion_quantity_need_of_use3">三、觀影券禁止線下交易、收購等不正當行為,PDLIVE將對各類以盈利為目的的交易行為進行嚴厲打擊。</string>
|
||||
|
||||
</resources>
|
||||
|
@ -1391,7 +1391,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="room_sill500_m">Above 500 coins</string>
|
||||
<string name="combo">combo X</string>
|
||||
<string name="conversion_quantity">Exchange quantity:</string>
|
||||
<string name="conversion_quantity_need">Need %s</string>
|
||||
<string name="conversion_quantity_need">Balance %s</string>
|
||||
<string name="conversion_quantity_need_of_use">Exchange&Usage Rules:</string>
|
||||
<string name="conversion_quantity_need_of_use1">1.One star coin can be exchanged for one ticket. You can customize the exchange quantity according to your needs. Once the ticket is exchanged, it cannot be revoked. Please confirm in advance;</string>
|
||||
<string name="conversion_quantity_need_of_use2">2.One ticket can be used to watch one episode of a short drama. After successful redemption, you can return to the viewing page and use the ticket to continue watching the movie;</string>
|
||||
|
@ -4,12 +4,12 @@ ext {
|
||||
buildToolsVersion: "29.0.2",
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 33,
|
||||
versionCode : 458,
|
||||
versionCode : 460,
|
||||
versionName : "6.6.3"
|
||||
]
|
||||
manifestPlaceholders = [
|
||||
//正式、
|
||||
//serverHost : "https://napi.yaoulive.com",
|
||||
// serverHost : "https://napi.yaoulive.com",
|
||||
// 测试
|
||||
serverHost : " https://ceshi.yaoulive.com",
|
||||
|
||||
@ -19,8 +19,9 @@ ext {
|
||||
baiduAppKey : "zgCgFhUKEOV7I3ZXDFpTfnRB",
|
||||
|
||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 三星包
|
||||
isGooglePlay : 3,
|
||||
|
||||
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包
|
||||
isGooglePlay : 1,
|
||||
//是否上报异常日志
|
||||
isUploadLog : true,
|
||||
//是否打包成插件包模式
|
||||
|
@ -29,11 +29,8 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 新写Google内付工具类做简单的封装
|
||||
@ -207,6 +204,11 @@ public class GoogleBillingManage implements PurchasesUpdatedListener {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getGoogleService() {
|
||||
int code = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mContext);
|
||||
return code == 0;
|
||||
}
|
||||
|
||||
int resultCode = -1;
|
||||
String resultToken = "";
|
||||
String resultOrderId = "";
|
||||
|
@ -309,7 +309,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
if (bean.getType() == -3) {
|
||||
String str1 = WordUtil.isNewZh() ? "整蠱來了! " : "Pranks are coming";
|
||||
String str2 = WordUtil.isNewZh() ? "向 " : "too";
|
||||
String str2 = WordUtil.isNewZh() ? "向 " : "to";
|
||||
builder.append(str1);
|
||||
int length = builder.length();
|
||||
builder.append(bean.getUserNiceName());
|
||||
@ -318,7 +318,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
int length2 = builder.length();
|
||||
builder.append(bean.getAnchorName());
|
||||
builder.setSpan(new ForegroundColorSpan(0xFF73FFFF), length2, length2 + bean.getAnchorName().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
builder.append(WordUtil.isNewZh() ? "發出了 " : "Sent out " + bean.getContent());
|
||||
builder.append(WordUtil.isNewZh() ? "發出了 " + bean.getContent(): "Sent out " + bean.getContent());
|
||||
mTextView.setText(builder);
|
||||
} else if (bean.getType() == -4) {
|
||||
String str1 = WordUtil.isNewZh() ? "成功拯救了 " : "Succeeded in saving";
|
||||
|
@ -22,8 +22,6 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
@ -65,9 +63,6 @@ import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imlib.IRongCoreCallback;
|
||||
import io.rong.imlib.IRongCoreEnum;
|
||||
import io.rong.imlib.chatroom.base.RongChatRoomClient;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
/**
|
||||
@ -637,6 +632,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
|
||||
|
||||
private void gotoLive(String live_id) {
|
||||
dismiss();
|
||||
DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.party_studio), new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.yunbao.live.presenter;
|
||||
|
||||
import static com.blankj.utilcode.util.SnackbarUtils.dismiss;
|
||||
import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
|
||||
import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK;
|
||||
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
|
||||
@ -38,7 +37,6 @@ import android.widget.TextView;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.ViewUtils;
|
||||
import com.tencent.trtc.TRTCCloud;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
@ -858,7 +856,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
@Override
|
||||
public void onSuccess(RCRTCOtherRoom rcrtcOtherRoom) {
|
||||
rcrtcOtherRoom.registerOtherRoomEventsListener(otherRoomEventsListener);
|
||||
ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "接受成功" : "Success");
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
for (int i = 0; i < rcrtcOtherRoom.getRemoteUsers().size(); i++) {
|
||||
@ -977,7 +975,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
@Override
|
||||
public void onSuccess(RCRTCOtherRoom rcrtcOtherRoom) {
|
||||
rcrtcOtherRoom.registerOtherRoomEventsListener(otherRoomEventsListener);
|
||||
ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "接受成功" : "Success");
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
public void run() {
|
||||
Log.e("ry", liveid + "来了!!!!" + rcrtcOtherRoom.getRemoteUsers().size());
|
||||
@ -1660,7 +1658,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
}
|
||||
|
||||
Log.e("ry", "多人接受成功" + mApplyUid);
|
||||
ToastUtil.show(WordUtil.isNewZh()?"接受成功":"Success");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "接受成功" : "Success");
|
||||
//遍历远端用户列表
|
||||
for (int i = 0; i < rcrtcOtherRoom.getRemoteUsers().size(); i++) {
|
||||
Log.e("ry", rcrtcOtherRoom.getRemoteUsers().get(i).getUserId() + "收到rcrtcOtherRoom" + rcrtcOtherRoom.getRemoteUsers().size());
|
||||
@ -1697,7 +1695,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
|
||||
@ -2332,7 +2330,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
* 主播与主播PK 断开连麦PK的回调
|
||||
*/
|
||||
public void onLinkMicPkClose(int i) {
|
||||
Log.e("ry",mPkUid+"aaaaqwqw"+i);
|
||||
Log.e("ry", mPkUid + "aaaaqwqw" + i);
|
||||
|
||||
PKing = false;
|
||||
LiveRyAnchorActivity.isDRPK = 0;
|
||||
@ -2500,11 +2498,11 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
* 更新Pk分数
|
||||
*/
|
||||
public void upDataPkScore(JSONArray pkScores, String uid, int time) {
|
||||
|
||||
String userID1 = (String) imageGrade1.getTag();
|
||||
String userID2 = (String) imageGrade2.getTag();
|
||||
String userID4 = (String) imageGrade4.getTag();
|
||||
if (livePushRyViewHolder.timeTitle.getVisibility() == View.GONE) {
|
||||
mHandler.removeMessages(WHAT_PK_TIME2);
|
||||
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) livePushRyViewHolder.timeTitle.getLayoutParams();
|
||||
layoutParams.topMargin = DpUtil.dp2px(123);
|
||||
livePushRyViewHolder.timeTitle.setLayoutParams(layoutParams);
|
||||
@ -2512,7 +2510,12 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
||||
String pkTime = StringUtil.getDurationText(time * 1000);
|
||||
livePushRyViewHolder.textTime.setText(String.format(mContext.getString(R.string.pk_time), pkTime));
|
||||
mPkTimeCount = time;
|
||||
pkCountdownTimer();
|
||||
if (time>0){
|
||||
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
||||
livePushRyViewHolder.textTime.setText(String.format(mContext.getString(R.string.pk_time), s1));
|
||||
mHandler.sendEmptyMessage(WHAT_PK_TIME2);
|
||||
}
|
||||
|
||||
}
|
||||
int pkScoreSize = pkScores.size();
|
||||
if (pkScoreSize == 3) {
|
||||
|
@ -387,7 +387,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
private FrameLayout pa_pao_layout;
|
||||
private LinearLayout combo_layout;
|
||||
private TextView combo_number;
|
||||
private View quick_gift_reminder ;
|
||||
private View quick_gift_reminder;
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdata(String str) {
|
||||
@ -720,6 +720,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onQuickGifting3() {
|
||||
IMLoginManager.get(mContext).setQuickGiftIfFirst();
|
||||
quick_gift_reminder.setVisibility(View.GONE);
|
||||
@ -1825,6 +1826,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
* 重置数据
|
||||
*/
|
||||
public void resetView() {
|
||||
countdownHandler.removeCallbacks(countdownRunnable);
|
||||
svgaImageViewHashMap.clear();
|
||||
pa_pao_layout.removeAllViews();
|
||||
timeHandler.removeCallbacks(timeRunnable);
|
||||
@ -2574,9 +2576,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setHotNum(String hotNum) {
|
||||
setHotData(formatBigNum.formatBigNum(hotNum));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新心愿单进度
|
||||
*
|
||||
@ -4283,7 +4287,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
bean1.setId(Integer.parseInt(giftModel.getId()));
|
||||
bean1.setName(giftModel.getGiftname());
|
||||
bean1.setTag("1");
|
||||
|
||||
bean1.setPrice(WordUtil.isNewZh() ? "免费" : "free");
|
||||
if (!IMLoginManager.get(mContext).isisNewUserOne()) {
|
||||
if (TextUtils.equals(taskModel.getSendgift(), "0")) {
|
||||
IMLoginManager.get(mContext).setNewUserGif(true);
|
||||
@ -5010,6 +5014,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
public void upDataPkScore(JSONArray pkScores, int time) {
|
||||
|
||||
isShowGif = true;
|
||||
if (detailsView == null) {
|
||||
detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||
@ -5050,9 +5055,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
countdownHandler.removeCallbacks(countdownRunnable);
|
||||
if (time > 0) {
|
||||
mPkTimeCount = time;
|
||||
timeTitle.setVisibility(View.VISIBLE);
|
||||
countdownHandler.post(countdownRunnable);
|
||||
}
|
||||
|
||||
}
|
||||
Log.e("多人Pk", "upDataPkScore mPkTimeCount:" +mPkTimeCount);
|
||||
for (int i = 0; i < pkScores.size(); i++) {
|
||||
JSONObject score = pkScores.getJSONObject(i);
|
||||
String userNiceName = score.getString("user_nicename");
|
||||
@ -5116,11 +5126,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
|
||||
if (time > 0) {
|
||||
mPkTimeCount = time;
|
||||
timeTitle.setVisibility(View.VISIBLE);
|
||||
countdownHandler.postAtTime(countdownRunnable, getNextSecondTime());
|
||||
}
|
||||
|
||||
textPkName2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@ -5147,8 +5153,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
public void run() {
|
||||
mPkTimeCount--;
|
||||
if (mPkTimeCount > 0) {//
|
||||
Log.e("多人Pk", "countdownRunnable mPkTimeCount:" +mPkTimeCount);
|
||||
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
||||
textTime.setText(String.format(mContext.getString(R.string.pk_time), s1));
|
||||
Log.e("多人Pk", "countdownRunnable s1:" +s1);
|
||||
countdownHandler.postAtTime(countdownRunnable, getNextSecondTime());
|
||||
} else {
|
||||
mPkTimeCount = 0;
|
||||
|
@ -56,7 +56,6 @@ import com.yunbao.common.event.LiveFloatEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.QuickGiftingEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
@ -243,15 +242,17 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}
|
||||
|
||||
public void setGiftRemainingQuantity(String giftRemainingQuantity) {
|
||||
if (mLiveAudienceViewHolder!=null){
|
||||
if (mLiveAudienceViewHolder != null) {
|
||||
mLiveAudienceViewHolder.setGiftRemainingQuantity(giftRemainingQuantity);
|
||||
}
|
||||
}
|
||||
|
||||
public void setHotNum(String hotNum) {
|
||||
if (mLiveRoomViewHolder!=null){
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.setHotNum(hotNum);
|
||||
}
|
||||
}
|
||||
|
||||
public PortraitLiveManager(Activity context, Intent intent) {
|
||||
this.mContext = context;
|
||||
this.mIntent = intent;
|
||||
@ -448,6 +449,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
public void run() {
|
||||
//加入房间发送Im消息
|
||||
LiveNetManager.get(mContext).userJoinRoomNew(mLiveBean.getStream(), mLiveBean.getUid());
|
||||
Log.e("观看时长","userJoinRoomNew-----------------------"+mLiveBean.getUid());
|
||||
}
|
||||
};
|
||||
|
||||
@ -460,6 +462,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
.enterRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), mLiveBean.getCity(), new com.yunbao.common.http.base.HttpCallback<EnterRoomNewModel>() {
|
||||
@Override
|
||||
public void onSuccess(EnterRoomNewModel data) {
|
||||
Log.e("观看时长","enterRoomNew-----------------------"+ mLiveBean.getUid());
|
||||
isEnterRoom = true;
|
||||
if (TextUtils.isEmpty(leaveStream)) {
|
||||
leaveStream = mLiveBean.getStream();
|
||||
@ -687,6 +690,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
}
|
||||
|
||||
upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time"));
|
||||
Log.e("多人Pk", "enterRoomNew drpk_time:" + pkInfo.getIntValue("drpk_time"));
|
||||
}
|
||||
// mLivePlayViewHolder.setLayoutInterface(new LivePlayRyViewHolder.PlayViewLayoutInterface() {
|
||||
// @Override
|
||||
@ -809,6 +813,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
@Override
|
||||
public void onRemove(boolean isQuit) {
|
||||
Log.e("直播间接口调用排查", "onRemove---------------");
|
||||
LiveNetManager.get(mContext).cancelLive();
|
||||
liveHandler.removeCallbacks(sendFIm);
|
||||
linkMicPkStartHandler.removeCallbacks(linkMicPkStartRunnable);
|
||||
@ -1846,14 +1851,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
if (!isEnterRoom) {
|
||||
return;
|
||||
}
|
||||
if (mLiveBean != null) {
|
||||
isEnterRoom = false;
|
||||
|
||||
RongChatRoomClient.getInstance().quitChatRoom("g" + mLiveBean.getUid(), new IRongCoreCallback.OperationCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
try {
|
||||
Log.i("tx", "退出成功" + mLiveBean.getUid());
|
||||
LiveNetManager.get(mContext)
|
||||
.leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() {
|
||||
@Override
|
||||
@ -1867,6 +1864,15 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
});
|
||||
leaveStream = "";
|
||||
leaveGroupId = "";
|
||||
if (mLiveBean != null) {
|
||||
isEnterRoom = false;
|
||||
|
||||
RongChatRoomClient.getInstance().quitChatRoom("g" + mLiveBean.getUid(), new IRongCoreCallback.OperationCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
try {
|
||||
Log.i("tx", "退出成功" + mLiveBean.getUid());
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -1878,19 +1884,19 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
|
||||
try {
|
||||
|
||||
Log.i("tx", "退出成功" + mLiveBean.getUid());
|
||||
LiveNetManager.get(mContext)
|
||||
.leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
}
|
||||
});
|
||||
leaveStream = "";
|
||||
leaveGroupId = "";
|
||||
// Log.i("tx", "退出成功" + mLiveBean.getUid());
|
||||
// LiveNetManager.get(mContext)
|
||||
// .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() {
|
||||
// @Override
|
||||
// public void onSuccess(String data) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(String error) {
|
||||
// }
|
||||
// });
|
||||
// leaveStream = "";
|
||||
// leaveGroupId = "";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -63,8 +63,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp" />
|
||||
android:textSize="9sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -40,6 +40,8 @@ public class GoogleFragment extends Fragment {
|
||||
|
||||
GoogleUtils googleUtils;
|
||||
|
||||
boolean isGoogleService = true;
|
||||
|
||||
public GoogleFragment() {
|
||||
}
|
||||
|
||||
@ -59,8 +61,14 @@ public class GoogleFragment extends Fragment {
|
||||
rlWebview = (WebView) view.findViewById(R.id.rlWebview);
|
||||
Log.e("ttt", url);
|
||||
rlWebview.loadUrl(url);
|
||||
initGooglePay();
|
||||
|
||||
googleUtils = new GoogleUtils(getActivity());
|
||||
|
||||
// 验证是否已在此设备上安装并启用Google Play服务,以及此设备上安装的旧版本是否为此客户端所需的版本
|
||||
if (googleUtils.getGoogleService()) {
|
||||
isGoogleService = true;
|
||||
// 支持Google服务
|
||||
initGooglePay();
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -68,7 +76,6 @@ public class GoogleFragment extends Fragment {
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
WebSettings webSettings = rlWebview.getSettings();
|
||||
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
|
@ -91,7 +91,6 @@ import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.GoogleUtils;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.LocationUtil;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
@ -511,6 +510,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
findViewById(R.id.banner_click).setVisibility(View.GONE);
|
||||
isfloatBannernet = false;
|
||||
}
|
||||
mViewHolders[index].onResume();
|
||||
});
|
||||
//获取指导员账号
|
||||
ConversationIMListManager.get(this).getUserInstructor(this);
|
||||
@ -860,7 +860,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
NoviceInstructorManager.get(mContext).getNoviceInstructor();
|
||||
NoviceInstructorManager.get(mContext).checktHomeZdyPop();
|
||||
initAnchorRecommendBanner();
|
||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1302,7 +1301,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
messageNumber = event.getNumber();
|
||||
if (event.getNumber() > 0) {
|
||||
v_table_redpoint.setVisibility(View.VISIBLE);
|
||||
if (event.getNumber() > 99) {
|
||||
v_table_redpoint.setText("99+");
|
||||
} else {
|
||||
v_table_redpoint.setText(event.getNumber() + "");
|
||||
}
|
||||
|
||||
} else {
|
||||
v_table_redpoint.setVisibility(View.GONE);
|
||||
v_table_redpoint.setText("");
|
||||
|
@ -17,6 +17,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
@ -55,6 +56,7 @@ import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.views.LoadingView;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
@ -101,7 +103,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
Bus.getOn(this);
|
||||
String url = HtmlConfig.ENCOURAGE + "?t=" + Math.random() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()
|
||||
+ "&isZh=" + ((IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0");
|
||||
// String url = "https://coolshi.feioou.com/testAndroid.html";
|
||||
// String url = "https://api.coolydrama.com/?agentCode=186279";
|
||||
final LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView);
|
||||
mProgressBar = (ProgressBar) findViewById(R.id.progressbar);
|
||||
mWebView = new WebView(mContext);
|
||||
@ -118,6 +120,12 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
|
||||
mWebView.getSettings().setJavaScriptEnabled(true);
|
||||
mWebView.getSettings().setDomStorageEnabled(true);
|
||||
CookieManager cookieManager = CookieManager.getInstance();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
cookieManager.setAcceptThirdPartyCookies(mWebView, true);
|
||||
} else {
|
||||
cookieManager.setAcceptCookie(true);
|
||||
}
|
||||
String appCachePath = mContext.getCacheDir().getAbsolutePath();
|
||||
// mWebView.getSettings().setAppCachePath(appCachePath);
|
||||
mWebView.getSettings().setAllowFileAccess(true);
|
||||
@ -399,6 +407,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
public void onSuccess(CoolConfig data) {
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.autoOpenSoftInput(false)
|
||||
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
|
||||
.asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() {
|
||||
@Override
|
||||
@ -417,6 +426,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
|
||||
}
|
||||
});
|
||||
} else if (TextUtils.equals(data, "1")) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "兑换成功" : "Successful exchange");
|
||||
mWebView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -46,6 +46,7 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.LiveClassManager;
|
||||
import com.yunbao.common.manager.OpenAdManager;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
@ -557,6 +558,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
OpenAdManager.getInstance().show(OpenAdManager.TYPE_HOME, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -104,6 +104,12 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mViewHolders[mViewPager.getCurrentItem()].onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPageCount() {
|
||||
return 4;
|
||||
|
@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
@ -29,10 +30,12 @@ import com.yunbao.common.bean.ImUserInfoModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NoviceInstructorManager;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.views.AbsMainViewHolder;
|
||||
@ -41,8 +44,6 @@ import com.yunbao.live.activity.SystemMessageActivity;
|
||||
import com.yunbao.live.bean.ImUserBean;
|
||||
import com.yunbao.live.event.RecommendLiveRoomEvent;
|
||||
import com.yunbao.live.http.ImHttpUtil;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.activity.MainActivity;
|
||||
import com.yunbao.main.adapter.SystemMessageAdapter;
|
||||
@ -229,7 +230,15 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textNewsNotice.setVisibility(View.GONE);
|
||||
} else {
|
||||
textNewsNotice.setVisibility(View.VISIBLE);
|
||||
textNewsNotice.setText(userBean.getNum());
|
||||
int numberInt = Integer.parseInt(userBean.getNum());
|
||||
if (numberInt > 99) {
|
||||
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsNotice.setText("99+");
|
||||
} else {
|
||||
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsNotice.setText(String.valueOf(numberInt));
|
||||
}
|
||||
|
||||
}
|
||||
ImgLoader.display(mContext, userBean.getNewImage(), imgNewsNotice);
|
||||
ViewClicksAntiShake.clicksAntiShake(imgNewsNotice, () -> {
|
||||
@ -249,7 +258,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textNewsInteraction.setVisibility(View.GONE);
|
||||
} else {
|
||||
textNewsInteraction.setVisibility(View.VISIBLE);
|
||||
textNewsInteraction.setText(userBean.getNum());
|
||||
int numberInt = Integer.parseInt(userBean.getNum());
|
||||
if (numberInt > 99) {
|
||||
textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsInteraction.setText("99+");
|
||||
} else {
|
||||
textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsInteraction.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, userBean.getNewImage(), imgNewsInteraction);
|
||||
ViewClicksAntiShake.clicksAntiShake(imgNewsInteraction, () -> {
|
||||
@ -269,7 +285,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textNewsOnline.setVisibility(View.GONE);
|
||||
} else {
|
||||
textNewsOnline.setVisibility(View.VISIBLE);
|
||||
textNewsOnline.setText(userBean.getNum());
|
||||
int numberInt = Integer.parseInt(userBean.getNum());
|
||||
if (numberInt > 99) {
|
||||
textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsOnline.setText("99+");
|
||||
} else {
|
||||
textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsOnline.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, userBean.getNewImage(), imgNewsOnline);
|
||||
ViewClicksAntiShake.clicksAntiShake(imgNewsOnline, () -> {
|
||||
@ -295,7 +318,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textSystemMessages.setVisibility(View.GONE);
|
||||
} else {
|
||||
textSystemMessages.setVisibility(View.VISIBLE);
|
||||
textSystemMessages.setText(userBean.getNum());
|
||||
int numberInt = Integer.parseInt(userBean.getNum());
|
||||
if (numberInt > 99) {
|
||||
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textSystemMessages.setText("99+");
|
||||
} else {
|
||||
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textSystemMessages.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, userBean.getNewImage(), imgSystemMessages);
|
||||
ViewClicksAntiShake.clicksAntiShake(imgSystemMessages, () -> {
|
||||
@ -402,11 +432,18 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
textNewsNotice.setText("");
|
||||
} else {
|
||||
String number = textNewsNotice.getText().toString().trim();
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
textNewsNotice.setVisibility(View.VISIBLE);
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
if (numberInt > 99) {
|
||||
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsNotice.setText("99+");
|
||||
} else {
|
||||
textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsNotice.setText(String.valueOf(numberInt));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
//互動消息
|
||||
case "2":
|
||||
@ -417,8 +454,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
String number = textNewsInteraction.getText().toString().trim();
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
textNewsInteraction.setVisibility(View.VISIBLE);
|
||||
if (numberInt > 99) {
|
||||
textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsInteraction.setText("99+");
|
||||
} else {
|
||||
textNewsInteraction.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsInteraction.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
@ -431,8 +474,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
String number = textNewsOnline.getText().toString().trim();
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
textNewsOnline.setVisibility(View.VISIBLE);
|
||||
if (numberInt > 99) {
|
||||
textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textNewsOnline.setText("99+");
|
||||
} else {
|
||||
textNewsOnline.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textNewsOnline.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
break; //在線客服
|
||||
case "4":
|
||||
if (textSystemMessages.getVisibility() == View.GONE) {
|
||||
@ -442,8 +491,14 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
|
||||
String number = textSystemMessages.getText().toString().trim();
|
||||
int numberInt = Integer.parseInt(number) + 1;
|
||||
textSystemMessages.setVisibility(View.VISIBLE);
|
||||
if (numberInt > 99) {
|
||||
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
textSystemMessages.setText("99+");
|
||||
} else {
|
||||
textSystemMessages.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
|
||||
textSystemMessages.setText(String.valueOf(numberInt));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
systemNumber = systemNumber + 1;
|
||||
|
@ -8,7 +8,7 @@
|
||||
android:id="@+id/rootView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="45dp"
|
||||
android:layout_marginBottom="68dp"
|
||||
android:orientation="vertical" />
|
||||
|
||||
<ProgressBar
|
||||
|
@ -52,8 +52,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_news_notice"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
@ -81,8 +81,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_system_messages"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
@ -108,8 +108,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_news_interaction"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
@ -135,8 +135,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_news_online"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="17dp"
|
||||
|
Loading…
Reference in New Issue
Block a user