android

How to make error message in TextInputLayout appear in center

萝らか妹 提交于 2021-02-16 04:50:35
问题 Currently it looks as in attached with this layout: <android.support.design.widget.TextInputLayout android:id="@+id/layoutCurrentPW" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" app:errorEnabled="true"> How to set the error message "password must at least be 8 characters" to center gravity ? I tried with android:gravity="center" but that did not work. EDIT Layout that includes EditText: <android.support.design.widget.TextInputLayout

How to make error message in TextInputLayout appear in center

戏子无情 提交于 2021-02-16 04:49:16
问题 Currently it looks as in attached with this layout: <android.support.design.widget.TextInputLayout android:id="@+id/layoutCurrentPW" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" app:errorEnabled="true"> How to set the error message "password must at least be 8 characters" to center gravity ? I tried with android:gravity="center" but that did not work. EDIT Layout that includes EditText: <android.support.design.widget.TextInputLayout

How to change AndroidManifest in runtime?

只谈情不闲聊 提交于 2021-02-16 04:38:28
问题 Is it possible to change AndroidManifest.xml in runtime programatically? If it is possible, how can I change the following programatically int he AndroidManifest while running app? android:configChanges="orientation|keyboardHidden" 回答1: No - it's not possible to change the Android AndroidManifest.xml in runtime. But, you CAN do changes in runtime programatically - see here (look for onConfigurationChanged ). 回答2: There is no way to set the configChanges attribute programmatically 来源: https:/

ListAdapter submitList() - How to scroll to beginning

橙三吉。 提交于 2021-02-16 04:09:58
问题 I have an issue with my RecyclerView and ListAdapter. Through an API, I receive items in a ascending order from older to newer. My list is then being refreshed by calling the submitList(items) method. However, since everything is asynchronous, after receiving the first item, the RecyclerView remains on the position of the first item received and showed. Since in the ListAdapter class there is no callback when the submitList() method completed, I cannot find a way to scroll after the updates

Does the Android Keystore make use of the Trusted Execution Environment (TEE) and Secure Element (SE) automatically if it is available?

依然范特西╮ 提交于 2021-02-16 03:08:01
问题 Does the Android Keystore make use of the Trusted Execution Environment (TEE) and Secure Element (SE) automatically if it is available? Or are any further steps required? 回答1: Generally yes. There is no requirement for the Keystore to be hardware backed on all device, but if it is hardware backed and if that is by a TEE (the common case) then it will be used whenever Keystore backed keys are used. See the current CDD document for requirements around this. Section 9.11. Keys and Credentials

三分钟明白 Activity工作流 -- java运用

China☆狼群 提交于 2021-02-15 20:41:02
一、 什么是工作流 以请假为例,现在大多数公司的请假流程是这样的 员工打电话(或网聊)向上级提出请假申请——上级口头同意——上级将请假记录下来——月底将请假记录上交公司——公司将请假录入电脑 采用工作流技术的公司的请假流程是这样的 员工使用账户登录系统——点击请假——上级登录系统点击允许 就这样,一个请假流程就结束了 有人会问,那上级不用向公司提交请假记录?公司不用将记录录入电脑?答案是,用的。但是这一切的工作都会在上级点击允许后自动运行! 这就是工作流技术。 Georgakopoulos给出的工作流定义是: 工作流是将一组任务组织起来以完成某个经营过程:定义了任务的触发顺序和触发条件,每个任务可以由一个或多个软件系统完成,也可以由一个或一组人完成,还可以由一个或多个人与软件系统协作完 二、 工作流技术的优点 从上面的例子,很容易看出 工作流系统,实现了工作流程的自动化,提高了企业运营效率、改善企业资源利用、提高企业运作的灵活性和适应性、提高量化考核业务处理的效率、减少浪费(时间就是金钱)。 而手工处理工作流程,一方面无法对整个流程状况进行有效跟踪、了解,另一方面难免会出现人为的失误和时间上的延时导致效率低下,特别是无法进行量化统计,不利于查询、报表及绩效评估。 三、 Java开发者会为什么要学Activity工作流 在Java领域,JBPM和Activity是两个主流的工作流系统

