The library is an advanced edit text with a rigth drawable that allows you to show the progress bar when you click on the right icon. For example, you can use component for geolocation request.
Component extended TextView and using animated vector drawable for progress animation. Used right icon and animation are fully customizable.
dependencies {
implementation 'ru.superjob:loadingedittext:1.0.3'
}
defaultConfig {
...
vectorDrawables.useSupportLibrary = true
...
}
<ru.superjob.loadingedittext.LoadingTextView
android:id="@+id/locationEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:text="Moscow, Tverskaya street, 24"
app:lockingField="true" />
##Control state: You can control display the progress bar. If you want hide progress call method
loadingEditText.setLoading(false)
You can use own right drawable:
android:drawableRight="@drawable/ic_circle"
android:drawableEnd="@drawable/ic_circle"
loadingEditText.setRightDrawable(R.drawable.ic_near_me_gray)
app:customLoadAnimation="@drawable/avd_anim"
loadingEditText.setCustomLoadingDrawable(R.drawable.avd_anim)
Also, you can lock(disable) the field when progress is appearing:
app:lockingField="true"
You can handle click events on right drawable:
locationEditText.setActionClickListener {
//handle action
}
loadingEditText.setActionClickListener(new LoadingEditText.ActionClickListener() {
@Override
public void onClicked() {
//handle action
}
});
Copyright 2018.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.