Linear Layout Manager which supports WRAP_CONTENT

Overview

Linear Layout Manager

DEPRECATED

RecyclerView supports WRAP_CONTENT starting from Android Support Library 23.2. More details here: http://android-developers.blogspot.se/2016/02/android-support-library-232.html

Description

Implementation of LinearLayoutManager which wraps its contents.

Usage example:

final LinearLayoutManager layoutManager = new org.solovyev.android.views.llm.LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerview);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new DividerItemDecoration(this, null));
recyclerView.setAdapter(adapter);

Note that if the child views in your RecyclerView have the fixed size LinearLayoutManager#setChildSize should be used to avoid unnecessary measuring.

Installation

Gradle dependency:

compile 'org.solovyev.android.views:linear-layout-manager:0.5@aar'

Maven dependency:

<dependency>
    <groupId>org.solovyev.android.views</groupId>
    <artifactId>linear-layout-manager</artifactId>
    <version>0.5</version>
    <type>apklib</type>
</dependency>

License

Library is distributed under Apache 2.0 license, see LICENSE.txt

Applications

The following applications use this library:

You might also like...
A layout to transition between two views using a Floating Action Button as shown in many Material Design concepts
A layout to transition between two views using a Floating Action Button as shown in many Material Design concepts

⚠ This library is no longer maintained ⚠️ FABRevealLayout A layout to transition between two views using a Floating Action Button as shown in many Mat

An Android demo of a foldable layout implementation. Engineered by Vincent Brison.
An Android demo of a foldable layout implementation. Engineered by Vincent Brison.

Foldable Layout This code is a showcase of a foldable animation I created for Worldline. The code is fully written with java APIs from the Android SDK

A 3D Layout for Android,When you use it warp other view,it can became a 3D view,一秒让你的view拥有3D效果!
A 3D Layout for Android,When you use it warp other view,it can became a 3D view,一秒让你的view拥有3D效果!

