{"id":19510844,"url":"https://github.com/smuyyh/bankcardformat","last_synced_at":"2025-07-11T00:33:51.115Z","repository":{"id":108852929,"uuid":"61364264","full_name":"smuyyh/BankCardFormat","owner":"smuyyh","description":":credit_card: 自动格式化银行卡号的EditText，卡号格式化、归属银行及卡别判断","archived":false,"fork":false,"pushed_at":"2018-01-23T08:14:48.000Z","size":144,"stargazers_count":286,"open_issues_count":3,"forks_count":81,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-09T21:18:21.975Z","etag":null,"topics":["android","bank-card","credit-card","edittext","formatter"],"latest_commit_sha":null,"homepage":"","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/smuyyh.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}},"created_at":"2016-06-17T09:58:19.000Z","updated_at":"2025-02-08T15:34:46.000Z","dependencies_parsed_at":"2023-04-15T22:46:57.983Z","dependency_job_id":null,"html_url":"https://github.com/smuyyh/BankCardFormat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smuyyh%2FBankCardFormat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smuyyh%2FBankCardFormat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smuyyh%2FBankCardFormat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smuyyh%2FBankCardFormat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smuyyh","download_url":"https://codeload.github.com/smuyyh/BankCardFormat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111973,"owners_count":21049578,"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":["android","bank-card","credit-card","edittext","formatter"],"created_at":"2024-11-10T23:17:55.701Z","updated_at":"2025-04-09T21:18:25.820Z","avatar_url":"https://github.com/smuyyh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BankCardFormat\n\n## 自动格式化银行卡号的EditText，每四位增加一个空格，并根据银行卡号判断该银行卡归属的银行及卡别\n\n![image](https://github.com/smuyyh/BankCardFormat/blob/master/screenshot/device-1.png?raw=true)\n\n### 使用\n```\ndependencies {\n    compile 'com.yuyh.bankcardformat:library:1.0.3'\n}\n```\n```xml\n\u003ccom.example.library.BandCardEditText\n    android:id=\"@+id/et\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"30dp\"\n    android:text=\"622700187301032701\"\n    android:background=\"#cccccc\"/\u003e\n```\n```java\n  tv = (TextView) findViewById(R.id.tv);\n  editText = (BandCardEditText) findViewById(R.id.et);\n  editText.setBankCardListener(new BankCardListener() {\n      @Override\n      public void success(String name) {\n          tv.setText(\"所属银行：\" + name);\n      }\n  \n      @Override\n      public void failure() {\n          tv.setText(\"所属银行：\");\n      }\n  });\n\n  // 或者直接检测\n  String carnum = \"622700187301032701\";\n  if (BankCardUtils.checkBankCard(carnum)) {\n      char[] ss = carnum.toCharArray();\n      String bank = BankCardUtils.getNameOfBank(ss, 0);\n  }\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmuyyh%2Fbankcardformat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmuyyh%2Fbankcardformat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmuyyh%2Fbankcardformat/lists"}