diff --git a/common/src/main/res/drawable/bg_main_com_type.xml b/common/src/main/res/drawable/bg_main_com_type.xml index a147ea5da..7118dce79 100644 --- a/common/src/main/res/drawable/bg_main_com_type.xml +++ b/common/src/main/res/drawable/bg_main_com_type.xml @@ -2,8 +2,8 @@ + android:endColor="#FF0FA4FF" + android:startColor="#FF0FA4FF" /> { @Override public int getItemViewType(int position) { - if (position == 0) { + if (position == 4) { return HEAD; - } else if (position > 0) { - LiveBean mode = mList.get(position - 1); + } else{ + if(position>4){ + + } + LiveBean mode = mList.get(position>4?position-1:position); if (TextUtils.equals(mode.getIs_week(), "1")) { return WEEKLAYOUT; } else { @@ -114,8 +117,9 @@ public class MainHomeLiveAdapter extends RefreshAdapter { @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) { + int nowPosition = position>4?position-1:position; if (vh instanceof MainHomeLiveWeekItemViewHolder) { - ((MainHomeLiveWeekItemViewHolder) vh).loadViewDate(mList.get(position - 1), position - 1, Height, new MainHomeLiveWeekItemViewHolder.OnItemClickListener() { + ((MainHomeLiveWeekItemViewHolder) vh).loadViewDate(mList.get(nowPosition), nowPosition, Height, new MainHomeLiveWeekItemViewHolder.OnItemClickListener() { @Override public void onItemClick(LiveBean bean, int position) { if (mOnItemClickListener != null) { @@ -124,7 +128,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter { } }); } else if (vh instanceof MainHomeLiveItemViewHolder) { - ((MainHomeLiveItemViewHolder) vh).loadViewDate(mList.get(position - 1), position - 1, Height, new MainHomeLiveItemViewHolder.OnItemClickListener() { + ((MainHomeLiveItemViewHolder) vh).loadViewDate(mList.get(nowPosition), nowPosition, Height, new MainHomeLiveItemViewHolder.OnItemClickListener() { @Override public void onItemClick(LiveBean bean, int position) { if (mOnItemClickListener != null) { @@ -137,7 +141,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter { @Override public int getItemCount() { - return super.getItemCount() + 1; + return super.getItemCount(); } class HeadVh extends RecyclerView.ViewHolder { diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java index c082df357..9c235552f 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeLivesClassAdapter.java @@ -96,11 +96,9 @@ public class MainHomeLivesClassAdapter extends RecyclerView.Adapter= Build.VERSION_CODES.TIRAMISU) { + permissions = new String[]{ + //Manifest.permission.READ_MEDIA_IMAGES, 去掉选择图片的权限,到里面选择封面的时候再去申请 + Manifest.permission.CAMERA, + Manifest.permission.RECORD_AUDIO + }; + } else { + permissions = new String[]{ + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE, + Manifest.permission.CAMERA, + Manifest.permission.RECORD_AUDIO + }; + } + mProcessResultUtil.requestPermissions(permissions, mStartLiveRunnable); + } else { + ToastUtil.show(mContext.getString(R.string.only_open_anchor)); + } + } + }); } + private Runnable mStartLiveRunnable = new Runnable() { + @Override + public void run() { + if (CommonAppConfig.LIVE_SDK_CHANGED) { + if (mGetLiveSdkCallback == null) { + mGetLiveSdkCallback = new HttpCallback() { + @Override + public void onSuccess(int code, String msg, final String[] info) { + if (code == 0 && info.length > 0) { + LiveHttpUtil.getisRong(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info1) { + try { + LiveHttpUtil.getIsSw(new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] infos) { + JSONObject obj = JSON.parseObject(info[0]); + JSONObject obj1 = JSON.parseObject(info1[0]); + try { + if(code==201){ //声网 + LiveSwAnchorActivity.forward(mContext, Constants.LIVE_SDK_SW, JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class)); + }else if(code==200){//融云 + LiveRyAnchorActivity.forward(mContext, obj.getIntValue("live_sdk"), JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class)); + } + } catch (Exception e) { + + } + } + }); + } catch (Exception e) { + + } + } + }); + } + } + }; + } + if (!CommonAppConfig.IS_PLUGIN_MODEL || PluginManager.getInstance().isDownloadApk()) { + PluginManager.getInstance().loadAnchorPlugin(it -> { + LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback); + }); + } else { + String tips = "需要下載開播插件,是否下載"; + if (!WordUtil.isNewZh()) { + tips = "You need to download the plug-in, whether to download"; + } + DialogUitl.showSimpleDialog(mContext, tips, new DialogUitl.SimpleCallback() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + Dialog downloadDialog = DialogUitl.loadingDialog(mContext, "Downloading..."); + downloadDialog.show(); + PluginManager.getInstance().loadAnchorPlugin(it -> { + LiveHttpUtil.getLiveSdk(mGetLiveSdkCallback); + downloadDialog.dismiss(); + }); + } + }); + } + } else { + LiveAnchorActivity.forward(mContext, CommonAppConfig.LIVE_SDK_USED, LiveConfig.getDefaultKsyConfig()); + } + } + }; + + private HttpCallback mGetLiveSdkCallback; + private ProcessResultUtil mProcessResultUtil; + public void setCurPosition(int position) { mViewPager.setCurrentItem(position); } diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index c480a76c9..3bc6df0d3 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -437,11 +437,11 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi Constants.myUid = u.getGoodnum(); Constants.myAvatar = u.getAvatar(); if (u.getUserInfoComplete() == 1) { - findViewById(R.id.complete_information_radius).setVisibility(View.INVISIBLE); - findViewById(R.id.complete_information).setVisibility(View.INVISIBLE); + //findViewById(R.id.complete_information_radius).setVisibility(View.INVISIBLE); + //findViewById(R.id.complete_information).setVisibility(View.INVISIBLE); } else { - findViewById(R.id.complete_information_radius).setVisibility(View.VISIBLE); - findViewById(R.id.complete_information).setVisibility(View.VISIBLE); + //findViewById(R.id.complete_information_radius).setVisibility(View.VISIBLE); + //findViewById(R.id.complete_information).setVisibility(View.VISIBLE); } EventBus.getDefault().post(new CompleteInformationEvent().setCompleteInformation(findViewById(R.id.complete_information).getVisibility() == View.VISIBLE)); } diff --git a/main/src/main/res/drawable/bg_msg_top_title.xml b/main/src/main/res/drawable/bg_msg_top_title.xml new file mode 100644 index 000000000..9b676adc1 --- /dev/null +++ b/main/src/main/res/drawable/bg_msg_top_title.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/main/src/main/res/drawable/bg_my_info_input.xml b/main/src/main/res/drawable/bg_my_info_input.xml new file mode 100644 index 000000000..e19d754f1 --- /dev/null +++ b/main/src/main/res/drawable/bg_my_info_input.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/main/src/main/res/layout/item_main_home_com_class.xml b/main/src/main/res/layout/item_main_home_com_class.xml index c4f677c53..5bec56cad 100644 --- a/main/src/main/res/layout/item_main_home_com_class.xml +++ b/main/src/main/res/layout/item_main_home_com_class.xml @@ -1,21 +1,21 @@ + android:paddingBottom="10dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + android:textSize="16sp" + android:gravity="center" + android:textColor="#FF777777"/> + \ No newline at end of file diff --git a/main/src/main/res/layout/item_main_home_live_head.xml b/main/src/main/res/layout/item_main_home_live_head.xml index 2bc10b407..859d4e5d0 100644 --- a/main/src/main/res/layout/item_main_home_live_head.xml +++ b/main/src/main/res/layout/item_main_home_live_head.xml @@ -1,7 +1,6 @@ @@ -26,9 +25,8 @@ android:id="@+id/banner" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginLeft="3dp" - - android:layout_marginBottom="5dp" + android:layout_marginStart="5dp" + android:layout_marginBottom="10dp" app:delay_time="3000" app:indicator_drawable_selected="@drawable/bg_home_indicator_selected" app:indicator_drawable_unselected="@drawable/bg_home_indicator_unselected" diff --git a/main/src/main/res/layout/item_main_home_lives_class.xml b/main/src/main/res/layout/item_main_home_lives_class.xml index c17159264..5bec56cad 100644 --- a/main/src/main/res/layout/item_main_home_lives_class.xml +++ b/main/src/main/res/layout/item_main_home_lives_class.xml @@ -3,7 +3,6 @@ android:orientation="vertical" android:gravity="center" android:paddingRight="5dp" - android:layout_marginLeft="15dp" android:paddingTop="12dp" android:paddingBottom="10dp" android:layout_width="wrap_content" @@ -16,8 +15,7 @@ android:text="音乐" android:textSize="16sp" android:gravity="center" - android:background="@drawable/button_ffc621" - android:textColor="#FFC621"/> + android:textColor="#FF777777"/> \ No newline at end of file diff --git a/main/src/main/res/layout/simple_pager_title_layout.xml b/main/src/main/res/layout/simple_pager_title_layout.xml index e96098453..6d4324eed 100644 --- a/main/src/main/res/layout/simple_pager_title_layout.xml +++ b/main/src/main/res/layout/simple_pager_title_layout.xml @@ -21,6 +21,7 @@ diff --git a/main/src/main/res/layout/view_main_home.xml b/main/src/main/res/layout/view_main_home.xml index 1e99b6ebd..4d0aa3c28 100644 --- a/main/src/main/res/layout/view_main_home.xml +++ b/main/src/main/res/layout/view_main_home.xml @@ -19,8 +19,8 @@ @@ -62,14 +62,23 @@ android:id="@+id/ijiasdw" android:layout_width="wrap_content" android:layout_height="match_parent" + android:gravity="center_vertical" android:layout_alignParentRight="true" android:layout_alignParentBottom="true"> + + diff --git a/main/src/main/res/layout/view_main_home_com.xml b/main/src/main/res/layout/view_main_home_com.xml index 4442a10d0..36ecd6f27 100644 --- a/main/src/main/res/layout/view_main_home_com.xml +++ b/main/src/main/res/layout/view_main_home_com.xml @@ -11,7 +11,7 @@ android:id="@+id/appBarLayout" android:layout_width="match_parent" android:layout_height="70dp" - android:layout_marginTop="20dp" + android:layout_marginTop="10dp" android:background="@android:color/transparent" android:fadingEdge="none" app:elevation="0dp" @@ -19,13 +19,13 @@ - diff --git a/main/src/main/res/layout/view_main_me.xml b/main/src/main/res/layout/view_main_me.xml index 51e45af5f..976538bb0 100644 --- a/main/src/main/res/layout/view_main_me.xml +++ b/main/src/main/res/layout/view_main_me.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/gray2" + android:background="#FFF7F8FA" android:orientation="vertical" android:paddingBottom="50dp"> @@ -27,43 +27,95 @@ android:orientation="vertical"> - + android:layout_height="40dp"> + + + + + + + + + + + + + + + @@ -80,7 +132,6 @@ android:id="@+id/lt_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="21dp" android:layout_marginTop="8dp" android:gravity="center" android:orientation="horizontal"> @@ -90,9 +141,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="用戶名稱" + android:ellipsize="end" + android:maxLines="1" android:textColor="@color/black2" - android:textSize="19sp" - android:textStyle="bold" /> + android:textSize="15sp" + /> + android:textSize="11sp" /> @@ -134,8 +185,8 @@ android:visibility="gone" /> + android:id="@+id/complete_information" + android:layout_marginEnd="15dp" + android:layout_width="wrap_content" + android:layout_height="match_parent"> - - - + + @@ -267,8 +316,8 @@ android:paddingTop="6dp"> @@ -734,9 +784,9 @@ android:orientation="vertical"> + android:layout_height="4dp" + android:layout_marginTop="2dp" + android:background="@drawable/bg_msg_top_title" + android:scaleType="fitXY" /> @@ -66,7 +65,7 @@ android:layout_gravity="end|bottom" android:layout_marginStart="8dp" android:layout_marginTop="18dp" - android:layout_marginEnd="15dp" + android:layout_marginEnd="5dp" android:layout_marginBottom="16dp" android:layout_weight="0.1" android:src="@mipmap/ic_msg_contacts" @@ -90,33 +89,30 @@ + android:layout_height="wrap_content" + android:orientation="vertical"> - + - + - + - - + + - - + + + - + + + + android:layout_weight="1" + android:visibility="gone" + tools:visibility="visible"> + android:layout_weight="1" + android:visibility="gone" + tools:visibility="visible"> + android:layout_weight="1" + android:visibility="gone" + tools:visibility="visible">