This commit is contained in:
18142669586 2022-08-20 14:48:09 +08:00
parent 8bd6a6b071
commit 3ae14ed506
16 changed files with 422 additions and 42 deletions

View File

@ -92,13 +92,19 @@
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:replace="theme,label,icon,allowBackup"> tools:replace="theme,label,icon,allowBackup">
<service <service
android:name="io.rong.push.platform.google.RongFirebaseMessagingService" android:name="com.shayu.phonelive.utils.MyNotificationService">
android:stopWithTask="false"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/> <action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter> </intent-filter>
</service> </service>
<!-- <service-->
<!-- android:name="io.rong.push.platform.google.RongFirebaseMessagingService"-->
<!-- android:stopWithTask="false"-->
<!-- android:exported="false">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.google.firebase.MESSAGING_EVENT"/>-->
<!-- </intent-filter>-->
<!-- </service>-->
<activity <activity
android:name="com.shayu.phonelive.activity.LauncherActivity" android:name="com.shayu.phonelive.activity.LauncherActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
@ -158,6 +164,7 @@
<meta-data <meta-data
android:name="firebase_analytics_collection_enabled" android:name="firebase_analytics_collection_enabled"
android:value="false" /> android:value="false" />
</application> </application>
</manifest> </manifest>

View File

@ -0,0 +1,70 @@
package com.shayu.phonelive.utils;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.RingtoneManager;
import android.net.Uri;
import android.util.Log;
import android.widget.RemoteViews;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import com.google.android.gms.common.internal.zzm;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.main.activity.MainActivity;
import myname.pdlive.shayu.R;
public class MyNotificationService extends FirebaseMessagingService {
private String createNotificationChannel(String channelID, String channelNAME, int level) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
NotificationChannel channel = new NotificationChannel(channelID, channelNAME, level);
manager.createNotificationChannel(channel);
return channelID;
} else {
return null;
}
}
public void onMessageReceived(RemoteMessage remoteMessage) {
Log.e("gmc","remoteMessage");
// do nothing
sendNotification("remoteMessage");
}
private void sendNotification(String messageBody) {
// 设置通知的点击行为这里启动一个 Activity
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);
String channelId = createNotificationChannel("my_channel_ID", "my_channel_NAME", NotificationManager.IMPORTANCE_HIGH);
// 构建 remoteView
RemoteViews remoteView = new RemoteViews(getPackageName(), R.layout.notification_message);
// remoteView.setTextViewText(R.id.tvMsg, "RemoteViews");
// remoteView.setImageViewResource(R.id.ivIcon, R.mipmap.ic_launcher_round);
NotificationCompat.Builder builder = new NotificationCompat.Builder(this,channelId);
// 设置自定义 RemoteViews
builder.setContent(remoteView).setSmallIcon(R.mipmap.ic_launcher);
// 设置通知的优先级(悬浮通知)
builder.setPriority(NotificationCompat.PRIORITY_MAX);
builder.setContentIntent(pendingIntent);
builder.setAutoCancel(true);
Notification notification = builder.build();
NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(0, notification);
}
}

View File

@ -45,12 +45,8 @@ public abstract class HttpCallback extends AbsCallback<JsonBean> {
//token过期重新登录 //token过期重新登录
RouteUtil.forwardLoginInvalid(data.getMsg()); RouteUtil.forwardLoginInvalid(data.getMsg());
} else { } else {
if(data.getInfo().length==0){
onSuccess(data.getCode(), data.getMsg(), new String[]{data.getData()});
}else {
onSuccess(data.getCode(), data.getMsg(), data.getInfo()); onSuccess(data.getCode(), data.getMsg(), data.getInfo());
} }
}
} else { } else {
L.e("服务器返回值异常--->ret: " + bean.getRet() + " msg: " + bean.getMsg()); L.e("服务器返回值异常--->ret: " + bean.getRet() + " msg: " + bean.getMsg());
} }

View File

@ -0,0 +1,53 @@
<?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="80dp"
android:gravity="center">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="60dp"
android:orientation="horizontal">
<ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:textColor="@color/yellow4"
android:text="我开播了!"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:layout_marginTop="5dp"
android:textColor="@color/gray3"
android:text="说好的,你今天来看我直播!"/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:textColor="@color/gray3"
android:layout_alignParentRight="true"
android:text="PD LIVE"/>
</RelativeLayout>

View File

