首页 文章 精选 留言 我的

精选列表

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

Android UI开发第七篇之Android Gallery

新建项目 ② 定义layout外部resource的xml文件,用来改变layout的背景 <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="Gallery"> <attr name="android:galleryItemBackground" /> </declare-styleable> <!-- 定义layout 外部resource 的xml 文件,用来改变layout 的背景图。 --> </resources> 复制代码 ③ 修改main.xml布局,添加一个Gallery和一个ImageView <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout android:id="@+id/widget_absolutelayout" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" > <Gallery android:layout_width="fill_parent" android:layout_height="143px" android:layout_x="0px" android:layout_y="51px" android:id="@+id/Gallery_preView"> </Gallery> <ImageView android:layout_width="239px" android:layout_height="218px" android:layout_x="38px" android:layout_y="184px" android:id="@+id/ImageView_photo"> </ImageView> </AbsoluteLayout> 复制代码 ④ 新建一个myImageAdapter类--Gallery的适配器,它继承于BaseAdapter类. package zyf.Ex_Ctrl_10ME; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; public class myImageAdapter extends BaseAdapter { @Override public int getCount() { // TODO Auto-generated method stub return 0; } @Override public Object getItem(int position) { // TODO Auto-generated method stub return null; } @Override public long getItemId(int position) { // TODO Auto-generated method stub return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub return null; } } 复制代码 ⑤ 修改mainActivity.java,添加Gallery相关操作 package zyf.Ex_Ctrl_10ME; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.Gallery; import android.widget.ImageView; import android.widget.Toast; public class Ex_Ctrl_10ME extends Activity { /** Called when the activity is first created. */ /*定义要使用的对象*/ privateGallerygallery; private ImageView imageview; private myImageAdapter imageadapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); imageadapter=new myImageAdapter(this); /* 通过findViewById 取得 资源对象*/ gallery=(Gallery)findViewById(R.id.Gallery_preView); imageview=(ImageView)findViewById(R.id.ImageView_photo); /*给Gallery设置适配器 把Ex_Ctrl_10ME类传入参数*/ gallery.setAdapter(imageadapter); /*设置Gallery的点击事件监听器*/ gallery.setOnItemClickListener(newGallery.OnItemClickListener(){ @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { // TODO Auto-generated method stub /*显示该图片是几号*/ Toast.makeText(Ex_Ctrl_10ME.this, "这是图片:"+position+"号", Toast.LENGTH_SHORT).show(); /*设置大图片*/ imageview.setBackgroundResource(imageadapter.myImageIds[position]); } }); } } 复制代码 ⑥ 修改myImageAdapter.java文件,实现相簿浏览效果 package zyf.Ex_Ctrl_10ME; import android.content.Context; import android.content.res.TypedArray; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Gallery; import android.widget.ImageView; public class myImageAdapter extends BaseAdapter{//自定义的类变量 /*变量声明*/ int mGalleryItemBackground; private Context context;//上下文 /* 构建一Integer array 并取得预加载Drawable 的图片id */ public Integer[] myImageIds = { R.drawable.photo1, R.drawable.photo2, R.drawable.photo3, R.drawable.photo4, R.drawable.photo5, R.drawable.photo6, }; /*自定义的构造方法*/ public myImageAdapter(Context context) { // TODO Auto-generated constructor stub this.context=context; /* * 使用在res/values/attrs.xml 中的<declare-styleable>定义 的Gallery属性. */ TypedArray typed_array=context.obtainStyledAttributes(R.styleable.Gallery); /* 取得Gallery属性的Index id */ mGalleryItemBackground=typed_array.getResourceId(R.styleable.Gallery_android_galleryItemBackground, 0); /* 让对象的styleable 属性能够反复使用 */ typed_array.recycle(); } /* 重写的方法getCount,返回图片数目 */ @Override public int getCount() { // TODO Auto-generated method stub return myImageIds.length; } /* 重写的方法getItemId,返回图像的数组id */ @Override public Object getItem(int position) { // TODO Auto-generated method stub return position; } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; } /* 重写的方法getView,返回一View 对象 */ @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub /* 产生ImageView 对象 */ ImageView imageview = new ImageView(context); /* 设置图片给imageView 对象 */ imageview.setImageResource(myImageIds[position]); /* 重新设置图片的宽高 */ imageview.setScaleType(ImageView.ScaleType.FIT_XY); /* 重新设置Layout 的宽高 */ imageview.setLayoutParams(newGallery.LayoutParams(128, 128)); /* 设置Gallery背景图 */ imageview.setBackgroundResource(mGalleryItemBackground); /* 返回imageView 对象 */ return imageview; } } 复制代码 http://www.devdiv.com/home.php?mod=space&uid=14682&do=blog&id=3860 本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/817368,如需转载请自行联系原作者

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

android UI设计属性中英对照表(未修订)

