Skip to content
Gallery app using RecyclerView + Toast + Snackbar
Swift Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Android
Visuals
iOS
.gitattributes
GallarySample_RC-Report.pdf
LICENSE
readme.md

readme.md

ReflectCode

Automated Source Code Transformation service
Re-cycle / Re-use / Re-purpose

Platform - Android | iOS Follow @reflectcode


Gallery Demo

This project demonstrates the conversion of Gallery demo. RecyclerView is ported to UICollectionView. Along with this this project also shows how android Toast, Snackbar and android resource class gets ported to iOS.

This repository contains the Android source code which was used as input and generated iOS source code project.

Class Package
RecyclerView android.support.v7.widget.RecyclerView
GridLayoutManager android.support.v7.widget.GridLayoutManager
Snackbar android.support.design.widget.Snackbar
Toast android.widget.Toast
ArrayList java.util.ArrayList
R Resources

Statement Estimation

File Statement
ImageData.java 16
MainActivity.java 67
MyAdapter.java 90
activity_main.xml 393
cell_layout.xml 249
Resource xml 48
Images 120
Total 1437

Dev Notes

  • RecyclerView - The RecyclerView on iOS is ported to 'UICollectionView' is used. The 'cell_layout.xml' from android project is ported to xib file and used as layout for the 'UICollectionViewCell'. To handle button tap event addTarget() is used. UILabel and UIImageView do not have addTarget(), for these controls 'UITapGestureRecognizer' is assigned.

  • Snackbar - We were not able to identify suitable library which provides this functionality. Therefore swift implementation of android 'Snackbar' control is provided using custom lib 'RC_Snackbar.swift' developed by ReflectCode.

  • Toast - Swift implementation of android 'Toast' control is provided using custom lib 'RC_toast.swift' developed by ReflectCode.

  • Resources - During compilation Android creates R.java providing good type-safety. Taking inspiration from R.swift lib, RC generates 'R.swift' file which provide type-safe access to all the resources. To access the resources 'RC_GetResources.swift' provides various methods which are inlined with android 'Resources' class.

Credits for Android project - http://www.androidauthority.com/how-to-build-an-image-gallery-app-718976/

Screen shots

Side-by-Side-Video


ScreenShot-01


ScreenShot-02


ScreenShot-03


License

This project is made available under the MIT license. See the LICENSE file for more details.

You can’t perform that action at this time.