5 Star 0 Fork 0

佰钧成开源官方组织/PinView

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

PinView

Pin code input control component, support any length and input any data.

Design sketch

1、Use steps

Solution 1:

  1. Copy the PinView/library folder to the project directory
  2. Modify settings.gradle under the project and add the dependency on this module as follows:
include ':entry', ':library'
  1. Introduce the dependency of the module under the project. Taking the entry module as an example, you need to modify the build.gradle file under the entry module to add the dependency:
compile project(path: ':library')

or

implementation project(':library')

Solution 2: local use of har package integration

  1. Compile this project, copy the har package generated in the build directory of the PinView/library folder to the project lib folder: directory:\PinView\library\build\outputs\har\debug\library-debug.har
  2. Add the following code in the entry's gradle
implementation fileTree(dir:'libs', include: ['*.jar','*.har'])

Solution 3:

  1. Add this in your root build.gradle file (not your module build.gradle file):
allprojects {
	repositories {
		...
		mavenCentral()
	}
}
  1. The lib is available on Maven Central, you can find it with [Gradle, please]
dependencies {
    implementation ‘com.gitee.baijuncheng-open-source:pin-view:1.0.0'
}

2、The best way to use it is to refer to demo

    mPinView.setCanInput(true);// 设置是否可输入 默认true
    mPinView.setHint("");      // 设置EditText的Hint
    mPinView.setInputType(PinView.InputType.NUMBER); // 设置输入的格式
    mPinView.setPassword(true); // 设置是否以明文显示
    mPinView.setPinHeight(60);  // 设置每一个EditText的高度
    mPinView.setPinWidth(60);   // 设置每一个EditText的宽度
    mPinView.setPinLength(4);   // 设置可输入的 PIN 码长度,默认4
    mPinView.clearValue();      // 清除输入的数据
    mPinView.setValue("1234");  // 设置输入值
    mPinView.setPinViewEventListener(this); // 设置输入完毕的监听事件

3、Use in XML

<com.nanchen.pinview.PinView
    ohos:id="$+id:pinView"
    ohos:width="match_content"
    ohos:height="match_content"
    ohos:layout_alignment="vertical_center"
    ohos:left_margin="20vp"
    app:cursorVisible="false"
    app:hint=""
    app:inputType="number"
    app:password="true"
    app:pinHeight="30vp"
    app:pinLength="4"
    app:pinWidth="30vp"
    app:splitWidth="20vp"/>

License

Copyright 2018 nanchen(刘世麟)

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.
Copyright 2018 nanchen(刘世麟) 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.

简介

PIN 码专用输入控件,支持任意长度和输入任意数据 展开 收起
README
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/baijuncheng-open-source/pin-view.git
git@gitee.com:baijuncheng-open-source/pin-view.git
baijuncheng-open-source
pin-view
PinView
master

搜索帮助