1.在登录或引导页面添加 “已阅读和同意用户使用协议隐私政策”
<LinearLayoutandroid:layout_width="match_parent"android:layout_height="30dp"android:orientation="horizontal"android:gravity="center"><CheckBoxandroid:id="@+id/checkBox"android:layout_width="wrap_content"android:layout_height="wrap_content"android:theme="@style/MyCheckBox"/><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="已阅读并同意"android:textSize="14sp"/><TextViewandroid:id="@+id/tv_xieyi"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/xieyi"android:textSize="14sp"/><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="和"android:textSize="14sp"/><TextViewandroid:id="@+id/tv_yinsi"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="@string/zhengce"android:textSize="14sp"/>
</LinearLayout>

2.点击用户使用协议隐私政策时,显示dialog弹窗

String str = initAssets("yszc.txt");
final View inflate = LayoutInflater.from(mActivity).inflate(R.layout.dialog_xieyi_yinsi_style, null);
TextView tv_title = (TextView) inflate.findViewById(R.id.tv_title);
tv_title.setText("隐私政策");
TextView tv_content = (TextView) inflate.findViewById(R.id.tv_content);
tv_content.setText(str);
final Dialog dialog = new AlertDialog.Builder(mActivity).setView(inflate).show();
final WindowManager.LayoutParams params = dialog.getWindow().getAttributes();
params.width = 800;
params.height = 1200;
dialog.getWindow().setAttributes(params);
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);

3.将隐私政策yszc.txt和用户使用协议yhsyxy.txt的文本放在assets下

4.读取assets下的文件

/*** 从assets下的txt文件中读取数据*/
public String initAssets(String fileName) {String str = null;try {InputStream inputStream = getAssets().open(fileName);str = getString(inputStream);} catch (IOException e1) {e1.printStackTrace();}return str;
}
public static String getString(InputStream inputStream) {InputStreamReader inputStreamReader = null;try {inputStreamReader = new InputStreamReader(inputStream, "UTF-8");} catch (UnsupportedEncodingException e1) {e1.printStackTrace();}BufferedReader reader = new BufferedReader(inputStreamReader);StringBuffer sb = new StringBuffer("");String line;try {while ((line = reader.readLine()) != null) {sb.append(line);sb.append("\n");}} catch (IOException e) {e.printStackTrace();}return sb.toString();
}

5.dialog主体内容的布局 dialog_xieyi_yinsi_style.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"android:background="@drawable/background_dialog_xieyi"><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"><LinearLayoutandroid:layout_above="@+id/ll_btn_bottom"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"android:gravity="center"android:layout_marginBottom="15dp"><TextViewandroid:id="@+id/tv_title"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="用户使用协议"android:textSize="18sp"android:textColor="@color/colorBlack"android:layout_marginTop="10dp"android:layout_marginBottom="10dp"/><ScrollViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:fadingEdgeLength="50dp"android:requiresFadingEdge="horizontal"android:layout_marginLeft="5dp"android:layout_marginRight="5dp"><TextViewandroid:id="@+id/tv_content"android:layout_width="match_parent"android:layout_height="match_parent"android:singleLine="false"android:text=""android:textColor="@color/colorBlack"android:layout_marginTop="10dp"/></ScrollView></LinearLayout><LinearLayoutandroid:id="@+id/ll_btn_bottom"android:layout_width="match_parent"android:layout_height="40dp"android:layout_alignParentBottom="true"android:gravity="center"android:visibility="gone"><Buttonandroid:id="@+id/tv_cancle"android:layout_width="60dp"android:layout_height="30dp"android:text="关闭"android:textSize="15dp"android:textColor="@color/white"android:background="@drawable/blue_btn_bg"android:layout_marginBottom="5dp"/></LinearLayout></RelativeLayout>
</LinearLayout>

6.布局中的圆角背景 drawable/background_dialog_xieyi.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="rectangle"><!-- 填充色 --><solid android:color="@color/white" /><!--描边、 线的宽度,颜色 --><!--<stroke--><!--android:width="1dp"--><!--android:color="@color/colorMainColor" />--><!-- 矩形圆角半径 --><corners android:radius="10dp" />
</shape>