英语 中文 备注 plurals 多义性 Animator 动画师 android 3.0以上版本才能用 ordering 调整 sequentially 顺序地 together 同时 duration 持久时间 tween 补间 Alpha 透明度 Scale 比例尺 Degree 度数 rotate 旋转 interpolator 插补器 translate 转换,说明 accelerate 加速 decelerate 减速 frame 帧 gravity 重力 clip 剪辑 vertical 垂直 horizontal 水平 clamp 固定 mirror 倒影 dimension 尺寸 dither 抖动 图片里的术语(例如一张26万色的图片放在了6万色的屏幕中就会发生抖动) linear 直线 radial 发散 gradient 跛度 sweep 广度 merge 合并 本文转自 liam2199 博客,原文链接:http://blog.51cto.com/youxilua/772693 如需转载请自行联系原作者

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

Android优化——UI优化(二) 使用include标签复用布局

使用include标签复用布局 - 1.include标签的作用 假如说我下图的这个布局在很多界面都用到了,我该怎么办?每个页面都写一遍的话,代码太冗余,并且维护难度加大。 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:orientation="vertical"> <include layout="@layout/activity_clude_item"/> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:text="这是中间的东西"/> </LinearLayout> 上边的这个布局我就用的include标签,代码显然更加的整洁,并且增加的布局的复用性,降低了app的使用内存 - 2.include标签的用法 <include layout="@layout/activity_clude_item"/> 1 其中我们使用layout="@layout/activity_clude_item"设置复用的布局文件 本文转自 一点点征服 博客园博客,原文链接: http://www.cnblogs.com/ldq2016/p/5226576.html ,如需转载请自行联系原作者

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

Android UI开发第五篇——自定义列表

自定义列表,设置列表背景、列表的列背景、列表的间隔线。 借鉴了一些前辈的代码。 MainActivity.class public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //绑定Layout里面的ListView ListView list = (ListView) findViewById(R.id.ListView01); //生成动态数组,加入数据 ArrayList<HashMap<String, Object>> listItem = new ArrayList<HashMap<String, Object>>(); for(int i=0;i<5;i++) { if(i==0){ HashMap<String, Object> map = new HashMap<String, Object>(); map.put("ItemImage", R.drawable.checked);//图像资源的ID map.put("ItemTitle", "个人信息"); map.put("LastImage", R.drawable.lastimage); listItem.add(map); }else if(i==1){ HashMap<String, Object> map = new HashMap<String, Object>(); map.put("ItemImage", R.drawable.c);//图像资源的ID map.put("ItemTitle", "修改密码"); map.put("LastImage", R.drawable.lastimage); listItem.add(map); }else if(i==2){ HashMap<String, Object> map = new HashMap<String, Object>(); map.put("ItemImage", R.drawable.d);//图像资源的ID map.put("ItemTitle", "网络设置"); map.put("LastImage", R.drawable.lastimage); listItem.add(map); }else if(i==3){ HashMap<String, Object> map = new HashMap<String, Object>(); map.put("ItemImage", R.drawable.d);//图像资源的ID map.put("ItemTitle", "打印设置"); map.put("LastImage", R.drawable.lastimage); listItem.add(map); }else{ HashMap<String, Object> map = new HashMap<String, Object>(); map.put("ItemImage", R.drawable.e);//图像资源的ID map.put("ItemTitle", "返回"); map.put("LastImage", R.drawable.lastimage); listItem.add(map); } } //生成适配器的Item和动态数组对应的元素 SimpleAdapter listItemAdapter = new SimpleAdapter(this,listItem,// 数据源 R.layout.list_items,//ListItem的XML实现 //动态数组与ImageItem对应的子项 new String[] {"ItemImage","ItemTitle", "LastImage"}, //ImageItem的XML文件里面的一个ImageView,两个TextView ID new int[] {R.id.ItemImage,R.id.ItemTitle,R.id.last} ); //添加并且显示 list.setAdapter(listItemAdapter); //添加点击 list.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { setTitle("点击第"+arg2+"个项目"); if(arg2 == 4){ MainActivity.this.finish(); } } }); //添加长按点击 list.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { @Override public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) { menu.setHeaderTitle("长按菜单-ContextMenu"); menu.add(0, 0, 0, "弹出长按菜单0"); menu.add(0, 1, 0, "弹出长按菜单1"); } }); } //长按菜单响应函数 @Override public boolean onContextItemSelected(MenuItem item) { setTitle("点击了长按菜单里面的第"+item.getItemId()+"个项目"); return super.onContextItemSelected(item); } } main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff" xmlns:android="http://schemas.android.com/apk/res/android"> <ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/ListView01" android:divider="@drawable/divider_color" android:dividerHeight="3dip" android:cacheColorHint="#00000000" /> </LinearLayout> list_item.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:paddingBottom="4dip" android:paddingLeft="12dip" android:paddingRight="12dip" android:background="@drawable/list_bg"> <ImageView android:paddingTop="12dip" android:layout_alignParentLeft="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ItemImage" /> <TextView android:text="TextView01" android:layout_height="wrap_content" android:layout_marginTop="30px" android:textSize="20dip" android:paddingLeft="12dip" android:textColor="#000000" android:layout_width="fill_parent" android:id="@+id/ItemTitle" android:layout_toRightOf="@+id/ItemImage" /> <ImageView android:paddingTop="12dip" android:layout_marginTop="20px" android:layout_alignParentRight="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/last" /> </RelativeLayout> http://www.devdiv.com/home.php?mod=space&uid=14682&do=blog&id=2888 http://www.devdiv.com/home.php?mod=space&uid=14682&do=blog&id=2888 http://www.devdiv.com/home.php?mod=space&uid=14682&do=blog&id=2888 http://www.devdiv.com/forum.php?mod=viewthread&tid=97913&page=1#pid591587 http://blog.csdn.net/zeng622peng/archive/2010/08/11/5804965.aspx http://www.devdiv.com/home.php?mod=space&uid=14682&do=blog&id=2888 本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/817375 ,如需转载请自行联系原作者

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

