Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rajkumariray committed Mar 27, 2019
1 parent 0ddf1d4 commit da42ed6
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 37 deletions.
33 changes: 32 additions & 1 deletion app/src/main/java/com/customedittext/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
package com.customedittext;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;

import com.lib.customedittext.CustomEditText;

public class MainActivity extends AppCompatActivity {

private static final String TAG = MainActivity.class.getSimpleName();
private CustomEditText mEdtName;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mEdtName = findViewById(R.id.edtName);

mEdtName.getEditText().addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

}

@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {

}

@Override
public void afterTextChanged(Editable editable) {
Log.d(TAG,"Name " + editable.toString());
}
});

//for getting value of edittext on button click
String name = mEdtName.getText();
Log.d(TAG, "Name " + name);
}
}
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/ic_person_black.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
<path android:fillColor="#000000" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/ic_vpn_key_black.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0" android:width="24dp">
<path android:fillColor="#000000" android:pathData="M12.65,10C11.83,7.67 9.61,6 7,6c-3.31,0 -6,2.69 -6,6s2.69,6 6,6c2.61,0 4.83,-1.67 5.65,-4H17v4h4v-4h2v-4H12.65zM7,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
</vector>
27 changes: 23 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,29 @@
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
android:orientation="vertical"
android:padding="@dimen/_10sdp"
android:padding="@dimen/_12sdp"
android:layout_gravity="center"
android:gravity="center"
tools:context=".MainActivity">


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="@color/colorAccent"
android:textSize="@dimen/_18ssp"
android:padding="@dimen/_10sdp"
android:fontFamily="sans-serif-condensed-medium"
/>
<com.lib.customedittext.CustomEditText
android:id="@+id/edtName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/_8sdp"
android:imeOptions="actionNext"
android:inputType="text"
android:fontFamily="sans-serif-condensed"
android:maxLength="15"
app:edt_background="@drawable/round_editbox"
app:edt_hint="Enter Name"
Expand All @@ -29,6 +43,7 @@
android:imeOptions="actionNext"
android:inputType="textPassword"
android:maxLength="15"
android:fontFamily="sans-serif-condensed"
app:edt_background="@drawable/round_editbox"
app:edt_hint="Enter Password"
app:edt_padding="@dimen/_10sdp"
Expand All @@ -52,8 +67,9 @@
android:imeOptions="actionNext"
android:inputType="text"
android:maxLength="15"
android:fontFamily="sans-serif-condensed"
app:edt_background="@android:color/transparent"
app:edt_drawable_start="@android:drawable/ic_dialog_email"
app:edt_drawable_start="@drawable/ic_person_black"
app:edt_hint="Enter Name"
app:edt_padding="@dimen/_10sdp"
app:edt_show_drawable="true"
Expand All @@ -78,9 +94,10 @@
android:inputType="textPassword"
android:maxLength="15"
app:edt_background="@android:color/transparent"
app:edt_drawable_start="@android:drawable/ic_lock_lock"
app:edt_hint="Enter Name"
app:edt_drawable_start="@drawable/ic_vpn_key_black"
app:edt_hint="Enter Password"
app:edt_padding="@dimen/_10sdp"
android:fontFamily="sans-serif-condensed"
app:edt_password_toggle="true"
app:edt_show_drawable="true"
app:edt_text_color="@android:color/black"
Expand All @@ -94,6 +111,7 @@
android:imeOptions="actionDone"
android:inputType="text"
android:maxLength="15"
android:fontFamily="sans-serif-condensed"
app:edt_background_tint="@color/offWhite"
app:edt_hint="Enter Name"
app:edt_padding="@dimen/_10sdp"
Expand All @@ -108,6 +126,7 @@
android:imeOptions="actionDone"
android:inputType="textPassword"
android:maxLength="15"
android:fontFamily="sans-serif-condensed"
app:edt_background_tint="@color/offWhite"
app:edt_hint="Enter Password"
app:edt_padding="@dimen/_10sdp"
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="colorPrimary">#E91E63</color>
<color name="colorPrimaryDark">#E91E63</color>
<color name="colorAccent">#FFFFFF</color>
<color name="offWhite">#efefef</color>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">CurrencyEditText</string>
<string name="app_name">Custom EditText</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
Expand Down
36 changes: 18 additions & 18 deletions customedittext/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}

//configurations {
// javadocDeps
//}
configurations {
javadocDeps
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
// javadocDeps 'com.android.support:support-annotations:28.0.0'
javadocDeps 'com.android.support:support-annotations:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
Expand All @@ -58,10 +58,10 @@ ext {

libraryDescription = 'This view is a container that supports diagonal scroll and fling gesture. It is based on AOSP HorizontalScrollView.'

siteUrl = 'https://github.com/kailashchouhan1306/customedittext'
gitUrl = 'https://github.com/kailashchouhan1306/customedittext.git'
siteUrl = 'https://github.com/rkmobile2519/customedittext'
gitUrl = 'https://github.com/rkmobile2519/customedittext/issues'

libraryVersion = '1.0'
libraryVersion = '1.0.0'

developerId = 'rkmobile'
developerName = 'RK'
Expand Down Expand Up @@ -113,19 +113,19 @@ task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
}

//task javadoc(type: Javadoc) {
// source = android.sourceSets.main.java.srcDirs
// classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
//// classpath += configurations.javadocDeps
//}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
// classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.javadocDeps
}

//task javadocJar(type: Jar, dependsOn: javadoc) {
// classifier = 'javadoc'
// from javadoc.destinationDir
//}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
// archives javadocJar
archives javadocJar
archives sourcesJar
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

/**
* @author Kailash Chouhan
* @creationDate 05-Feb-18
* Copyright © 2018 SynsoftGlobal. All rights reserved.
*/

public class CustomEditText extends FrameLayout {
Expand Down Expand Up @@ -327,10 +325,7 @@ public void setErrorPadding(int left, int top, int right, int bottom) {

/**
* Change the editor type integer associated with the text view, which
* is reported to an Input Method Editor (IME) with {@link EditorInfo#imeOptions}
* when it has focus.
*
* @see EditorInfo
* is reported to an Input Method Editor (IME) with when it has focus.
*/
public void setImeOptions(int imeOptions) {
editText.setImeOptions(imeOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

/**
* @author Kailash Chouhan
* creationDate 07-Mar-18
* Copyright © 2018 SynsoftGlobal. All rights reserved.
*/

public class DimensionsUtils {
Expand All @@ -18,7 +16,7 @@ public static float getDimension(Context context, @DimenRes int resourceId) {
return context.getResources().getDimension(resourceId);
}

public static int getDimensionPixelSize(Context context, @DimenRes int resourceId) {
static int getDimensionPixelSize(Context context, @DimenRes int resourceId) {
return context.getResources().getDimensionPixelSize(resourceId);
}

Expand Down

0 comments on commit da42ed6

Please sign in to comment.