diff --git a/config.gradle b/config.gradle index 9b9ac5933..e8971d031 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", @@ -25,8 +25,8 @@ ext { baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false - isGooglePlay : true, + isGooglePlay : false, //是否上报异常日志 - isUploadLog : true + isUploadLog : false ] } \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/adapter/RandomPkRecyclerAdapter.java b/live/src/main/java/com/yunbao/live/adapter/RandomPkRecyclerAdapter.java new file mode 100644 index 000000000..6206619c9 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/RandomPkRecyclerAdapter.java @@ -0,0 +1,56 @@ +package com.yunbao.live.adapter; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.adapter.RefreshAdapter; +import com.yunbao.live.bean.RandomPkBean; + +import java.util.ArrayList; +import java.util.List; + +public class RandomPkRecyclerAdapter extends RefreshAdapter { + private List list=new ArrayList<>(); + + public RandomPkRecyclerAdapter(Context context) { + super(context); + } + + @Override + public void setList(List list) { + this.list = list; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return null; + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + + } + + + @Override + public int getItemCount() { + return 0; + } + + @Override + public int getItemViewType(int position) { + return super.getItemViewType(position); + } + + public class ViewHolder extends RecyclerView.ViewHolder{ + + public ViewHolder(@NonNull View itemView) { + super(itemView); + } + } +} diff --git a/live/src/main/java/com/yunbao/live/bean/RandomPkBean.java b/live/src/main/java/com/yunbao/live/bean/RandomPkBean.java new file mode 100644 index 000000000..c68b735cd --- /dev/null +++ b/live/src/main/java/com/yunbao/live/bean/RandomPkBean.java @@ -0,0 +1,33 @@ +package com.yunbao.live.bean; + +import com.yunbao.common.bean.UserBean; + +public class RandomPkBean extends UserBean { + private String status; + private boolean pkIng; + private boolean follow; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public boolean isPkIng() { + return pkIng; + } + + public void setPkIng(boolean pkIng) { + this.pkIng = pkIng; + } + + public boolean isFollow() { + return follow; + } + + public void setFollow(boolean follow) { + this.follow = follow; + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index ed9d1f8ad..373da2a29 100644 --- a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -1,11 +1,18 @@ package com.yunbao.live.dialog; +import android.os.Bundle; +import android.view.Gravity; import android.view.View; import android.view.Window; +import android.view.WindowManager; +import android.widget.TextView; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.SwitchCompat; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.tabs.TabLayout; +import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.live.R; @@ -15,7 +22,12 @@ import com.yunbao.live.R; public class RandomPkDialogFragment extends AbsDialogFragment { private TabLayout tabLayout; private View reset; - private RecyclerView mRecyclerView; + private CommonRefreshView mRecyclerView; + private View mPkInfoLayout; + private View mPkBtn; + private TextView mPkBtnTitle; + private TextView mPkBtnDesc; + private SwitchCompat mRandomPkSwitch; @Override protected int getLayoutId() { @@ -34,13 +46,74 @@ public class RandomPkDialogFragment extends AbsDialogFragment { @Override protected void setWindowAttributes(Window window) { - initView(); + WindowManager.LayoutParams params = window.getAttributes(); + window.setWindowAnimations(R.style.bottomToTopAnim); + params.width = WindowManager.LayoutParams.MATCH_PARENT; + params.height = WindowManager.LayoutParams.WRAP_CONTENT; + params.gravity = Gravity.BOTTOM; + window.setAttributes(params); + } + + @Override + public void onActivityCreated(@Nullable Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + initView(); + initTab(); + initData(); } private void initView() { tabLayout = (TabLayout) findViewById(R.id.menu_tab); reset = findViewById(R.id.menu_reset); - mRecyclerView = (RecyclerView) findViewById(R.id.random_container_view); + mRecyclerView = (CommonRefreshView) findViewById(R.id.random_container_view); + mPkInfoLayout = findViewById(R.id.layout_random_pk_info); + mPkBtn = findViewById(R.id.random_pk_info_btn); + mPkBtnTitle = (TextView) findViewById(R.id.random_pk_btn_title); + mPkBtnDesc = (TextView) findViewById(R.id.random_pk_btn_desc); + mRandomPkSwitch = (SwitchCompat) findViewById(R.id.live_random_pk_switch); + } + + private void initData() { } + + private void initTab() { + TabLayout.Tab randPkTag = tabLayout.newTab(); + TabLayout.Tab searchTag = tabLayout.newTab(); + TabLayout.Tab listTag = tabLayout.newTab(); + randPkTag.setTag(1); + randPkTag.setText("隨機PK"); + searchTag.setTag(2); + searchTag.setText("主播搜索"); + listTag.setTag(3); + listTag.setText("關注列表"); + tabLayout.addTab(randPkTag); + tabLayout.addTab(searchTag); + tabLayout.addTab(listTag); + tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { + @Override + public void onTabSelected(TabLayout.Tab tab) { + if (tab.getTag() != null) { + switch ((int) tab.getTag()) { + case 1: + mPkInfoLayout.setVisibility(View.VISIBLE); + mRecyclerView.setVisibility(View.GONE); + break; + case 2: + break; + } + } + } + + @Override + public void onTabUnselected(TabLayout.Tab tab) { + + } + + @Override + public void onTabReselected(TabLayout.Tab tab) { + + } + }); + } } diff --git a/live/src/main/res/drawable/bg_item_random_pk_type_1.xml b/live/src/main/res/drawable/bg_item_random_pk_type_1.xml new file mode 100644 index 000000000..ce9ea1e40 --- /dev/null +++ b/live/src/main/res/drawable/bg_item_random_pk_type_1.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_random_pk_rv_search.xml b/live/src/main/res/drawable/bg_random_pk_rv_search.xml new file mode 100644 index 000000000..aae6625dd --- /dev/null +++ b/live/src/main/res/drawable/bg_random_pk_rv_search.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/random_pk_shape_tab_indicator.xml b/live/src/main/res/drawable/random_pk_shape_tab_indicator.xml new file mode 100644 index 000000000..53176bb53 --- /dev/null +++ b/live/src/main/res/drawable/random_pk_shape_tab_indicator.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_live_random_pk_function.xml b/live/src/main/res/layout/dialog_live_random_pk_function.xml index 9ee2ab156..3035cbbca 100644 --- a/live/src/main/res/layout/dialog_live_random_pk_function.xml +++ b/live/src/main/res/layout/dialog_live_random_pk_function.xml @@ -2,6 +2,7 @@ @@ -49,6 +51,7 @@ android:layout_height="match_parent" app:tabIndicatorColor="#F6F7FB" app:tabIndicatorFullWidth="false" + app:tabIndicator="@drawable/random_pk_shape_tab_indicator" app:tabMaxWidth="100dp" app:tabMode="scrollable" app:tabSelectedTextColor="#F6F7FB" @@ -85,9 +88,15 @@ + diff --git a/live/src/main/res/layout/item_random_pk_info.xml b/live/src/main/res/layout/item_random_pk_info.xml index 3a1474a02..31aa12d9c 100644 --- a/live/src/main/res/layout/item_random_pk_info.xml +++ b/live/src/main/res/layout/item_random_pk_info.xml @@ -2,6 +2,8 @@ -