{"id":13642454,"url":"https://github.com/flschweiger/SwipeStack","last_synced_at":"2025-04-20T16:32:28.529Z","repository":{"id":39618029,"uuid":"50510157","full_name":"flschweiger/SwipeStack","owner":"flschweiger","description":"A simple, customizable and easy to use swipeable view stack for Android.","archived":true,"fork":false,"pushed_at":"2018-01-23T09:09:31.000Z","size":19483,"stargazers_count":1484,"open_issues_count":57,"forks_count":223,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-08-03T01:26:32.065Z","etag":null,"topics":[],"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/flschweiger.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-01-27T13:45:34.000Z","updated_at":"2024-07-18T07:17:41.000Z","dependencies_parsed_at":"2022-09-16T11:32:14.665Z","dependency_job_id":null,"html_url":"https://github.com/flschweiger/SwipeStack","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flschweiger%2FSwipeStack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flschweiger%2FSwipeStack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flschweiger%2FSwipeStack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flschweiger%2FSwipeStack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flschweiger","download_url":"https://codeload.github.com/flschweiger/SwipeStack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223833105,"owners_count":17210781,"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-08-02T01:01:31.635Z","updated_at":"2024-11-09T13:32:00.110Z","avatar_url":"https://github.com/flschweiger.png","language":"Java","readme":"# SwipeStack\nA simple, customizable and easy to use swipeable view stack for Android.\n\n[![Download](https://api.bintray.com/packages/flschweiger/maven/swipestack/images/download.svg) ](https://bintray.com/flschweiger/maven/swipestack/_latestVersion) \n[![License Apache](https://img.shields.io/badge/license-Apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SwipeStack-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/3079)\n\n![Demo screen 1](https://raw.githubusercontent.com/flschweiger/SwipeStack/master/art/screen1.png)\n![Demo animation](https://raw.githubusercontent.com/flschweiger/SwipeStack/master/art/demo.gif)\n![Demo screen 2](https://raw.githubusercontent.com/flschweiger/SwipeStack/master/art/screen2.png)  \n\n## QuickStart ##\n### Include the Gradle dependency ###\n\n```java\ndependencies {\n    compile 'link.fls:swipestack:0.3.0'\n}\n```\n\n### Use it in your layout file ###\n1. Use the `link.fls.swipestack.SwipeStack` view in your XML layout file \n2. Set the parent view's `clipChildren` attribute to `false`\n\n*Example:*\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cFrameLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:clipChildren=\"false\"\u003e\n\n    \u003clink.fls.swipestack.SwipeStack\n        android:id=\"@+id/swipeStack\"\n        android:layout_width=\"320dp\"\n        android:layout_height=\"240dp\"\n        android:padding=\"32dp\"/\u003e\n\n\u003c/FrameLayout\u003e\n```\n\n### Create an adapter ###\n\nCreate an adapter which holds the data and creates the views for the stack.\n\n*Example:*\n\n```java\npublic class SwipeStackAdapter extends BaseAdapter {\n\n    private List\u003cString\u003e mData;\n\n    public SwipeStackAdapter(List\u003cString\u003e data) {\n        this.mData = data;\n    }\n\n    @Override\n    public int getCount() {\n        return mData.size();\n    }\n\n    @Override\n    public String getItem(int position) {\n        return mData.get(position);\n    }\n\n    @Override\n    public long getItemId(int position) {\n        return position;\n    }\n\n    @Override\n    public View getView(final int position, View convertView, ViewGroup parent) {\n        convertView = getLayoutInflater().inflate(R.layout.card, parent, false);\n        TextView textViewCard = (TextView) convertView.findViewById(R.id.textViewCard);\n        textViewCard.setText(mData.get(position));\n\n        return convertView;\n    }\n}\n```\n\n### Assign the adapter to the SwipeStack ###\n\nLast, but not least, assign the adapter to the SwipeStack.\n\n*Example:*\n\n```java\nSwipeStack swipeStack = (SwipeStack) findViewById(R.id.swipeStack);\nswipeStack.setAdapter(new SwipeStackAdapter(mData));\n```\n\nThat's it!\n\n## Callbacks ##\n\nCurrently SwipeStack implements the following callbacks:\n\n- the ` SwipeStackListener ` notifies you when a view was swiped to the left / right or when the stack becomes empty.\n- the ` SwipeProgressListener ` notifies you about the progress when the user starts / stops dragging a view around.\n\n## Attributes ##\n\n*All attributes are optional.*\n\n`allowed_swipe_directions` specifies the allowed swipe directions. *Default: both*\n\n`animation_duration` specifies the duration of the animations. *Default: 300ms*\n\n`stack_size` specifies the maximum number of visible views. *Default: 3*\n\n`stack_spacing` specifies the vertical distance between two views. *Default: 12dp*\n\n`stack_rotation` specifies the maximum random ratation (in degrees) of a card on the stack. *Default: 8*\n\n`swipe_rotation` specifies the rotation (in degrees) of the view when it gets swiped left / right. *Default: 15*\n\n`swipe_opacity` specifies the opacity of the view when it gets swiped left / right. *Default: 1.0*\n\n`scale_factor` specifies the scale factor of the views in the stack. *Default: 1.0*\n\n`disable_hw_acceleration` set to `true` disables hardware acceleration. *Default: false*\n\n## Copyright Notice ##\n``` \nCopyright (C) 2016 Frederik Schweiger\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n ```\n","funding_links":[],"categories":["Java","Card","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflschweiger%2FSwipeStack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflschweiger%2FSwipeStack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflschweiger%2FSwipeStack/lists"}