6 Star 0 Fork 0

hihopeorg / RelativePopupWindow

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

RelativePopupWindow

本项目是基于开源项目RelativePopupWindow进行ohos化的移植和开发,可以通过项目标签以及github地址(https://github.com/kakajika/RelativePopupWindow )追踪到原项目版本

项目介绍

  • 项目名称:相对位置的PopupWindow
  • 所属系列:ohos的第三方组件适配移植
  • 功能:相对某个控件位置的PopupWindow。
  • 项目移植状态:完成
  • 调用差异:无
  • 项目作者和维护人:hihope
  • 联系方式:hihope@hoperun.com
  • 原项目Doc地址:https://github.com/kakajika/RelativePopupWindow
  • 原项目基线版本:V0.4.1
  • 编程语言:Java

演示效果

Image text

安装教程

方法1.

  1. 下载har包RelativePopupWindow.har。
  2. 启动 DevEco Studio,将下载的har包,导入工程目录“entry->libs”下。
  3. 在moudle级别下的build.gradle文件中添加依赖,在dependences标签中增加对libs目录下har包的引用。
repositories {
    flatDir { dirs 'libs' }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
    implementation(name: 'RelativePopupWindow', ext: 'har')
    ....
}

方法2.

  1. 在工程的build.gradle的allprojects中,添加HAR所在的Maven仓地址
repositories {
    maven {
        url 'http://106.15.92.248:8081/repository/Releases/'
    }
}
  1. 在应用模块的build.gradle的dependencies闭包中,添加如下代码:
dependencies {
    Implementation 'com.labo.kaji.ohos:relativepopupwindow:1.0.0'
}

使用说明

  1. 你可以在代码中这样使用:
Component content = LayoutScatter.getInstance(MainAbilitySlice.this).parse(ResourceTable.Layout_popup, null, false);
RelativePopupWindow popupWindow = new RelativePopupWindow(MainAbilitySlice.this, content, width, height);
popupWindow.setCustomComponent(content);
popupWindow.setBackColor(Color.TRANSPARENT);
popupWindow.setAutoClosable(true);
popupWindow.showOnAnchor(component, RelativePopupWindow.VerticalPosition.ABOVE, RelativePopupWindow.HorizontalPosition.LEFT, false);
VerticalPosition
  • ABOVE
  • ALIGN_BOTTOM
  • CENTER
  • ALIGN_TOP
  • BELOW
HorizontalPosition
  • LEFT
  • ALIGN_RIGHT
  • CENTER
  • ALIGN_LEFT
  • RIGHT

版本迭代

  • v1.0.0

支持:

相对于控件显示dialog,自由设置宽高。

不支持:

fit in screen相对于屏幕显示。

版权和许可信息

  • MIT License.
The MIT License (MIT) Copyright (c) 2016 Keita Kajiwara Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

相对某个控件位置的PopupWindow 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/hihopeorg/RelativePopupWindow.git
git@gitee.com:hihopeorg/RelativePopupWindow.git
hihopeorg
RelativePopupWindow
RelativePopupWindow
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891