Skip to content

Commit

Permalink
Layout fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kundan Kamal committed Sep 21, 2020
1 parent 9f7718b commit dfe3330
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand Down
25 changes: 20 additions & 5 deletions app/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custome="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.thekundankamal.textinputedittext.TextInputEditText
<com.thekundankamal.textinputlibrary.TextInputEditText
android:layout_margin="10dp"
android:id="@+id/input_data"
custome:titleText="Hello"
custome:hintText="This is text input"
custome:titleText="Title"
custome:hintText="Enter your value"
custome:titleTextSize="4sp"
custome:textSize="5sp"
custome:borderSelectedColor="@color/colorPrimaryDark"
custome:textSize="6sp"
custome:borderColor="@color/strokeColor"
custome:titleColor="@color/colorPrimaryDark"
custome:hintColor="@color/colorAccent"
custome:textColor="@color/colorPrimary"
custome:borderWidth="10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<com.thekundankamal.textinputlibrary.TextInputEditText
android:layout_margin="10dp"
android:id="@+id/input_data_two"
custome:titleText="Title"
custome:hintText="Enter your value"
custome:titleTextSize="4sp"
custome:textSize="6sp"
custome:borderColor="@color/strokeColor"
custome:titleColor="@color/colorPrimaryDark"
custome:hintColor="@color/colorAccent"
Expand Down
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">My Application</string>
<string name="app_name">TextInputEditTextSampleApp</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public TextInputEditText(Context context) {
public TextInputEditText(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater layoutInflater= (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view=layoutInflater.inflate(R.layout.activity_main,this,true);
View view=layoutInflater.inflate(R.layout.text_input_layout,this,true);
edData=view.findViewById(R.id.ed_edit_text);
tvTitle=view.findViewById(R.id.tv_title);
rlContainer=view.findViewById(R.id.rl_container);
Expand All @@ -37,7 +37,7 @@ public TextInputEditText(Context context, AttributeSet attrs) {
int textColor = typedArray.getColor(R.styleable.TextInputOption_textColor,getResources().getColor(android.R.color.holo_blue_light));
float titleTextSize = typedArray.getDimension(R.styleable.TextInputOption_titleTextSize,2f);
float textSize = typedArray.getDimension(R.styleable.TextInputOption_textSize,1f);
int maxLength = typedArray.getInt(R.styleable.TextInputOption_maxLength,10);
int maxLength = typedArray.getInt(R.styleable.TextInputOption_maxLength,100);
final int borderWidth = typedArray.getInt(R.styleable.TextInputOption_borderWidth,3);
final int borderColor = typedArray.getColor(R.styleable.TextInputOption_borderColor,getResources().getColor(R.color.strokeColor));
final int borderSelectedColor = typedArray.getColor(R.styleable.TextInputOption_borderSelectedColor,getResources().getColor(R.color.strokeColor));
Expand All @@ -63,8 +63,8 @@ public void afterTextChanged(Editable s) {


//Set the content in attribute
edData.setHint(titleText);
tvTitle.setText(hintText);
edData.setHint(hintText);
tvTitle.setText(titleText);
tvTitle.setTextColor(titleColor);
tvTitle.setTextSize(titleTextSize);
edData.setTextSize(textSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
android:paddingLeft="10dp"
android:background="@android:color/transparent"
android:hint="Enter you value"
android:inputType="number"
android:textColorHint="#000000"
android:imeOptions="actionNext"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Expand Down

0 comments on commit dfe3330

Please sign in to comment.