Android library that allows you to bind a LinearLayout with a ListAdapter.

Overview

LinearListView

Android library that allows you to bind a LinearLayout with a ListAdapter.

Download

Gradle:

dependencies {
  compile 'com.github.frankiesardo:linearlistview:1.0.1@aar'
}

Usage

A simple example of the xml attributes that you can use

<com.linearlistview.LinearListView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:showDividers="none|middle|beginning|end"
    android:divider="@drawable/your_divider"
    android:dividerPadding="2dp"
    app:dividerThickness="2dp"
    android:entries="@array/your_array" />

Where: showDividers, divider and dividerPadding have the same meaning of a LinearLayout (API 11) attributes, entries is the same as a ListView attribute and dividerThickness controls how thick is the divider (namely its height or width depending on its orientation).

In your Activity you can call myLinearListView.setAdapter(myAdapter) and each view from your ListAdapter will be inflated and kept in sync with its data.

Why you want to use a LinearListVew:

  • You need an horizontal scrollable list (since Gallery is deprecated): Just embed this layout with an horizontal orientation in an HorizontalScrollView.
  • You need two or more lists in a vertical scrollable view.
  • You need to inflate several views in a LinearLayout from an Adapter and you want to keep them synchronized with its data. This is especially useful when working with a CursorAdapter.
  • You need a list with a fixed height (the total height of its children). Or, you have a complex, scrollable layout and don't want to use a ListView with footers and headers.
  • You simply want to use a LinearLayout with dividers (API 11) with the added benefit of a dividerThickness attribute.

Roadmap

  • Adding a drawSelectorOnTop attribute.

License