Android APP 用户协议与隐私政策 圆角Dialog显示相关推荐

  1. APP用户协议和隐私政策怎么写?

    用户协议参考: 欢迎您签订<合作协议>(下称"本协议")!本协议签约主体为您与SAC俱乐部平台经营者(陕西联杰宇宙娱乐有限公司],下称"SAC俱乐部" ...

  2. 编程乐园APP、编程学院APP的《用户协议与隐私政策》(Code Land and Code Land2's Privacy Policy)

    编程乐园APP.编程学院APP的<用户协议与隐私政策> 本软件尊重并保护所有使用服务用户的个人隐私权.本软件为手机本地应用,不涉及任何网络功能.不申请任何网络权限.因此本软件不会将您的个人 ...

  3. 「助记词密盒」用户协议与隐私政策

    用户协议: 本协议是您(以下简称"用户")与 助记词密盒APP(以下简称"APP")之间就助记词密盒提供的服务等相关事宜所订立的契约,对用户与助记词密盒具有法律 ...

  4. iOS隐私安全:用户协议及隐私政策弹框(包含超链接属性、demo支持中英文切换)【设置 NSLinkAttributeName 字体颜色:链接默认蓝色】

    文章目录 前言 I 自定义TextView 1.1 采用富文本属性进行内容设置 1.2 实现代理方法 II 封装<用户协议及隐私政策>视图 2.1 封装带有富文本字符串的TextView视 ...

  5. iOS自定义视图:阅读并同意注册协议 【用户协议及隐私政策入口】

    文章目录 前言 I .用户协议及隐私政策的超链接功能实现方式 1.1 使用富文本API `NSLinkAttributeName` 实现超链接功能 1.2 使用按钮处理点击事件实现超链接功能 II. ...

  6. uniapp打包的app上架应用商店隐私政策:您的应用在用户同意隐私政策前申请获取用户个人信息

    uniapp打包的app上架应用商店需要在进入app前弹出隐私政策框 app在上架应用商店的时候要验证是否在进入应用前有隐私政策的弹窗,因为最近自己app在华为应用商店,由于没有这个隐私政策弹窗导致下 ...

  7. User Agreement(APP用户协议)

    User Agreement(APP用户协议) Privacy policy This application respects and protects the privacy of all use ...

  8. App用户协议隐私政策

    用户协议 尊敬的用户,欢迎使用由深圳市中其信息技术有限公司(下列简称为"中其"或"中其信息")提供的服务.在使用前请您阅读如下服务协议,使用本应用即表示您同意接 ...

  9. 【Google Play】Android 应用用户协议 ( 生成用户协议 | HTML 用户协议模板 | Markdown 用户协议模板 )

    文章目录 一.生成用户协议 二.HTML 用户协议模板 三.Markdown 用户协议模板 一.生成用户协议 推荐使用 https://toolbox.yolo.blue/#/terms-and-co ...

最新文章

  1. shiro处理ajax请求未登录,shiro处理ajax请求session失效跳转
  2. 【Java Web后台实验与开发】CookieSession部分
  3. strstr函数_【每日编程176期】实现strStr() II
  4. C#中使用DbHelper连接SqlServer数据库
  5. TensorFlow 教程——基本分类:对服装图像进行分类
  6. mysql客户端安装错误_windows下mysql 5.7以上版本安装及遇到的问题
  7. Linux 字符设备驱动开发基础(一)—— 编写简单 LED 设备驱动
  8. go利用反射实现任意类型切片删除元素
  9. 跑步(【CCF】NOI Online能力测试 入门组第二题)
  10. 初学Python01
  11. TensorFlow基础篇(二)——tf.get_variable()和tf.get_variable_scope()
  12. matlab strel
  13. 计算机专业认识实习目的,计算机专业实习目的与意义
  14. 《道德经》全文和译文
  15. 第三方银联支付接口对接_php版银联支付接口开发简明教程
  16. python课程设计——当当网Python图书数据分析
  17. 火狐,Firefox浏览器怎么设置主页
  18. 毕业论文关键字HTML5,毕业论文关键词的选择
  19. 中考可以使用计算机吗,中考物理课可以带计算机吗
  20. TEE7是什么?好不好

热门文章

  1. qt和android文件传输,编写qt到安卓手机的一些小心得
  2. 根据文件头判断文件真实类型,让更改后缀的文件无所遁形!
  3. 【转载】Unix设计哲学 回车换行八卦 EOF八卦 UNIX目录结构八卦
  4. Switch与for循环
  5. PostMapping和GetMapping
  6. @RequestMapping与@GetMapping区别
  7. Java实现算法推荐:Mahout实践
  8. 我们一起去旅行-上海西塘苏杭篇
  9. 暗影精灵win11装ubuntu双系统,安装显卡驱动、配置深度学习环境
  10. 逃不掉的小球-第10届蓝桥杯Scratch国赛真题第1题