ScrollableItemList
An Android RecyclerView List with items that can scroll to reveal more content
Install / Use
/learn @rohaanhamid/ScrollableItemListREADME
ScrollableItemList
Description
An Android RecyclerView List with items that can scroll to reveal more content on the side. This view has been inspired by the one found in the Reddit News App.
Demo
[
]
Notes on using this
The view has been created using standard views now available with Android Lollipop and its compatibility libraries. The list is a RecyclerView with a LinearLayoutManager. Each item in the list is essentially a ViewPager with two views; a CardView and FrameLayout with three buttons.
Everything else can be used normally except the RecyclerViewAdapter.java where most of the work is required.
The challenges were as follows:
1) The ViewPager does not inflate properly inside the RecyclerView.
In order to solve this, the width of the ViewPager was manually set to the current width of the screen when it inflates inside the adapter. The height should be specified manaully and wrap_content attribute cannot be used.
2) The ViewPagers do not retain state as the list items are scrolled away from current view and back.
In order to solve this problem, the RecyclerViewAdapter holds a list of states for each of the ViewPager and sets them back when a previously modified item comes back in view.
License
The MIT License (MIT)
Copyright (c) 2016 Rohaan Hamid
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Related Skills
qqbot-channel
354.2kQQ 频道管理技能。查询频道列表、子频道、成员、发帖、公告、日程等操作。使用 qqbot_channel_api 工具代理 QQ 开放平台 HTTP 接口,自动处理 Token 鉴权。当用户需要查看频道、管理子频道、查询成员、发布帖子/公告/日程时使用。
docs-writer
100.8k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
354.2kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
Design
Campus Second-Hand Trading Platform \- General Design Document (v5.0 \- React Architecture \- Complete Final Version)1\. System Overall Design 1.1. Project Overview This project aims t
