美文网首页bugly
bugly全量更新自定义升级UI弹窗

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

作者: 走在冷风中吧 | 来源:发表于2018-08-03 21:57 被阅读1169次

之前项目中集成了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

相关文章

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

    之前项目中集成了bugly, 使用的是默认的UI样式, 最近领导突然让把样式修改成自定义的, 于是...吐槽bug...

  • Android更新那些事(bugly、flavors、walle

    关于android的更新,我了解到的方法有:1、在应用市场,发布新版本2、使用Bugly的全量更新(应用升级)3、...

  • 关于安卓mvvm基础库集成

    databinding+rxjava+livedata+viewmodel实现 内含bugly全量更新集成 mod...

  • SYAlertView弹窗视图

    SYAlertView自定义弹窗子视图UI根据UI设计需求,自定义各种样式的弹窗子视图: 自定义UI及样式 自定义...

  • Bugly全量更新详解

    前言 在之前我已经讲过了一些关于App版本更新的文章,大家感兴趣的话,可参考以下文章Kotlin笔记(67) — ...

  • Android技术分享| Bugly 应用升级自定义UI

    最近项目里的采用免费的Bugly应用升级功能,由于默认的 UI 非常的简陋且与项目整体风格不搭,所以需要自定义UI...

  • Bugly热更新集成详解

    前言 更新一直是一个很重要的点,从最开始的全量更新,到我之前讲过的增量更新,当然也到今天我要讲的bugly热更新。...

  • vue usePop弹窗控制器

    当UI库弹窗无法满足自定义需求时,需要我们自己开发简单的弹窗组件。弹窗组件与普通业务组件开发没有太大区别,重点在多...

  • Bugly使用——热修复

    项目中之前已经接入bugly的异常收集和全量更新SDK,为了应对bug及时修复以及一些改动不太大的需求,准备接入T...

  • Bugly内测分发体验

    简介 Bugly内测分发是一个『应用内升级』功能。做到了『筛选』和『控量』两个目的,还能在Bugly后台查看下发和...

网友评论

    本文标题:bugly全量更新自定义升级UI弹窗

    本文链接:https://www.haomeiwen.com/subject/xeouvftx.html