首页 文章 精选 留言 我的

精选列表

搜索[UI设计],共10000篇文章
优秀的个人博客,低调大师

Android UI开发第二十三篇——分享书架UI实现

android中有很多的电子书阅读应用,应用中都仿真了书架的实现,这里也分享一篇读书应用的书架实现: java: public class ShelvesView extends GridView { private Bitmap mShelfBackground; private int mShelfWidth; private int mShelfHeight; private Bitmap mWebLeft; private Bitmap mWebRight; private int mWebRightWidth; public ShelvesView(Context context) { super(context); init(context); } public ShelvesView(Context context, AttributeSet attrs) { super(context, attrs); load(context, attrs, 0); init(context); } public ShelvesView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); load(context, attrs, defStyle); init(context); } private void load(Context context, AttributeSet attrs, int defStyle) { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ShelvesView, defStyle, 0); final Resources resources = getResources(); final int background = a.getResourceId(R.styleable.ShelvesView_shelfBackground, 0); final Bitmap shelfBackground = BitmapFactory.decodeResource(resources, background); if (shelfBackground != null) { mShelfWidth = shelfBackground.getWidth(); mShelfHeight = shelfBackground.getHeight(); mShelfBackground = shelfBackground; } mWebLeft = BitmapFactory.decodeResource(resources, R.drawable.web_left); final Bitmap webRight = BitmapFactory.decodeResource(resources, R.drawable.web_right); mWebRightWidth = webRight.getWidth(); mWebRight = webRight; a.recycle(); } private void init(Context context) { StateListDrawable drawable = new StateListDrawable(); SpotlightDrawable start = new SpotlightDrawable(context, this); start.disableOffset(); SpotlightDrawable end = new SpotlightDrawable(context, this, R.drawable.spotlight_blue); end.disableOffset(); TransitionDrawable transition = new TransitionDrawable(start, end); drawable.addState(new int[] { android.R.attr.state_pressed }, transition); final SpotlightDrawable normal = new SpotlightDrawable(context, this); drawable.addState(new int[] { }, normal); normal.setParent(drawable); transition.setParent(drawable); setSelector(drawable); setDrawSelectorOnTop(false); } @Override protected void dispatchDraw(Canvas canvas) { final int count = getChildCount(); final int top = count > 0 ? getChildAt(0).getTop() : 0; final int shelfWidth = mShelfWidth; final int shelfHeight = mShelfHeight; final int width = getWidth(); final int height = getHeight(); final Bitmap background = mShelfBackground; for (int x = 0; x < width; x += shelfWidth) { for (int y = top; y < height; y += shelfHeight) { canvas.drawBitmap(background, x, y, null); } } if (count == 0) { canvas.drawBitmap(mWebLeft, 0.0f, top + 1, null); canvas.drawBitmap(mWebRight, width - mWebRightWidth, top + shelfHeight + 1, null); } super.dispatchDraw(canvas); } @Override public void setPressed(boolean pressed) { super.setPressed(pressed); final Drawable current = getSelector().getCurrent(); if (current instanceof TransitionDrawable) { if (pressed) { ((TransitionDrawable) current).startTransition( ViewConfiguration.getLongPressTimeout()); } else { ((TransitionDrawable) current).resetTransition(); } } } } 代码:http://download.csdn.net/detail/xyz_lmn/4698124 本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/1230767,如需转载请自行联系原作者

优秀的个人博客,低调大师

前端 UI 框架 Svelte 4 发布

