{"id":10083,"date":"2023-06-28T21:16:32","date_gmt":"2023-06-28T17:46:32","guid":{"rendered":"http:\/\/milmit.net\/custom-edittext-for-bank-card-on-android\/"},"modified":"2023-06-28T21:16:32","modified_gmt":"2023-06-28T17:46:32","slug":"custom-edittext-for-bank-card-on-android","status":"publish","type":"post","link":"https:\/\/milmit.net\/en\/custom-edittext-for-bank-card-on-android\/","title":{"rendered":"Custom EditText for bank card on Android"},"content":{"rendered":"<p>\u06cc\u0634 \u0646\u0645\u0627\u06cc\u0634 \u06a9\u062a\u0627\u0628 \u062e\u0627\u0646\u0647<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-62185\" src=\"http:\/\/www.programchi.ir\/\/wp-content\/uploads\/2018\/06\/preview2.gif\" alt=\"\" width=\"292\" height=\"518\" \/><br \/>\n\u062f\u0631 \u062d\u0627\u0644\u062a \u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0645\u06cc \u062a\u0648\u0627\u0646 \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f.<br \/>\n\u0627\u0628\u062a\u062f\u0627 \u0628\u0627\u06cc\u062f \u06a9\u062a\u0627\u0628 \u062e\u0627\u0646\u0647 \u0645\u0631\u0628\u0648\u0637\u0647 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u0647\u0645\u0627\u0646\u0646\u062f \u0632\u06cc\u0631 \u0639\u0645\u0644 \u06a9\u0646\u06cc\u062f.<br \/>\n\u0648\u0627\u0631\u062f \u0641\u0627\u06cc\u0644 Build.gradle \u0627\u0632 \u0646\u0648\u0639 Top-Level \u0634\u062f\u0647 \u0633\u067e\u0633 \u062f\u0631 \u0628\u062e\u0634 repositories \u062e\u0637 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">repositories {\r\n maven{\r\n   url \"https:\/\/dl.bintray.com\/infideap2\/Block-EditText\"\r\n }\r\n}<\/pre>\n<p>\u0648\u0627\u0631\u062f \u0641\u0627\u06cc\u0644 Build.gradle \u0627\u0632 \u0646\u0648\u0639 Module \u0634\u062f\u0647 \u0633\u067e\u0633 \u062f\u0631 \u0628\u062e\u0634 dependencies \u062e\u0637 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dependencies {\r\n   implementation 'com.infideap.blockedittext:block-edittext:0.0.6'\r\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;com.infideap.blockedittext.BlockEditText\r\n    android:id=\"@+id\/blockEditText_tac\"\r\n    app:bet_defaultLength=\"1\"\r\n    app:bet_numberOfBlock=\"4\"\r\n    app:bet_inputType=\"Integer\"\r\n    app:bet_hintTextAppearance=\"@style\/TextAppearance.AppCompat.Medium\"\r\n    app:bet_hint=\"TAC\"\r\n    app:bet_textSize=\"24sp\"\r\n    android:layout_width=\"300dp\"\r\n    app:bet_editTextBackground=\"@drawable\/selector_edittext_round_border\"\r\n    android:layout_height=\"wrap_content\" \/&gt;<\/pre>\n<h3>Credit Card<\/h3>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;com.infideap.blockedittext.BlockEditText\r\n    android:id=\"@+id\/blockEditText_visa\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"wrap_content\"\r\n    app:bet_defaultLength=\"4\"\r\n    app:bet_hint=\"Visa\/Mastercard\"\r\n    app:bet_hintTextAppearance=\"@style\/TextAppearance.AppCompat.Medium\"\r\n    app:bet_inputType=\"Integer\"\r\n    app:bet_numberOfBlock=\"4\"\r\n    app:bet_text=\"131321323-13213-21321312\" \/&gt;<\/pre>\n<div class=\"highlight highlight-text-xml\">\u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u0648\u06cc\u0698\u06af\u06cc \u06cc\u0627 Attributes \u0647\u0627\u06cc \u0647\u0631\u06a9\u062f\u0627\u0645 \u0631\u0627 \u062a\u0648\u0636\u06cc\u062d \u0645\u06cc\u062f\u0647\u06cc\u0645.<br \/>\napp:bet_defaultLength : \u0637\u0648\u0644 \u0647\u0631 \u062e\u0627\u0646\u0647 \u0627\u0632 EditText \u0648\u0631\u0648\u062f\u06cc \u0631\u0627 \u062a\u0639\u06cc\u06cc\u0646 \u0645\u06cc \u06a9\u0646\u062f.<br \/>\napp:bet_numberOfBlock : \u062a\u0639\u062f\u0627\u062f Block \u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0633\u0627\u062e\u062a\u0647 \u0645\u06cc \u0634\u0648\u062f \u0631\u0627 \u062a\u0639\u06cc\u06cc\u0646 \u0645\u06cc \u06a9\u0646\u062f.<br \/>\napp:bet_hint : \u06cc\u06a9 Hint \u0628\u0631\u0627\u06cc Block \u0647\u0627 \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc \u06a9\u0646\u062f.<br \/>\napp:bet_hintTextAppearance : \u0627\u0646\u062f\u0627\u0632\u0647 \u0627\u0632 \u0646\u0638\u0631 \u0645\u0642\u0627\u06cc\u0633\u06cc \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 hint \u0631\u0627 \u062a\u0639\u06cc\u0646 \u0645\u06cc \u06a9\u0646\u062f \u0634\u0627\u0645\u0644 medium , Large , samll \u0645\u06cc \u0634\u0648\u062f.<br \/>\napp:bet_inputType : \u062a\u0639\u06cc\u06cc\u0646 \u0646\u0648\u0639 \u0648\u0631\u0648\u062f\u06cc Edittext \u0647\u0627<br \/>\napp:bet_text : \u0645\u062a\u0646 \u067e\u06cc\u0634\u0641\u0631\u0636 \u06a9\u0647 \u062f\u0631 Edittext \u0647\u0627 \u0642\u0631\u0627\u0631 \u0645\u06cc\u06af\u06cc\u0631\u062f \u0634\u0645\u0627 \u0628\u0627\u06cc\u062f \u0622\u0646 \u0631\u0627 \u062d\u0630\u0641 \u06a9\u0646\u06cc\u062f.<\/div>\n<p>\u0627\u06af\u0631 \u0628\u062e\u0648\u0627\u0647\u06cc\u062f \u0627\u0632 \u0637\u0631\u06cc\u0642 \u06a9\u062f \u0622\u0646 \u0631\u0627 \u0633\u0641\u0627\u0631\u0634\u06cc \u06a9\u0646\u06cc\u062f \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0646\u0645\u0648\u0646\u0647 \u06a9\u062f\u0647\u0627\u06cc \u0632\u06cc\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">amexEditText.setNumberOfBlock(3);\r\namexEditText.setDefaultLength(4);\r\namexEditText.setLengthAt(1,6);\r\namexEditText.setHint(\"Amex\");\r\namexEditText.setText(\"1234567890\");\r\namexEditText.getText();\r\namexEditText.setTextSize(16);\r\namexEditText.setHintTextSize(16);\r\namexEditText.setSeparatorTextSize(16);\r\namexEditText.setSeparatorCharacter('-');\r\namexEditText.setSeparatorPadding(8);\r\namexEditText.setInputType(InputType.TYPE_CLASS_NUMBER);\r\namexEditText.setTextAppearance(android.support.v7.appcompat.R.style.Base_TextAppearance_AppCompat_Medium);\r\namexEditText.setHintTextAppearance(android.support.v7.appcompat.R.style.Base_TextAppearance_AppCompat_Medium);\r\namexEditText.setSeparatorTextAppearance(android.support.v7.appcompat.R.style.Base_TextAppearance_AppCompat_Medium);\r\namexEditText.setEdiTextBackground(ContextCompat.getDrawable(this, R.drawable.selector_edittext_round_border_line));\r\namexEditText.setSelection(0);\r\namexEditText.addCardPrefix(CardPrefix.amex(this))\r\namexEditText.addCardPrefix(CardPrefix.amex(amexDrawable))\r\namexEditText.addCardPrefix(new CardPrefix(this, R.drawable.ic_amex, \"34\"))\r\namexEditText.addCardPrefix(new CardPrefix(amexDrawable, \"34\"))<\/pre>\n<p>\u0648 \u062f\u0631 \u0646\u0647\u0627\u06cc\u062a \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u0622\u0646 \u0631\u0627 findViewbyid \u06a9\u0646\u06cc\u062f \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0645\u062b\u0644 \u0632\u06cc\u0631 \u0639\u0645\u0644 \u06a9\u0646\u06cc\u062f.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">BlockEditText amexEditText = findViewById(R.id.blockEditText_amex);<\/pre>\n<p>\u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634 \u0647\u0645 \u0628\u0647 \u067e\u0627\u06cc\u0627\u0646 \u0631\u0633\u06cc\u062f.<br \/>\n\u0645\u0648\u0641\u0642 \u0648 \u067e\u06cc\u0631\u0648\u0632 \u0628\u0627\u0634\u06cc\u062f.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u06cc\u0634 \u0646\u0645\u0627\u06cc\u0634 \u06a9\u062a\u0627\u0628 \u062e\u0627\u0646\u0647 \u062f\u0631 \u062d\u0627\u0644\u062a \u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0645\u06cc \u062a\u0648\u0627\u0646 \u0627\u0632 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f. \u0627\u0628\u062a\u062f\u0627 \u0628\u0627\u06cc\u062f \u06a9\u062a\u0627\u0628 \u062e\u0627\u0646\u0647 \u0645\u0631\u0628\u0648\u0637\u0647 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f \u0647\u0645\u0627\u0646\u0646\u062f \u0632\u06cc\u0631 \u0639\u0645\u0644 \u06a9\u0646\u06cc\u062f. \u0648\u0627\u0631\u062f \u0641\u0627\u06cc\u0644 Build.gradle \u0627\u0632 \u0646\u0648\u0639 Top-Level \u0634\u062f\u0647 \u0633\u067e\u0633 \u062f\u0631 \u0628\u062e\u0634 repositories \u062e\u0637 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f. repositories { maven{ url &#8220;https:\/\/dl.bintray.com\/infideap2\/Block-EditText&#8221; } } \u0648\u0627\u0631\u062f \u0641\u0627\u06cc\u0644 Build.gradle \u0627\u0632 \u0646\u0648\u0639 Module [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":4925,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-10083","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/posts\/10083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/comments?post=10083"}],"version-history":[{"count":0,"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/posts\/10083\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/media\/4925"}],"wp:attachment":[{"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/media?parent=10083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/categories?post=10083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/milmit.net\/en\/wp-json\/wp\/v2\/tags?post=10083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}