web前端性能优化

99封情书 提交于 2021-02-15 20:25:08
1、资源(js、css)合并与压缩,减少http请求 1)在线工具压缩 2)构建工具压缩 2、图片优化 1)png8、png24、png32之间的区别 2)图片格式 jpg 图片有损压缩,不支持透明,适用于不需要透明图片的场景 webp 只适用于安卓,ios上有兼容性问题 svg 矢量图,比png小,适用于需要简单的矢量图的场景 png 支持透明,适用于需要大量透明图片的场景 3)雪碧图,将小图标和背景图像合并到一张图片上,然后利用css的背景定位来显示需要显示的图片部分 www.spritecow.com 优点: 将多张图片合并到一张图片中,可以减小图片的总大小 将多张图片合并到一张图片后,只需一次网络请求就可以将所需的资源全部下载,减小建立连接的消耗,在移动端尤为明显 显示雪碧图的条件: 需要一个设置好宽和高的容器 需要设置background-position的值(默认为(0,0),也就是图片的左上角),即移动图片到自己想要的图标位置。 4)Image inline (一般8kb以下的图片用,根据业务场景权衡) <img alt="Embedded Image" src="data:image/png;base64,/9j/4AAQSkZ..." /> 优点: 减少http请求次数    缺点: 会使总体资源变大 浏览器不会缓存内联图片资源 兼容性较差,只支持ie8以上浏览器

egret iOS微信浏览器默认不播放背景音乐

丶灬走出姿态 提交于 2021-02-15 12:16:08
egret iOS微信浏览器默认不播放背景音乐 最近在做一个小项目,用的是egret+微信浏览器环境,在安卓上运行没有任何问题,但是到了万恶的苹果上不行了,立马有问题了,BGM不能自动播放,查了一下发现是IOS系统为了节省用户的流量,禁止了audio标签的自动播放,哈哈哈,特么的,对用户真是太贴心了(不得不吐槽一下,都已经用上苹果了,还会在乎那几个流量费?)。本不想改了,但是这时候万恶的产品经理说,不行,这个必须要能自动播放。没办法,人在屋檐下不得不低头,百度一通,找到一个,一试还真行。在这里贴出来记录一下。 1.首先要在index.html这个文件里添加一个函数用于引导播放: function playsound ( sound , loop ) { if ( sound == null ) { console . log ( 'sound err' ) return ; } var times = loop ? 0 : 1 ; if ( typeof WeixinJSBridge != 'undefined' ) { WeixinJSBridge . invoke ( 'getNetworkType' , { } , function ( e ) { return sound . play ( 0 , times ) . volume = 0 ; } ) ; } else {

Android应用-底部导航栏的使用

£可爱£侵袭症+ 提交于 2021-02-15 12:11:31
[TOC] 底部导航栏是基于Bottom Navigation Bar 插件使用的 这个插件包裹在 com.android.support:design:28.0.0 ,必须引入 1. 设计底部导航栏页面 1.1. 创建必须的文件夹 在res下创建color和menu文件夹 color文件夹: 用于存放导航栏的个性化颜色 menu文件夹: 用于存放导航栏的子项 1.2. 设计主页面 首先设计子项: menu下新建nav_items.xml文件 <?xml version="1.0" encoding="utf-8"?> <menu xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/nav_homes" android:icon="@drawable/ic_home_black_24dp" android:title="@string/nav_home" /> <item android:id="@+id/nav_searchs" android:icon="@drawable/ic_search_black_24dp" android:title="@string

Select subset of characters in many lines (column selection) in Eclipse/Android Studio

主宰稳场 提交于 2021-02-15 10:42:04
问题 How to select subset of characters in many lines (column selection) in Eclipse/Android Studio? Ideally without plugins. Shift+Alt+A seems not to be working for me either. In Notepad++ you can do it with Shift+Alt+(Arrows) or Alt+Left_Mouse (and drag to select) Please see example below (Column selection I'm after): (source: softwareninjaneer.com) Visual Studio and many other tools support it. Thanks 回答1: I use android studio. You can switch between selection mode by: alt - shift - insert , or