在成品APP直播源码中,对于屏幕底部划出更多面板的实现代码
核心代码如下:

xmlns:sothree="http://schemas.android.com/apk/res-auto"        android:id="@+id/sliding_layout"        android:layout_width="wrap_content"        android:layout_height="425dp"        android:layout_alignParentBottom="true"        android:layout_centerHorizontal="true"        android:gravity="bottom"        sothree:umanoDragView="@+id/dragView"        sothree:umanoOverlay="false"        sothree:umanoPanelHeight="120dp"        sothree:umanoParallaxOffset="100dp"        sothree:umanoScrollableView="@+id/list"        sothree:umanoShadowHeight="0dp">        android:layout_width="match_parent"            android:layout_height="1dp"            android:background="@color/transparent" />                android:id="@+id/dragView"            android:layout_width="match_parent"            android:layout_height="match_parent"            android:clickable="true"            android:focusable="false">            android:id="@+id/pull_layout"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:layout_centerHorizontal="true"                android:paddingLeft="10dp"                android:paddingRight="10dp"                android:paddingBottom="3dp">                android:id="@+id/pull_imageview"                    android:layout_width="20dp"                    android:layout_height="20dp"                    android:src="@drawable/pull_up" />                        android:id="@+id/bottom_layout"                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_below="@+id/pull_layout"                android:background="@color/bg_lightblue"                >                android:id="@+id/simple"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_centerHorizontal="true"                    android:layout_marginBottom="10dp"                    android:layout_marginTop="10dp"                    android:layout_marginLeft="10dp"                    android:layout_marginRight="10dp"                    android:text="蒙奇·D·路飞 日本漫画《航海王》及其衍生作品中的主角,外号“草帽”路飞,草帽一伙、草帽大船团船长,极恶的世代之一。 橡胶果实能力者的橡胶人,悬赏金15亿贝里。梦想是找到传说中的One Piece,成为海贼王" />                android:id="@+id/list"                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:layout_below="@+id/simple"                    android:layout_centerHorizontal="true"                    android:orientation="vertical">                    android:layout_margin="10dp"                        android:layout_width="wrap_content"                        android:layout_height="wrap_content"                        android:text="路飞性格积极乐观,爱憎分明,而且十分重视伙伴,不甘屈居于他人之下,对任何危险的事物都超感兴趣。和其他传统的海贼所不同的是,他并不会为了追求财富而杀戮,而是享受着身为海贼的冒险和自由。" />                    android:layout_width="match_parent"                        android:layout_height="100dp"                        android:src="@drawable/luff"/>                    android:layout_margin="10dp"                        android:layout_width="wrap_content"                        android:layout_height="wrap_content"                        android:text="路飞(Luffy)这名字源自英语“Luff”,意即“逆风航行”,这是他想过最适合船长使用的名字。此外,他也指出路飞生下来就是运势非凡的人;只有实力和运气兼备的人,才能成就伟大功业。" />                                                                

xml中关键的属性配置

sothree:umanoPanelHeight : 收缩状态下的面板高度sothree:umanoOverlay : 是否显示阴影sothree:umanoFadeColor : 设置阴影颜色,可设置透明,同setCoveredFadeColorsothree:umanoScrollableView : 设置可展开的是哪个viewsothree:umanoDragView : 设置外层拖拽的view(包含umanoScrollableView)

java代码设置阴影颜色和滑动监听

 mLayout.setCoveredFadeColor(Color.parseColor("#00000000")); mLayout.addPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {                 @Override            public void onPanelSlide(View panel, float slideOffset) {                     Log.i(TAG, "onPanelSlide, offset " + slideOffset);            }            @Override            public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {                     if(mLayout.getPanelState().toString().equals(SlidingUpPanelLayout.PanelState.COLLAPSED.toString())){                         // 箭头                    pullIV.setImageResource(R.drawable.pull_up);                    // 遮罩层                    hatView.setVisibility(View.GONE);                }else if(mLayout.getPanelState().toString().equals(SlidingUpPanelLayout.PanelState.EXPANDED.toString())){                         pullIV.setImageResource(R.drawable.pull_down);                    hatView.setVisibility(View.VISIBLE);                }            }        });

以上就是关于成品APP直播源码中,屏幕底部画出更多面板的实现代码,更多信息欢迎关注之后的文章
本文转载自网络,转载仅为分享干货知识,如有侵权欢迎联系云豹科技进行删除处理

更多相关文章

  1. android json访问php webservice
  2. android登录模块之静态登录
  3. Android(安卓)实现歌词同步
  4. Android(安卓)MVP 模式:简单易懂的介绍方式
  5. android TextView显示文字和图片
  6. Android使用Google Breakpad进行崩溃日志管理
  7. 阿里路由框架ARouter简介
  8. Android中ScrollView布局初始化显示的时候使页面置顶
  9. 【Android开发】构建第一个APP

随机推荐

  1. 大华NVR监控恢复案例
  2. 如何解决迁移新域后用友ERP U8打印报错执
  3. 面试官:谈谈 SimpleDateFormat 的线程安全
  4. SpringBoot同时支持多个视图解析器jsp+ht
  5. 如何解决 MacBook Pro Touch ID不起作用?
  6. 留后门?Nacos被爆存在严重的旁路身份验证
  7. for do-while
  8. 华为联运游戏或应用审核驳回:游戏启动后弹
  9. 我的应用所需权限都已全部打开,定位数据依
  10. 痞子衡嵌入式:飞思卡尔Kinetis系列MCU启动