@ -9,9 +9,10 @@ ext {
] ]
manifestPlaceholders = [ 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", txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -290,7 +290,7 @@ public class ImListAdapter extends RecyclerView.Adapter
} }
if ("1".equals(bean.getIs_admin())) { if ("1".equals(bean.getIs_admin())) {
ImgLoader.display(mContext, "https://qny.shayucm.com/Instructors.png", img_new); ImgLoader.display(mContext, "https://downs.yaoulive.com/Instructors.png", img_new);
img_new.setVisibility(View.VISIBLE); img_new.setVisibility(View.VISIBLE);
} else { } else {
img_new.setVisibility(View.GONE); img_new.setVisibility(View.GONE);

View File

@ -326,7 +326,7 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
}); });
//周星 //周星
BannerBean bannerBean = new BannerBean(); BannerBean bannerBean = new BannerBean();
bannerBean.setImageUrl("https://qny.shayucm.com/img/BTN_WEEKSTAR%20%281%29.png"); bannerBean.setImageUrl("https://downs.yaoulive.com/img/BTN_WEEKSTAR%20%281%29.png");
bannerBean.setLink("zxb"); bannerBean.setLink("zxb");
mBannerList1.add(bannerBean); mBannerList1.add(bannerBean);
@ -358,18 +358,18 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
} }
} }
BannerBean banner3Bean = new BannerBean(); BannerBean banner3Bean = new BannerBean();
banner3Bean.setImageUrl("https://qny.shayucm.com/live_Mission_box.png"); banner3Bean.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
banner3Bean.setLink(obj.getString("sendgift")); banner3Bean.setLink(obj.getString("sendgift"));
mBannerList3.add(banner3Bean); mBannerList3.add(banner3Bean);
BannerBean banner3Bean1 = new BannerBean(); BannerBean banner3Bean1 = new BannerBean();
banner3Bean1.setImageUrl("https://qny.shayucm.com/live_Mission_box.png"); banner3Bean1.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
banner3Bean1.setLink(obj.getString("attent")); banner3Bean1.setLink(obj.getString("attent"));
mBannerList3.add(banner3Bean1); mBannerList3.add(banner3Bean1);
BannerBean banner3Bean2 = new BannerBean(); BannerBean banner3Bean2 = new BannerBean();
banner3Bean2.setImageUrl("https://qny.shayucm.com/live_Mission_box.png"); banner3Bean2.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png");
banner3Bean2.setLink(obj.getString("illumine")); banner3Bean2.setLink(obj.getString("illumine"));
mBannerList3.add(banner3Bean2); mBannerList3.add(banner3Bean2);

View File

