Merge remote-tracking branch 'origin/master'

This commit is contained in:
18142669586 2022-09-16 14:21:50 +08:00
commit 5e581dd65e
92 changed files with 3396 additions and 88 deletions

View File

@ -171,7 +171,7 @@ dependencies {
api 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
//gson解析
api 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation "io.reactivex.rxjava3:rxjava:3.0.0-RC5"
implementation "io.reactivex.rxjava2:rxjava:2.2.3"
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
api 'com.jakewharton.rxbinding3:rxbinding:3.1.0'
//loading样式库

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -11,6 +11,7 @@ import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.yunbao.common.R;
@ -128,7 +129,8 @@ public class ImgLoader {
if (!contextIsExist(context)) {
return;
}
Glide.with(context).asDrawable().load(url).skipMemoryCache(SKIP_MEMORY_CACHE).into(new SimpleTarget<Drawable>() {
Glide.with(context).asDrawable().load(url).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
if (callback != null) {
@ -137,12 +139,29 @@ public class ImgLoader {
}
@Override
public void onLoadFailed(@Nullable Drawable errorDrawable) {
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
}
public static void displayFileDrawable(Context context, File file, final DrawableCallback callback) {
if (!contextIsExist(context)) {
return;
}
Glide.with(context).asDrawable().load(file).skipMemoryCache(SKIP_MEMORY_CACHE).into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
if (callback != null) {
callback.onLoadFailed();
callback.onLoadSuccess(resource);
}
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
}

View File

@ -5,8 +5,13 @@ import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.provider.MediaStore;
import com.bumptech.glide.Glide;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
@ -16,6 +21,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.ref.SoftReference;
import java.util.concurrent.ExecutionException;
/**
* Created by cxf on 2018/6/22.
@ -138,4 +144,55 @@ public class BitmapUtil {
e.printStackTrace();
}
}
/**
* 转圆形图片
*
* @param context
* @param url
* @param width
* @param height
* @param radius
* @return
*/
public Bitmap getBitmap(Context context, String url, int width, int height, int radius) {
Bitmap myBitmap = null;
try {
myBitmap = Glide.with(context)
.asBitmap()
.load(url)
.submit(width, height).get();
Bitmap bitmap = Bitmap.createBitmap(myBitmap, 0, 0, myBitmap.getWidth(), myBitmap.getHeight());
return toRoundBitmap(bitmap, width, height, radius);
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
return null;
}
/***
* 转圆形图片
* @param bitmap
* @param width
* @param height
* @param radius
* @return
*/
public Bitmap toRoundBitmap(Bitmap bitmap, int width, int height, int radius) {
// 前面同上绘制图像分别需要bitmapcanvaspaint对象
bitmap = Bitmap.createScaledBitmap(bitmap, width, height, true);
Bitmap bm = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bm);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
// 这里需要先画出一个圆
canvas.drawCircle(width / 2, height / 2, radius, paint);
// 圆画好之后将画笔重置一下
paint.reset();
// 设置图像合成模式该模式为只在源图像和目标图像相交的地方绘制源图像
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(bitmap, 0, 0, paint);
return bm;
}
}

View File

@ -120,8 +120,6 @@ public class FullServiceNotificationView extends FrameLayout {
private void setFullServiceStart(String svgaName) {
svagaBc.setCallback(svgaCallback);
svagaBc.setLoops(1);
svagaBc.startAnimation();
new SVGAParser(mContext)
.decodeFromAssets(svgaName, new SVGAParser.ParseCompletion() {
@Override
@ -138,6 +136,7 @@ public class FullServiceNotificationView extends FrameLayout {
} catch (Exception e) {
e.printStackTrace();
}
svagaBc.setLoops(1);
svagaBc.startAnimation();
}

View File

@ -0,0 +1,402 @@
package com.yunbao.common.views.weight;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;
import android.widget.FrameLayout;
import android.widget.HorizontalScrollView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.opensource.svgaplayer.SVGACallback;
import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGADynamicEntity;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.R;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.BitmapUtil;
import org.jetbrains.annotations.NotNull;
import java.lang.reflect.Field;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* 开通贵族的通知
*/
public class NobleNoticeView extends FrameLayout {
private Context mContext;
private View rootView;
private SVGAImageView svagaBc;
private RelativeLayout rootLayout;
private long animationTime = 8000;
private TextView gotoRoomView, nobleNickname;
private String mSvgaName;
private RoleType roleType;
private HorizontalScrollView contextLayout;
private RelativeLayout scrollLayout;
private ImageView nobleIcon;
public NobleNoticeView(@NonNull Context context) {
super(context);
init(context);
}
public NobleNoticeView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init(context);
}
public NobleNoticeView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
private void init(Context context) {
mContext = context;
rootView = LayoutInflater.from(mContext).inflate(R.layout.view_noble_notice, this, true);
svagaBc = rootView.findViewById(R.id.svaga_bc);
rootLayout = rootView.findViewById(R.id.root_layout);
gotoRoomView = rootView.findViewById(R.id.goto_room_view);
contextLayout = rootView.findViewById(R.id.context_layout);
scrollLayout = rootView.findViewById(R.id.scroll_layout);
nobleIcon = rootView.findViewById(R.id.noble_icon);
nobleNickname = rootView.findViewById(R.id.noble_nickname);
contextLayout.setVisibility(GONE);
gotoRoomView.setVisibility(GONE);
}
/**
* 设置展示的类型
*
* @param roleType
* @return
*/
public NobleNoticeView setRoleType(RoleType roleType) {
this.roleType = roleType;
// setButtonPosition(roleType);
switch (roleType) {
//男爵
case BARON:
nobleNoticeStart("icon_noble_nanjue.svga");
break;
//子爵
case VISCOUNT:
nobleNoticeStart("icon_noble_zijue.svga");
break;
//侯爵
case MARQUIS:
nobleNoticeStart("icon_noble_houjue.svga");
break;
//公爵
case DUKE:
nobleNoticeStart("icon_noble_gongjue.svga");
break;
//国王
case KING:
nobleNoticeStart("icon_noble_guowang.svga");
break;
//皇帝
case EMPEROR:
nobleNoticeStart("icon_noble_huangdi.svga");
break;
//超皇
case BETTER_EMPEROR:
nobleNoticeStart("icon_noble_chaohuang.svga");
break;
}
return this;
}
private void nobleNoticeStart(String svgaName) {
svagaBc.setCallback(svgaCallback);
mSvgaName = svgaName;
observable.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(observer);
}
/**
* 子线程处理用户头像
*/
private Observable<Bitmap> observable = Observable.create(new ObservableOnSubscribe<Bitmap>() {
@Override
public void subscribe(ObservableEmitter<Bitmap> emitter) throws Exception {
Bitmap bitmap = BitmapUtil.getInstance()
.getBitmap(mContext,
"https://downs.yaoulive.com/20220818/372776fa38774814d601e68fcfc70f35.jpeg?imageView2/2/w/600/h/600",
174,
174,
87);
emitter.onNext(bitmap);
}
});
/**
* 线程调度展示SVGA
*/
private Observer<Bitmap> observer = new Observer<Bitmap>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(Bitmap bitmap) {
new SVGAParser(mContext)
.decodeFromAssets(mSvgaName, new SVGAParser.ParseCompletion() {
@Override
public void onComplete(@NotNull SVGAVideoEntity svgaVideoEntity) {
svagaBc.setVisibility(VISIBLE);
SVGADynamicEntity dynamicEntity = new SVGADynamicEntity();
dynamicEntity.setDynamicImage(bitmap, "psd_31");
SVGADrawable imageView = new SVGADrawable(svgaVideoEntity, dynamicEntity);
svagaBc.setImageDrawable(imageView);
try {
Field mAnimator = svagaBc.getClass().getDeclaredField("mAnimator");
mAnimator.setAccessible(true);
ValueAnimator animator = (ValueAnimator) mAnimator.get(svagaBc);
animationTime = animator.getDuration();
System.out.println("播放时间 = " + animator.getDuration());
} catch (Exception e) {
e.printStackTrace();
}
svagaBc.setLoops(1);
svagaBc.startAnimation();
}
@Override
public void onError() {
}
}, null);
}
@Override
public void onError(Throwable e) {
}
@Override
public void onComplete() {
}
};
/**
* SVGA播放监听
*/
private SVGACallback svgaCallback = new SVGACallback() {
@Override
public void onPause() {
}
@Override
public void onFinished() {
svagaBc.clear();
svagaBc.setVisibility(GONE);
contextLayout.setVisibility(GONE);
gotoRoomView.setVisibility(GONE);
}
@Override
public void onRepeat() {
}
@Override
public void onStep(int frame, double v) {
System.out.println("frame = " + frame);
if (frame == 10) {
setButtonPosition(roleType);
observable.observeOn(AndroidSchedulers.mainThread())
.subscribe(bitmap -> {
TranslateAnimation animationTranslate = new TranslateAnimation(0, -scrollLayout.getMeasuredWidth(), 0, 0);
AnimationSet animationSet1 = new AnimationSet(true);
animationSet1.addAnimation(animationTranslate);
animationSet1.setFillAfter(true);
animationSet1.setDuration((animationTime - 1000) / 2);
animationSet1.setAnimationListener(animationListener);
scrollLayout.startAnimation(animationSet1);
}, throwable -> {
}).isDisposed();
}
if (frame == 150) {
contextLayout.setVisibility(GONE);
gotoRoomView.setVisibility(GONE);
scrollLayout.clearAnimation();
}
}
};
//设置围观按钮/文字內容位置
private void setButtonPosition(RoleType roleType) {
rootLayout.post(() -> {
int measuredHeight = rootLayout.getMeasuredHeight();
int measuredWidth = rootLayout.getMeasuredWidth();
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) gotoRoomView.getLayoutParams();
RelativeLayout.LayoutParams contextLayoutParams = (RelativeLayout.LayoutParams) contextLayout.getLayoutParams();
switch (roleType) {
case BARON:
layoutParams.rightMargin = measuredWidth / 7;
layoutParams.topMargin = measuredHeight / 12 * 5;
contextLayoutParams.leftMargin = (int) (measuredWidth / 13 * 3.5);
contextLayoutParams.topMargin = measuredHeight / 12 * 5;
gotoRoomView.setBackgroundResource(R.drawable.background_baron_station_horn);
ImgLoader.display(mContext, R.mipmap.icon_open_nanjue, nobleIcon);
nobleNickname.setText(R.string.baron);
break;
case VISCOUNT:
layoutParams.rightMargin = measuredWidth / 7;
layoutParams.topMargin = measuredHeight / 15 * 6;
contextLayoutParams.leftMargin = measuredWidth / 15 * 4;
contextLayoutParams.topMargin = measuredHeight / 15 * 6;
gotoRoomView.setBackgroundResource(R.drawable.background_viscount_station_horn);
ImgLoader.display(mContext, R.mipmap.icon_open_zijue, nobleIcon);
nobleNickname.setText(R.string.viscount);
break;
case MARQUIS:
layoutParams.rightMargin = measuredWidth / 6;
layoutParams.topMargin = measuredHeight / 15 * 6;
contextLayoutParams.leftMargin = measuredWidth / 15 * 4;
contextLayoutParams.topMargin = measuredHeight / 15 * 6;
gotoRoomView.setBackgroundResource(R.drawable.background_marquis_station_horn);
ImgLoader.display(mContext, R.mipmap.icon_open_houjue, nobleIcon);
nobleNickname.setText(R.string.marquis);
break;
case DUKE:
layoutParams.rightMargin = measuredWidth / 6;
layoutParams.topMargin = measuredHeight / 15 * 6;
contextLayoutParams.leftMargin = measuredWidth / 15 * 4;
contextLayoutParams.topMargin = measuredHeight / 15 * 6;
gotoRoomView.setBackgroundResource(R.drawable.background_duke_station_horn);
ImgLoader.display(mContext, R.mipmap.icon_open_gongjue, nobleIcon);
nobleNickname.setText(R.string.duke);
break;
case KING:
layoutParams.rightMargin = measuredWidth / 6;
layoutParams.topMargin = measuredHeight / 15 * 6;
contextLayoutParams.leftMargin = (int) (measuredWidth / 15 * 4.2);
contextLayoutParams.topMargin = measuredHeight / 15 * 6;
gotoRoomView.setBackgroundResource(R.drawable.background_duke_king_horn);
ImgLoader.display(mContext, R.mipmap.icon_open_guowang, nobleIcon);
nobleNickname.setText(R.string.king);
break;
case EMPEROR:
layoutParams.rightMargin = measuredWidth / 5;
layoutParams.topMargin = measuredHeight / 15 * 7;
contextLayoutParams.leftMargin = (int) (measuredWidth / 15 * 4.2);
contextLayoutParams.topMargin = measuredHeight / 15 * 7;
gotoRoomView.setBackgroundResource(R.drawable.background_duke_king_horn);
ImgLoader.display(mContext, R.mipmap.icon_open_huangdi, nobleIcon);
nobleNickname.setText(R.string.emperor);
break;
case BETTER_EMPEROR:
layoutParams.rightMargin = measuredWidth / 5;
layoutParams.topMargin = (int) (measuredHeight / 15 * 6.7);
contextLayoutParams.leftMargin = (int) (measuredWidth / 15 * 4.5);
contextLayoutParams.topMargin = (int) (measuredHeight / 15 * 6.5);
gotoRoomView.setBackgroundResource(R.drawable.background_duke_king_horn);
ImgLoader.display(mContext, R.mipmap.icon_open_chaohuang, nobleIcon);
nobleNickname.setText(R.string.better_emperor);
break;
}
gotoRoomView.setLayoutParams(layoutParams);
contextLayout.setLayoutParams(contextLayoutParams);
contextLayout.setVisibility(VISIBLE);
gotoRoomView.setVisibility(VISIBLE);
});
}
Animation.AnimationListener animationListener = new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
scrollLayout.clearAnimation();
if (svagaBc.isAnimating()) {
TranslateAnimation animationTranslate = new TranslateAnimation(0, -scrollLayout.getMeasuredWidth(), 0, 0);
AnimationSet animationSet1 = new AnimationSet(true);
animationSet1.addAnimation(animationTranslate);
animationSet1.setFillAfter(true);
animationSet1.setDuration((animationTime - 600) / 2);
animationSet1.setAnimationListener(animationListener);
scrollLayout.startAnimation(animationSet1);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
};
public enum RoleType {
BARON("男爵", 1),
VISCOUNT("子爵", 2),
MARQUIS("侯爵", 3),
DUKE("公爵", 4),
KING("国王", 5),
EMPEROR("皇帝", 6),
BETTER_EMPEROR("超皇", 7);
private String name;
private int type;
RoleType(String name, int type) {
this.name = name;
this.type = type;
}
public String getName() {
return name;
}
public RoleType setName(String name) {
this.name = name;
return this;
}
public int getType() {
return type;
}
public RoleType setType(int type) {
this.type = type;
return this;
}
}
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="11dp" />
<stroke android:width="1dp" android:color="@color/white" />
<gradient android:angle="360" android:endColor="#D8A0FE" android:startColor="#7683D9" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="11dp" />
<stroke android:width="1dp" android:color="@color/white" />
<gradient android:angle="360" android:endColor="#FF544F" android:startColor="#FAD126" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="11dp" />
<stroke android:width="1dp" android:color="@color/white" />
<gradient android:angle="360" android:endColor="#18A86B" android:startColor="#2FB383" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="11dp" />
<stroke android:width="1dp" android:color="@color/white" />
<gradient android:angle="360" android:endColor="#4760FF" android:startColor="#0DCCFF" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="11dp" />
<stroke android:width="1dp" android:color="@color/white" />
<gradient android:angle="360" android:endColor="#0DE3AC" android:startColor="#98E05F" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,285 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_live_tota"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="30dp"
android:text="@string/value_added_benefits"
android:textColor="@color/white"
android:textSize="14sp" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:paddingEnd="16dp">
<LinearLayout
android:id="@+id/live_tool_wish"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_xinyuandan" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_wishlist"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_prank"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_zhenggu" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_zg"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_wks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_weekstar" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_wks"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="30dp"
android:text="@string/basic_tools"
android:textColor="@color/white"
android:textSize="14sp" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:paddingEnd="16dp">
<LinearLayout
android:id="@+id/live_tool_beauty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_beauty" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_beauty"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_live_ready_camera" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_camera"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_leave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/live_tool_leave_img"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_leave" />
<TextView
android:id="@+id/live_tool_leave_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_zslk"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:text="@string/live_config"
android:textColor="@color/white"
android:textSize="14sp" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="20dp"
android:paddingEnd="16dp">
<LinearLayout
android:id="@+id/live_tool_one_pk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_danrenpk" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_link_pk"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_multi_pk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_duorenpk" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_dr"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/live_tool_mic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/icon_microphone" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/live_mic"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>

View File

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_layout"
android:layout_width="match_parent"
android:layout_height="120dp"
android:animateLayoutChanges="true">
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svaga_bc"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/goto_room_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginTop="42dp"
android:layout_marginEnd="19dp"
android:background="@drawable/background_baron_station_horn"
android:paddingLeft="7dp"
android:paddingTop="3dp"
android:paddingRight="7dp"
android:paddingBottom="3dp"
android:text="@string/onlookers"
android:textColor="#FFFEFEFE"
android:textSize="10dp" />
<HorizontalScrollView
android:id="@+id/context_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="42dp"
android:layout_marginEnd="10dp"
android:layout_toStartOf="@id/goto_room_view"
android:scrollbars="none">
<RelativeLayout
android:id="@+id/scroll_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="用户昵称"
android:textColor="#F7FF74"
android:textSize="14sp" />
<TextView
android:id="@+id/in"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="7.5dp"
android:layout_toEndOf="@id/user_name"
android:text="@string/in"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/anchor_nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="6.5dp"
android:layout_toEndOf="@id/in"
android:text="主播昵称"
android:textColor="#F7FF74"
android:textSize="14sp" />
<TextView
android:id="@+id/open_noble"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="4.5dp"
android:layout_toEndOf="@id/anchor_nickname"
android:text="@string/open_noble"
android:textColor="@color/white"
android:textSize="14sp" />
<ImageView
android:id="@+id/noble_icon"
android:layout_width="25dp"
android:layout_height="24dp"
android:layout_marginStart="4.5dp"
android:layout_toEndOf="@id/open_noble"
android:scaleType="fitCenter"
android:src="@mipmap/icon_open_chaohuang" />
<TextView
android:id="@+id/noble_nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="4.5dp"
android:layout_toEndOf="@id/noble_icon"
android:text="主播昵称"
android:textColor="#F7FF74"
android:textSize="14sp" />
</RelativeLayout>
</HorizontalScrollView>
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 809 B

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -264,7 +264,7 @@
<string name="live_title_hint">Write a title for the live broadcast</string>
<string name="live_class">channel</string>
<string name="live_class_choose">Select live channel</string>
<string name="live_class_tip">Pay attention to the channel that suits you. During the live broadcast, if the operator finds that the selected channel does not match the live content, he / she will adjust your live channel.</string>
<string name="live_class_tip">During the live broadcast, if the operator finds that the selected channel does not match the live content, he / she will adjust your live channel.</string>
<string name="live_set_pwd">Please set room password</string>
<string name="live_set_fee">Please set the charge amount (the revenue is subject to the end of live broadcast)</string>
<string name="live_set_pwd_empty">Please set room password</string>
@ -872,4 +872,7 @@ Limited ride And limited avatar frame</string>
<string name="current_live_room">You are in the current live room</string>
<string name="live_room_air_ticket">has recommended an anchor to you!</string>
<string name="bonus_message">has sent you a reward, come and get it!</string>
<string name="live_class_tip_title">Pay attention to the channel that suits you.</string>
<string name="live_anchor_send">What do you say to everyone</string>
<string name="live_config">LiveConfig</string>
</resources>

View File

@ -214,7 +214,8 @@
<string name="live_title_hint">給直播寫個標題吧</string>
<string name="live_class">頻道</string>
<string name="live_class_choose">選擇直播頻道</string>
<string name="live_class_tip">注意選擇適合自己的頻道。直播過程中,若運營人員發現選擇的頻道和直播內容不相符的情况,會調整您的直播頻道。</string>
<string name="live_class_tip_title">注意選擇適合自己的頻道。</string>
<string name="live_class_tip">直播過程中,若運營人員發現選擇的頻道和直播內容不相符的情况,會調整您的直播頻道。</string>
<string name="live_set_pwd">請設定房間密碼</string>
<string name="live_set_fee">請設定收費金額\n收益以直播結束顯示為准</string>
<string name="live_set_pwd_empty">請設定房間密碼</string>
@ -889,4 +890,16 @@
<string name="system_notice">系統通知</string>
<string name="online_service">在線客服</string>
<string name="bonus_message">向你發送了一個獎勵,快來領取吧!</string>
<string name="live_anchor_send">和大家說些什麼</string>
<string name="live_config">直播設置</string>
<string name="onlookers">圍觀</string>
<string name="open_noble">的直播間開通了</string>
<string name="baron">男爵</string>
<string name="viscount">子爵</string>
<string name="marquis">侯爵</string>
<string name="duke">公爵</string>
<string name="king">国王</string>
<string name="emperor">皇帝</string>
<string name="better_emperor">超皇</string>
</resources>

View File

@ -10,9 +10,9 @@ ext {
manifestPlaceholders = [
//
serverHost : "https://napi.yaoulive.com",
// serverHost : "https://napi.yaoulive.com",
//
// serverHost : "https://ceshi.yaoulive.com",
serverHost : "https://ceshi.yaoulive.com",
//
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -479,7 +479,9 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
mLiveRoomViewHolder.setName(u.getUserNiceName());
mLiveRoomViewHolder.setAvatar(u.getAvatar());
mLiveRoomViewHolder.setAnchorLevel(u.getLevelAnchor());
mLiveRoomViewHolder.setLiveUid(u.getId());
}
mLiveRoomViewHolder.initHourRankList();
mLiveRoomViewHolder.startAnchorLight();
}
if (mLiveAnchorViewHolder == null) {

View File

@ -14,6 +14,7 @@ import androidx.fragment.app.DialogFragment;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils;
import com.lzy.okgo.callback.Callback;
import com.lzy.okgo.model.Progress;
import com.lzy.okgo.model.Response;
@ -43,10 +44,14 @@ import com.yunbao.live.R;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.WishlistModel;
import com.yunbao.live.dialog.LiveBeautyDialogFragment;
import com.yunbao.live.dialog.LiveFunctionDialogFragment;
import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
import com.yunbao.live.dialog.LiveMicUserDialogFragment;
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
import com.yunbao.live.dialog.LiveNewWishListDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment;
import com.yunbao.live.event.LinkMicTxMixStreamEvent;
import com.yunbao.live.http.LiveHttpConsts;
@ -64,8 +69,8 @@ import com.yunbao.live.socket.SocketSendBean;
import com.yunbao.live.views.AbsRyLivePushViewHolder;
import com.yunbao.live.views.LiveEndViewHolder;
import com.yunbao.live.views.LiveMusicViewHolder;
import com.yunbao.live.views.LiveNewReadyRyViewHolder;
import com.yunbao.live.views.LivePushRyViewHolder;
import com.yunbao.live.views.LiveReadyRyViewHolder;
import com.yunbao.live.views.LiveRoomViewHolder;
import com.yunbao.live.views.LiveRyAnchorViewHolder;
@ -117,7 +122,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
private ViewGroup mRoot;
private ViewGroup mContainerWrap;
public static AbsRyLivePushViewHolder mLivePushViewHolder;
public static LiveReadyRyViewHolder mLiveReadyViewHolder;
public static LiveNewReadyRyViewHolder mLiveReadyViewHolder;
public static LiveRyAnchorViewHolder mLiveAnchorViewHolder;
private LiveMusicViewHolder mLiveMusicViewHolder;
private boolean mStartPreview;//是否开始预览
@ -136,6 +141,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
public static int backIndex = 0;//0=未判断1=已判断
@Override
protected int getLayoutId() {
return R.layout.activity_live_anchor;
@ -171,7 +177,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePushViewHolder, true, mContainer);
//添加开播前设置控件
mLiveReadyViewHolder = new LiveReadyRyViewHolder(mContext, mContainer, mLiveSDK);
mLiveReadyViewHolder = new LiveNewReadyRyViewHolder(mContext, mContainer, mLiveSDK);
mLiveReadyViewHolder.addToParent();
mLiveReadyViewHolder.subscribeActivityLifeCycle();
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePushViewHolder, true, mLiveSDK, mContainer);
@ -211,7 +217,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
* @param functionID
*/
int mrr = 0;
public static int leave = 0;
public int leave = 0;
@Override
public void onClick(int functionID) {
@ -428,7 +434,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
* 打开心愿单窗口
*/
public void openWishListWindow() {
LiveWishListDialogFragment fragment = new LiveWishListDialogFragment();
LiveNewWishListDialogFragment fragment = new LiveNewWishListDialogFragment();
if (mContext instanceof LiveRyAnchorActivity) {
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveWishListDialogFragment");
}
@ -527,13 +533,14 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
* 打开功能弹窗
*/
public void showFunctionDialog() {
LiveFunctionDialogFragment fragment = new LiveFunctionDialogFragment();
LiveNewFunctionDialogFragment fragment = new LiveNewFunctionDialogFragment();
Bundle bundle = new Bundle();
boolean hasGame = false;
if (CommonAppConfig.GAME_ENABLE && mGameList != null) {
hasGame = mGameList.size() > 0;
}
bundle.putBoolean(Constants.HAS_GAME, hasGame);
bundle.putInt("leave",leave);
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
fragment.setArguments(bundle);
fragment.setFunctionClickListener(this);
@ -609,8 +616,25 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveRoomViewHolder.setName(u.getUserNiceName());
mLiveRoomViewHolder.setAvatar(u.getAvatar());
mLiveRoomViewHolder.setAnchorLevel(u.getLevelAnchor());
mLiveRoomViewHolder.initHourRankList();
}
mLiveRoomViewHolder.startAnchorLight();
//心愿单
LiveHttpUtil.getWishList(mLiveUid, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (info.length > 0) {
String json = info[0];
WishlistModel model = GsonUtils.fromJson(json, WishlistModel.class);
if (mLiveRoomViewHolder != null && model != null) {
mLiveRoomViewHolder.initWishList(model.getWishlist());
}
}
}
@Override
public void onFinish() {
}
});
}
if (mLiveAnchorViewHolder == null) {
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);
@ -644,6 +668,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
mStartLive = true;
mLiveRoomViewHolder.startRefreshUserList();
mLiveRoomViewHolder.hideFloatMsg();
//守护相关
mLiveGuardInfo = new LiveGuardInfo();
@ -850,6 +875,18 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
protected void onDestroy() {
LiveHttpUtil.cancel(LiveHttpConsts.ANCHOR_CHECK_LIVE);
super.onDestroy();
if(mLivePushViewHolder!=null) {
mLivePushViewHolder.onDestroy();
}
if(mLiveReadyViewHolder!=null){
mLiveReadyViewHolder.onDestroy();
}
if(mLiveAnchorViewHolder!=null){
mLiveAnchorViewHolder.onDestroy();
}
mLivePushViewHolder=null;
mLiveReadyViewHolder=null;
mLiveAnchorViewHolder=null;
L.e("LiveAnchorActivity-------onDestroy------->");
}
@ -1206,6 +1243,25 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
LiveHttpUtil.anchorCheckLive(mLiveUid, mStream, mCheckLiveCallback);
}
@Override
public void onSendGift(LiveReceiveGiftBean bean) {
//购买守护
if (bean.ismTypeBuyGuard()) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.showGuardGifMessage(bean);
}
} else {
if (mLiveRoomViewHolder != null) {
if (bean.getmLiveUId().equals(bean.getRoomnum())) {
mLiveRoomViewHolder.insertChat(bean.getLiveChatBean(), 1);
}
mLiveRoomViewHolder.showGiftMessage(bean, false);
mLiveRoomViewHolder.updataWishList(bean.getGiftId(), bean.getGiftCount());
}
}
}
private void printLog(String content) {
if (mLogFile == null) {

View File

@ -44,7 +44,8 @@ public class LiveFunctionAdapter extends RecyclerView.Adapter<LiveFunctionAdapte
if (LiveRyAnchorActivity.mLivePushViewHolder != null) {
if (LiveRyAnchorActivity.leave == 0) {
//LiveRyAnchorActivity.leave
if (leave == 0) {
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_ZSLK, R.mipmap.icon_leave, R.string.live_zslk));
} else {
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_ZSLK, R.mipmap.icon_leave_p, R.string.live_zslk1));

View File

@ -0,0 +1,254 @@
package com.yunbao.live.adapter;
import android.app.Dialog;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.bean.LiveWishlistBean;
import java.util.List;
/**
* 直播 心愿单
*/
public class LiveNewWishListAdapter extends RecyclerView.Adapter<LiveNewWishListAdapter.Vh> {
private List<LiveWishlistBean> mWishList;
private LayoutInflater mInflater;
private View.OnClickListener mOnClickListener;
private OnItemClickListener<LiveWishlistBean> mOnItemClickListener;
private Context mContext;
public LiveNewWishListAdapter(Context context, boolean noLink) {
mContext = context;
mInflater = LayoutInflater.from(context);
mOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
Object tag = v.getTag();
if (tag != null) {
if (mOnItemClickListener != null) {
mOnItemClickListener.onItemClick((LiveWishlistBean) tag, 0);
}
}
}
};
}
public void setData(List<LiveWishlistBean> list) {
mWishList = list;
}
public void setOnItemClickListener(OnItemClickListener<LiveWishlistBean> onItemClickListener) {
mOnItemClickListener = onItemClickListener;
}
@NonNull
@Override
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new Vh(mInflater.inflate(R.layout.item_new_live_wish_list, parent, false));
}
@Override
public void onBindViewHolder(@NonNull Vh vh, int position) {
vh.setData(mWishList.get(position), position);
}
@Override
public int getItemCount() {
return mWishList.size();
}
class Vh extends RecyclerView.ViewHolder {
ImageView mIcon;
TextView mName;
TextView mNum;
TextView mIncrease;
TextView mDecrease;
View mRlDelete;
ProgressBar pb_wishlist;
TextView tvProgress;
TextView tvWishIndex;
public Vh(View itemView) {
super(itemView);
mIcon = (ImageView) itemView.findViewById(R.id.icon);
mName = (TextView) itemView.findViewById(R.id.name);
mNum = (TextView) itemView.findViewById(R.id.tv_num);
mIncrease = (TextView) itemView.findViewById(R.id.tv_increase);
mDecrease = (TextView) itemView.findViewById(R.id.tv_decrease);
mRlDelete = itemView.findViewById(R.id.iv_delete);
pb_wishlist = itemView.findViewById(R.id.pb_wishlist);
tvProgress = itemView.findViewById(R.id.tvProgress);
tvWishIndex = itemView.findViewById(R.id.tvWishIndex);
itemView.setOnClickListener(mOnClickListener);
}
void setData(LiveWishlistBean bean, int pos) {
itemView.setTag(bean);
ImgLoader.display(mContext, bean.getWishlist_icon(), mIcon);
mName.setText(bean.getWishlist_name());
mNum.setText(bean.getWishlist_num());
int pro = 0;
try {
int num1 = Integer.parseInt(bean.getWishlist_progress());
int num2 = Integer.parseInt(bean.getWishlist_num());
pro = num1 * 100 / num2;
//如果进度大于0则不允许删除该礼物
if (num1 > 0) {
mRlDelete.setVisibility(View.INVISIBLE);
} else {
mRlDelete.setVisibility(View.VISIBLE);
}
} catch (Exception e) {
e.printStackTrace();
}
pb_wishlist.setProgress(pro);
if (bean.getWishlist_num().isEmpty() || bean.getWishlist_progress().isEmpty()) {
tvProgress.setText("");
} else {
tvProgress.setText(bean.getWishlist_progress() + "/" + bean.getWishlist_num());
}
if (pro >= 100) {
tvWishIndex.setText("已达成");
} else {
tvWishIndex.setText("心愿" + getNameByIndex(pos));
}
// tvWishIndex.setText("心愿"+getNameByIndex(pos+1));
decreaseClick(bean);
increaseClick(bean);
numTextClick(bean);
mRlDeleteClick(pos);
}
private String getNameByIndex(int pos) {
String ret = "";
String arr[] = {"", "", "", "", "", "", "", "", "", ""};
try {
ret = arr[pos];
} catch (Exception e) {
e.printStackTrace();
}
return ret;
}
private void mRlDeleteClick(final int pos) {
mRlDelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ToastUtil.show("删除" + mWishList.get(pos).getWishlist_name() + "成功");
mWishList.remove(pos);
notifyDataSetChanged();
}
});
}
private void numTextClick(final LiveWishlistBean bean) {
mNum.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DialogUitl.showSimpleInputDialog(mContext,
"请输入" + bean.getWishlist_name() + "的数量",
DialogUitl.INPUT_TYPE_NUMBER, 5,
new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
if (TextUtils.isEmpty(content)) {
ToastUtil.show(R.string.live_set_wishlist_num);
} else {
int num;
if (StringUtil.isInt(content)) {
num = Integer.parseInt(content);
if (num <= 0) {
ToastUtil.show("数字必须大于0");
} else {
mNum.setText(num + "");
bean.setWishlist_num(num + "");
}
}
dialog.dismiss();
}
}
});
}
});
}
private void increaseClick(final LiveWishlistBean bean) {
mIncrease.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
int num = Integer.parseInt(mNum.getText().toString());
num++;
mNum.setText("x"+num );
bean.setWishlist_num(num + "");
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
private void decreaseClick(final LiveWishlistBean bean) {
mDecrease.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
int num = Integer.parseInt(mNum.getText().toString());
if (num > 1) {
num--;
mNum.setText("x"+num );
bean.setWishlist_num(num + "");
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
}

View File

@ -1,12 +1,15 @@
package com.yunbao.live.adapter;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.TextView;
import com.yunbao.common.bean.LiveClassBean;
@ -26,32 +29,27 @@ public class LiveReadyClassAdapter extends RecyclerView.Adapter<LiveReadyClassAd
private Context mContext;
private List<LiveClassBean> mList;
private LayoutInflater mInflater;
private View.OnClickListener mOnClickListener;
private OnItemClickListener<LiveClassBean> mOnItemClickListener;
public LiveReadyClassAdapter(Context context, List<LiveClassBean> list) {
mContext=context;
mContext = context;
mList = list;
mInflater = LayoutInflater.from(context);
mOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
Object tag = v.getTag();
if (tag != null && mOnItemClickListener != null) {
mOnItemClickListener.onItemClick((LiveClassBean) tag, 0);
}
}
};
}
public void setOnItemClickListener(OnItemClickListener<LiveClassBean> onItemClickListener) {
mOnItemClickListener = onItemClickListener;
}
public void setList(List<LiveClassBean> mList) {
this.mList = mList;
notifyDataSetChanged();
}
@NonNull
@Override
public Vh onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new Vh(mInflater.inflate(R.layout.item_live_ready_class, parent, false));
return new Vh(mInflater.inflate(R.layout.item_new_live_ready_class, parent, false));
}
@Override
@ -70,23 +68,38 @@ public class LiveReadyClassAdapter extends RecyclerView.Adapter<LiveReadyClassAd
ImageView mThumb;
TextView mName;
TextView mDes;
MyRadioButton mRadioButton;
RadioButton mRadioButton;
public Vh(View itemView) {
super(itemView);
mThumb = (ImageView) itemView.findViewById(R.id.thumb);
mName = (TextView) itemView.findViewById(R.id.name);
mDes = (TextView) itemView.findViewById(R.id.des);
mRadioButton = (MyRadioButton) itemView.findViewById(R.id.radioButton);
itemView.setOnClickListener(mOnClickListener);
mThumb = itemView.findViewById(R.id.thumb);
mName = itemView.findViewById(R.id.name);
mDes = itemView.findViewById(R.id.des);
mRadioButton = itemView.findViewById(R.id.radioButton);
itemView.setOnClickListener(view -> {
Object tag = view.getTag();
if (tag != null && mOnItemClickListener != null) {
mOnItemClickListener.onItemClick((LiveClassBean) tag, 0);
}
});
}
void setData(LiveClassBean bean) {
itemView.setTag(bean);
ImgLoader.display(mContext,bean.getThumb(), mThumb);
mName.setText(bean.getName());
mDes.setText(bean.getDes());
mRadioButton.doChecked(bean.isChecked());
mRadioButton.setChecked(bean.isChecked());
if (bean.isChecked()) {
itemView.setBackgroundResource(R.drawable.bg_new_live_room_type_select);
} else {
itemView.setBackgroundResource(R.drawable.bg_new_live_room_type_uncheck);
}
try {
ImgLoader.display(mContext, bean.getThumb(), mThumb);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@ -34,6 +34,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.activity.ZhuangBanActivity;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.event.LiveRoomChangeEvent;
@ -194,6 +195,9 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
@JavascriptInterface
public String androidMethodClickUser(String userId, String liveId) {
if(mContext instanceof LiveRyAnchorActivity){
return "";
}
//点击用户头像
if (!TextUtils.isEmpty(userId) && !TextUtils.isEmpty(liveId)) {
showUserDialog(userId, liveId);
@ -222,7 +226,9 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
@JavascriptInterface
public void androidMethodLookToLive(String liveId) {
if(mContext instanceof LiveRyAnchorActivity){
return;
}
mWebView.post(new Runnable() {
@Override
public void run() {

View File

@ -0,0 +1,138 @@
package com.yunbao.live.dialog;
import static com.yunbao.common.Constants.*;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.yunbao.common.Constants;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.interfaces.LiveFunctionClickListener;
/**
* Created by cxf on 2018/10/9.
*/
public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements View.OnClickListener {
private View mWishView, mPrankView, mWksView, mBeautyView, mCameraView, mLeaveView, mOnePkView, mMultiPkView, mMicView;
private LiveFunctionClickListener mFunctionClickListener;
private int leave = 0;
// boolean isRy = false;
@Override
protected int getLayoutId() {
return R.layout.dialog_live_new_function;
}
@Override
protected int getDialogStyle() {
return R.style.dialog2;
}
@Override
protected boolean canCancel() {
return true;
}
@Override
protected void setWindowAttributes(Window window) {
window.setWindowAnimations(R.style.bottomToTopAnim);
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
boolean hasGame = false;
boolean openFlash = false;
Bundle bundle = getArguments();
if (bundle != null) {
hasGame = bundle.getBoolean(Constants.HAS_GAME, false);
openFlash = bundle.getBoolean(Constants.OPEN_FLASH, false);
leave = bundle.getInt("leave", 0);
// isRy = bundle.getBoolean("isRy", false);
}
mWishView = findViewById(R.id.live_tool_wish);
mPrankView = findViewById(R.id.live_tool_prank);
mWksView = findViewById(R.id.live_tool_wks);
mBeautyView = findViewById(R.id.live_tool_beauty);
mCameraView = findViewById(R.id.live_tool_camera);
mLeaveView = findViewById(R.id.live_tool_leave);
mOnePkView = findViewById(R.id.live_tool_one_pk);
mMultiPkView = findViewById(R.id.live_tool_multi_pk);
mMicView = findViewById(R.id.live_tool_mic);
mWishView.setOnClickListener(this);
mPrankView.setOnClickListener(this);
mWksView.setOnClickListener(this);
mBeautyView.setOnClickListener(this);
mCameraView.setOnClickListener(this);
mLeaveView.setOnClickListener(this);
mOnePkView.setOnClickListener(this);
mMultiPkView.setOnClickListener(this);
mMicView.setOnClickListener(this);
if(leave==0){
((ImageView)mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave);
((TextView)mLeaveView.findViewById(R.id.live_tool_leave_text)).setText(R.string.live_zslk);
}else {
((ImageView)mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave_p);
((TextView)mLeaveView.findViewById(R.id.live_tool_leave_text)).setText(R.string.live_zslk1);
}
}
public void setFunctionClickListener(LiveFunctionClickListener functionClickListener) {
mFunctionClickListener = functionClickListener;
}
@Override
public void onDestroy() {
// if(isRy == false) {
// ((LiveAnchorActivity) mContext).setBtnFunctionDark();
// }else{
((LiveRyAnchorActivity) mContext).setBtnFunctionDark();
// }
super.onDestroy();
}
@Override
public void onClick(View view) {
dismiss();
int id = view.getId();
if (id == R.id.live_tool_wish) {
mFunctionClickListener.onClick(LIVE_FUNC_WISHLIST);
} else if (id == R.id.live_tool_prank) {
mFunctionClickListener.onClick(LIVE_FUNC_ZG);
} else if (id == R.id.live_tool_wks) {
mFunctionClickListener.onClick(LIVE_FUNC_WKS);
} else if (id == R.id.live_tool_beauty) {
mFunctionClickListener.onClick(LIVE_FUNC_BEAUTY);
} else if (id == R.id.live_tool_camera) {
mFunctionClickListener.onClick(LIVE_FUNC_CAMERA);
} else if (id == R.id.live_tool_leave) {
mFunctionClickListener.onClick(LIVE_FUNC_ZSLK);
} else if (id == R.id.live_tool_one_pk) {
mFunctionClickListener.onClick(LIVE_FUNC_LINK_MIC);
} else if (id == R.id.live_tool_multi_pk) {
mFunctionClickListener.onClick(LIVE_FUNC_DR);
} else if (id == R.id.live_tool_mic) {
mFunctionClickListener.onClick(LIVE_FUNC_MIC);
}
}
}

View File

@ -0,0 +1,107 @@
package com.yunbao.live.dialog;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.LiveClassBean;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.live.R;
import com.yunbao.live.adapter.LiveReadyClassAdapter;
import com.yunbao.live.bean.LiveRoomTypeBean;
import java.util.ArrayList;
import java.util.List;
public class LiveNewRoomClassDialogFragment extends AbsDialogFragment implements OnItemClickListener<LiveClassBean> {
private RecyclerView mRecyclerView;
private LiveReadyClassAdapter adapter;
private List<LiveClassBean> list = new ArrayList<>();
private CommonCallback<LiveClassBean> mCallback;
@Override
protected int getLayoutId() {
return R.layout.dialog_new_live_room_class;
}
@Override
protected int getDialogStyle() {
return R.style.dialog2;
}
@Override
protected boolean canCancel() {
return true;
}
public void setCallback(CommonCallback<LiveClassBean> callback) {
mCallback = callback;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
Bundle bundle = getArguments();
if (bundle == null) {
return;
}
final int checkedClassId = bundle.getInt(Constants.CLASS_ID, 0);
CommonAppConfig.getInstance().getConfig(new CommonCallback<ConfigBean>() {
@Override
public void callback(ConfigBean configBean) {
if (configBean != null) {
List<LiveClassBean> list1 = configBean.getLiveClass();
for (int i = 0; i < list1.size(); i++) {
if (!list1.get(i).getName().equals("New") && !list1.get(i).getName().equals("Hot") && !list1.get(i).getName().equals("熱門") && !list1.get(i).getName().equals("新秀")) {
list.add(list1.get(i));
}
}
for (int i = 0, size = list.size(); i < size; i++) {
LiveClassBean bean = list.get(i);
if (bean.getId() == checkedClassId) {
bean.setChecked(true);
} else {
bean.setChecked(false);
}
}
adapter = new LiveReadyClassAdapter(mContext, list);
adapter.setOnItemClickListener(LiveNewRoomClassDialogFragment.this);
mRecyclerView.setAdapter(adapter);
}
}
});
}
@Override
protected void setWindowAttributes(Window window) {
window.setWindowAnimations(R.style.bottomToTopAnim);
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);
}
@Override
public void onItemClick(LiveClassBean bean, int position) {
System.out.println("bean = " + bean + ", position = " + position);
bean.setChecked(true);
if(mCallback!=null){
mCallback.callback(bean);
}
dismiss();
}
}

View File

@ -0,0 +1,145 @@
package com.yunbao.live.dialog;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.bean.LiveRoomTypeBean;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 新直播准备间
*/
public class LiveNewRoomTypeDialogFragment extends AbsDialogFragment implements OnItemClickListener<LiveRoomTypeBean> {
private CommonCallback<LiveRoomTypeBean> mCallback;
private List<LiveRoomTypeBean> mList;
private ConstraintLayout pub, pwd;
private ImageView pubBtn, pwdBtn;
private boolean isSelectPublic = true;
@Override
protected int getLayoutId() {
return R.layout.dialog_new_live_room_type;
}
@Override
protected int getDialogStyle() {
return R.style.dialog2;
}
@Override
protected boolean canCancel() {
return true;
}
@Override
protected void setWindowAttributes(Window window) {
window.setWindowAnimations(R.style.bottomToTopAnim);
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = DpUtil.dp2px(236);
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
pub = mRootView.findViewById(R.id.public_room);
pwd = mRootView.findViewById(R.id.private_room);
View submit = mRootView.findViewById(R.id.submit);
pubBtn = pub.findViewById(R.id.public_select);
pwdBtn = pwd.findViewById(R.id.private_select);
Bundle bundle = getArguments();
if (bundle == null) {
return;
}
int checkedId = bundle.getInt(Constants.CHECKED_ID, Constants.LIVE_TYPE_NORMAL);
select(checkedId == Constants.LIVE_TYPE_NORMAL);
pub.setOnClickListener(view -> select(true));
pwd.setOnClickListener(view -> select(false));
submit.setOnClickListener(view -> {
if (isSelectPublic) {
LiveRoomTypeBean bean = new LiveRoomTypeBean(0, WordUtil.getString(R.string.live_room_public));
mCallback.callback(bean);
} else {
for (LiveRoomTypeBean bean : mList) {
if (bean.getId() == Constants.LIVE_TYPE_PWD) {
bean.setChecked(true);
mCallback.callback(bean);
break;
}
}
}
dismiss();
});
initData();
}
private void initData() {
mList = new ArrayList<>();
ConfigBean configBean = CommonAppConfig.getInstance().getConfig();
Log.i("tag", configBean.toString());
String[][] liveType = configBean.getLiveType();
if (liveType != null) {
Log.i("tag", Arrays.toString(liveType));
List<LiveRoomTypeBean> list = LiveRoomTypeBean.getLiveTypeList(liveType);
mList.addAll(list);
}
}
private void select(boolean isSelectPublic) {
this.isSelectPublic = isSelectPublic;
if (isSelectPublic) {
pub.setBackgroundResource(R.drawable.bg_new_live_room_type_select);
pwd.setBackgroundResource(R.drawable.bg_new_live_room_type_uncheck);
pubBtn.setImageResource(R.mipmap.icon_selected);
pwdBtn.setImageResource(R.mipmap.icon_uncheck);
} else {
pub.setBackgroundResource(R.drawable.bg_new_live_room_type_uncheck);
pwd.setBackgroundResource(R.drawable.bg_new_live_room_type_select);
pubBtn.setImageResource(R.mipmap.icon_uncheck);
pwdBtn.setImageResource(R.mipmap.icon_selected);
}
}
@Override
public void onItemClick(LiveRoomTypeBean bean, int position) {
dismiss();
if (mCallback != null) {
mCallback.callback(bean);
}
}
public void setCallback(CommonCallback<LiveRoomTypeBean> callback) {
mCallback = callback;
}
@Override
public void onDestroy() {
mCallback = null;
super.onDestroy();
}
}

View File

@ -0,0 +1,248 @@
package com.yunbao.live.dialog;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.yunbao.common.bean.LiveGiftBean;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.adapter.LiveNewWishListAdapter;
import com.yunbao.live.adapter.LiveWishListAdapter;
import com.yunbao.live.bean.LiveWishlistBean;
import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
/**
* Created by cxf on 2018/10/19.
* 主播直播开播时 心愿单弹窗
*/
public class LiveNewWishListDialogFragment extends AbsDialogFragment implements OnItemClickListener<LiveWishlistBean> {
private RecyclerView mRecyclerView;
private ActionListener mActionListener;
private boolean mNoLink;
private View mrlAdd, tvDone;
LiveNewWishListAdapter mAdapter;
List<LiveWishlistBean> mWishlist;
@Override
protected int getLayoutId() {
return R.layout.dialog_new_live_wishlist;
}
@Override
protected int getDialogStyle() {
return R.style.dialog;
}
@Override
protected boolean canCancel() {
return true;
}
@Override
protected void setWindowAttributes(Window window) {
window.setWindowAnimations(R.style.bottomToTopAnim);
WindowManager.LayoutParams params = window.getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = DpUtil.dp2px(580);
params.gravity = Gravity.BOTTOM;
window.setAttributes(params);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mRecyclerView = (RecyclerView) mRootView.findViewById(R.id.recyclerView);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
mrlAdd = findViewById(R.id.rl_add);
tvDone = findViewById(R.id.tvDone);
mrlAddClick();
tvDoneClick();
loadData();
EventBus.getDefault().register(this);
}
private void tvDoneClick() {
tvDone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
modifyWishlist();
}
});
}
//修改心愿单列表
private void modifyWishlist() {
if (mWishlist != null && mWishlist.size() > 0) {
Gson gson = new Gson();
int size = mWishlist.size();
String params;
if (size > 0) {
Log.i("tos", gson.toJson(mWishlist));
params = gson.toJson(mWishlist);
} else {
params = "";
}
LiveHttpUtil.modifyWishList(params, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
ToastUtil.show("修改成功");
dismiss();
} else {
ToastUtil.show("修改失败" + (msg.isEmpty() ? "" : msg));
}
}
@Override
public void onFinish() {
}
});
}
}
//获取心愿单列表
private void loadData() {
LiveHttpUtil.getWishList(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
try {
JSONObject obj = JSON.parseObject(info[0]);
String giftJson = obj.getString("wishlist");
mWishlist = JSON.parseArray(giftJson, LiveWishlistBean.class);
mAdapter = new LiveNewWishListAdapter(mContext, mNoLink);
mAdapter.setData(mWishlist);
mRecyclerView.setAdapter(mAdapter);
mAdapter.setOnItemClickListener(new OnItemClickListener<LiveWishlistBean>() {
@Override
public void onItemClick(LiveWishlistBean bean, int position) {
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override
public void onFinish() {
}
});
}
//点击 + ,弹出礼物列表
private void mrlAddClick() {
mrlAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openGiftWindow();
}
});
}
/**
* 心愿单打开礼物窗口
*/
public void openGiftWindow() {
LiveGiftDialogFragment4Wishlist fragment = new LiveGiftDialogFragment4Wishlist();
Log.e("ry",getTag());
if(getTag().equals("TX")) {
fragment.show(((LiveAnchorActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
}else{
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
}
}
@Override
public void onItemClick(LiveWishlistBean bean, int position) {
}
public interface ActionListener {
void onItemClick(String type);
}
public void setActionListener(ActionListener actionListener) {
mActionListener = actionListener;
}
public void setNoLink(boolean noLink) {
mNoLink = noLink;
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onChooseGift(LiveGiftBean bean) {
//选择礼物回调
if (bean != null) {
LiveWishlistBean wishlistBean = new LiveWishlistBean();
wishlistBean.setWishlist_num(bean.getNum());
wishlistBean.setWishlist_name(bean.getName());
wishlistBean.setWishlist_icon(bean.getIcon());
wishlistBean.setLid(bean.getId() + "");
wishlistBean.setWishlist_progress("0");
boolean isSame = false;
int size = mWishlist.size();
for (int i = 0; i < size; i++) {
if ((mWishlist.get(i).getLid()).equals("" + bean.getId())) {
ToastUtil.show(bean.getName() + "礼物重复");
isSame = true;
break;
}
}
if (size < 10) {
if (!isSame) {
mWishlist.add(0, wishlistBean);
mAdapter.notifyDataSetChanged();
}
} else {
ToastUtil.show("最多添加10个心愿");
}
}
}
@Override
public void onDestroy() {
super.onDestroy();
mActionListener = null;
mContext = null;
LiveHttpUtil.cancel(LiveHttpConsts.GET_WISH_LIST);
LiveHttpUtil.cancel(LiveHttpConsts.SET_WISH_LIST);
EventBus.getDefault().unregister(this);
}
}

View File

@ -0,0 +1,507 @@
package com.yunbao.live.views;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSendCallback;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.bean.LiveClassBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.ActivityResultCallback;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.ImageResultCallback;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ProcessImageUtil;
import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.AbsViewHolder;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveChooseClassActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.adapter.LiveReadyShareAdapter;
import com.yunbao.live.bean.LiveRoomTypeBean;
import com.yunbao.live.dialog.LiveNewRoomClassDialogFragment;
import com.yunbao.live.dialog.LiveNewRoomTypeDialogFragment;
import com.yunbao.live.dialog.LiveNewWishListDialogFragment;
import com.yunbao.live.dialog.LiveRoomTypeDialogFragment;
import com.yunbao.live.dialog.LiveTimeDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment;
import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil;
import java.io.File;
import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.stream.RCRTCCameraOutputStream;
public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnClickListener {
private ConstraintLayout mAvatar;
private TextView mCoverText;
private EditText mEditTitle;
private ProcessImageUtil mImageUtil;
private File mAvatarFile;
private TextView mLiveClass;
private TextView mLiveTypeTextView;//房间类型TextView
private TextView mLiveWishListTextView;//心愿单TextView
private int mLiveClassID;//直播频道id
private int mLiveType;//房间类型
private int mLiveTypeVal;//房间密码门票收费金额
private int mLiveTimeCoin;//计时收费金额
private ActivityResultCallback mActivityResultCallback;
private CommonCallback<LiveRoomTypeBean> mLiveTypeCallback;
private boolean mOpenLocation = true;
private int mLiveSdk;
private LiveClassBean classBean;
public LiveNewReadyRyViewHolder(Context context, ViewGroup parentView, int liveSdk) {
super(context, parentView, liveSdk);
}
@Override
protected void processArguments(Object... args) {
if (args.length > 0) {
mLiveSdk = (int) args[0];
}
}
@Override
protected int getLayoutId() {
return R.layout.view_new_live_ready;
}
@Override
public void init() {
ConstraintLayout traceroute_rootview = (ConstraintLayout)findViewById(R.id.traceroute_rootview);
traceroute_rootview.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
InputMethodManager imm = (InputMethodManager)
mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
});
mAvatar = (ConstraintLayout) findViewById(R.id.avatar);
mAvatar.setOnClickListener(this);
UserBean u = CommonAppConfig.getInstance().getUserBean();
ImgLoader.displayDrawable(mContext, u.getAvatar(), new ImgLoader.DrawableCallback() {
@Override
public void onLoadSuccess(Drawable drawable) {
mAvatar.setBackground(drawable);
}
@Override
public void onLoadFailed() {
}
});
mCoverText = (TextView) findViewById(R.id.cover_text);
mEditTitle = (EditText) findViewById(R.id.edit_title);
findViewById(R.id.btn_room_type).setOnClickListener(this);
mOpenLocation = true;
mLiveClass = (TextView) findViewById(R.id.live_class);
mLiveTypeTextView = (TextView) findViewById(R.id.text_room_type);
mLiveWishListTextView= (TextView) findViewById(R.id.text_wishlist);
mImageUtil = ((LiveActivity) mContext).getProcessImageUtil();
mImageUtil.setImageResultCallback(new ImageResultCallback() {
@Override
public void beforeCamera() {
((LiveRyAnchorActivity) mContext).beforeCamera();
}
@Override
public void onSuccess(File file) {
if (file != null) {
ImgLoader.displayFileDrawable(mContext, file, new ImgLoader.DrawableCallback() {
@Override
public void onLoadSuccess(Drawable drawable) {
mAvatar.setBackground(drawable);
}
@Override
public void onLoadFailed() {
}
});
if (mAvatarFile == null) {
mCoverText.setText(WordUtil.getString(R.string.live_cover_2));
mCoverText.setBackground(ContextCompat.getDrawable(mContext, R.drawable.bg_live_cover));
}
mAvatarFile = file;
}
}
@Override
public void onFailure() {
}
});
findViewById(R.id.btn_camera).setOnClickListener(this);
findViewById(R.id.btn_live_class).setOnClickListener(this);
findViewById(R.id.btn_close).setOnClickListener(this);
findViewById(R.id.btn_beauty).setOnClickListener(this);
findViewById(R.id.btn_start_live).setOnClickListener(this);
findViewById(R.id.btn_wishlist).setOnClickListener(this);
findViewById(R.id.btn_horizontally).setOnClickListener(this);
mActivityResultCallback = new ActivityResultCallback() {
@Override
public void onSuccess(Intent intent) {
mLiveClassID = intent.getIntExtra(Constants.CLASS_ID, 0);
mLiveClass.setText(intent.getStringExtra(Constants.CLASS_NAME));
}
};
mLiveTypeCallback = new CommonCallback<LiveRoomTypeBean>() {
@Override
public void callback(LiveRoomTypeBean bean) {
switch (bean.getId()) {
case Constants.LIVE_TYPE_NORMAL:
onLiveTypeNormal(bean);
break;
case Constants.LIVE_TYPE_PWD:
onLiveTypePwd(bean);
break;
case Constants.LIVE_TYPE_PAY:
onLiveTypePay(bean);
break;
case Constants.LIVE_TYPE_TIME:
onLiveTypeTime(bean);
break;
}
}
};
}
@Override
public void onClick(View v) {
if (!canClick()) {
return;
}
int i = v.getId();
if (i == R.id.avatar) {
setAvatar();
} else if (i == R.id.btn_camera) {
toggleCamera();
} else if (i == R.id.btn_close) {
close();
} else if (i == R.id.btn_live_class) {
chooseLiveClass();
} else if (i == R.id.btn_beauty) {
beauty();
}else if (i == R.id.btn_wishlist) {
//点击心愿单
openWishListWindow();
} else if (i == R.id.btn_room_type) {
chooseLiveType();
} else if (i == R.id.btn_start_live) {
startLive();
} else if (i == R.id.btn_locaiton) {
switchLocation();
}else if(i == R.id.btn_horizontally){
RCRTCCameraOutputStream cameraStream = RCRTCEngine.getInstance().getDefaultVideoStream();
cameraStream.setPreviewMirror(!cameraStream.isPreviewMirror());
}
}
/**
* 打开心愿单窗口
*/
public void openWishListWindow() {
LiveNewWishListDialogFragment fragment = new LiveNewWishListDialogFragment();
if (mContext instanceof LiveRyAnchorActivity){
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "RY");
}
}
/**
* 打开 关闭位置
*/
private void switchLocation() {
if (mOpenLocation) {
new DialogUitl.Builder(mContext)
.setContent(WordUtil.getString(R.string.live_location_close_3))
.setCancelable(true)
.setConfrimString(WordUtil.getString(R.string.live_location_close_2))
.setClickCallback(new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
toggleLocation();
}
})
.build()
.show();
} else {
toggleLocation();
}
}
private void toggleLocation() {
mOpenLocation = !mOpenLocation;
}
/**
* 设置头像
*/
private void setAvatar() {
if (mLiveSdk == Constants.LIVE_SDK_TX) {
mImageUtil.getImageByAlumb();
} else {
DialogUitl.showStringArrayDialog(mContext, new Integer[]{
R.string.camera, R.string.alumb}, new DialogUitl.StringArrayDialogCallback() {
@Override
public void onItemClick(String text, int tag) {
if (tag == R.string.camera) {
mImageUtil.getImageByCamera();
} else {
mImageUtil.getImageByAlumb();
}
}
});
}
}
/**
* 切换镜头
*/
private void toggleCamera() {
((LiveRyAnchorActivity) mContext).toggleCamera();
}
/**
* 关闭
*/
private void close() {
((LiveRyAnchorActivity) mContext).endLives();
}
/**
* 选择直播频道
*/
private void chooseLiveClass() {
/* try {
Intent intent = new Intent(mContext, LiveChooseClassActivity.class);
intent.putExtra(Constants.CLASS_ID, mLiveClassID);
mImageUtil.startActivityForResult(intent, mActivityResultCallback);
}catch (Exception e){
}*/
Bundle bundle = new Bundle();
bundle.putInt(Constants.CLASS_ID, mLiveClassID);
LiveNewRoomClassDialogFragment fragment = new LiveNewRoomClassDialogFragment();
fragment.setArguments(bundle);;
fragment.setCallback(new CommonCallback<LiveClassBean>() {
@Override
public void callback(LiveClassBean bean) {
classBean=bean;
mLiveClassID=classBean.getId();
mLiveClass.setText(bean.getName());
}
});
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveRoomTypeDialogFragment");
}
/**
* 设置美颜
*/
private void beauty() {
((LiveRyAnchorActivity) mContext).beauty();
// Intent intent = new Intent(mContext, Beauty360Activity3.class);
// mContext.startActivity(intent);
}
/**
* 选择直播类型
*/
private void chooseLiveType() {
Bundle bundle = new Bundle();
bundle.putInt(Constants.CHECKED_ID, mLiveType);
LiveNewRoomTypeDialogFragment fragment = new LiveNewRoomTypeDialogFragment();
fragment.setArguments(bundle);
fragment.setCallback(mLiveTypeCallback);
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveRoomTypeDialogFragment");
}
/**
* 普通房间
*/
private void onLiveTypeNormal(LiveRoomTypeBean bean) {
mLiveType = bean.getId();
mLiveTypeTextView.setText(bean.getName());
mLiveTypeVal = 0;
mLiveTimeCoin = 0;
}
/**
* 密码房间
*/
private void onLiveTypePwd(final LiveRoomTypeBean bean) {
DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_set_pwd), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, 8, new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
if (TextUtils.isEmpty(content)) {
ToastUtil.show(R.string.live_set_pwd_empty);
} else {
mLiveType = bean.getId();
mLiveTypeTextView.setText(bean.getName());
if (StringUtil.isInt(content)) {
mLiveTypeVal = Integer.parseInt(content);
}
mLiveTimeCoin = 0;
dialog.dismiss();
}
}
});
}
/**
* 付费房间
*/
private void onLiveTypePay(final LiveRoomTypeBean bean) {
DialogUitl.showSimpleInputDialog(mContext, WordUtil.getString(R.string.live_set_fee), DialogUitl.INPUT_TYPE_NUMBER, 8, new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
if (TextUtils.isEmpty(content)) {
ToastUtil.show(R.string.live_set_fee_empty);
} else {
mLiveType = bean.getId();
mLiveTypeTextView.setText(bean.getName());
if (StringUtil.isInt(content)) {
mLiveTypeVal = Integer.parseInt(content);
}
mLiveTimeCoin = 0;
dialog.dismiss();
}
}
});
}
/**
* 计时房间
*/
private void onLiveTypeTime(final LiveRoomTypeBean bean) {
LiveTimeDialogFragment fragment = new LiveTimeDialogFragment();
Bundle bundle = new Bundle();
bundle.putInt(Constants.CHECKED_COIN, mLiveTimeCoin);
fragment.setArguments(bundle);
fragment.setCommonCallback(new CommonCallback<Integer>() {
@Override
public void callback(Integer coin) {
mLiveType = bean.getId();
mLiveTypeTextView.setText(bean.getName());
mLiveTypeVal = coin;
mLiveTimeCoin = coin;
}
});
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveTimeDialogFragment");
}
public void hide() {
if (mContentView != null && mContentView.getVisibility() == View.VISIBLE) {
mContentView.setVisibility(View.INVISIBLE);
}
}
public void show() {
if (mContentView != null && mContentView.getVisibility() != View.VISIBLE) {
mContentView.setVisibility(View.VISIBLE);
}
}
/**
* 点击开始直播按钮
*/
private void startLive() {
boolean startPreview = ((LiveRyAnchorActivity) mContext).isStartPreview();
// if (!startPreview) {
// ToastUtil.show(R.string.please_wait);
// return;
// }
if (mLiveClassID == 0) {
ToastUtil.show(R.string.live_choose_live_class);
return;
}
createRoom();
}
/**
* 请求创建直播间接口开始直播
*/
boolean isHttpBack = false;
private void createRoom() {
if(!isHttpBack) {
isHttpBack = true;
if (mLiveClassID == 0) {
ToastUtil.show(R.string.live_choose_live_class);
return;
}
String title = mEditTitle.getText().toString().trim();
LiveHttpUtil.newcreateRoom(title, mLiveClassID, mLiveType, mLiveTypeVal, mAvatarFile, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, final String[] info) {
if (code == 0 && info.length > 0) {
L.e("开播", "createRoom------->" + info[0]);
isHttpBack = false;
final CommonAppConfig appConfig = CommonAppConfig.getInstance();
UserBean u = appConfig.getUserBean();
((LiveRyAnchorActivity) mContext).startLiveSuccess(info[0], mLiveType, mLiveTypeVal);
} else {
ToastUtil.show(msg);
}
}
@Override
public void onError() {
super.onError();
isHttpBack = false;
}
});
}else {
ToastUtil.show("請求中,請勿重複點擊");
}
}
public void release() {
mImageUtil = null;
mActivityResultCallback = null;
mLiveTypeCallback = null;
}
@Override
public void onDestroy() {
LiveHttpUtil.cancel(LiveHttpConsts.CREATE_ROOM);
}
}

