Giter VIP home page Giter VIP logo

instagramclient's People

Contributors

smacgregor avatar smacgregorz avatar

Watchers

 avatar

instagramclient's Issues

Week 1 Project: Instagram Photo Viewer

My app is complete, please review. /cc @codepathreview @codepath

Looking for feedback in particular on the layout for my listview cell: item_photo.xml

I used three layouts:

  • A relative layout for the entire cell
  • A relative layout to encapsulate the user profile picture, user name and age
  • A vertical linear layout to encapsulate the caption and the last 2 comments

I'd like to learn if I could have been more efficient.

Issues Encountered / Interesting Notes

XML includes and Butterknife

I wanted to use XML includes in item_photo.xml to break that UI down into smaller re-usable components. But butterknife crashes if I try to include a layout and give that layout an id like:

<include layout="@layout/item_comment"
    
   android:id="@+id/tvFirstComment"

   android:layout_below="@+id/tvCaption"
    
   android:layout_width="match_parent"
    
   android:layout_height="wrap_content"
    
   android:paddingTop="5dp"/>

It can't find a field with the id tvFirstComment

Resizing the blue heart icon

I grabbed an image off the web that was too large. I had to resort to using Picasso to resize the image down to what I wanted. This is inefficient.

        Picasso.with(getContext()).load(R.drawable.small_like_heart)
                .resize(20, 0)
                .into(viewHolder.likeHeartImageView);

Should I have been able to do that in the xml without involving Picasso? I struggled to get the right scaleType that would scale it to 20px without distortion or adding white space around the image.

GSON

The GSON library was great - I was easily able to construct all of my models without parsing the JSON response directly. One downside is the model hierarchy has to exactly match the JSON hierarchy for everything to work.

styles.xml

I overrode the default theme with custom colors that matched instgram's color palette and that worked well. But I was trying to figure out where to put generic padding constants. For instance, many of the elements in a list view cell for an instagram post have the same left and right padding (20dp) values. I wanted to put that value in one place and then refer to it by name in the layout.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.