距离 Svelte 3 发布已经过去了四年多的时间,经过几个月的筹备,Svelte 4 稳定版本于今天正式发布。 新版本改进了性能、优化了开发者体验,并大改了网站。Svelte 4 主要是一个维护版本,它为下一代的 Svelte 发布奠定了基础。 性能 这个版本使 hydration 代码更小更快。为了看到其影响,SvelteKit 用户可以通过检查.svelte-kit/output/client/_app/immutable/nodes文件夹来看到其编译后的输出尺寸缩小。例如,在kit.svelte.dev 上,整个网站生成的 JS 大小减少了 12.7%。 Svelte 4 将 Svelte 包的大小减少了近 75%,这意味着在npm install上的等待时间减少了。对于第一次在 learn.svelte.dev 上加载交互式学习体验的用户、Svelte REPL 的用户以及网络条件有限的用户来说,这一改进将尤为明显。剩下的大部分软件包大小是对 eslint 的支持,这就需要发布一个 CJS 构建,一旦 eslint 重写完成,Svelte的软件包大小可以再下降 50% 以上。 Svelte 中依赖的数量已经从 61 个大大减少到 16 个。这意味着用户下载速度更快,也更不容易受到供应链攻击的影响。 开发者体验 Svelte 4 使 Svelte 的创作体验更加直观和一致: |local现在是转换的默认值,以避免动画阻碍页面转换,预处理程序现在更容易编写,多项修正使 CSP 更容易设置和使用。 对于 Web 组件的用户来说,最大的变化是对你使用 Svelte 编写自定义元素的方式进行了全面修改。通过改变它们的生成方式,可以消除了一大类错误和不一致的地方。 最后,还做了几项改进 IDE 编写的体验:“cmd + 点击” svelte 模块现在可以带你到实现,而不是.d.ts文件。 从svelte/internal导入的文件现在被隐藏,不会干扰自动补全建议,自动导入现在更可靠。 更新了网站、文档和教程 官方 svelte.dev 网站已经进行了大改。它现在被分割成多个页面,并改进了导航、更新了 TypeScript 文档、黑暗模式和增强的 REPL。SvelteKit 网站也在进行更新,以与之匹配。还更新了所有的教程链接,以指向新的 learn.svelte.dev。旧的教程仍然适用于 Safari 16.3 及以前的用户。 更多详情可查看:https://github.com/sveltejs/svelte/releases/tag/svelte%404.0.0

优秀的个人博客,低调大师

View UI(原 iView) 4.1.0 发布

4.1.0 Pascal's Wager Table: 支持树形数据。 新增属性indent-size,可设置树形的缩进宽度。 新增属性load-data,树形数据异步时使用。 row-key支持 String 类型,使用树形数据时必须为 String。 column 新增属性tree,树形数据使用,开启则该列为可展开列。 data 新增属性_showChildren,树形数据使用,指定默认子数据是否展开。 data 新增属性_loading,树形数据使用,用于异步请求子数据。 新增属性context-menu,开启后,当前行点击右键会阻止默认行为。 新增事件@on-contextmenu,当前行点击右键时触发。 其它: Select 新增事件@on-select,选择项目时触发。 Carousel 新增事件@on-click,点击幻灯片时触发,返回索引值。 Tree 使用 Render 时,可以直接使用选中功能。 Affix 新增属性use-capture。 修复 Carousel 内的 CarouselItem 样式重叠的问题。 修复 Carousel 点击指示器时,不触发 on-click 事件的问题。 修复 Collapse 异步加载时,不能打开面板的问题。 修复 Split 嵌套使用时,有时样式出错的问题。 修复 FormItem 没有监听 required 属性改变的问题。 修复 AutoComplete 的 transfer 属性,在全局配置有时错误的问题。 修复 AutoComplete 的事件 on-select 有时不触发的问题。 修复 Modal confirm 关闭按钮事件问题。 修复 TimePicker 使用向上箭头选择时出错的问题。 修复 DatePicker 有时选择日期,错误的问题。 修复 DatePicker setMonth 的问题。 修复 Split 的 min 和 max 属性在改变浏览器尺寸时不正确的问题。 修复 Time 不能动态设置 time 属性的问题。#199 修复 Avatar 自定义尺寸有时样式出错的问题。 修复 Tree 数据设置 disabled 时,不能点击箭头的问题。 修复 TypeScript 的一些问题。 新增维吾尔语。

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册