View File

@ -17,6 +17,7 @@ import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.lzy.okgo.model.Response;
import com.tencent.imsdk.v2.V2TIMManager;
import com.tencent.imsdk.v2.V2TIMSendCallback;
import com.tencent.trtc.TRTCCloudDef;
@ -25,6 +26,7 @@ import com.yunbao.common.Constants;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.JsonBean;
import com.yunbao.common.interfaces.ActivityResultCallback;
import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.ImageResultCallback;
@ -493,7 +495,7 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
@Override
public void onSuccess(int code, String msg, final String[] info) {
if (code == 0 && info.length > 0) {
L.e("开播", "createRoom------->" + info[0]);
L.e("tx开播", "createRoom------->" + info[0]);
final CommonAppConfig appConfig = CommonAppConfig.getInstance();
UserBean u = appConfig.getUserBean();
V2TIMManager.getInstance().createGroup(V2TIMManager.GROUP_TYPE_AVCHATROOM, "g" + appConfig.getUid(), "直播", new V2TIMSendCallback<String>() {
@ -523,6 +525,18 @@ public class LiveReadyViewHolder extends AbsViewHolder implements View.OnClickLi
ToastUtil.show(msg);
}
}
@Override
public void onError() {
super.onError();
System.out.println("tx 开播失败");
}
@Override
public void onError(Response<JsonBean> response) {
super.onError(response);
System.out.println("tx 开播失败 = "+response);
}
});
}

