- Android Fragment笔记
ChrisChanSysu
生命周期Fragment生命周期常用的子类DialogFragment显示浮动对话框ListFragment显示由Adapter管理的一系列项目PreferenceFragment以列表形式显示Preference对象的层次结构,用于创建“设置”布局向Activity添加Fragment在Activity的布局文件内通过标签声明Fragment通过FragmentTransaction的add(@
- DialogFragment你可能踩过或将要踩的坑
菜鸟何时起飞
原文地址:https://www.jianshu.com/p/db2946b0b217(1)dialogfragment展示时引起的崩溃问题(2)内存泄露问题(3)加载含有fragment的view导致的崩溃dialogfragment展示时引起的崩溃问题这个问题比较简单,就是在dialogfragment要展示的时候,如果按home键返回到了桌面,这时强行调用show方法就会导致app崩溃,抛出
- DialogFragment
微笑碧落
1.设置DialogFragment外部点击不能关闭ViewDialogFragmentdialog=newViewDialogFragment();dialog.setCancelable(false);//加上这句外部取消和back取消都无效一定要在这里设置。在ViewDialogFragment里面的新建Dialog里设置不能生效dialog.show(fm,TAG);2.设置dialog背
- DialogFragment(四)——自定义通用dialogFragment
奔跑的佩恩
前言相信大家在做项目的时候,都会用到一些提示网络状况,是否更新app啊啥的需要与用户进行互动的提示框。我们希望能有一个统一的提示框dialog,能英应对各种app中需要的一般性提示。当然,我在DialogFragment(二)——创建默认dialogFragment一文中已经实现了提示框的统一性,但其自由与可控性还不够,于是我写了一个新的dialogFragment--------SyDialog
- Android DialogFragment 底部弹框 去掉默认的左右下边距
拉风的喵了个咪得儿
android
DialogFragment默认左右下会有边距这个需要重写一下onstart,关键属性,必须给设置背景图classMyBottomDialogFragment:DialogFragment(){overridefunonCreateDialog(savedInstanceState:Bundle?):Dialog{valdialog=Dialog(requireContext())dialog.s
- 后台弹窗-Dialog只显示了一层蒙灰,没有布局,DialogFragment无法点击交互
秋晓知风
问题叙述APP业务需求是,使用了一个后台服务监听后台推送通知,有些通知收到后就要弹窗展示给用户,并做相关操作,这样就出现了:第一个问题使用Dialog时,当切到后台执行弹窗后,再次将APP切换到前台后,弹窗的UI没有出现,页面上出现一层蒙灰,其下层页面点击事件正常;第二个问题使用的DialogFragment弹窗时,因为需求要做成只显示一个弹窗,要关闭已经展示的弹窗,显示新的弹窗,然而APP切到后
- Fragment生命周期的坑和DialogFragment宽高的坑
键盘上的麒麟臂
最近在开发单页面应用,多个fragment嵌套在一个activity里面,和之前单个Fragment依赖在activivty中管理还是有点不同,我这Fragment嵌套了3层,最终还是出问题了。一.Fragment生命周期的坑1.问题描述我用FragmentManager去管理和切换Fragment,在这过程中用到了回退栈,先声明对于回退栈的出栈操作fragmentmanager.popBackS
- DialogFragment监听返回键的方法
lucas777
在onCreateView中加入this.getDialog().setOnKeyListener(newOnKeyListener(){@OverridepublicbooleanonKey(DialogInterfacearg0,intkeyCode,KeyEventarg2){//TODOAuto-generatedmethodstubif(keyCode==KeyEvent.KEYCODE
- DialogFragment中通过dataBinding绑定View,设置点击事件无效,通过getWindow设置dialog位置和大小无效。
安卓更新太快了
Bug杂谈androidkotlin开发语言
1、问题描述:DialogFragment中通过dataBinding绑定View,设置点击事件无效。privatevalbinding:CoreDialogEditContentBindingbylazy{CoreDialogEditContentBinding.inflate(mContext.layoutInflater)}privatefuninitWindowView(){valview
- 解决DialogFragment状态栏亮色问题
白熊小北极
上一篇文章:AndroidDialogFragment快速使用方法-(jianshu.com)前言请先看上一篇文章,本篇文件紧接着上一篇的思路和框架,所有的操作还是在父类的BaseDialog下进行关于ViewBinding注意!!!不要和DataBinding弄混了官方文档:视图绑定|Android开发者|AndroidDevelopers(google.cn)先说点题外话,DialogFrag
- Android中不让软键盘顶起DialogFragment弹窗
守望的天空_9a6e
最近做需求遇到一个问题,说是问题也可能不是,主要还是看需求吧。废话不多说,先抛出这个需求问题,做的东西是对某些素材的评论弹窗,类似抖音、头条这种,很多app也都有,实现方案是使用了BottomSheetDialogFragment去实现,视图的高度是屏幕高度的80%,后来由于某些原因替换为DialogFragment,这时问题出现了,当我点击评论弹窗里的某条内容回复评论时,需要弹出输入法,这时这个
- Android DialogFragment(2)
zhangphil
Androidandroid
AndroidDialogFragment(2)附录文章1简单介绍了如何实现一个DialogFragment,本文再介绍一种简单的方法:直接重写DialogFragment的onCreateDialog返回一个AlertDialog实现对话框。本文的例子和附录文章1不同的地方:不在依赖onCreateView。代码运行逻辑简述:功能简单,当点击FloatingActionButton后弹出一个
- Android DialogFragment全屏
zhangphil
Androidandroid
在onCreate里面写入代码:@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setStyle(DialogFragment.STYLE_NORMAL,android.R.style.Theme_Holo_Light_NoActionBar_Fullscreen)
- Android屏幕底部弹出DialogFragment(3)
zhangphil
Androidandroid
Android屏幕底部弹出DialogFragment(3)附录文章1,2的DialogFragment是常规的DialogFragment,但是现在的一些Android开发中,往往需要从底部弹出一个功能对话框供用户选择使用。这种底部弹出的对话框开源项目也很多,比如附录文章3,4,5,6,7,8,9,10,11。对Android原生的DialogFragment进行改造,也可以实现底部弹出的对
- Android DialogFragment(1)
zhangphil
Androidandroid
AndroidDialogFragment(1)和过去的AlertDialog类似,Android引入的DialogFragment旨在为开发者提供一个“富”dialog,而不必受到过去AndroidAlertDialog的局限。首先,DialogFragment是一个Fragment,它有Fragment的一切属性和生命周期,其次,DialogFragment具有和AlertDialog相类似的
- 如何解决Android中DialogFragmen标题栏ttitle无法显示的问题与样式设计
Jett Klyne
Androidandroidjava开发语言
前言最近在使用DialogFragment中,遇到了设置标题无效的问题原因查找相关文档,在API21以后在style中XML默认是true解决解决步骤一在使用DialogFragment中,重写onCreateDialog@NonNull@OverridepublicDialogonCreateDialog(@NullableBundlesavedInstanceState){Dialogdial
- dialogfragment 数据交互_交互的学习与应用指南 | 人人都是产品经理
weixin_39905037
dialogfragment数据交互软件观念革命:交互设计精髓
编辑导语:交互设计就是互联网产品与用户之间的一个交流,交互设计是比较了解和靠近用户体验的,以用户为中心对交互过程进行研究和设计;本文作者分享了关于交互的学习和应用指南,我们一起来了解一下。千万不要以为培训班的老师传你几年的功力就真的够使了,知道跟理解是两个阶段,交互设计还得实践出真知。身边有些朋友想要学习交互设计,又怕平时工作琐碎学不好,问到我该如何学习和开展交互设计工作?交互设计的市场与发展又是
- DialogFragment的使用技巧
番茄tomato
一.前言在我看来,DialogFragment可以帮助我们非常方便地完成自定义弹窗,随心所欲的控制弹窗出现的位置,出现动画等等。甚至可以处理一些复杂的业务,同时拥有Dialog和Fragment的所有特点。可以轻量地用于一个loading,也可以重业务的处理一些很复杂的逻辑。使用起来非常的方便,现在我的项目中的对话框全部采用DialogFragment,后续可能会用来做一些侧滑菜单或者上拉抽屉等效
- Android DialogFragment关闭状态如何监听?
aitality
DialogFragment大家都不陌生,这也是官方推荐使用的弹框方式,关于这个类的使用也很多,今天就讲一下如何监听的它的关闭状态。在很多情况下,我们都要对用户的行为进行监听,比如在弹框消失的时候刷新页面,这是很常见的需求了,使用Dialog做的话,我们可以使用dialog.setOnDismissListener(DialogInterface.OnDismissListenerlistener
- DialogFragment 設置横竖屏各自宽高,且适应屏幕旋转
花艺荣
@OverridepublicvoidonConfigurationChanged(@NonNullConfigurationnewConfig){DisplayMetricsdisplayMetrics=newDisplayMetrics();getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetric
- android的fragment作用,《Android Fragment 非常详细的一篇》
庄有猫
导语:Fragment作为Android最基本,最重要的基础概念之一,在开发中经常会和他打交道。本文从为什么出现Fragment开始,介绍了Fragment相关的方方面面,包括Fragment的基本定义及使用、回退栈的内部实现、Fragment通信、DialogFragment、ViewPager+Fragment的使用、嵌套Fragment、懒加载等。基本概念Fragment,简称碎片,是And
- Butterfly 重磅更新,一个支持Activity、Fragment、DialogFragment以及Compose UI的全功能路由组件化框架
Season_zlc
Butterfly.pngGitHub:https://github.com/ssseasonnn/Butterfly经过漫长的等待,Butterfly终于发布了新版本,本次更新为大家带来全功能的路由框架,不仅支持Activity、Fragment和DialogFragment,同时增加了ComposeUI的路由支持,至此,一个大一统的路由框架诞生了。不仅小巧灵活,而且功能强大,Butterfly
- 使用DialogFragment时出现的问题
LanceHsiung
最近公司项目里面有一些弹出的页面,采用了DialogFragment的方式,但是经常在调用Dismiss的时候会报错CannotperformthisactionafteronSaveInstanceState网上找了很多都是说把commit()方法替换成commitAllowingStateLoss()还有说用反射重写show()方法,目的也是为了把show()方法中的commit()方法替换成
- 判断当前Activity是否有DialogFragment显示
阿根vs
Android知识归纳android
DialogFragment一种情况是在当前Activity上启动,一种情况是在Fragment上启动,判断当前fragmentManager上是否有,以及遍历判断子fragment上是否有,即可确定是否有DialogFragment展示。使用方式://supportFragmentManager为当前Activity的fragmentManagerhasDialogFragment(suppor
- DialogFragment实现截图,生成二维码,保存图片到本地功能
木叶纷飞
packagecom.dianchou.dcw.view.strict.group.goods.dialog;importandroid.app.DialogFragment;importandroid.app.ProgressDialog;importandroid.content.ClipboardManager;importandroid.content.Context;importandr
- Android Kotlin仿iOS底部选择框
懵叶
自定义控件Androidandroidkotlinios
先看下使用方式:DialogFunction(data=listOf("相册","拍照")){position,_->setListener(baseActivity)when(position){0->{//选择相册}1->{//拍照}}}.show(activity.supportFragmentManager,"showPhotoDialog")源码:继承自DialogFragment/**
- 日常积累2
niknowzcd
Android里如何让DialogFragment的宽度顶满屏幕?在dialogFragment中的onstart()方法调用以下代码@OverridepublicvoidonStart(){super.onStart();Windowwindow=getDialog().getWindow();if(window!=null){getDialog().getWindow().setBackgro
- 日常搬砖 dialogfragment
luoye呀
说实话,dialogfragment其实没有什么讲的,使用方式都差不多,主题设置和activity差不多。主要有几个属性。是否全屏。全屏后背景是否变暗。是否保留标题栏。是否保留边框。@android:color/transparenttrue@nulltruefalseandroid:backgroundDimEnabled这个属性设置true后,背景就全透明了。大概这么设置:image.pngi
- 全屏dialogfragment 状态栏黑
木木阳光
@OverridepublicvoidonActivityCreated(@NullableBundlesavedInstanceState){Windowwindow=getDialog().getWindow();window.requestFeature(Window.FEATURE_NO_TITLE);window.setDimAmount(0);window.clearFlags(Win
- DialogFragment使用
文强小弟
https://www.jianshu.com/p/d1852b04a0aa使用一个DialogFragment一般我们需要重新写一个类来继承DialogFragment,DialogFragment原本其实也是一个fragment,只是其内部绑定了dialog,所以很多操作是差不多的。创建一个DialogFragment有两个方法,一个是我们比较熟悉的,重新onCreateDialog方法,返回
- 集合框架
天子之骄
java数据结构集合框架
集合框架
集合框架可以理解为一个容器,该容器主要指映射(map)、集合(set)、数组(array)和列表(list)等抽象数据结构。
从本质上来说,Java集合框架的主要组成是用来操作对象的接口。不同接口描述不同的数据类型。
简单介绍:
Collection接口是最基本的接口,它定义了List和Set,List又定义了LinkLi
- Table Driven(表驱动)方法实例
bijian1013
javaenumTable Driven表驱动
实例一:
/**
* 驾驶人年龄段
* 保险行业,会对驾驶人的年龄做年龄段的区分判断
* 驾驶人年龄段:01-[18,25);02-[25,30);03-[30-35);04-[35,40);05-[40,45);06-[45,50);07-[50-55);08-[55,+∞)
*/
public class AgePeriodTest {
//if...el
- Jquery 总结
cuishikuan
javajqueryAjaxWebjquery方法
1.$.trim方法用于移除字符串头部和尾部多余的空格。如:$.trim(' Hello ') // Hello2.$.contains方法返回一个布尔值,表示某个DOM元素(第二个参数)是否为另一个DOM元素(第一个参数)的下级元素。如:$.contains(document.documentElement, document.body); 3.$
- 面向对象概念的提出
麦田的设计者
java面向对象面向过程
面向对象中,一切都是由对象展开的,组织代码,封装数据。
在台湾面向对象被翻译为了面向物件编程,这充分说明了,这种编程强调实体。
下面就结合编程语言的发展史,聊一聊面向过程和面向对象。
c语言由贝尔实
- linux网口绑定
被触发
linux
刚在一台IBM Xserver服务器上装了RedHat Linux Enterprise AS 4,为了提高网络的可靠性配置双网卡绑定。
一、环境描述
我的RedHat Linux Enterprise AS 4安装双口的Intel千兆网卡,通过ifconfig -a命令看到eth0和eth1两张网卡。
二、双网卡绑定步骤:
2.1 修改/etc/sysconfig/network
- XML基础语法
肆无忌惮_
xml
一、什么是XML?
XML全称是Extensible Markup Language,可扩展标记语言。很类似HTML。XML的目的是传输数据而非显示数据。XML的标签没有被预定义,你需要自行定义标签。XML被设计为具有自我描述性。是W3C的推荐标准。
二、为什么学习XML?
用来解决程序间数据传输的格式问题
做配置文件
充当小型数据库
三、XML与HTM
- 为网页添加自己喜欢的字体
知了ing
字体 秒表 css
@font-face {
font-family: miaobiao;//定义字体名字
font-style: normal;
font-weight: 400;
src: url('font/DS-DIGI-e.eot');//字体文件
}
使用:
<label style="font-size:18px;font-famil
- redis范围查询应用-查找IP所在城市
矮蛋蛋
redis
原文地址:
http://www.tuicool.com/articles/BrURbqV
需求
根据IP找到对应的城市
原来的解决方案
oracle表(ip_country):
查询IP对应的城市:
1.把a.b.c.d这样格式的IP转为一个数字,例如为把210.21.224.34转为3524648994
2. select city from ip_
- 输入两个整数, 计算百分比
alleni123
java
public static String getPercent(int x, int total){
double result=(x*1.0)/(total*1.0);
System.out.println(result);
DecimalFormat df1=new DecimalFormat("0.0000%");
- 百合——————>怎么学习计算机语言
百合不是茶
java 移动开发
对于一个从没有接触过计算机语言的人来说,一上来就学面向对象,就算是心里上面接受的了,灵魂我觉得也应该是跟不上的,学不好是很正常的现象,计算机语言老师讲的再多,你在课堂上面跟着老师听的再多,我觉得你应该还是学不会的,最主要的原因是你根本没有想过该怎么来学习计算机编程语言,记得大一的时候金山网络公司在湖大招聘我们学校一个才来大学几天的被金山网络录取,一个刚到大学的就能够去和
- linux下tomcat开机自启动
bijian1013
tomcat
方法一:
修改Tomcat/bin/startup.sh 为:
export JAVA_HOME=/home/java1.6.0_27
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export PATH=$JAVA_HOME/bin:$PATH
export CATALINA_H
- spring aop实例
bijian1013
javaspringAOP
1.AdviceMethods.java
package com.bijian.study.spring.aop.schema;
public class AdviceMethods {
public void preGreeting() {
System.out.println("--how are you!--");
}
}
2.beans.x
- [Gson八]GsonBuilder序列化和反序列化选项enableComplexMapKeySerialization
bit1129
serialization
enableComplexMapKeySerialization配置项的含义
Gson在序列化Map时,默认情况下,是调用Key的toString方法得到它的JSON字符串的Key,对于简单类型和字符串类型,这没有问题,但是对于复杂数据对象,如果对象没有覆写toString方法,那么默认的toString方法将得到这个对象的Hash地址。
GsonBuilder用于
- 【Spark九十一】Spark Streaming整合Kafka一些值得关注的问题
bit1129
Stream
包括Spark Streaming在内的实时计算数据可靠性指的是三种级别:
1. At most once,数据最多只能接受一次,有可能接收不到
2. At least once, 数据至少接受一次,有可能重复接收
3. Exactly once 数据保证被处理并且只被处理一次,
具体的多读几遍http://spark.apache.org/docs/lates
- shell脚本批量检测端口是否被占用脚本
ronin47
#!/bin/bash
cat ports |while read line
do#nc -z -w 10 $line
nc -z -w 2 $line 58422>/dev/null2>&1if[ $?-eq 0]then
echo $line:ok
else
echo $line:fail
fi
done
这里的ports 既可以是文件
- java-2.设计包含min函数的栈
bylijinnan
java
具体思路参见:http://zhedahht.blog.163.com/blog/static/25411174200712895228171/
import java.util.ArrayList;
import java.util.List;
public class MinStack {
//maybe we can use origin array rathe
- Netty源码学习-ChannelHandler
bylijinnan
javanetty
一般来说,“有状态”的ChannelHandler不应该是“共享”的,“无状态”的ChannelHandler则可“共享”
例如ObjectEncoder是“共享”的, 但 ObjectDecoder 不是
因为每一次调用decode方法时,可能数据未接收完全(incomplete),
它与上一次decode时接收到的数据“累计”起来才有可能是完整的数据,是“有状态”的
p
- java生成随机数
cngolon
java
方法一:
/**
* 生成随机数
* @author
[email protected]
* @return
*/
public synchronized static String getChargeSequenceNum(String pre){
StringBuffer sequenceNum = new StringBuffer();
Date dateTime = new D
- POI读写海量数据
ctrain
海量数据
import java.io.FileOutputStream;
import java.io.OutputStream;
import org.apache.poi.xssf.streaming.SXSSFRow;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming
- mysql 日期格式化date_format详细使用
daizj
mysqldate_format日期格式转换日期格式化
日期转换函数的详细使用说明
DATE_FORMAT(date,format) Formats the date value according to the format string. The following specifiers may be used in the format string. The&n
- 一个程序员分享8年的开发经验
dcj3sjt126com
程序员
在中国有很多人都认为IT行为是吃青春饭的,如果过了30岁就很难有机会再发展下去!其实现实并不是这样子的,在下从事.NET及JAVA方面的开发的也有8年的时间了,在这里在下想凭借自己的亲身经历,与大家一起探讨一下。
明确入行的目的
很多人干IT这一行都冲着“收入高”这一点的,因为只要学会一点HTML, DIV+CSS,要做一个页面开发人员并不是一件难事,而且做一个页面开发人员更容
- android欢迎界面淡入淡出效果
dcj3sjt126com
android
很多Android应用一开始都会有一个欢迎界面,淡入淡出效果也是用得非常多的,下面来实现一下。
主要代码如下:
package com.myaibang.activity;
import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.os.CountDown
- linux 复习笔记之常见压缩命令
eksliang
tar解压linux系统常见压缩命令linux压缩命令tar压缩
转载请出自出处:http://eksliang.iteye.com/blog/2109693
linux中常见压缩文件的拓展名
*.gz gzip程序压缩的文件
*.bz2 bzip程序压缩的文件
*.tar tar程序打包的数据,没有经过压缩
*.tar.gz tar程序打包后,并经过gzip程序压缩
*.tar.bz2 tar程序打包后,并经过bzip程序压缩
*.zi
- Android 应用程序发送shell命令
gqdy365
android
项目中需要直接在APP中通过发送shell指令来控制lcd灯,其实按理说应该是方案公司在调好lcd灯驱动之后直接通过service送接口上来给APP,APP调用就可以控制了,这是正规流程,但我们项目的方案商用的mtk方案,方案公司又没人会改,只调好了驱动,让应用程序自己实现灯的控制,这不蛋疼嘛!!!!
发就发吧!
一、关于shell指令:
我们知道,shell指令是Linux里面带的
- java 无损读取文本文件
hw1287789687
读取文件无损读取读取文本文件charset
java 如何无损读取文本文件呢?
以下是有损的
@Deprecated
public static String getFullContent(File file, String charset) {
BufferedReader reader = null;
if (!file.exists()) {
System.out.println("getFull
- Firebase 相关文章索引
justjavac
firebase
Awesome Firebase
最近谷歌收购Firebase的新闻又将Firebase拉入了人们的视野,于是我做了这个 github 项目。
Firebase 是一个数据同步的云服务,不同于 Dropbox 的「文件」,Firebase 同步的是「数据」,服务对象是网站开发者,帮助他们开发具有「实时」(Real-Time)特性的应用。
开发者只需引用一个 API 库文件就可以使用标准 RE
- C++学习重点
lx.asymmetric
C++笔记
1.c++面向对象的三个特性:封装性,继承性以及多态性。
2.标识符的命名规则:由字母和下划线开头,同时由字母、数字或下划线组成;不能与系统关键字重名。
3.c++语言常量包括整型常量、浮点型常量、布尔常量、字符型常量和字符串性常量。
4.运算符按其功能开以分为六类:算术运算符、位运算符、关系运算符、逻辑运算符、赋值运算符和条件运算符。
&n
- java bean和xml相互转换
q821424508
javabeanxmlxml和bean转换java bean和xml转换
这几天在做微信公众号
做的过程中想找个java bean转xml的工具,找了几个用着不知道是配置不好还是怎么回事,都会有一些问题,
然后脑子一热谢了一个javabean和xml的转换的工具里,自己用着还行,虽然有一些约束吧 ,
还是贴出来记录一下
顺便你提一下下,这个转换工具支持属性为集合、数组和非基本属性的对象。
packag
- C 语言初级 位运算
1140566087
位运算c
第十章 位运算 1、位运算对象只能是整形或字符型数据,在VC6.0中int型数据占4个字节 2、位运算符: 运算符 作用 ~ 按位求反 << 左移 >> 右移 & 按位与 ^ 按位异或 | 按位或 他们的优先级从高到低; 3、位运算符的运算功能: a、按位取反: ~01001101 = 101
- 14点睛Spring4.1-脚本编程
wiselyman
spring4
14.1 Scripting脚本编程
脚本语言和java这类静态的语言的主要区别是:脚本语言无需编译,源码直接可运行;
如果我们经常需要修改的某些代码,每一次我们至少要进行编译,打包,重新部署的操作,步骤相当麻烦;
如果我们的应用不允许重启,这在现实的情况中也是很常见的;
在spring中使用脚本编程给上述的应用场景提供了解决方案,即动态加载bean;
spring支持脚本