{"id":18914491,"url":"https://github.com/angeloavv/recyclerviewflipper","last_synced_at":"2026-03-09T21:30:14.836Z","repository":{"id":33242620,"uuid":"36886963","full_name":"AngeloAvv/RecyclerViewFlipper","owner":"AngeloAvv","description":"A custom ViewFlipper to dinamically add views at runtime without render-loss time","archived":false,"fork":false,"pushed_at":"2019-01-09T17:54:04.000Z","size":256,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T15:54:00.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AngeloAvv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-04T18:03:39.000Z","updated_at":"2015-06-04T19:06:39.000Z","dependencies_parsed_at":"2022-08-17T21:40:20.015Z","dependency_job_id":null,"html_url":"https://github.com/AngeloAvv/RecyclerViewFlipper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloAvv%2FRecyclerViewFlipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloAvv%2FRecyclerViewFlipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloAvv%2FRecyclerViewFlipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngeloAvv%2FRecyclerViewFlipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AngeloAvv","download_url":"https://codeload.github.com/AngeloAvv/RecyclerViewFlipper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239907240,"owners_count":19716584,"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":[],"created_at":"2024-11-08T10:11:43.425Z","updated_at":"2026-03-09T21:30:14.743Z","avatar_url":"https://github.com/AngeloAvv.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RecyclerViewFlipper\nA custom ViewFlipper to dinamically add views at runtime without render-loss time\n\nThe \u003cb\u003eRecyclerViewFlipper\u003c/b\u003e is a Custom \u003cb\u003eViewFlipper\u003c/b\u003e that allows you to scroll between an infinite number of \u003cb\u003eViews\u003c/b\u003e without render-loss time. The component stores a \u003cb\u003edouble-ended queue\u003c/b\u003e (deque) in order to pre-load the views that need to be shown. In this way, you could \u003cb\u003edinamically\u003c/b\u003e add an infinite (we suppose to!) odd number of views without wasting your time in pre-rendering phases while scrolling.\nThe RecyclerViewFlipper also supports \u003cb\u003eanimations\u003c/b\u003e as its superclass ViewFlipper, and distorts the way of seeing the views since they are handled as a \u003cb\u003estack\u003c/b\u003e, but stored as a deque.\nThis library also avoids OutOfMemory errors due to a lot of views loaded inside the ViewFlipper, because in this case the views are added at runtime with a fixed number of loaded views per time.\n\n## How to use it\n\nIn your layout:\n\n        \u003cit.mls.recyclerviewflipper.RecyclerViewFlipper\n          android:layout_width=\"match_parent\"\n          android:layout_height=\"match_parent\"\n          android:layout_below=\"@+id/buttonContainer\"\n          android:id=\"@+id/viewFlipper\" \u003e\n        \u003c/it.mls.recyclerviewflipper.RecyclerViewFlipper\u003e\n\nand in your Java file:\n\n        View firstView = View.inflate(this, FIRST_VIEW, null);\n        View secondView = View.inflate(this, SECOND_VIEW, null);\n        View thirdView = View.inflate(this, THIRD_VIEW, null);\n\n        ArrayList\u003cView\u003e views = new ArrayList\u003c\u003e();\n        views.add(firstView);\n        views.add(secondView);\n        views.add(thirdView);\n\n        mRecyclerViewFlipper = (RecyclerViewFlipper\u003cView\u003e) findViewById(ID_VIEWFLIPPER);\n        mRecyclerViewFlipper.initializeComponents(views);\n        mRecyclerViewFlipper.setRecycleViewFlipperRequest(this);\n\nyour activity must implement \u003ccode\u003eRecyclerViewFlipperRequest\\\u003cT\u003e\u003c/code\u003e , where T could be a class that inherits from View and these two methods deal the runtime generation of the dynamic view\n\n        @Override\n        public View requestLeftItem() {\n          View newView = View.inflate(this, SECOND_VIEW, null);\n          Button btn = (Button) newView.findViewById(R.id.btn);\n          btn.setText(String.valueOf(mCounter++));\n        \n          return newView;\n        }\n\n        @Override\n        public View requestRightItem() {\n          View newView = View.inflate(this, SECOND_VIEW, null);\n          Button btn = (Button) newView.findViewById(R.id.btn);\n          btn.setText(String.valueOf(mCounter--));\n        \n          return newView;\n        }\n\nIn this example I've inflated the same view changing the content of the button, but you can do it in very different ways, like putting it inside a Stack while you process it and so on.\nKeep in mind that the preprocessing deque is defined when you call \u003ccode\u003emRecyclerViewFlipper.initializeComponents(views);\u003c/code\u003e\nthe queue will keep a number of K views per time, where K is the size of the List\n\nIf you want to see an example of the library in action, please [watch a demo here](https://youtu.be/jqfqNujkTfo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangeloavv%2Frecyclerviewflipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangeloavv%2Frecyclerviewflipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangeloavv%2Frecyclerviewflipper/lists"}