Copyright 2012 Frankie Sardo

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.
Comments
  • Can't compile

    Can't compile

    Hi, I'm unable to compile the most recent linearlistview release. I downloaded the source with the "Download zip" button. I've also tried gradle versions 1.12, and 1.9 which also have errors. What is the proper way to compile?

    ~/Downloads/LinearListView-master$ ./gradlew --stacktrace RELEASE BUILD 1.0.1

    FAILURE: Build failed with an exception.

    • Where: Script '/usr/local/google/home/mschneider/Downloads/LinearListView-master/linearlistview/deploy.gradle' line: 27

    • What went wrong: A problem occurred configuring project ':linearlistview'.

      Failed to notify project evaluation listener. Could not find property 'nexusUsername' on project ':linearlistview'.

    • Try: Run with --info or --debug option to get more log output.

    • Exception is: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':linearlistview'. at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:74) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:469) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:77) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:48) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.Main.main(Main.java:39) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) at org.gradle.launcher.GradleMain.main(GradleMain.java:26) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify project evaluation listener. at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:90) at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:30) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy16.afterEvaluate(Unknown Source) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67) ... 29 more Caused by: groovy.lang.MissingPropertyException: Could not find property 'nexusUsername' on project ':linearlistview'. at org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43) at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35) at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:94) at org.gradle.api.internal.project.DefaultProject_Decorated.getProperty(Unknown Source) at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:248) at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:136) at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147) at org.gradle.api.internal.project.DefaultProject_Decorated.invokeMethod(Unknown Source) at deploy_3vtg6sifnm34n97d4qup3805rm$_run_closure1_closure2_closure8_closure9_closure11.doCall(/usr/local/google/home/mschneider/Downloads/LinearListView-master/linearlistview/deploy.gradle:27) at deploy_3vtg6sifnm34n97d4qup3805rm$_run_closure1_closure2_closure8_closure9_closure11.doCall(/usr/local/google/home/mschneider/Downloads/LinearListView-master/linearlistview/deploy.gradle) at org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer.methodMissing(DefaultGroovyMavenDeployer.groovy:40) at org.gradle.api.publication.maven.internal.ant.DefaultGroovyMavenDeployer.invokeMethod(DefaultGroovyMavenDeployer.groovy) at deploy_3vtg6sifnm34n97d4qup3805rm$_run_closure1_closure2_closure8_closure9.doCall(/usr/local/google/home/mschneider/Downloads/LinearListView-master/linearlistview/deploy.gradle:26) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58) at org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.addRepository(DefaultArtifactRepositoryContainer.java:183) at org.gradle.api.publication.maven.internal.DefaultMavenRepositoryHandlerConvention.mavenDeployer(DefaultMavenRepositoryHandlerConvention.java:43) at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:248) at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:136) at org.gradle.api.internal.plugins.DefaultConvention$ExtensionsDynamicObject.invokeMethod(DefaultConvention.java:221) at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147) at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147) at org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler_Decorated.invokeMethod(Unknown Source) at deploy_3vtg6sifnm34n97d4qup3805rm$_run_closure1_closure2_closure8.doCall(/usr/local/google/home/mschneider/Downloads/LinearListView-master/linearlistview/deploy.gradle:23) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:113) at org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.configure(DefaultArtifactRepositoryContainer.java:76) at org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer.configure(DefaultArtifactRepositoryContainer.java:44) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:50) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94) at org.gradle.api.tasks.Upload.repositories(Upload.java:122) at deploy_3vtg6sifnm34n97d4qup3805rm$_run_closure1_closure2.doCall(/usr/local/google/home/mschneider/Downloads/LinearListView-master/linearlistview/deploy.gradle:22) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:113) at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:436) at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:59) at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:50) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:133) at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:94) at org.gradle.api.internal.DefaultNamedDomainObjectCollection$ContainerElementsDynamicObject.invokeMethod(DefaultNamedDomainObjectCollection.java:316) at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147) at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:83) at deploy_3vtg6sifnm34n97d4qup3805rm$_run_closure1.doCall(/usr/local/google/home/mschneider/Downloads/LinearListView-master/linearlistview/deploy.gradle:21) at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40) at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25) at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:81) ... 33 more

    BUILD FAILED

    Total time: 4.597 secs

    opened by mikepschneider 8
  • Use Support ICSLinearLayout

    Use Support ICSLinearLayout

    The v7, compat lib provides the support LinearLayout adding only the dividers you need in a friendly support fashion. That way any bug fixes added to the LinearLayout Post ICS will be inherited.

    import android.support.v7.internal.widget.LinearLayoutICS;

    Chris.

    opened by chrisjenx 8
  • notifyDataSetChanged Issue

    notifyDataSetChanged Issue

    Hi. I'm facing a big issue I have more data to bind LinearListView,but when use notifyDataSetChanged then it takes lot of time, how can I remove this issue?

    Thanks

    opened by NazarAbbas 2
  • Choice mode does not get recognized

    Choice mode does not get recognized

    Common for list views is the possibility to set the choice mode via android:choiceMode="none" Even if set, the item goes into the selected state if you click on an item and back to the default state after clicking on it again.

    opened by mlilienberg 0
  • Can not be used as a list view for ListFragment

    Can not be used as a list view for ListFragment

    Any chance of updating it to be able to use it in a ListFragment ? And have all the benefits like alphabetindexer, which can only be used on classes extending AbsListView.

    opened by miroslavign 0
  • Touch on LinearListView within a NestedScrollView blocks scrolling

    Touch on LinearListView within a NestedScrollView blocks scrolling

    I have the typical Material layout with a CollapsingToolbarLayout in a CoordinatorLayout an on the bottom a NestedScrollView with a LinearListView.

    The LinearListView in the NestedScrollView blocks the scrolling function of the NestedScrollView if I touch inside the LinearListView but if I touch outside of the LinearListView within the NestedScrollView it works. But this issue only occurs when the LinearListView have just few of elements. If I have more, the touching and scrolling works with LinearListView.

    Here is a sample code:

    <android.support.design.widget.CoordinatorLayout
            android:id="@+id/rootLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto">
    
            <android.support.design.widget.AppBarLayout
                android:id="@+id/appbarlayout"
                android:layout_width="match_parent"
                android:layout_height="@dimen/app_bar_height"
                android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
    
                <android.support.design.widget.CollapsingToolbarLayout
                    android:id="@+id/collapsingToolbarLayout"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    app:contentScrim="?attr/colorPrimary"
                    app:expandedTitleMargin="@dimen/expandedTitleMargin"
                    app:layout_scrollFlags="scroll|exitUntilCollapsed">
    
                    <ImageView
                        android:id="@+id/userpicture"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:scaleType="centerCrop"
                        app:layout_collapseMode="parallax"
                        app:layout_collapseParallaxMultiplier="0.7" />
    
                    <android.support.v7.widget.Toolbar
                        android:id="@+id/toolbar"
                        android:layout_width="match_parent"
                        android:layout_height="?attr/actionBarSize"
                        app:layout_collapseMode="pin"
                        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
    
                </android.support.design.widget.CollapsingToolbarLayout>
            </android.support.design.widget.AppBarLayout>
    
            <android.support.v4.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">
    
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:padding="5dp"
                    android:orientation="vertical">
    
    
    
                    <android.support.v7.widget.CardView
                        xmlns:android="http://schemas.android.com/apk/res/android"    
                        xmlns:card_view="http://schemas.android.com/apk/res-auto"
    
                        android:id="@+id/card_view"
                        android:layout_gravity="center"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        card_view:cardCornerRadius="4dp"
                        card_view:cardUseCompatPadding="true"
                        card_view:cardPreventCornerOverlap="true"
                        android:layout_alignParentBottom="true"
                        android:clickable="false"
                        android:layout_marginBottom="35dp"
                        android:background="@color/cardview_light_background">
    
                        <com.linearlistview.LinearListView
                            android:clickable="false"
                            xmlns:app="http://schemas.android.com/apk/res-auto"
                            android:id="@+id/list_view"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical"
                            android:showDividers="middle"
                            android:dividerPadding="2dp"
                            app:dividerThickness="2dp" />
    
                        </android.support.v7.widget.CardView>   
                </RelativeLayout>
    
            </android.support.v4.widget.NestedScrollView>
    
        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fabBttn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_anchorGravity="bottom|right|end"
            app:layout_anchor="@id/appbarlayout"
            android:layout_margin="16dp"
            android:src="@drawable/ic_create_24dp"
            android:tint="@color/white"
            app:borderWidth="0dp"
            app:fabSize="normal" />
    
    </android.support.design.widget.CoordinatorLayout>
    
    opened by alican 2
  • error in  android studio

    error in android studio

    i m using your lib in AS and have mentioned compile in gradle file too . i have defined like this : compile 'com.github.frankiesardo:linearlistview:1.0.1@aar' HERE IS THE ERROR I M GETTTING
    java.lang.NoClassDefFoundError: com.linearlistview.R$attr @frankiesardo

    opened by engr-erum 1
  • drawDividersHorizontal incorrectly overrides package-private method with same name

    drawDividersHorizontal incorrectly overrides package-private method with same name

    i read the following warning in logcat: dalvikvm﹕ method Lcom/linearlistview/internal/IcsLinearLayout;.drawDividersHorizontal incorrectly overrides package-private method with same name in Landroid/widget/LinearLayout;

    opened by drindt 0