@ -1773,7 +1773,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 获取是否有热度卡加成 * 获取是否有热度卡加成
*/ */
public static void getIsHot() { public static void getIsHot() {
ImgLoader.display(Contexts, "https://qny.shayucm.com/img_hot_gif.gif", img_hot_gif); ImgLoader.display(Contexts, "https://downs.yaoulive.com/img_hot_gif.gif", img_hot_gif);
LiveHttpUtil.isHotCard(mLiveUid, new HttpCallback() { LiveHttpUtil.isHotCard(mLiveUid, new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {

View File

@ -70,6 +70,8 @@ dependencies {
// //
api project(':video') api project(':video')
api project(':common') api project(':common')
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
annotationProcessor rootProject.ext.dependencies["arouter-compiler"] annotationProcessor rootProject.ext.dependencies["arouter-compiler"]
api files('libs/OpenInstall_v2.3.0.jar') api files('libs/OpenInstall_v2.3.0.jar')
implementation project(path: ':lib_country_code') implementation project(path: ':lib_country_code')

View File

@ -5,7 +5,10 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".activity.OneLoginActivity"></activity> <activity
android:name=".MsgSettActivity"
android:exported="false" />
<activity android:name=".activity.OneLoginActivity" />
<activity <activity
android:name=".activity.WeekWebViewActivity" android:name=".activity.WeekWebViewActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
@ -56,7 +59,7 @@
<activity <activity
android:name=".activity.SearchActivity" android:name=".activity.SearchActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/CAppTheme"/> android:theme="@style/CAppTheme" />
<activity <activity
android:name=".activity.FollowActivity" android:name=".activity.FollowActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
@ -122,8 +125,7 @@
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".activity.MyWebViewActivity2" android:name=".activity.MyWebViewActivity2"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" /> <!-- 融云消息列表界面 -->
<!--融云消息列表界面-->
<activity <activity
android:name=".activity.PDLiveConversationListActivity" android:name=".activity.PDLiveConversationListActivity"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
@ -131,7 +133,9 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/noAnimationStyle" android:theme="@style/noAnimationStyle"
android:windowSoftInputMode="stateHidden|adjustResize" /> android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name=".activity.MsgSettActivity"
android:screenOrientation="portrait" />
</application> </application>
</manifest> </manifest>

View File

@ -277,23 +277,23 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
// RTCLib 初始化 // RTCLib 初始化
RCRTCConfig.Builder config = RCRTCConfig.Builder.create(); RCRTCConfig.Builder config = RCRTCConfig.Builder.create();
RCRTCEngine.getInstance().init(MainActivity.this, config.build()); RCRTCEngine.getInstance().init(MainActivity.this, config.build());
// FirebaseMessaging.getInstance().getToken() FirebaseMessaging.getInstance().getToken()
// .addOnCompleteListener(new OnCompleteListener<String>() { .addOnCompleteListener(new OnCompleteListener<String>() {
// @Override @Override
// public void onComplete(@NonNull Task<String> task) { public void onComplete(@NonNull Task<String> task) {
// if (!task.isSuccessful()) { if (!task.isSuccessful()) {
// Log.w(TAG, "Fetching FCM registration token failed", task.getException()); Log.w(TAG, "Fetching FCM registration token failed", task.getException());
// return; return;
// } }
//
// // Get new FCM registration token // Get new FCM registration token
// String token = task.getResult(); String token = task.getResult();
//
// // Log and toast // Log and toast
// Log.d(TAG, token); Log.d(TAG, token);
// Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT).show(); Toast.makeText(MainActivity.this, token, Toast.LENGTH_SHORT).show();
// } }
// }); });
boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false); boolean showInvite = getIntent().getBooleanExtra(Constants.SHOW_INVITE, false);
mRootView = (ViewGroup) findViewById(R.id.rootView); mRootView = (ViewGroup) findViewById(R.id.rootView);
floatBanner = findViewById(R.id.float_banner_home); floatBanner = findViewById(R.id.float_banner_home);
@ -379,6 +379,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (showInvite) { if (showInvite) {
showInvitationCode(); showInvitationCode();
} }
checkVersion(); checkVersion();
loginIM(); loginIM();
CommonAppConfig.getInstance().setLaunched(true); CommonAppConfig.getInstance().setLaunched(true);

View File

@ -0,0 +1,23 @@
package com.yunbao.main.activity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.main.R;
public class MsgSettActivity extends AbsActivity {
@Override
protected int getLayoutId() {
return R.layout.activity_msg_sett;
}
@Override
protected void main() {
super.main();
setTitle("消息通知");
}
}

View File

@ -96,6 +96,8 @@ public class SettingActivity extends AbsActivity implements OnItemClickListener<
FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(),1); FollowActivity.forward(mContext, CommonAppConfig.getInstance().getUid(),1);
} else if (bean.getId() == SETTING_CLEAR_CACHE) {//清除缓存 } else if (bean.getId() == SETTING_CLEAR_CACHE) {//清除缓存
clearCache(position); clearCache(position);
}else if (bean.getId() == 21) {//清除缓存
startActivity(new Intent(SettingActivity.this,MsgSettActivity.class));
} }
} else { } else {
if (bean.getId() == 17) {//意见反馈要在url上加版本号和设备号 if (bean.getId() == 17) {//意见反馈要在url上加版本号和设备号

View File

@ -60,7 +60,7 @@ public class PDLiveCustomConversationProvider extends BaseConversationProvider {
if (userInfo != null && !TextUtils.isEmpty(userInfo.getExtra())) { if (userInfo != null && !TextUtils.isEmpty(userInfo.getExtra())) {
IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class); IMLoginModel model = new Gson().fromJson(userInfo.getExtra(), IMLoginModel.class);
if (model != null && TextUtils.equals(model.getIsAdmin(), "1")) if (model != null && TextUtils.equals(model.getIsAdmin(), "1"))
Glide.with(holder.getContext()).asDrawable().load("https://qny.shayucm.com/Instructors.png").into(imgNew); Glide.with(holder.getContext()).asDrawable().load("https://downs.yaoulive.com/Instructors.png").into(imgNew);
} }
} }

View File

@ -35,7 +35,7 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
super.init(); super.init();
img_trophy = (ImageView) findViewById(R.id.img_trophy); img_trophy = (ImageView) findViewById(R.id.img_trophy);
ImgLoader.display(mContext, "https://qny.shayucm.com/gif_trophy.gif", img_trophy); ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy);
} }
@Override @Override

View File

@ -0,0 +1,221 @@
<?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="#F4F6F8"
android:orientation="vertical">
<include layout="@layout/view_title" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="73dp"
android:layout_marginTop="12dp"
android:background="@color/color_white">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="26dp"
android:gravity="center|left"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="動態消息"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="主播發佈新動態通知"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:id="@+id/special_switch"
android:layout_width="40.8dp"
android:layout_height="24.8dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="end|center_vertical"
android:layout_marginRight="25dp"
android:src="@mipmap/special_icon_off" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="73dp"
android:background="@color/color_white">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="26dp"
android:gravity="center|left"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="動態消息"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="主播發佈新動態通知"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="40.8dp"
android:layout_height="24.8dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="end|center_vertical"
android:layout_marginRight="25dp"
android:src="@mipmap/special_icon_off" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="73dp"
android:background="@color/color_white">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="26dp"
android:gravity="center|left"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="動態消息"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="主播發佈新動態通知"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="40.8dp"
android:layout_height="24.8dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="end|center_vertical"
android:layout_marginRight="25dp"
android:src="@mipmap/special_icon_off" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="73dp"
android:background="@color/color_white">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="26dp"
android:gravity="center|left"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="動態消息"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="主播發佈新動態通知"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="40.8dp"
android:layout_height="24.8dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="end|center_vertical"
android:layout_marginRight="25dp"
android:src="@mipmap/special_icon_off" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="73dp"
android:layout_marginTop="12dp"
android:background="@color/color_white">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="26dp"
android:gravity="center|left"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="動態消息"
android:textColor="#ff1e1f20"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="主播發佈新動態通知"
android:textColor="#ffc7c8c9"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="40.8dp"
android:layout_height="24.8dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_gravity="end|center_vertical"
android:layout_marginRight="25dp"
android:src="@mipmap/special_icon_off" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>