diff --git a/common/build.gradle b/common/build.gradle index eb03a2177..3f9c8d5dd 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -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样式库 diff --git a/common/src/main/assets/icon_noble_chaohuang.svga b/common/src/main/assets/icon_noble_chaohuang.svga new file mode 100644 index 000000000..f0d13f774 Binary files /dev/null and b/common/src/main/assets/icon_noble_chaohuang.svga differ diff --git a/common/src/main/assets/icon_noble_gongjue.svga b/common/src/main/assets/icon_noble_gongjue.svga new file mode 100644 index 000000000..c0a90c61e Binary files /dev/null and b/common/src/main/assets/icon_noble_gongjue.svga differ diff --git a/common/src/main/assets/icon_noble_guowang.svga b/common/src/main/assets/icon_noble_guowang.svga new file mode 100644 index 000000000..5360deb8d Binary files /dev/null and b/common/src/main/assets/icon_noble_guowang.svga differ diff --git a/common/src/main/assets/icon_noble_houjue.svga b/common/src/main/assets/icon_noble_houjue.svga new file mode 100644 index 000000000..1ffe267a7 Binary files /dev/null and b/common/src/main/assets/icon_noble_houjue.svga differ diff --git a/common/src/main/assets/icon_noble_huangdi.svga b/common/src/main/assets/icon_noble_huangdi.svga new file mode 100644 index 000000000..584c7f62d Binary files /dev/null and b/common/src/main/assets/icon_noble_huangdi.svga differ diff --git a/common/src/main/assets/icon_noble_nanjue.svga b/common/src/main/assets/icon_noble_nanjue.svga new file mode 100644 index 000000000..49f840673 Binary files /dev/null and b/common/src/main/assets/icon_noble_nanjue.svga differ diff --git a/common/src/main/assets/icon_noble_zijue.svga b/common/src/main/assets/icon_noble_zijue.svga new file mode 100644 index 000000000..1a78b5455 Binary files /dev/null and b/common/src/main/assets/icon_noble_zijue.svga differ diff --git a/common/src/main/java/com/yunbao/common/utils/BitmapUtil.java b/common/src/main/java/com/yunbao/common/utils/BitmapUtil.java index 9af6cd15f..9ea112281 100644 --- a/common/src/main/java/com/yunbao/common/utils/BitmapUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/BitmapUtil.java @@ -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) { + // 前面同上,绘制图像分别需要bitmap,canvas,paint对象 + 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; + } } diff --git a/common/src/main/java/com/yunbao/common/views/weight/FullServiceNotificationView.java b/common/src/main/java/com/yunbao/common/views/weight/FullServiceNotificationView.java index 9b2d3b39e..e83e8060f 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/FullServiceNotificationView.java +++ b/common/src/main/java/com/yunbao/common/views/weight/FullServiceNotificationView.java @@ -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(); } diff --git a/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java b/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java new file mode 100644 index 000000000..48521ff5d --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/weight/NobleNoticeView.java @@ -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 observable = Observable.create(new ObservableOnSubscribe() { + @Override + public void subscribe(ObservableEmitter 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 observer = new Observer() { + + @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; + } + } +} diff --git a/common/src/main/res/drawable/background_baron_station_horn.xml b/common/src/main/res/drawable/background_baron_station_horn.xml new file mode 100644 index 000000000..f061ab10c --- /dev/null +++ b/common/src/main/res/drawable/background_baron_station_horn.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/common/src/main/res/drawable/background_duke_king_horn.xml b/common/src/main/res/drawable/background_duke_king_horn.xml new file mode 100644 index 000000000..578b49bad --- /dev/null +++ b/common/src/main/res/drawable/background_duke_king_horn.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/common/src/main/res/drawable/background_duke_station_horn.xml b/common/src/main/res/drawable/background_duke_station_horn.xml new file mode 100644 index 000000000..936f0e615 --- /dev/null +++ b/common/src/main/res/drawable/background_duke_station_horn.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/common/src/main/res/drawable/background_marquis_station_horn.xml b/common/src/main/res/drawable/background_marquis_station_horn.xml new file mode 100644 index 000000000..b6ed329f4 --- /dev/null +++ b/common/src/main/res/drawable/background_marquis_station_horn.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/common/src/main/res/drawable/background_viscount_station_horn.xml b/common/src/main/res/drawable/background_viscount_station_horn.xml new file mode 100644 index 000000000..6aba0932a --- /dev/null +++ b/common/src/main/res/drawable/background_viscount_station_horn.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/view_noble_notice.xml b/common/src/main/res/layout/view_noble_notice.xml new file mode 100644 index 000000000..ca2830b5d --- /dev/null +++ b/common/src/main/res/layout/view_noble_notice.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/icon_open_chaohuang.png b/common/src/main/res/mipmap-xxhdpi/icon_open_chaohuang.png new file mode 100644 index 000000000..0f08eda06 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_open_chaohuang.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_open_gongjue.png b/common/src/main/res/mipmap-xxhdpi/icon_open_gongjue.png new file mode 100644 index 000000000..bed8cf7a2 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_open_gongjue.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_open_guowang.png b/common/src/main/res/mipmap-xxhdpi/icon_open_guowang.png new file mode 100644 index 000000000..10493dfdb Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_open_guowang.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_open_houjue.png b/common/src/main/res/mipmap-xxhdpi/icon_open_houjue.png new file mode 100644 index 000000000..0b43bcf7f Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_open_houjue.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_open_huangdi.png b/common/src/main/res/mipmap-xxhdpi/icon_open_huangdi.png new file mode 100644 index 000000000..547fe8c56 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_open_huangdi.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_open_nanjue.png b/common/src/main/res/mipmap-xxhdpi/icon_open_nanjue.png new file mode 100644 index 000000000..d90c2adec Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_open_nanjue.png differ diff --git a/common/src/main/res/mipmap-xxhdpi/icon_open_zijue.png b/common/src/main/res/mipmap-xxhdpi/icon_open_zijue.png new file mode 100644 index 000000000..520a3059e Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_open_zijue.png differ diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 311b2a5c7..1c8f3f578 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -892,4 +892,14 @@ 向你發送了一個獎勵,快來領取吧! 和大家說些什麼 直播設置 + 圍觀 + 的直播間開通了 + 男爵 + 子爵 + 侯爵 + 公爵 + 国王 + 皇帝 + 超皇 + diff --git a/config.gradle b/config.gradle index 629b46c1d..b0db8e5e2 100644 --- a/config.gradle +++ b/config.gradle @@ -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", diff --git a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java index 8212d6d02..064c081b5 100644 --- a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java @@ -13,7 +13,6 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Environment; -import android.os.Message; import android.provider.Settings; import android.util.Base64; import android.util.Log; @@ -67,46 +66,33 @@ import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; import com.yunbao.common.activity.WebViewActivity; -import com.yunbao.common.bean.BaseModel; -import com.yunbao.common.bean.FaceBookUpModel; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LoginData; import com.yunbao.common.bean.UserBean; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; -import com.yunbao.common.http.live.LiveNetManager; -import com.yunbao.common.http.main.MainNetManager; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.NoviceInstructorManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; -import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.views.weight.NobleNoticeView; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.bean.LiveBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; -import com.yunbao.live.socket.SocketRyClient; import com.yunbao.main.R; -import com.yunbao.main.dialog.LoginTipsDialog; -import com.yunbao.main.event.RegSuccessEvent; import com.yunbao.main.http.MainHttpUtil; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; -import org.json.JSONException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; -import java.util.List; -import io.rong.imlib.RongIMClient; -import io.rong.message.TextMessage; - -import static com.blankj.utilcode.util.SnackbarUtils.dismiss; import static com.yunbao.common.CommonAppContext.home_zdy_img_cn; import static com.yunbao.common.CommonAppContext.home_zdy_img_us; import static com.yunbao.common.CommonAppContext.logger; @@ -133,6 +119,7 @@ public class EntryActivity extends AppCompatActivity { private GoogleSignInClient mGoogleSignInClient; private LinearLayout lt_btn_twitter, lt_btn_facebook, lt_customer; private String kefuUrl = ""; + private NobleNoticeView noble; @Subscribe(threadMode = ThreadMode.MAIN) public void close(String str) { @@ -200,6 +187,7 @@ public class EntryActivity extends AppCompatActivity { btn_phone = findViewById(R.id.btn_phone); btn_line = findViewById(R.id.btn_line); lt_customer = findViewById(R.id.lt_customer); + noble = findViewById(R.id.noble); btn_tip.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); btn_tip.getPaint().setAntiAlias(true); @@ -226,8 +214,9 @@ public class EntryActivity extends AppCompatActivity { btn_phone.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - LoginTipsDialog loginTipsDialog = new LoginTipsDialog(); - loginTipsDialog.show(getSupportFragmentManager(), "LoginTipsDialog"); +// LoginTipsDialog loginTipsDialog = new LoginTipsDialog(); +// loginTipsDialog.show(getSupportFragmentManager(), "LoginTipsDialog"); + noble.setRoleType(NobleNoticeView.RoleType.BETTER_EMPEROR); } }); @@ -763,7 +752,7 @@ public class EntryActivity extends AppCompatActivity { IMLoginManager.get(EntryActivity.this).setisNewUserOne(true); MainActivity.forward(EntryActivity.this, false); gotoLive(obj.getString("anchor_id")); - if(obj.containsKey("home_zdy_img_us")) { + if (obj.containsKey("home_zdy_img_us")) { home_zdy_img_us = obj.getString("home_zdy_img_us"); home_zdy_img_cn = obj.getString("home_zdy_img_cn"); } diff --git a/main/src/main/res/layout/activity_entry.xml b/main/src/main/res/layout/activity_entry.xml index 9a8d0a3cb..af31c49e5 100644 --- a/main/src/main/res/layout/activity_entry.xml +++ b/main/src/main/res/layout/activity_entry.xml @@ -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" /> + \ No newline at end of file