移动端UI设计:情绪感知型AI音乐应用设计解析

从情绪校准到语音搜索,探索更具情境理解力的音乐体验 面向产品经理与资深设计师的案例研究 **导读|**从情绪校准到语音搜索,探索更具情境理解力的音乐体验。本文不止评价画面风格,而是从产品目标、信息组织、行为路径、视觉语义和落地风险五个层面拆解这套方案。 ![](https://developer.qcloudimg.com/http-save/audit-12648272/06c90d7d7a8acc4490810bee339918d8.png) # **一、产品定位:先回答系统替谁解决什么问题** Aura将音乐推荐从曲风和历史播放扩展到情绪与场景。产品以“理解你的心情”为核心叙事,通过入门情绪校准、语音或哼唱搜索、智能歌单和歌词翻译,构建更具感知性的音频体验。 图1  项目界面与设计细节 ![](https://developer.qcloudimg.com/http-save/audit-12648272/771688f908590af4ea5fc982411e9436.png) # **二、信息架构:把功能转译为用户的工作顺序** 底部导航围绕首页、搜索、资料库和个人区域展开。首页负责主动推荐,搜索承担明确意图,资料库保存喜欢的歌曲、歌单、专辑和艺人;入门流程则收集曲风与情绪偏好,为首次推荐建立基础。结构简洁,符合音乐产品的高频使用习惯。 # **三、关键交互:从浏览信息走向完成任务** 哼唱搜索、语音搜索与多模态输入降低“知道旋律却不知道歌名”的门槛。情绪校准使用抽象视觉与有限选项避免像问卷,播放页保持传统控制逻辑,减少创新功能对基本操作的干扰。智能归类则把被动收藏转化为可再次发现的内容。 图2  项目界面与设计细节 ![](https://developer.qcloudimg.com/http-save/audit-12648272/05936e45c69ed64a67d81ea1f53c60b5.png) # **四、视觉系统:品牌表达必须承担信息语义** 黑色底色、深蓝与紫色光晕形成沉浸和夜间聆听氛围。大幅人物摄影与渐变光效承担情绪表达,界面元素尽量悬浮和弱边框化,避免破坏音乐的连续性。白色文字和有限高亮保障关键控件在暗环境中清楚可见。 图3  项目界面与设计细节 ![](https://developer.qcloudimg.com/http-save/audit-12648272/a413621a4f7c59056d4ac1fd42dbaec2.png) # **五、面向产品与设计团队的可复用价值** 情绪型推荐的设计重点不是制造神秘感,而是让用户持续修正系统理解。产品应允许用户解释“不喜欢这首”的原因、快速切换情绪并查看推荐依据。设计师需要处理情绪标签的文化差异,避免把复杂心理状态压缩为过度简单的颜色。 # **六、专业审视:仍需补齐的体验边界** 情绪数据具有敏感性,入门环节应说明采集目的和保存方式。AI语音与哼唱识别需要明确等待、失败和结果置信度。深色渐变虽然表现力强,但列表页应提高文本与背景对比,并提供减少动态效果的可访问性选项。 图4  项目界面与设计细节 ![](https://developer.qcloudimg.com/http-save/audit-12648272/feb725e5e0a70594c202da51a92330b7.png) # **结语:设计的最终判断标准是业务与使用价值** Aura的启示是,AI可以让音乐产品更贴近当下情境,但体验价值仍取决于控制感。推荐越个性化,用户越需要知道如何调整、删除或重置系统对自己的理解。

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

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

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文件系统,支持十年生命周期更新。

用户登录
用户注册