Releases(v1.0.1)
Owner
Francesco Sardo
Francesco Sardo
Horizontal list view for Android which allows variable items widths

Deprecated This widget is now deprecated and it won't be updated anymore. Use RecyclerView instead Horizontal Variable ListView Horizontal ListView fo

Alessandro Crugnola 862 Nov 15, 2022
Android library to observe scroll events on scrollable views.

Android-ObservableScrollView Android library to observe scroll events on scrollable views. It's easy to interact with the Toolbar introduced in Androi

Soichiro Kashima 9.6k Dec 30, 2022
An android library for section headers that stick to the top

StickyListHeaders StickyListHeaders is an Android library that makes it easy to integrate section headers in your ListView. These section headers stic

Emil Sjölander 5.5k Jan 5, 2023
Android library to achieve in an easy way, the behaviour of the home page in the Expedia app, with a pair of auto-scroll circular parallax ListViews.

ListBuddies This library is not maintained anymore and there will be no further releases Android library of a pair of auto-scroll circular parallax Li

JPARDOGO 970 Dec 29, 2022
A small android library for tagging views inside a ScrollView as "sticky" making them stick to the top of the scroll container until a new sticky view comes and takes it's place

StickyScrollViewItems StickyScrollViewItems is a ScrollView subclass that allowed you to mark items inside the ScrollView as sticky. The items marked

