|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
|
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
you may not use this file except in compliance with the License.
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
See the License for the specific language governing permissions and
|
|
|
limitations under the License.
|
|
|
-->
|
|
|
|
|
|
<!--
|
|
|
======================= 4x4便签小部件配置文件 =======================
|
|
|
文件:widget_4x_info.xml
|
|
|
对应:NoteWidgetProvider_4x 小部件提供者
|
|
|
引用:在AndroidManifest.xml的meta-data中引用
|
|
|
作用:定义4x4便签小部件在桌面上的基本属性
|
|
|
-->
|
|
|
|
|
|
<!--
|
|
|
======================= 小部件提供者配置元素 =======================
|
|
|
appwidget-provider:Android小部件配置的核心元素
|
|
|
包含小部件的基本属性定义
|
|
|
|
|
|
-->
|
|
|
<appwidget-provider
|
|
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
android:initialLayout="@layout/widget_4x"
|
|
|
android:minWidth="294dip"
|
|
|
android:minHeight="294dip">
|
|
|
</appwidget-provider>
|
|
|
<!--
|
|
|
======================= Android框架命名空间 =======================
|
|
|
xmlns:android:声明Android框架的XML命名空间
|
|
|
值:标准的Android命名空间URI
|
|
|
作用:启用Android特定的XML属性和资源引用
|
|
|
位置:必须是appwidget-provider的第一个属性
|
|
|
-->
|
|
|
|
|
|
|
|
|
<!--
|
|
|
======================= 4x4小部件初始布局 =======================
|
|
|
android:initialLayout:指定小部件的初始布局文件
|
|
|
值:@layout/widget_4x
|
|
|
对应文件:res/layout/widget_4x.xml
|
|
|
内容:4x4便签小部件的界面布局
|
|
|
包含:背景图片、便签文本显示、点击区域
|
|
|
-->
|
|
|
|
|
|
|
|
|
<!--
|
|
|
======================= 4x4小部件最小宽度 =======================
|
|
|
android:minWidth:定义小部件在桌面网格中的最小宽度
|
|
|
值:294dip (density-independent pixels)
|
|
|
计算:4个网格单元格 × 74dp ≈ 296dp
|
|
|
实际:294dp (考虑边距和渲染误差)
|
|
|
单位:dip等同于dp,旧版Android使用的单位
|
|
|
作用:确保小部件至少占用4个网格宽度
|
|
|
-->
|
|
|
|
|
|
|
|
|
<!--
|
|
|
======================= 4x4小部件最小高度 =======================
|
|
|
android:minHeight:定义小部件在桌面网格中的最小高度
|
|
|
值:294dip
|
|
|
计算:与宽度相同,4×74≈296dp
|
|
|
实际:294dp
|
|
|
设计:正方形小部件,宽度和高度相等
|
|
|
布局:4×4网格,提供较大的显示区域
|
|
|
-->
|