GithubHelp home page GithubHelp logo

iammert / multisearchview Goto Github PK

View Code? Open in Web Editor NEW
1.2K 18.0 87.0 4.15 MB

Yet another built-in animated search view for Android.

Kotlin 100.00%
android kotlin searchview search animation tab tablayout custom customview

multisearchview's Introduction

MultiSearchView

Yet another built-in animated search view for Android.

All design credits goes to Cuberto And inspired from this design

Video demo

Here

Usage

<com.iammert.library.ui.multisearchviewlib.MultiSearchView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>     
multiSearchView.setSearchViewListener(object : MultiSearchView.MultiSearchViewListener{
    override fun onItemSelected(index: Int, s: CharSequence) {
    }

    override fun onTextChanged(index: Int, s: CharSequence) {
    }

    override fun onSearchComplete(index: Int, s: CharSequence) {
    }

    override fun onSearchItemRemoved(index: Int) {
    }

})

Customize

If you need customize MultiSearchView, firstly you should add style set under styles.xml

     <!-- Search Text Style. -->
    <style name="SearchTextStyle">
        <!-- Custom values write to here for SearchEditText. -->
        <item name="android:focusable">true</item>
        <item name="android:focusableInTouchMode">true</item>
        <item name="android:enabled">true</item>
        <item name="android:hint">Search</item>
        <item name="android:imeOptions">actionSearch</item>
        <item name="android:textSize">18sp</item>
        <item name="android:maxLength">15</item>
        <item name="android:inputType">textCapSentences</item>
        <item name="android:textColorHint">#80999999</item>
        <item name="android:textColor">#000</item>
    </style>

Thereafter, you should give style set to app:searchTextStyle under MultiSearchView

        <com.iammert.library.ui.multisearchviewlib.MultiSearchView
            android:id="@+id/multiSearchView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            app:searchTextStyle="@style/SearchTextStyle" />

That's it. You created own style for MultiSearchView

Setup

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.iammert:MultiSearchView:0.3'
}

Thanks to contributers

License

Copyright 2019 Mert Şimşek

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.

multisearchview's People

Contributors

iammert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multisearchview's Issues

Request (Style Programically)

Setting a style via xml doesn't really help in an app where the gui dynamically changes based on colors. I would enjoy the ability to tint the search icon and text via code.

Cannot find databinding

I tried implementing this library in my project and it compiled correctly but crashed when the app started and said something about not finding a databinding class.

ClassNotFoundException: Didn't find class "androidx.databinding.DataBinderMapperImpl"

onFocusChangeListener

This would help trigger onscreen keyboards or other options to tie in with the view visibility

Search Icon Color

Request to add some reference or function to edit the search icon and its color

Random Error - parameter must be a descendant of this view

When clicking on the search icon (copen, close, open, close, ...), I randomly get the following error:

2020-03-22 21:18:39.640 7533-7533/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.levionsoftware.instagram_map, PID: 7533
    java.lang.IllegalArgumentException: parameter must be a descendant of this view
        at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:6414)
        at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:6336)
        at android.widget.HorizontalScrollView.isWithinDeltaOfScreen(HorizontalScrollView.java:1724)
        at android.widget.HorizontalScrollView.onSizeChanged(HorizontalScrollView.java:2125)
        at android.view.View.sizeChange(View.java:23911)
        at android.view.View.setBottom(View.java:17998)
        at android.animation.PropertyValuesHolder.nCallIntMethod(Native Method)
        at android.animation.PropertyValuesHolder.access$200(PropertyValuesHolder.java:38)
        at android.animation.PropertyValuesHolder$IntPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1240)
        at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
        at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1349)
        at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1481)
        at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
        at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
        at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:994)
        at android.view.Choreographer.doCallbacks(Choreographer.java:794)
        at android.view.Choreographer.doFrame(Choreographer.java:725)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:981)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:7777)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)

GIF:
https://imgur.com/VaUivgR

Inflating Error

i got this error after implementing this.

E/AndroidRuntime: FATAL EXCEPTION: main Process: pk.com.informatica.tkonnect, PID: 23427 java.lang.RuntimeException: Unable to start activity ComponentInfo{pk.com.informatica.tkonnect/pk.com.informatica.tkonnect.ui.home.MainActivity}: android.view.InflateException: Binary XML file line #15 in pk.com.informatica.tkonnect:layout/activity_main: Binary XML file line #166 in pk.com.informatica.tkonnect:layout/content_main: Error inflating class com.iammert.library.ui.multisearchviewlib.MultiSearchView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3304) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3443) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2040) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7520) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: android.view.InflateException: Binary XML file line #15 in pk.com.informatica.tkonnect:layout/activity_main: Binary XML file line #166 in pk.com.informatica.tkonnect:layout/content_main: Error inflating class com.iammert.library.ui.multisearchviewlib.MultiSearchView Caused by: android.view.InflateException: Binary XML file line #166 in pk.com.informatica.tkonnect:layout/content_main: Error inflating class com.iammert.library.ui.multisearchviewlib.MultiSearchView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:858) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1267) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1267) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1130) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.inflate(LayoutInflater.java:686) at android.view.LayoutInflater.inflate(LayoutInflater.java:538) at android.view.LayoutInflater.inflate(LayoutInflater.java:481) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170) at pk.com.informatica.tkonnect.ui.home.MainActivity.onCreate(MainActivity.kt:72) at android.app.Activity.performCreate(Activity.java:7893) at android.app.Activity.performCreate(Activity.java:7880) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3279) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3443) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) E/AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2040) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:224) at android.app.ActivityThread.main(ActivityThread.java:7520) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950) Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/databinding/DataBinderMapperImpl; at androidx.databinding.DataBindingUtil.<clinit>(DataBindingUtil.java:32) at androidx.databinding.DataBindingUtil.inflate(DataBindingUtil.java:95) at com.iammert.library.ui.multisearchviewlib.extensions.DataBindingExtensionsKt.inflate(DataBindingExtensions.kt:17) at com.iammert.library.ui.multisearchviewlib.extensions.DataBindingExtensionsKt.inflate$default(DataBindingExtensions.kt:16) at com.iammert.library.ui.multisearchviewlib.MultiSearchView.<init>(MultiSearchView.kt:23) at com.iammert.library.ui.multisearchviewlib.MultiSearchView.<init>(MultiSearchView.kt:9) at com.iammert.library.ui.multisearchviewlib.MultiSearchView.<init>(Unknown Source:6) ... 38 more Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.databinding.DataBinderMapperImpl" on path: DexPathList[[zip file "/data/app/pk.com.informatica.tkonnect-97ae8aK8Zl_QasSvSudVhw==/base.apk"],nativeLibraryDirectories=[/data/app/pk.com.informatica.tkonnect-97ae8aK8Zl_QasSvSudVhw==/lib/arm64, /system/lib64, /product/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) ... 45 more

Getter method for EditText

It would be great to have a getter method (getEditText) for the MultiSearchView container so we can have more control and display of the EditText. I need to have dynamic control to programmatically modify it outside of XML in res.

Crashes

Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.databinding.DataBinderMapperImpl" on path: DexPathList[

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.