Emil Sjölander 1k Jan 7, 2023
Android library to display a ListView whose cells are not rigid but flabby and react to ListView scroll.

FlabbyListView This library is not maintained anymore and there will be no further releases Android library to display a ListView which cells are not

JPARDOGO 762 Nov 23, 2022
An open source Android library that provides a floating group view at the top of the ExpandableListView

FloatingGroupExpandableListView FloatingGroupExpandableListView is a huge name an open source Android library that provides a floating group view (aka

Diego Lima 376 Nov 28, 2022
An easy to use Drag & Drop List for Android. Direct replacement of the android ListView.

DragNDropListView DragNDropListView is a direct replacement for the stock Android ListView. If you know how to use ListView, you already know how to u

null 187 Dec 22, 2022
Easy to use ListView with pinned sections for Android.

Easy to use ListView with pinned sections for Android 2.1 and higher. Pinned section is a header view which sticks to the top of the list until at lea

Sergej Shafarenka 2.6k Dec 21, 2022
This project aims to provide a reusable pull to refresh widget for Android.

Pull To Refresh for Android Note This library is deprecated, a swipe refresh layout is available in the v4 support library. This project aims to provi

Johan Berg 2.5k Jan 2, 2023
An Android custom ListView and ScrollView with pull to zoom-in.

PullZoomView An Android custom ListView and ScrollView with pull to zoom-in. Features Set ZoomView enable Add HeaderView Custom ZoomView Parallax or N

Frank-Zhu 2.3k Dec 26, 2022
Lazy load of images in Android

LazyList A simple library to display images in Android ListView. Images are being downloaded asynchronously in the background. Images are being cached

Fedor Vlasov 1.2k Nov 15, 2022
Android widget with pull to refresh for all the views,and support loadMore for ListView , RecyclerView, GridView and SwipeRefreshLayout.

CommonPullToRefresh Android widget with pull to refresh for all the views,and support loadMore for ListView,RecyclerView,GridView and SwipeRefreshLayo

null 1.1k Nov 10, 2022
HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView which scrolls vertically).

HorizontalListView HorizontalListView is an Android ListView widget which scrolls in a horizontal manner (in contrast with the SDK-provided ListView w

MeetMe 722 Nov 10, 2022
A ListView with pinned section headers for Android

PinnedHeaderListView This library provides a sectioned ListView with pinned headers. It looks and feels much like the default contacts app does on And

James Smith 665 Nov 29, 2022
A generic, customizable, open source Android ListView implementation that has 'Pull to Refresh' functionality.

Android 'Pull to Refresh' ListView library Demo video: http://www.youtube.com/watch?v=VjmdELnm3GI Project A generic, customizable, open source Android

Erik Wallentinsen 639 Nov 17, 2022
Parallax ScrollView and ListView for Android

Parallax Scrolls Parallax ListView and ScrollView for Android This project includes ScrollView with one or more parallaxed views ListView with paralla

Nir Hartmann 851 Dec 3, 2022
android custom listview,with interaction pattern load more and pull to refresh to load data dinamically

The first thing that i have to say is render thanks to johannilsson because all the part of pull to refresh listview is based in the code of his repos

Fabian Leon 447 Nov 15, 2022
Awesome Listview filter functionality in Android.

About Awesome Listview filter functionality in Android. See it in Action: https://www.youtube.com/watch?v=RO54U1ES5CA Listview with beautiful transpar

Bhavya  Mehta 446 Nov 20, 2022