Android P 自由窗口模式实现及源代码解析

Android 专栏收录该内容
¥59.90 ¥99.00
73篇文章

Android P 自由窗口模式实现及源代码解析

随着移动设备屏幕的不断增大,用户对于多任务处理的需求也越来越强烈。为了提供更好的多任务体验,Android P 引入了自由窗口模式(FreeForm Window Mode)。在这种模式下,用户可以自由调整应用窗口的大小和位置,实现多个应用程序并排显示的效果。本文将介绍 Android P 自由窗口模式的简单实现原理,并提供相应的源代码。

一、自由窗口模式实现原理
Android P 自由窗口模式的实现基于 Android 提供的 WindowManager 和 ActivityManager 两个核心类。通过使用这两个类,我们可以实现自由调整应用窗口大小和位置的功能。

  1. 使用 WindowManager 控制窗口属性
    WindowManager 是 Android 系统中负责窗口管理的类,可以通过它来控制窗口的属性,如窗口大小、位置等。在自由窗口模式下,我们需要使用 WindowManager 提供的方法来设置窗口的属性。

以下是一个简单的示例代码,展示如何使用 WindowManager 设置窗口大小和位置:

WindowManager.LayoutParams params = getWindow
Android 系统自由窗口相关修改(AndroidQ) 自由窗口相关修改 AndroidQ 1 打开自由窗口相关配置 // frameworks/base/services/core/java/com/android/server/wm/ActivityTaskManagerService.java public void retrieveSettings(ContentResolver resolver) { // wugm: enable free form setting Settings.Global.putInt(resolver, D 阅读详情

相关推荐

Android自由窗口Freeform模式的深度解析与实战应用

本文深入解析Android自由窗口Freeform模式的技术原理与实战应用,详细介绍了三种开启方式、应用开发中的窗口控制与优化技巧,以及兼容性和性能优化策略。通过具体代码示例,帮助开发者掌握多任务处理场景下的自由窗口实现方法,提升生产力工具和游戏应用的开发效率。

weixin_42666036的博客 271

VS Code配置Unity安卓真机调试:从环境搭建到实战避坑指南

在Unity游戏开发中,高效的代码调试是提升开发效率的关键环节。传统IDE虽然功能全面,但在轻量化、响应速度和跨平台调试支持上存在局限。通过配置轻量级代码编辑器与调试器,开发者可以实现更快速的智能感知、灵活的断点管理以及跨设备(如安卓真机)的无缝调试,这对于移动端游戏开发尤为重要。本文聚焦于Unity开发中安卓设备调试这一高频需求场景,详细解析了如何通过配置ADB连接、管道传输协议和源码映射,解决“断点未验证”、“ADB连接失败”等常见问题,帮助开发者建立稳定可靠的移动端调试工作流。

weixin_34060299的博客 351

深入解析DES-ECB加密模式:原理、实现与安全警示

数据加密是信息安全的核心基础,其核心原理在于通过特定算法和密钥将明文转换为不可读的密文,以实现数据的保密性。分组密码作为经典加密技术,将数据划分为固定大小的块进行处理,DES(数据加密标准)便是其中的代表性算法。其技术价值在于为早期数据安全提供了标准化解决方案。在实际应用中,加密模式决定了分组密码如何被组织使用,直接影响着系统的安全性与性能。ECB(电子密码本)模式作为最基础的分组密码工作模式,因其实现简单、支持并行处理,曾在特定场景下被考虑。然而,该模式由于对每个数据块进行独立加密,会导致**密文暴露明文

weixin_33725515的博客 463

Java电商秒杀系统性能优化(一)——电商秒杀系统框架回顾

电商秒杀系统框架回顾项目简介外部依赖框架回顾项目要点项目中存在的问题小结 课程是免费的,课程地址如下:SpringBoot搭建电商秒杀项目,课程真的很棒,作者的思路很清晰,建议各位读者可以跟着视频练习一下这个项目; 项目简介 通过SpringBoot快速搭建的前后端分离的电商基础秒杀项目。项目通过应用领域驱动型的分层模型设计方式去完成:用户otp注册、登陆、查看、商品列表、进入商品详情以及倒计时秒...

ghw15221836342的博客 3729

医学影像弹性形变处理

这段代码的主要流程是:读取 DICOM 医学影像,尝试使用 MONAI 进行弹性形变(根据版本适配),如果失败则使用 OpenCV 实现,最后可视化并保存处理结果。这样可以在不同环境下灵活处理医学影像的弹性形变需求。后面会写一篇解释弹性变形方法的短文。

wh_xia_jun的专栏 784

超全!!snowboy语音唤醒(树莓派4b)

通过snowboy进行树莓派的语音唤醒

crimaster1024的博客 8743

java 二维码生成及其标签打印

本文主要内容 二维码生成 二维码标签预览及打印 二维码生成 笔者此次的二维码是通过调用第三方接口生成的,具体流程如下: 根据规范要求调用第三方接口,返回二维码下载地址及二维码图片的属性值(图片大小等) 根据返回的值获取二维码下载地址,根据地址下载二维码图片,保存至本地磁盘及记录数据信息 扫描二维码跳转相应地址,显示资产的基本信息 最终生成的二维码如下图所示: 预览并批量打印二维码标签 先...

孙小牟的博客 4950

华为 MetaERP 财务模块的核心业务对象,按子模块与架构维度分类,以表格呈现,适配架构设计与实施落地

华为MetaERP财务模块基于4A架构(业务/应用/数据/技术)与TOGAF框架,实现业财一体化与全球合规。业务架构涵盖组织模型与核心流程,应用架构支撑财务操作,数据架构确保数据一致性,技术架构提供高性能技术底座。模块覆盖总账、应收应付、资产等子模块,支持多组织、多币种、多准则核算,通过实时会计引擎实现"交易即核算"。4A架构与TOGAF框架对应,实现业务能力、应用组件、数据模型与技术栈的深度融合,为华为全球化财务核算提供核心支撑。

金牌架构师 447

线结构光相机原理详解以及精度控制总结

摘要:线阵结构光相机是工业三维检测的核心设备,结合线阵相机的高分辨率与结构光的主动三维成像能力。其工作原理基于线激光投射、逐线扫描、亚像素级条纹提取及三角测量法实现三维重建。精度受硬件、校准、环境和算法四因素影响,需通过优化硬件选型(如小像元相机、窄线宽激光)、精准校准(相机内参、激光平面)、环境控制(遮光、隔振、恒温)及算法优化(Steger算法、点云后处理)来提升。典型应用(卷材、轨道检测)中深度精度可达5-20μm,需根据场景需求平衡参数配置。

start_up_go的博客 942

月度补丁如何落地?Claude Code 在商业项目中实现版本追新的 4 步更新机制

揭示 Claude Code 月度补丁实为上下文感知能力的结构性重置,而非平滑模型升级;提出四步工程化更新机制,首步通过 CLAUDE.md 定义可量化的 SQL/HTTP/代码风格语义指纹,结合 CLI 工具采集基线指标,实现补丁变更的可测、可比、可控。

weixin_28728443的博客 391

【ARFoundation自学04】AR Tracked Image 图像追踪识别与对应类的调用

1.添加组件 2.创建图像识别库 3.创建识别后追踪的物体(UI、模型等)

leoysq的博客 2564

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

上一篇: Android 自定义下拉状态栏界面开发系列
下一篇: 如何在Android设备上运行Python程序
普通网友
博客等级 码龄3年 119粉丝 288原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址