草庐IT

keyboard-navigation

全部标签

Android:单Activity多Fragment,Navigation实现Fragment跳转,Fragment之间通过ViewModel共享数据

单Activity多Fragment,Navigation实现Fragment跳转,Fragment之间通过ViewModel共享数据1、MainActivity2、HomeFragment,DetailFragment2.1、HomeFragment2.2、DetailFragment3、MyViewModel参考1、MainActivity1、activity_main.xml?xmlversion="1.0"encoding="utf-8"?>androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://sc

Android:单Activity多Fragment,Navigation实现Fragment跳转,Fragment之间通过ViewModel共享数据

单Activity多Fragment,Navigation实现Fragment跳转,Fragment之间通过ViewModel共享数据1、MainActivity2、HomeFragment,DetailFragment2.1、HomeFragment2.2、DetailFragment3、MyViewModel参考1、MainActivity1、activity_main.xml?xmlversion="1.0"encoding="utf-8"?>androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://sc

Android-Jetpack-Navigation组件使用

图片来源网络可能有部分Android开发的小伙伴见过单Activity多Fragment的App,使用起来非常的流畅或者说非常的丝滑。自己想要尝试这种开发模式的时候,又会发现Fragment的管理会比较麻烦。现在不用怕了,AndroidSDK为了我们提供了Navigation来实现这种开发模式。希望这篇文章对小伙伴们有所启发。Navigation的优势先来说说使用Navigation的优势:可以可视化页面的导航,可以帮我们快速理清页面之间的关系;通过destination和action完成页面之间的导航;方便我们添加页面的切换动画;页面之间类型安全的参数传递;通过NavigationUI类,对

Navigator.sendBeacon-页面关闭也能发送请求

背景最近在需求中有一个这样的场景:需要在页面关闭的时候,用户不需要操作,主动关闭当前订单当时考虑的方案:在页面关闭的时候,向后端发送一个请求,将这个资源释放掉;定下方案时,觉得也不是什么难事,觉得谷歌浏览器应该会提供页面关闭的API供开发者使用。经过查找,找到了这么两个API:beforeunload和unloadbeforeunload当浏览器窗口关闭或者刷新时,会触发beforeunload事件。当前页面不会直接关闭,可以点击确定按钮关闭或刷新,也可以取消关闭或刷新。window.addEventListener('beforeunload',function(event){//Cance

java - Navigation Drawer - syncState() 做什么以及为什么应该在 onPostCreate() 中调用它?

我正在学习在Android中创建抽屉导航。阅读时this,我看不懂下面的代码:@OverrideprotectedvoidonPostCreate(BundlesavedInstanceState){super.onPostCreate(savedInstanceState);//SyncthetogglestateafteronRestoreInstanceStatehasoccurred.mDrawerToggle.syncState();}文档说:Synchronizethestateofthedrawerindicator/affordancewiththelinkedDraw

java - Navigation Drawer - syncState() 做什么以及为什么应该在 onPostCreate() 中调用它?

我正在学习在Android中创建抽屉导航。阅读时this,我看不懂下面的代码:@OverrideprotectedvoidonPostCreate(BundlesavedInstanceState){super.onPostCreate(savedInstanceState);//SyncthetogglestateafteronRestoreInstanceStatehasoccurred.mDrawerToggle.syncState();}文档说:Synchronizethestateofthedrawerindicator/affordancewiththelinkedDraw

【Unity】导航 Navigation 设置:窄桥、隧道、斜坡、台阶、坠落、跳跃

文章目录Navigation导航Bake烘焙狭窄路面隧道路面斜坡路面台阶路面自动生成外链坠落外链生成跳跃外链生成Navigation导航Navigation是导航网格的核心模块,可以实现对Agent(代理)、Area(区域)、Bake(烘焙)、Object(对象)的配置。Bake烘焙烘焙设置可以调整烘焙的方式,如代理半径、可移动斜坡角度等。狭窄路面AgentRadius:代理半径,这个代理半径决定了烘焙路面距离墙面的距离,有时两面墙距离过近时可能会出现路面烘焙不出来的情况,此时将代理半径调小就能将路面烘焙出来了。隧道路面AgentHeight:代理高度,通过调整高度可以使角色通过山洞、桥洞等具

javascript - navigator.getUserMedia() 录音 - 如何设置麦克风的音量输入级别?

navigator.getUserMedia(....)调用可以在某些现代浏览器中使用以使用Javascript录制音频。有没有办法调整/设置麦克风的输入音量?此设置并不总是最佳的。有时麦克风设置为仅在非常非常低的输入音量下录制。当然,用户可以在他的系统中手动调整输入音量级别,但我的大多数用户可能缺乏执行此操作的知识。因此,我最好能在通过“navigator.getUserMedia(....)”方式记录数据的JavaScript应用程序内部动态调整麦克风音量?是否有解决方案可以影响麦克风的输入音量水平? 最佳答案 WebAudio

Flutter : Exception on using Navigator. of(context) 用于 RaisedButton 的 onPressed 事件

我遇到了这个异常Exceptionhasoccurred.NoSuchMethodError(NoSuchMethodError:Themethod'ancestorStateOfType'wascalledonnull.Receiver:nullTriedcalling:ancestorStateOfType(Instanceof'TypeMatcher'))关于使用我为onPressed函数传递的自定义方法(navigateToLogin),对于RaisedButton,但是,当我直接在onPressed=(){...Navigationcode..}上编写相同的导航时,它工作正常

android - 带有抽屉导航的Jetpack导航不显示androidx中子 fragment 的mobile_navigation.xml中给出的后退按钮和标题

我正在使用Androidx,带有抽屉导航的androidjetpack导航不显示mobile_navigation.xml中给出的后退按钮和标题,我尝试使用nav_view.setupWithNavController(navController)的导航不起作用,工作室显示未解析的符号。我已经为项目添加了所需的依赖项Gradle.build:applyplugin:'com.android.application'applyplugin:'kotlin-android'applyplugin:'kotlin-kapt'applyplugin:'kotlin-android-extens