This commit is contained in:
18142669586
2022-07-27 20:44:55 +08:00
parent 8b9d10ca92
commit 1fc6a3adfe
20 changed files with 124 additions and 54 deletions

View File

@@ -858,7 +858,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
* 打开聊天输入框
*/
public void openChatWindow() {
if ("1".equals(Constants.isSend)) {
// if ("1".equals(Constants.isSend)) {
if (mKeyBoardHeightUtil == null) {
mKeyBoardHeightUtil = new KeyBoardHeightUtil2(mContext, super.findViewById(android.R.id.content), this);
mKeyBoardHeightUtil.start();
@@ -872,9 +872,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
bundle.putString(Constants.COIN_NAME, mCoinName);
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveInputDialogFragment");
} else {
showTaskDialog();
}
// } else {
// showTaskDialog();
// }
}
private void showTaskDialog() {

View File

@@ -275,7 +275,6 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
if (bundle != null) {
mLiveUid = bundle.getString(Constants.LIVE_UID);
mStream = bundle.getString(Constants.LIVE_STREAM);
ToastUtil.show(""+ bundle.getString(Constants.LIVE_WISH_GIFTID));
mWishGiftId = bundle.getString(Constants.LIVE_WISH_GIFTID);
by = bundle.getString("by");
}
@@ -428,9 +427,8 @@ public class LiveGiftDialogFragment extends AbsDialogFragment implements View.On
private void showGiftList(List<LiveGiftBean> list) {
if (IMLoginManager.get(mContext).isNewUserGif() == true && type_name.equals("熱門")|| type_name.equals("Hot")) {
list.add(0, bean1);
if(mWishGiftId==null) {
mWishGiftId = "" + bean1.getId();
}
}

View File

@@ -59,6 +59,7 @@ public class LivePromotionDialogFragment extends AbsDialogFragment {
mRefreshView = mRootView.findViewById(R.id.refreshView);
livePromotionAdapter = new LivePromotionAdapter(mContext, LiveActivity.mLiveUid,this );
mRefreshView.setLayoutManager(new GridLayoutManager(mContext, 4));
mRefreshView.setLoadMoreEnable(false);
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<LivePromotionBean>() {
@Override
public RefreshAdapter<LivePromotionBean> getAdapter() {
@@ -89,7 +90,7 @@ public class LivePromotionDialogFragment extends AbsDialogFragment {
@Override
public void onLoadMoreSuccess(List<LivePromotionBean> loadItemList, int loadItemCount) {
livePromotionAdapter.insertList(loadItemList);
// livePromotionAdapter.insertList(loadItemList);
}

View File

@@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
@@ -111,6 +112,7 @@ public class NewUserDialog extends AbsDialogFragment {
public void onClick(View view) {
EventBus.getDefault().post("showBanner");
EventBus.getDefault().post("svga_new_user_gif");
IMLoginManager.get(mContext).setNewUserGif(true);
countDownTimer.cancel();
dismiss();
}

View File

@@ -299,7 +299,8 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
public void onSuccess(int code, String msg, String[] info) {
JSONObject old_obj = JSON.parseObject(info[0]);
JSONObject obj = old_obj.getJSONObject("task");
JSONObject obj = old_obj.getJSONObject("task");
if (obj != null) {
JSONObject obj1 = old_obj.getJSONObject("gift");
JSONObject reward_one = old_obj.getJSONObject("reward_one");
@@ -313,8 +314,8 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
bean1.setName(obj1.getString("giftname"));
bean1.setTag("1");
if( IMLoginManager.get(mContext).isisNewUserOne() == false) {
if(obj.getString("sendgift").equals("0")) {
if (IMLoginManager.get(mContext).isisNewUserOne() == false) {
if (obj.getString("sendgift").equals("0")) {
EventBus.getDefault().post("svga_new_user_gif");
}
}
@@ -324,7 +325,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
mBannerList3.add(banner3Bean);
BannerBean banner3Bean1 = new BannerBean();
banner3Bean1.setImageUrl("https://qny.shayucm.com/live_Mission_box.png");
banner3Bean1.setLink(obj.getString("attent"));
@@ -335,14 +335,15 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
banner3Bean2.setLink(obj.getString("illumine"));
mBannerList3.add(banner3Bean2);
if(obj.getString("sendgift").equals("0")&& IMLoginManager.get(context).isisNewUserOne() == false) {
if (obj.getString("sendgift").equals("0") && IMLoginManager.get(context).isisNewUserOne() == false) {
showBanner3();
}else if(obj.getString("attent").equals("0")&& IMLoginManager.get(context).isisNewUserOne() == false){
} else if (obj.getString("attent").equals("0") && IMLoginManager.get(context).isisNewUserOne() == false) {
showBanner3();
}else if(obj.getString("illumine").equals("0")&& IMLoginManager.get(context).isisNewUserOne()== false){
} else if (obj.getString("illumine").equals("0") && IMLoginManager.get(context).isisNewUserOne() == false) {
showBanner3();
}
}
}
});

View File

@@ -0,0 +1,47 @@
package com.yunbao.live.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.widget.TextView;
@SuppressLint("AppCompatCustomView")
public class CenterTextView extends TextView {
private StaticLayout mStaticLayout;
private TextPaint mTextPaint;
public CenterTextView(Context context) {
super(context);
}
public CenterTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CenterTextView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
initView();
}
private void initView() {
mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
mTextPaint.setTextSize(getTextSize());
mTextPaint.setColor(getCurrentTextColor());
mStaticLayout = new StaticLayout(getText(), mTextPaint, getWidth(), Layout.Alignment.ALIGN_CENTER, 1.0f, 0.0f, false);
}
@Override
protected void onDraw(Canvas canvas) {
mStaticLayout.draw(canvas);
}
}

View File

@@ -23,9 +23,10 @@
android:text="Task 1"
android:textColor="#ffffffff"
android:textSize="8sp"
android:layout_marginBottom="3dp"
/>
<TextView
<com.yunbao.live.utils.CenterTextView
android:id="@+id/task_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View File

@@ -2,8 +2,8 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="40dp"
android:paddingRight="40dp">
android:paddingLeft="53dp"
android:paddingRight="53dp">
<LinearLayout
@@ -14,8 +14,8 @@
android:orientation="vertical">
<TextView
android:layout_marginTop="220dp"
android:layout_width="133dp"
android:layout_marginTop="210dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/welcome_pdlive"
android:layout_gravity="center"
@@ -33,9 +33,8 @@
android:layout_gravity="center"
android:textStyle="bold"
android:gravity="center"
android:textSize="18sp"
android:layout_marginTop="10dp"
/>
android:textSize="20sp"
android:layout_marginTop="5dp"/>
<RelativeLayout android:id="@+id/btn_rose"
android:layout_width="match_parent"
@@ -47,10 +46,11 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="一次免費贈送禮物特權!"
android:text="@string/one_free"
android:textColor="#ffffffff"
android:textSize="13sp"
android:textSize="15sp"
android:textStyle="bold"
android:paddingLeft="40dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
/>
@@ -93,6 +93,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textStyle="bold"
android:textColor="#fffff69f"
android:textSize="12sp"
/>
@@ -130,6 +131,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textStyle="bold"
android:textColor="#fffff69f"
android:textSize="12sp"
/>
@@ -145,7 +147,7 @@
android:text="@string/new_rewards"
android:textColor="#ffb3b3b3"
android:textSize="10sp"
android:layout_marginTop="10dp"
android:layout_marginTop="18dp"
/>
<TextView android:id="@+id/btn_confirm"
android:layout_width="match_parent"

View File

@@ -75,9 +75,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
app:delay_time="5000"
app:indicator_drawable_selected="@drawable/bg_home_indicator_selected"
app:indicator_drawable_unselected="@drawable/bg_home_indicator_unselected"
app:indicator_height="8dp"
app:indicator_width="8dp" />