{"id":13645643,"url":"https://github.com/tdscientist/ShelfView","last_synced_at":"2025-04-21T14:31:57.312Z","repository":{"id":217102697,"uuid":"82122263","full_name":"tdscientist/ShelfView","owner":"tdscientist","description":"Android custom view to display books on shelf","archived":false,"fork":false,"pushed_at":"2017-09-24T08:27:26.000Z","size":3547,"stargazers_count":102,"open_issues_count":0,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-09T18:43:16.126Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdscientist.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-16T00:47:15.000Z","updated_at":"2023-09-08T17:20:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"6973b6ce-e195-4450-bf4b-d6377a27c071","html_url":"https://github.com/tdscientist/ShelfView","commit_stats":null,"previous_names":["tdscientist/shelfview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdscientist","download_url":"https://codeload.github.com/tdscientist/ShelfView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250070233,"owners_count":21369840,"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:02:38.937Z","updated_at":"2025-04-21T14:31:56.952Z","avatar_url":"https://github.com/tdscientist.png","language":"Java","readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ShelfView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5299) [![MaterialUp](https://img.shields.io/badge/MaterialUp-ShelfView-deepblue.svg?style=flat)](https://material.uplabs.com/posts/shelfview)\n\n\n## ShelfView ##\n\n*Android custom view to display books on shelf* `     ` **([iOS version is available here](https://github.com/tdscientist/ShelfView-iOS))** \n\n\u003cimg src=\"/portrait.png\" width=\"340\"\u003e \u003cimg src=\"/landscape.png\" width=\"528\"\u003e\n\n\n\n\n#### How to use ####\n----\n\n**build.gradle**\n```\nallprojects {\n            repositories {\n                maven {\n                    url 'https://jitpack.io'\n                }\n            }\n        }\n```\n\n\n```\ndependencies {\n\t        compile 'com.github.tdscientist:ShelfView:v1.0'\n\t}\n```\n\n**Layout**\n```\n\u003ccom.tdscientist.shelfview.ShelfView \t\t  \n    android:id=\"@+id/shelfView\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\" /\u003e\n\n```\n\n\n**Activity**\n```\nimport com.tdscientist.shelfview.BookModel;\nimport com.tdscientist.shelfview.ShelfView;\nimport java.util.ArrayList;\n\npublic class MainActivity extends AppCompatActivity implements ShelfView.BookClickListener {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        ShelfView shelfView = (ShelfView) findViewById(R.id.shelfView);\n        shelfView.setOnBookClicked(this);\n        ArrayList\u003cBookModel\u003e models = new ArrayList\u003c\u003e();\n\n        models.add(new BookModel(\"http://eurodroid.com/pics/beginning_android_book.jpg\", \"1\", \"Beginning Android\"));\n       \n \t\tshelfView.loadData(models, ShelfView.BOOK_SOURCE_URL);\n\n\n    }\n\n\t@Override\n    public void onBookClicked(int position, String bookId, String bookTitle) {\t\n    \t// handle click events here \n        //Toast.makeText(this, bookTitle, Toast.LENGTH_SHORT).show();\n    }\n}\n\n```\n\n\n\n#### Loading book covers from other sources ####\n----\n\n* Internal/External directory in the device\n```\nmodel.add(new BookModel(\"/path/to/android_book_cover.jpg\", \"1\", \"Let's Talk About Android\"));\nshelfView.loadData(model, ShelfView.BOOK_SOURCE_FILE);\n``` \n\n\n\n* Assets folder\n```\nmodel.add(new BookModel(\"android.jpg\", \"1\", \"Android for Experts\"));\nshelfView.loadData(model, ShelfView.BOOK_SOURCE_ASSETS_FOLDER);\n```\n \n\n\n* Drawable folder\n```\nmodel.add(new BookModel(\"alice\", \"1\", \"Alice in Wonderland\"));\nshelfView.loadData(model, ShelfView.BOOK_SOURCE_DRAWABLE_FOLDER);\n``` \n\n\n#### Permissions ####\n----\n```\n    \u003cuses-permission android:name=\"android.permission.INTERNET\" /\u003e\n    \u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" /\u003e\n``` \n\n\n\n#### License ####\n----\n```\nCopyright 2017 Adeyinka Adediji\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\n\n#### Contributions \u0026 Bug Reporting ####\n---\ntdscientist@gmail.com \n\n\n\n#### Credits ####\n---\n* [Picasso](https://github.com/square/picasso)\n\n","funding_links":[],"categories":["其他"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdscientist%2FShelfView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdscientist%2FShelfView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdscientist%2FShelfView/lists"}