{"id":19945992,"url":"https://github.com/jpardogo/listbuddies","last_synced_at":"2025-05-16T17:07:46.499Z","repository":{"id":11746504,"uuid":"14275875","full_name":"jpardogo/ListBuddies","owner":"jpardogo","description":"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.","archived":false,"fork":false,"pushed_at":"2019-10-16T11:48:26.000Z","size":9772,"stargazers_count":962,"open_issues_count":8,"forks_count":294,"subscribers_count":66,"default_branch":"master","last_synced_at":"2025-05-16T17:07:04.118Z","etag":null,"topics":["android-library","autoscroll","expedia","listview","listviews"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpardogo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-10T12:21:00.000Z","updated_at":"2025-03-23T01:11:56.000Z","dependencies_parsed_at":"2022-09-02T03:31:01.735Z","dependency_job_id":null,"html_url":"https://github.com/jpardogo/ListBuddies","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpardogo%2FListBuddies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpardogo%2FListBuddies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpardogo%2FListBuddies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpardogo%2FListBuddies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpardogo","download_url":"https://codeload.github.com/jpardogo/ListBuddies/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573589,"owners_count":22093731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-library","autoscroll","expedia","listview","listviews"],"created_at":"2024-11-13T00:27:43.373Z","updated_at":"2025-05-16T17:07:46.481Z","avatar_url":"https://github.com/jpardogo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"ListBuddies\n===========\n\n**This library is not maintained anymore and there will be no further releases**\n\nAndroid library of a pair of auto-scroll circular parallax ListViews like the ones on the expedia app home page.\n\nA video example of this library is on this [youtube video][1].  \n\n\u003cp align=\"center\"\u003e\n \u003cimg height=393 width=200 src=\"https://raw.github.com/jpardogo/ListBuddies/master/art/screenshot_listbuddies_2.png\"/\u003e\n\u003c/p\u003e\n\nI would appreciate any kind of help to improve this library. Thanks\n\nUsage\n-----\n\nYou must declare the following view in your xml layout:\n\n```xml\n\u003ccom.jpardogo.listbuddies.lib.views.ListBuddiesLayout \n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/listbuddies\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"/\u003e\n```\n\nThere are a bunch of optional custom attributes:\n\n```xml\n\u003ccom.jpardogo.listbuddies.lib.views.ListBuddiesLayout\n        xmlns:listbuddies=\"http://schemas.android.com/apk/res-auto\"\n        android:id=\"@+id/listbuddies\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        listbuddies:speed=\"2\"\n        listbuddies:gap=\"@dimen/gap\"\n        listbuddies:gapColor=\"@color/frame\"\n        listbuddies:listsDivider=\"@drawable/divider\"\n        listbuddies:listsDividerHeight=\"@dimen/divider_height\"\n        listbuddies:autoScrollFaster=\"right\"\n        listbuddies:scrollFaster=\"left\"/\u003e\n```\n\nIf you prefere to create it dynamically use:\n\n```java\n    \n    ListBuddiesLayout listBuddies = new ListBuddiesLayout(this);\n    listBuddies.setGap(mMarginDefault)\n                .setSpeed(ListBuddiesLayout.DEFAULT_SPEED)\n                .setDividerHeight(mMarginDefault)\n                .setGapColor(getResources().getColor(R.color.frame))\n                .setAutoScrollFaster(mScrollConfig[ScrollConfigOptions.RIGHT.getConfigValue()])\n                .setManualScrollFaster(mScrollConfig[ScrollConfigOptions.LEFT.getConfigValue()])\n                .setDivider(getResources().getDrawable(R.drawable.divider));\n    ((FrameLayout)findViewById(R.id.\u003ccontainer_id\u003e)).addView(listBuddies)\n```\n\n######Attributes\n\n* `speed`: Sets the auto scroll speed (integer). 0 - no autoScroll\n* `gap`: Space between the lists, the default gap is 3dp (@dimen/default_margin_between_lists).\n* `gapColor`: Defines the color of the gap, if it is not set the gap is transparent\n* `listDivider`: Defines the lists dividers.\n* `listsDividerHeight`: Divider´s height.\n* `autoScrollFaster`: Indicate the ListView that will be faster on the parrallax effect during autoScroll. right/left.\n* `scrollFaster`: Indicate the ListView that will be faster on the parrallax effect during manual scroll. right/left.\n\nThis `LinearLayout` contains two ListViews. \nSo we need to set the adapters of the ListViews calling `listBuddies.setAdapters(adapter1,adapter2)`. \n```java\n    @Override\n    public View onCreateView(LayoutInflater inflater, ViewGroup container,\n                             Bundle savedInstanceState) {\n        View rootView = inflater.inflate(R.layout.fragment_main, container, false);\n        ListBuddiesLayout listBuddies = (ListBuddiesLayout) rootView.findViewById(R.id.listbuddies);\n        CircularAdapter adapter = new CircularAdapter(getActivity(), getResources().getDimensionPixelSize(R.dimen.image_size1), ImagesUrls.imageUrls_left);\n        CircularAdapter adapter2 = new CircularAdapter(getActivity(), getResources().getDimensionPixelSize(R.dimen.image_size2), ImagesUrls.imageUrls_right);\n        listBuddies.setAdapters(adapter, adapter2);\n        return rootView;\n    }\n```\n\nBoth adapters need to be extend from `CircularLoopAdapter`. With minimal differences from a BaseAdapter.\n\n```java\n    public class CircularAdapter extends CircularLoopAdapter\n```\nThe first different is that the adapter needs to `@Override getCircularCount` instead of `getCount`.\n\n```java\n    @Override\n    protected int getCircularCount() {\n        return mItems.size();\n    }\n```\n\nand instead of get the value of `position` to get the item from the list. We need to get the position calling `getCircularPosition(position)`, like this:\n\n```java\n    @Override\n    public String getItem(int position) {\n        return mItems.get(getCircularPosition(position));\n    }\n```\n\nTo receive the callback for the click on the items of the lists, Just call `setOnItemClickListener` on your `ListBuddiesLayout` view and pass and instance of `OnBuddyItemClickListener`.\n\n```java\npublic class ListBuddiesFragment extends Fragment implements ListBuddiesLayout.OnBuddyItemClickListener\n```\n....\n\n```java\nlistBuddies.setOnItemClickListener(this);\n```\nYou will receive the OnItemClick callback in `onBuddyItemClicked` which is similar to `onItemClick` but indicate with the parameter `int buddy` in which of the lists the item clicked is contained.\nif the value of `buddy` is 0 the item is on the first list (left) and if it is 1 is on the second list (right).\n\n```java\n@Override\n    public void onBuddyItemClicked(AdapterView\u003c?\u003e parent, View view, int buddy, int position, long id) {\n          //int buddy indicate the list where the item is contain.\n          // 0 - left\n          // 1 - right\n    }\n````\n\nIn order to receive touch feedback for the click of the list items, we need to have as a parent of our list item view one of the following layouts:\n\n`com.jpardogo.listbuddies.lib.views.containers.FrameLayoutFeedback`\n`com.jpardogo.listbuddies.lib.views.containers.RelativeLayoutFeedBack`\n`com.jpardogo.listbuddies.lib.views.containers.LinearLayoutFeedBack`\n\nThis layouts have `selectorColor` property to define the color of the selector for the feedback. \n\n```xml\n\u003ccom.jpardogo.listbuddies.lib.views.containers.FrameLayoutFeedback \n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:listbuddies=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_height=\"match_parent\"\n    android:layout_width=\"match_parent\"\n    listbuddies:selectorColor=\"@color/blue\"\u003e\n    \n    .....\n```\n\nThe color will need some transparency in order to act as the ListView selector:\n\n```xml\n\u003ccolor name=\"blue\"\u003e#7733B5E5\u003c/color\u003e\n````\n\nAlthough it is just optional.\n\nIncluding in your project\n-------------------------\n\nYou can either add the library to your application as a library project or add the following dependency to your build.gradle:\n\n![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.jpardogo.listbuddies/library/badge.svg)\n\n```groovy\ndependencies {\n    compile 'com.jpardogo.listbuddies:library:(latest version)'\n}\n```\n\n\nDeveloped By\n--------------------\n\nJavier Pardo de Santayana Gómez - \u003cjpardogo@gmail.com\u003e\n\n\u003ca href=\"https://twitter.com/jpardogo\"\u003e\n  \u003cimg alt=\"Follow me on Twitter\"\n       src=\"https://raw.github.com/jpardogo/ListBuddies/master/art/ic_twitter.png\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://plus.google.com/u/0/+JavierPardo/posts\"\u003e\n  \u003cimg alt=\"Follow me on Google+\"\n       src=\"https://raw.github.com/jpardogo/ListBuddies/master/art/ic_google+.png\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"http://www.linkedin.com/profile/view?id=155395637\"\u003e\n  \u003cimg alt=\"Follow me on LinkedIn\"\n       src=\"https://raw.github.com/jpardogo/ListBuddies/master/art/ic_linkedin.png\" /\u003e\n\nLicense\n-----------\n\n    Copyright 2013 Javier Pardo de Santayana Gómez\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n    \n[1]: https://www.youtube.com/watch?v=jgyMqlm_iDI\n[2]: https://play.google.com/store/apps/details?id=com.jpardogo.android.listbuddies\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpardogo%2Flistbuddies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpardogo%2Flistbuddies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpardogo%2Flistbuddies/lists"}