网络科技

    今日:866| 主题:245806
收藏本版
互联网、科技极客的综合动态。

[其他] How to build an image gallery app – full tutorial with code

[复制链接]
不忘初心 发表于 2016-10-4 01:55:21
316 12

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

How to build an image gallery app – full tutorial with code-1 (Android,different,something,learning,exercise)

  There are many reasons you might find yourself needing to create an image gallery – whether it’s to show off album covers for a music app, to present feature images for articles in a feed, or to showcase your work in a portfolio. To make the right impression though, these apps should allow users to effortlessly swipe through multiple images without slowdown and that’s where things get a little tricky.
   This tutorial will show you how to create a seamless gallery filled with nice big images and then adapt that for a number of different applications. Along the way, we’ll see how to use RecyclerViews , adapters and Picasso – so hopefully it will make for a great learning exercise, whatever you end up doing with it! Full code and project included below…

How to build an image gallery app – full tutorial with code-2 (Android,different,something,learning,exercise)
   See also: Using RecyclerView to build lists in Android     Introducing RecyclerView

   To create our Android gallery, we’re going to use something called a RecyclerView . This is a handy view that acts very much like a ListView but with the advantage of allowing us to scroll quickly through large data sets. It does this by only loading the images that are currently in view at any given time. This means we can load more images without the app becoming very slow. There’s a lot more that you can do with this view and it’s used all over Google’s own apps, so check out the full explanation tousing RecyclerView to find out more.
   The good news is that this is all we really need to create our gallery – a RecyclerView filled with images. The bad news is that the RecyclerView is a little more complicated than most other views. Because of course it is.
   RecyclerView is not, for starters, available to drag and drop using the design view. So we’ll just have to add it to the activity_main.xml , like so:
  [code]             android:id="@+id/imagegallery"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            />[/code]   Notice that we’re referencing the Android Support Library. This means we also need to modify our build.gradle in order to include the dependency. Just add this line to the app level file:
  [code]compile 'com.android.support:recyclerview-v7:24.2.1'[/code]  And if that’s not installed, then you’re going to have to open the SDK manager and install it. Fortunately, Android Studio is pretty smart about prompting you to do all this. I just got a new computer, so I can play along with you!
12345下一页
友荐云推荐




上一篇:三天的时间,我用同一种元素设计了3款风格迥异的LOGO
下一篇:Apple Watch sales will be worse in 2016 than in 2015 (AAPL)
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

牛轧糖牛萨萨 发表于 2016-10-4 03:50:08
走过路过请支持下!
回复 支持 反对

使用道具 举报

wolagequnima 发表于 2016-10-4 03:50:08
不忘初心在马路边丢了一分钱 !  
回复 支持 反对

使用道具 举报

幼丝 发表于 2016-10-4 03:52:51
为保住菊花,这个一定得回复!
回复 支持 反对

使用道具 举报

snkteko 发表于 2016-10-4 03:54:16
小弟snkteko默默的路过贵宝地~~~
回复 支持 反对

使用道具 举报

漫无天下 发表于 2016-10-4 03:54:24
众里寻他千百度,蓦然回首在这里!
回复 支持 反对

使用道具 举报

vae蛛丝马迹 发表于 2016-10-4 04:06:33
一直在看
回复 支持 反对

使用道具 举报

jiang5495 发表于 2016-10-4 04:52:24
报告!我就是路过来看看的。。。
回复 支持 反对

使用道具 举报

●.未央灬 发表于 2016-10-4 20:59:35
前排顶,很好!
回复 支持 反对

使用道具 举报

usawoainila 发表于 2016-10-15 16:51:53
不忘初心说的我也略懂!
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表