View File

@ -54,6 +54,7 @@ import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.BannerBean;
import com.yunbao.common.bean.HourRank;
import com.yunbao.common.bean.LevelBean;
@ -943,14 +944,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
// fastMsgRecyclerView.setItemAnimator(new DefaultItemAnimator());
//主播页面隐藏头部
if (mContext instanceof LiveRyAnchorActivity) {
findViewById(R.id.hour_rank_layout).setVisibility(View.GONE);
findViewById(R.id.live_wks_layout).setVisibility(View.GONE);
findViewById(R.id.wish_list_layout).setVisibility(View.GONE);
// findViewById(R.id.hour_rank_layout).setVisibility(View.GONE);
// findViewById(R.id.live_wks_layout).setVisibility(View.GONE);
// findViewById(R.id.wish_list_layout).setVisibility(View.GONE);
// findViewById(R.id.hour_rank_layout).setEnabled(false);
/* findViewById(R.id.live_wks_layout).setEnabled(false);
findViewById(R.id.wish_list_layout).setEnabled(false);*/
findViewById(R.id.open_sidebar).setVisibility(View.GONE);
findViewById(R.id.btn_follow).setVisibility(View.GONE);
}else {
configBanner3();
}
reloadIM();
configBanner3();
}
public void hideFloatMsg(){
msg.setVisibility(View.GONE);
}
private void showBanner2() {
@ -1165,7 +1173,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
/**
* 初始化小时榜
*/
protected void initHourRankList() {
public void initHourRankList() {
ViewFlipper flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16));
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
@ -1182,6 +1190,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
ImageView hourPic = hourView.findViewById(R.id.wish_pic);
mHotText = hotView.findViewById(R.id.wish_index);
mHourRank = hourView.findViewById(R.id.wish_index);
mHotText.setText("0");
mHotText.setLayoutParams(textParams);
mHourRank.setLayoutParams(textParams);
mHotText.setGravity(Gravity.CENTER);
@ -1193,7 +1202,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
hourPic.setLayoutParams(params);
flipper.addView(hotView);
flipper.addView(hourView);
flipper.startFlipping();
flipper.setOnClickListener(view -> {
Bundle bundle = new Bundle();
String path = info.get(0).getUrl();
@ -1209,9 +1218,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
bundle.putString("roomId", mLiveUid);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle);
liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
});
flipper.startFlipping();
}
}, Throwable::printStackTrace)
.isDisposed();
@ -1330,8 +1339,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
});
//点击打开周星榜
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_wks_layout),
() -> Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS)));
() -> {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS));
});
}
public static int pkEndIndex = 0;
@ -1729,6 +1741,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* @param in 展示的view
*/
private void changeMsgView(View out, View in) {
if(mContext instanceof LiveRyAnchorActivity){
return;
}
if (in.getVisibility() == View.VISIBLE) {
return;
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="339dp" android:height="2dp">
<shape android:shape="rectangle">
<solid android:color="#b3ffffff" />
<stroke android:width="1dp" android:color="#b3ffffff" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="189dp" android:height="42dp">
<shape android:shape="rectangle">
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffffae05" android:endColor="#ffffc621" android:angle="135" />
<corners android:radius="21dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:drawable="@mipmap/icon_selected"/>
<item android:state_checked="false" android:drawable="@mipmap/icon_uncheck"/>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="68dp" android:height="68dp">
<shape android:shape="rectangle">
<solid android:color="#59ffffff" />
<corners android:radius="2dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="166dp" android:height="162dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#ffffc621" />
<solid android:color="#33ffb2b2" />
<corners android:radius="8dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="166dp" android:height="162dp">
<shape android:shape="rectangle">
<solid android:color="#337792d0" />
<corners android:radius="8dp" />
</shape>
</item>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<item android:width="355dp" android:height="121dp">
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<solid android:color="#55000000 " />
<solid android:color="#4d000000" />
<corners android:radius="6dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:text="@string/live_class_choose"
android:textColor="#F6F7FB"
android:textSize="17sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="10dp"
android:text="@string/live_class_tip_title"
android:textColor="#F6F7FB"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/title" />
<TextView
android:id="@+id/textView3"
android:layout_width="355dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="10dp"
android:text="@string/live_class_tip"
android:textColor="#B3F6F7FB"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_marginStart="10dp"
android:layout_marginTop="13dp"
android:layout_marginEnd="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView3" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#b3000000">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:text="@string/live_room_title"
android:textColor="#F6F7FB"
android:textSize="17sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginEnd="24dp"
android:text="@string/live_room_type_submit"
android:textColor="#FFC621"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/public_room"
android:layout_width="166dp"
android:layout_height="162dp"
android:layout_marginTop="54dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="33dp"
android:background="@drawable/bg_new_live_room_type_select"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/private_room"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/public_icon"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginTop="41dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_public" />
<TextView
android:id="@+id/public_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/live_room_public"
android:textColor="#F6F7FB"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/public_icon" />
<TextView
android:id="@+id/public_dec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/live_room_public_des"
android:textColor="#B3F6F7FB"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/public_title" />
<ImageView
android:id="@+id/public_select"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_selected" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/private_room"
android:layout_width="166dp"
android:layout_height="162dp"
android:layout_marginTop="54dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="33dp"
android:background="@drawable/bg_new_live_room_type_uncheck"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/private_icon"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginTop="41dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_private" />
<TextView
android:id="@+id/private_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/live_room_private"
android:textColor="#F6F7FB"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/private_icon" />
<TextView
android:id="@+id/private_dec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="@string/live_room_private_des"
android:textColor="#B3F6F7FB"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/private_title" />
<ImageView
android:id="@+id/private_select"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_uncheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="573dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_xyd"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/rl_add"
android:layout_width="match_parent"
android:layout_height="140dp"
android:layout_marginTop="150dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView2"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/bg_xyd_add_item" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:layout_marginTop="24dp"
android:layout_marginEnd="90dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/live_item_add_gift"
android:textColor="#4223CD"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="18dp"
android:overScrollMode="never"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rl_add" />
<ImageView
android:id="@+id/tvDone"
android:layout_width="275dp"
android:layout_height="52dp"
android:layout_marginBottom="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/bg_xyd_button" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginBottom="12dp"
android:background="@drawable/bg_new_live_room_type_uncheck"
android:paddingLeft="35dp"
android:paddingRight="15dp">
<ImageView
android:id="@+id/thumb"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerVertical="true" />
<TextView
android:id="@+id/name"
android:text="123123"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="45dp"
android:layout_marginTop="8dp"
android:textColor="#F6F7FB"
android:textSize="16sp" />
<TextView
android:id="@+id/des"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/name"
android:layout_marginLeft="45dp"
android:layout_marginTop="4dp"
android:layout_marginRight="50dp"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#B3F6F7FB"
android:textSize="13sp" />
<RadioButton
android:id="@+id/radioButton"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:background="@drawable/bg_live_room_class_radio_btn"
android:button="@null" />
</RelativeLayout>

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/btn_system_msg"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_xyd_item">
<LinearLayout
android:id="@+id/llTop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="1dp">
<TextView
android:id="@+id/tvWishIndex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:layout_marginLeft="18dp"
android:layout_marginRight="15dp"
android:text="心愿"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:id="@+id/iv_delete"
android:layout_width="20dp"
android:layout_marginEnd="15dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:src="@drawable/delete_wish_item" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/rlTop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/llTop">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="24dp"
android:background="@drawable/bg_xyd_item_icon"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:riv_corner_radius="10dp" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_toRightOf="@id/icon"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/live_item_gift_name"
android:textColor="@color/white"
android:textSize="12sp"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
android:id="@+id/pb_wishlist"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="100dp"
android:layout_height="10dp"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_toEndOf="@+id/icon"
android:max="100"
android:progress="0"
android:progressDrawable="@drawable/progress_wishlist"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toBottomOf="@+id/name" />
<TextView
android:id="@+id/tvProgress"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="24dp"
android:layout_marginTop="2dp"
android:layout_weight="1"
android:gravity="center"
android:text="1/1"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="@+id/pb_wishlist"
app:layout_constraintTop_toBottomOf="@+id/name" />
<LinearLayout
android:id="@+id/llNum"
android:layout_width="70dp"
android:layout_height="20dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginTop="16dp"
android:layout_marginEnd="24dp"
android:background="@drawable/bg_xyd_number"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_decrease"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="-"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_num"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:maxLength="5"
android:text="x1"
android:textColor="#FFFFFF"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_increase"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="+"
android:textColor="@color/white"
android:textSize="12sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/rlTop"
android:layout_marginTop="2dp"
android:layout_marginRight="80dp"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/rlTop"
android:layout_alignParentRight="true"
android:layout_marginTop="3dp"
android:layout_marginRight="15dp"
android:textColor="@color/white"
android:textSize="12sp" />
<TextView
android:id="@+id/red_point"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_below="@id/time"
android:layout_alignParentRight="true"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:background="@drawable/bg_red_point"
android:gravity="center"
android:includeFontPadding="false"
android:minWidth="14dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:textColor="@color/white"
android:textSize="10sp"
android:visibility="invisible" />
</RelativeLayout>

View File

@ -91,15 +91,14 @@
android:id="@+id/live_class"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_gravity="center_vertical"
android:clickable="false"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:text="@string/live_class"
android:clickable="false"
android:textColor="#B6B6B6"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textSize="12sp"/>
android:textSize="12sp" />
<ImageView
android:layout_width="25dp"
@ -167,8 +166,8 @@
android:layout_marginTop="10dp"
android:layout_toRightOf="@id/avatar_group"
android:text="@string/live_title"
android:textSize="12sp"
android:textColor="#B6B6B6" />
android:textColor="#B6B6B6"
android:textSize="12sp" />
<EditText
android:id="@+id/edit_title"

View File

@ -635,9 +635,9 @@
android:id="@+id/live_time"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_below="@id/hour_rank_layout"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_alignTop="@id/hour_rank_layout"
android:layout_alignParentRight="true"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_live_push_time"
android:drawablePadding="5dp"
android:gravity="center_vertical"
@ -655,7 +655,7 @@
android:id="@+id/goto_room_view"
android:layout_width="wrap_content"
android:layout_height="27dp"
android:layout_below="@id/live_time"
android:layout_below="@id/lin"
android:layout_alignParentRight="true"
android:layout_marginTop="16dp"
android:layout_marginRight="9dp"

View File

@ -0,0 +1,254 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/traceroute_rootview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/btn_camera"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="10dp"
android:layout_marginTop="54dp"
android:padding="3dp"
android:src="@mipmap/icon_live_ready_camera"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/btn_horizontally"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="20dp"
android:layout_marginTop="54dp"
android:layout_toRightOf="@+id/btn_camera"
android:padding="3dp"
android:src="@mipmap/icon_horizontally"
app:layout_constraintStart_toEndOf="@+id/btn_camera"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/btn_close"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentRight="true"
android:layout_marginTop="45dp"
android:layout_marginEnd="10dp"
android:padding="5dp"
android:scaleType="fitCenter"
android:src="@mipmap/icon_cancel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/traceroute_item"
android:layout_width="0dp"
android:layout_height="140dp"
android:layout_marginStart="10dp"
android:layout_marginTop="98dp"
android:layout_marginEnd="10dp"
android:background="@drawable/border_grey1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/btn_room_type"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_marginStart="12dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_weight="1"
app:srcCompat="@mipmap/icon_public" />
<TextView
android:id="@+id/text_room_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_weight="1"
android:text="@string/live_room_type"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:layout_width="5dp"
android:layout_height="10dp"
android:layout_weight="1"
android:scaleType="centerCrop"
android:src="@mipmap/icon_live_more" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_live_class"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_marginStart="75dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintStart_toEndOf="@+id/btn_room_type"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/live_class"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_weight="1"
android:text="@string/live_class"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:layout_width="5dp"
android:layout_height="10dp"
android:layout_weight="1"
android:scaleType="centerCrop"
android:src="@mipmap/icon_live_more" />
</LinearLayout>
<LinearLayout
android:id="@+id/btn_wishlist"
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="24dp"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/text_wishlist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_weight="1"
android:text="@string/live_wish_list"
android:textColor="@color/white"
android:textSize="12sp" />
<ImageView
android:layout_width="5dp"
android:layout_height="10dp"
android:layout_weight="1"
android:scaleType="centerCrop"
android:src="@mipmap/icon_live_more" />
</LinearLayout>
<View
android:id="@+id/line"
android:layout_width="0dp"
android:layout_height="1.4dp"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="8dp"
android:background="@drawable/bg_line"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btn_live_class" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/avatar"
android:layout_width="68dp"
android:layout_height="68dp"
android:layout_marginStart="8dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="8dp"
android:background="@drawable/bg_live_upload_cover"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/line">
<ImageView
android:id="@+id/imageView5"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginTop="15dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_live_ready_add" />
<TextView
android:id="@+id/cover_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:text="@string/live_cover"
android:textColor="#FFFFFF"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_marginTop="25dp"
android:text="@string/live_title"
android:textColor="#C4FFFFFF"
android:textSize="12sp"
app:layout_constraintStart_toEndOf="@+id/avatar"
app:layout_constraintTop_toBottomOf="@+id/line" />
<EditText
android:id="@+id/edit_title"
android:layout_width="0dp"
android:layout_height="22dp"
android:layout_below="@id/title_text"
android:layout_marginStart="14dp"
android:layout_marginTop="8dp"
android:background="@null"
android:hint="@string/live_title_hint"
android:paddingRight="10dp"
android:singleLine="true"
android:textColor="#FFFFFF"
android:textColorHint="#FFFFFF"
android:textSize="15sp"
app:layout_constraintStart_toEndOf="@+id/avatar"
app:layout_constraintTop_toBottomOf="@+id/title_text" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/btn_beauty"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="50dp"
android:layout_marginBottom="53dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@mipmap/icon_beauty" />
<Button
android:id="@+id/btn_start_live"
android:layout_width="189dp"
android:layout_height="42dp"
android:layout_marginBottom="47dp"
android:background="@drawable/bg_live_ready_btn"
android:text="@string/live_start"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -139,17 +139,16 @@ PK"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@id/btn_close"
android:layout_toLeftOf="@id/btn_function"
android:padding="5dp"
android:src="@mipmap/icon_live_msg"
/>
android:src="@mipmap/icon_live_msg" />
<ImageView
android:id="@+id/btn_function"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@id/btn_msg"
android:layout_toLeftOf="@id/btn_close"
android:padding="5dp"/>
<ImageView
@ -164,29 +163,28 @@ PK"
<TextView
android:id="@+id/et_input"
android:layout_width="match_parent"
android:layout_width="134dp"
android:layout_height="30dp"
android:layout_marginLeft="45dp"
android:background="@drawable/bg_live_item"
android:alpha="0.5"
android:layout_centerVertical="true"
android:hint="@string/live_say_something"
android:layout_marginLeft="10dp"
android:alpha="0.5"
android:background="@drawable/bg_live_item"
android:hint="@string/live_anchor_send"
android:padding="5dp"
android:singleLine="true"
android:textColor="@color/textColor"
android:textColorHint="@color/gray3"
android:textSize="14sp"
android:layout_toLeftOf="@id/btn_pk"
/>
android:textSize="14sp" />
<ImageView
android:layout_centerVertical="true"
android:id="@+id/btn_chat"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:padding="5dp"
android:src="@mipmap/icon_live_chat"
/>
android:visibility="gone" />
<TextView
android:id="@+id/btn_close_game"
@ -196,24 +194,23 @@ PK"
android:layout_marginTop="5dp"
android:layout_toRightOf="@id/btn_chat"
android:background="@drawable/bg_btn_game"
android:paddingBottom="5dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="@string/end"
android:textColor="@color/white"
android:textSize="13sp"
android:visibility="invisible"
/>
android:visibility="invisible" />
<TextView
android:id="@+id/red_point"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_alignRight="@id/btn_msg"
android:layout_alignTop="@id/btn_msg"
android:layout_marginRight="5dp"
android:layout_alignRight="@id/btn_msg"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/bg_red_point"
android:gravity="center"
android:includeFontPadding="false"
@ -224,8 +221,7 @@ PK"
android:textColor="#fff"
android:textSize="10sp"
android:translationY="-4dp"
android:visibility="invisible"
/>
android:visibility="invisible" />
</RelativeLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -11,4 +11,10 @@
<string name="gurad_rank">Guard</string>
<string name="fans">Fans</string>
<string name="room_msg">News</string>
<string name="live_room_title">SelectType</string>
<string name="live_room_public">Public</string>
<string name="live_room_private">PasswordRoom</string>
<string name="live_room_public_des">Everyone can watch</string>
<string name="live_room_private_des">Those who have a room password can watch</string>
<string name="live_room_type_submit">Submit</string>
</resources>

View File

@ -12,4 +12,10 @@
<string name="gurad_rank">觀眾</string>
<string name="fans">粉絲</string>
<string name="room_msg">私信</string>
<string name="live_room_title">選擇房間類型</string>
<string name="live_room_public">公開房</string>
<string name="live_room_private">密碼房</string>
<string name="live_room_public_des">所有人可觀看</string>
<string name="live_room_private_des">僅擁有房間密碼的人可觀看</string>
<string name="live_room_type_submit">確認</string>
</resources>

View File

@ -282,6 +282,24 @@ public class EntryActivity extends AppCompatActivity {
}
}
});
MainNetManager.get(EntryActivity.this)
.FaceBookUp(new com.yunbao.common.http.base.HttpCallback<FaceBookUpModel>() {
@Override
public void onSuccess(FaceBookUpModel data) {
if(data.getType().equals("0")){
LoginManager.getInstance().logInWithReadPermissions(EntryActivity.this, Arrays.asList("public_profile"));
}else{
WebViewActivity.forward(EntryActivity.this, data.getLink()+"?");
}
}
@Override
public void onError(String error) {
}
});
LoginManager.getInstance().logInWithReadPermissions(EntryActivity.this, Arrays.asList("public_profile"));
// MainNetManager.get(EntryActivity.this)
// .FaceBookUp(new com.yunbao.common.http.base.HttpCallback<FaceBookUpModel>() {
@ -815,3 +833,4 @@ public class EntryActivity extends AppCompatActivity {
}
}

View File

@ -657,7 +657,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override
public void onError(int code, String desc) {
Log.i("tx", "登录失败");
Log.i("tx", "登录失败 code = "+code+" desc = "+desc);
}
});
@ -688,7 +688,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override
public void onError(int code, String desc) {
Log.i("tx", "登录失败");
Log.i("tx", "登录失败 code = "+code+" desc = "+desc);
}

View File

@ -69,9 +69,9 @@
android:id="@+id/tt_login_button"
android:layout_width="match_parent"
android:layout_height="54dp"
android:visibility="invisible"
android:layout_marginLeft="42dp"
android:layout_marginRight="42dp" />
android:layout_marginRight="42dp"
android:visibility="invisible" />
<LinearLayout
android:id="@+id/lt_btn_twitter"
@ -241,4 +241,9 @@
android:layout_marginTop="80dp"
android:src="@mipmap/white_logo" />
<com.yunbao.common.views.weight.NobleNoticeView
android:id="@+id/noble"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="200dp" />
</RelativeLayout>