# PullZoomView **Repository Path**: hihopeorg/PullZoomView ## Basic Information - **Project Name**: PullZoomView - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-11 - **Last Updated**: 2021-10-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PullZoomView **本项目是基于开源项目PullZoomView进行ohos化的移植和开发的,可以通过项目标签以及github地址(https://github.com/Frank-Zhu/PullZoomView ) 追踪到原项目版本** #### 项目介绍 - 项目名称: PullZoomView列表自定义head缩放 - 所属系列:ohos的第三方组件适配移植 - 功能: 支持ZoomView显示、headview自定义、headview缩放、headview显示隐藏 - 项目移植状态:完成 - 调用差异:无 - 项目作者和维护人: hihope - 联系方式:hihope@hoperun.com - 原项目Doc地址:https://github.com/Frank-Zhu/PullZoomView - 原项目基线版本:v1.0.0 sha1:fed1339e86937d20ffba95f12b371aa459c7e3d9 - 编程语言:Java - 外部库依赖: #### 效果展示 ![效果展示](screenshot/show.gif) #### 安装教程 方法1. 1. 下载依赖库har包 pulltozoomview.har。 2. 启动 DevEco Studio,将下载的har包,导入工程目录“entry->libs”下。 3. 在moudle级别下的build.gradle文件中添加依赖,在dependences标签中增加对libs目录下har包的引用。 ``` dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) …… } ``` 4. 在导入的har包上点击右键,选择“Add as Library”对包进行引用,选择需要引用的模块,并点击“OK”即引用成功。 方法2. 1. 在工程的build.gradle的allprojects中,添加HAR所在的Maven仓地址 ``` repositories { maven { url 'http://106.15.92.248:8081/repository/Releases/' } } ``` 2. 在应用模块的build.gradle的dependencies闭包中,添加如下代码: ``` dependencies { implementation 'com.github.frank-zhu.ohos:pullzoomview:1.0.1' } ``` #### 使用说明 ##### 基本使用 例子为单任务下载,只需要很简单的代码,便可以实现下载功能。 1. 在布局文件中添加PullToZoomListViewEx或者PullToZoomScrollViewEx ```xml ````` 或者 ```xml ``` 相关参数: - headerView 指定head的xml布局文件 - zoomView 指定可以缩放的布局文件 2. 在代码中设置list或者scroll 示例如下 ````java private void initView() { Log.println("PullToZoomListSlice initView"); String[] adapterData = new String[]{"Activity", "Service", "Content Provider", "Intent", "BroadcastReceiver", "ADT", "Sqlite3", "HttpClient", "DDMS", "Studio", "Fragment", "Loader", "Activity", "Service", "Content Provider", "Intent", "BroadcastReceiver", "ADT", "Sqlite3", "HttpClient", "Activity", "Service", "Content Provider", "Intent", "BroadcastReceiver", "ADT", "Sqlite3", "HttpClient"}; listView = (PullToZoomListViewEx) findComponentById(ResourceTable.Id_listview); if(listView == null){ Log.println("PullToZoomListViewEx is null "); return; } listView.setAdapter(new ArrayAdapter(this,ResourceTable.Layout_simple_list_item_1,ResourceTable.Id_text1,adapterData)); listView.getPullRootView().setItemClickedListener((listContainer, component, position, id) -> { Log.e("zhuwenwu", "position = " + position); }); listView.setOnItemClickListener(new ListContainer.ItemClickedListener() { @Override public void onItemClicked(ListContainer listContainer, Component component, int position, long id) { Log.e("zhuwenwu", "position = " + position); } }); Point point = new Point(); Display display = DisplayManager.getInstance().getDefaultDisplay(getContext()).get(); // display.getRealSize(point);//包含状态栏高度 : getRealHeight-getHeight =状态栏高度 display.getSize(point);//不包含状态栏的高度 int mScreenWidth = point.getPointXToInt(); ComponentContainer.LayoutConfig config = new ComponentContainer.LayoutConfig(mScreenWidth, (int) (9.0F * (mScreenWidth / 16.0F))); listView.setHeaderLayoutParams(config); } ```` #### 版本迭代 - v1.0.1 #### 版权和许可信息 Apache License