ThreeDLayout A 3D Layout,When you use it warp other view,it can became a 3D view 中文文档 preview USAGE 1.compile library allprojects { repositories {

It's an Android library that allows you to use Layout as RadioButton or CheckBox.
It's an Android library that allows you to use Layout as RadioButton or CheckBox.

Android - CompoundLayout It's an Android library that allows you to use Layout as RadioButton or CheckBox. The librarie is Android 14+ compatible. Gra

A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc.  really a practical RefreshLayout!
A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!

RecyclerRefreshLayout English | 中文版 RecyclerRefreshLayout based on the {@link android.support.v4.widget.SwipeRefreshLayout} The RecyclerRefreshLayout

A layout that creates a loading-like progress around it's child ( circle ) on touch, inspired from Destiny's ( PS4 )  accept mechanism
A layout that creates a loading-like progress around it's child ( circle ) on touch, inspired from Destiny's ( PS4 ) accept mechanism

HoldToLoadLayout HoldToLoadLayout is a view group that can contain a single child. It draws your child to middle of layout, and performs loading wheel

Easy, flexible and powerful Swipe Layout for Android
Easy, flexible and powerful Swipe Layout for Android

SwipeRevealLayout A layout that you can swipe/slide to show another layout. Demo Overview Drag mode Drag mode normal: Drag mode same_level: Features F

[UNMAINTAINED]: AndroidMosaicLayout is android layout to display group of views as grid consists of different asymmetric patterns (90 different patterns).
[UNMAINTAINED]: AndroidMosaicLayout is android layout to display group of views as grid consists of different asymmetric patterns (90 different patterns).

AndroidMosaicLayout AndroidMosaicLayout is android layout to display group of views in more that 90 different patterns. What is AndroidMosaicLayout? I

Scalable Layout For Android
Scalable Layout For Android

ScalableLayout for Android. Class: com.ssomai.android.scalablelayout.ScalableLayout 한글버전 README.md: https://github.com/ssomai/ScalableLayout/blob/mast

Comments
  • Right now, we have changed files immediately after open project in An…

    Right now, we have changed files immediately after open project in An…

    …droid Studio:

    dkalita$ git status HEAD detached at upstream/master Changes not staged for commit: (use "git add/rm ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory)

    modified:   .idea/gradle.xml
    deleted:    .idea/libraries/jsr305_2_0_3.xml
    deleted:    .idea/libraries/material_0_1_3.xml
    deleted:    .idea/libraries/recyclerview_v7_22_0_0.xml
    deleted:    .idea/libraries/support_annotations_22_0_0.xml
    deleted:    .idea/libraries/support_v4_22_0_0.xml
    

    This patch fixes it by adding all idea files to .gitignore.

    It may be necessary to re-import the project, after merging this commit.

    opened by rusmonster 5
  • The command:

    The command:

    ./gradlew clean && ./gradlew assemble fails with errors below. This patch fixes it.

    :app:preDexDebug /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/DividerItemDecoration.java:8: error: package android.support.v7.widget does not exist import android.support.v7.widget.LinearLayoutManager; ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/DividerItemDecoration.java:9: error: package android.support.v7.widget does not exist import android.support.v7.widget.RecyclerView; ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/DividerItemDecoration.java:13: error: package RecyclerView does not exist public class DividerItemDecoration extends RecyclerView.ItemDecoration { ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/DividerItemDecoration.java:56: error: cannot find symbol public void getItemOffsets(Rect outRect, View view, RecyclerView parent, ^ symbol: class RecyclerView location: class DividerItemDecoration /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/DividerItemDecoration.java:57: error: package RecyclerView does not exist RecyclerView.State state) { ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/DividerItemDecoration.java:79: error: cannot find symbol public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { ^ symbol: class RecyclerView location: class DividerItemDecoration /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/DividerItemDecoration.java:79: error: package RecyclerView does not exist public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/DividerItemDecoration.java:142: error: cannot find symbol private int getOrientation(RecyclerView parent) { ^ symbol: class RecyclerView location: class DividerItemDecoration /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:5: error: package android.support.v4.view does not exist import android.support.v4.view.ViewCompat; ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:6: error: package android.support.v7.widget does not exist import android.support.v7.widget.RecyclerView; ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:22: error: package android.support.v7.widget does not exist public class LinearLayoutManager extends android.support.v7.widget.LinearLayoutManager { ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:32: error: cannot find symbol private final RecyclerView view; ^ symbol: class RecyclerView location: class LinearLayoutManager /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:52: error: cannot find symbol public LinearLayoutManager(RecyclerView view) { ^ symbol: class RecyclerView location: class LinearLayoutManager /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:59: error: cannot find symbol public LinearLayoutManager(RecyclerView view, int orientation, boolean reverseLayout) { ^ symbol: class RecyclerView location: class LinearLayoutManager /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:78: error: package RecyclerView does not exist public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state, int widthSpec, int heightSpec) { ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:78: error: package RecyclerView does not exist public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state, int widthSpec, int heightSpec) { ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:230: error: package RecyclerView does not exist private void measureChild(RecyclerView.Recycler recycler, int position, int widthSize, int heightSize, int[] dimensions) { ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:262: error: package RecyclerView does not exist private static void makeInsetsDirty(RecyclerView.LayoutParams p) { ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:13: error: reference not found

    • {@link android.support.v7.widget.LinearLayoutManager} which wraps its content. Note that this class will always ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:14: error: reference not found
    • wrap the content regardless of {@link android.support.v7.widget.RecyclerView} layout parameters. ^ /Users/dkalita/android/android-linear-layout-manager/lib/src/main/java/org/solovyev/android/views/llm/LinearLayoutManager.java:15: error: self-closing element not allowed
    • ^ 3 errors 18 warnings :app:preDexDebug FAILED

    FAILURE: Build failed with an exception.

    opened by rusmonster 2
  • Fix for varriable size children as well as wrap_content parent

    Fix for varriable size children as well as wrap_content parent

    The onMeassure() step now finds the largest child when setting the wrapping dimension.

    measureChild() now properly handles the case where all parent views are wrap_content. RecyclerView's own getChildMeasureSpec() has some limitations in this regaurd which we must work around.

    The result is allowing RecyclerView to size it's self entirely based on it's children as well as deal with heterogenous children.

    opened by Wavesonics 0
Owner
Sergey Solovyev
Sergey Solovyev
GoolgePlusLayout is a custom layout that plays animation on the children views while scrolling as the layout in the Google Plus (android) main page

Google Plus Layout Google Plus Layout is a custom layout that support playing animation on child view(s) in a serialize manner like the the main

Ahmed Nammari 224 Nov 25, 2022
Responsive Layout Gird Configuration using Compose. An adaptive layout

ResponsiveGrid Responsive Grid is most followed layout system by the designer as it adapts to screen size and orientation, ensuring consistency across

null 4 Apr 12, 2022
An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu

ResideLayout An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu. Can be used on Android 1.6(I haven't try it.)

Yang Hui 392 Oct 12, 2022
a custom pull-to-refresh layout which contains a interesting animation

This is a project with custom pull-to-refresh layout which contains a interesting animation. And the animation is inspired by https://dribbble.com/sho

ZhangLei 1.8k Dec 27, 2022
ConstraintLayout is an Android layout component which allows you to position and size widgets in a flexible way

ConstraintLayout is a layout manager for Android which allows you to position and size widgets in a flexible way. It's available for both the Android view system and Jetpack Compose.

Android Jetpack 970 Jan 6, 2023
Draftsman is an on device layout inspector which can be embedded in your android app.

Draftsman Draftsman is an on-device layout inspector for Android apps. It allows you to view various properties of rendered Android Views such as widt

Gojek 243 Dec 22, 2022
The Most Powerful Swipe Layout!

Android Swipe Layout ![Gitter](https://badges.gitter.im/Join Chat.svg) This is the brother of AndroidViewHover. One year ago, I started to make an app

代码家 12.3k Dec 28, 2022
A very simple arc layout library for Android

ArcLayout A very simple arc layout library for Android. Try out the sample application on the Play Store. Usage (For a working implementation of this

ogaclejapan 1.4k Dec 26, 2022
Android layout that simulates physics using JBox2D

PhysicsLayout Android layout that simulates physics using JBox2D. Simply add views, enable physics, and watch them fall! See it in action with the sam

John Carlson 689 Dec 29, 2022