{"id":13645059,"url":"https://github.com/GitPhoenix/KeyboardView","last_synced_at":"2025-04-21T11:32:43.984Z","repository":{"id":112692142,"uuid":"76777822","full_name":"GitPhoenix/KeyboardView","owner":"GitPhoenix","description":"自定义安全键盘","archived":false,"fork":false,"pushed_at":"2016-12-19T03:10:02.000Z","size":207,"stargazers_count":108,"open_issues_count":0,"forks_count":27,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-09T17:42:58.837Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GitPhoenix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-12-18T11:02:33.000Z","updated_at":"2024-09-11T01:02:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e512e32-cfcf-4e4f-9b81-a2853caefd62","html_url":"https://github.com/GitPhoenix/KeyboardView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitPhoenix%2FKeyboardView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitPhoenix%2FKeyboardView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitPhoenix%2FKeyboardView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitPhoenix%2FKeyboardView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitPhoenix","download_url":"https://codeload.github.com/GitPhoenix/KeyboardView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250048034,"owners_count":21366163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:02:24.970Z","updated_at":"2025-04-21T11:32:43.953Z","avatar_url":"https://github.com/GitPhoenix.png","language":"Java","readme":"# KeyboardView 自定义安全键盘\n######效果图：![keyboardView](https://github.com/GitPhoenix/KeyboardView/blob/master/art/keyboardView.gif)\n\n具体使用\n```\neditView.setEditView(llKeyboard, keyboardView, true);\n\neditView.setOnKeyboardListener(new EditView.OnKeyboardListener() {\n\t@Override\n\tpublic void onHide(boolean isCompleted) {\n\t\tif (height \u003e 0) {\n\t\t\tllGuan.scrollBy(0, -(height + DensityUtil.dp2px(MainActivity.this, 16)));\n\t\t}\n\n\t\tif (isCompleted) {\n\t\t\tLog.i(\"\", \"你点击了完成按钮\");\n\t\t}\n\t}\n\n\t@Override\n\tpublic void onShow() {\n\t\tllGuan.post(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t//pos[0]: X，pos[1]: Y\n\t\t\t\tint[] pos = new int[2];\n\t\t\t\t//获取编辑框在整个屏幕中的坐标\n\t\t\t\teditView.getLocationOnScreen(pos);\n\t\t\t\t//编辑框的Bottom坐标和键盘Top坐标的差\n\t\t\t\theight = (pos[1] + editView.getHeight())\n\t\t\t\t\t\t- (ScreenUtil.getScreenHeight(MainActivity.this) - keyboardView.getHeight());\n\t\t\t\tif (height \u003e 0) {\n\t\t\t\t\t//编辑框和键盘之间预留出16dp的距离\n\t\t\t\t\tllGuan.scrollBy(0, height + DensityUtil.dp2px(MainActivity.this, 16));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t@Override\n\tpublic void onPress(int primaryCode) {\n\n\t}\n});\n```\nllKeyboard为包裹键盘的父布局，llGuan为包裹输入框的父布局。\n","funding_links":[],"categories":["软键盘"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGitPhoenix%2FKeyboardView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGitPhoenix%2FKeyboardView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGitPhoenix%2FKeyboardView/lists"}