bugly全量更新自定义升级UI弹窗

之前项目中集成了bugly, 使用的是默认的UI样式, 最近领导突然让把样式修改成自定义的, 于是...吐槽bugly文档开始:
1.自定义样式第一坑: 弹窗样式的半透明背景需要写在样式里

  1. 自定义样式第二坑: 自定义布局中, bugly写了5个需要对应标注的tag, 但是并没有说其实这五个tag都必须出现在布局中, 否则将显示不出更新的信息

  2. 自定义样式第三坑: 升级弹窗中有下次再说和立即更新两种选项, 但是自定义的文案不管是在样式中直接写死, 还是在弹窗回调中重新复制都不会生效, 目前我还没有找到解决办法

//注意要设置在bugly init之前
Beta.upgradeDialogLayoutId = R.layout.upgrade_dialog;

R.layout.upgrade_dialog文件
注意1: 半透明背景要自己加上
注意2: 即使自定义的弹窗不需要title, info等这些信息, 也需要将对于的tag标出出来, 一共有5个

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/base_aa_transparent_black">

    <RelativeLayout
        android:layout_width="@dimen/base_wh250.0dimens250.0dp"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_gravity="center">

        <ImageView
            android:id="@+id/iv"
            android:layout_width="@dimen/base_wh250.0dimens250.0dp"
            android:layout_height="@dimen/base_wh110.0dimens110.0dp"
            android:src="@drawable/app_upgrade" />

        <TextView
            android:id="@+id/tv_upgrade_cancel"
            android:layout_width="@dimen/base_wh22.0dimens22.0dp"
            android:layout_height="@dimen/base_wh22.0dimens22.0dp"
            android:layout_alignParentEnd="true"
            android:layout_marginEnd="@dimen/base_wh8.0dimens8.0dp"
            android:layout_marginTop="@dimen/base_wh34.0dimens34.0dp"
            android:gravity="center"
            android:tag="beta_cancel_button"
            android:textColor="@color/transparent_color"
            android:background="@drawable/base_close_white"
            android:textSize="@dimen/base_navigator_text17text4j" />

        <TextView
            android:id="@+id/tv_upgrade_feature"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/iv"
            android:background="@color/base_main_white4j"
            android:paddingBottom="@dimen/base_wh20.0dimens20.0dp"
            android:paddingEnd="@dimen/base_wh25.0dimens25.0dp"
            android:paddingStart="@dimen/base_wh25.0dimens25.0dp"
            android:paddingTop="@dimen/base_wh20.0dimens20.0dp"
            android:tag="beta_upgrade_feature"
            android:textColor="@color/base_text_2c5j"
            android:textSize="@dimen/base_wh15.0dimens15.0dp" />

        <View
            android:id="@+id/line"
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:layout_below="@id/tv_upgrade_feature"
            android:background="@color/base_selected_grey9j" />

        <TextView
            android:id="@+id/tv_upgrade_confirm"
            android:layout_width="match_parent"
            android:layout_height="@dimen/base_wh45.0dimens45.0dp"
            android:layout_below="@id/line"
            android:background="@drawable/base_bg_corner_10"
            android:gravity="center"
            android:tag="beta_confirm_button"
            android:visibility="visible"
            android:text="立即升级"
            android:textStyle="bold"
            android:textColor="@color/base_d5aa5c_19j" />
        <TextView
            android:tag="beta_title"
            android:layout_width="0dp"
            android:layout_height="0dp" />
        <TextView
            android:tag="beta_upgrade_info"
            android:layout_width="0dp"
            android:layout_height="0dp" />
    </RelativeLayout>
</RelativeLayout>

效果图:


image.png

更新中:


image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 开始想自己写的,但是看了下面这篇博客写了比我了解的多太多了就直接变成转载了。该博客只能参考作用,请根据最新的官方文...
    Thor_果冻阅读 2,582评论 0 6
  • 在这个吃碗拉面都要互联网+的时代,作为一只安卓开发狗,必须跟紧整互联网大潮整一款装逼的App出来才能不被out啊!...
    VellBibi阅读 4,073评论 5 10
  • 我一直在想什么样的标题才能描述清楚我想要说的问题,文章中不会写如何创建自定义弹窗,如果有这类需求的同学请移步自行G...
    喜欢摄影的developer阅读 40,721评论 56 50
  • 新的学期已经开始两周了,在这开始的两周里自己好像比以前的开学初期忙了许多,除了在开学第天就收到区教研室丁君老师让准...
    xiaonuanba阅读 153评论 0 0
  • 1. 内存布局相关 学习链接堆区(heap): 向高地址扩展的数据结构,由链表实现,内存不连续,由程序员管理 栈区...
    进击的iOS开发阅读 287评论 0 3