Giter VIP home page Giter VIP logo

quotes's People

Contributors

srgtrujillo avatar tonilopezmr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

quotes's Issues

Add Navigation to move between activities

This is a common problem when different parts of the Android software need navigate to a Activity and needs arguments or specific parameters.

The problem:

  • Activity A launch Activity B and Activity C launch Activity B
  • Activity B needs to be launched, a Bundle, and all activities that launch the Activity B needs write .putExtra(someArgument).
  • The worst is that when you launch Activity B needs remember what Activity B needs.

The solutions:

  1. Navigation with Command pattern. A specific class for each Activity that know how that activity is launched. LoginNavigation -> launch LoginActivity and only LoginNavigation know how LoginActivity needs be launched.
  2. SomeActivity.launch(Context context, arguments) Static method in each Activity to know how this Activity is launched.

You can decide what kind of solution we will apply.

Create a Comments list UI

Its a independent view with comments by Quote, like a fragment below Quote detail.

  • Show comments from Quote
  • Sorted by timestamp
  • If there are not comment items, must show the message: "There are not messages"
    . If there are any error from network, must show the message: "There are not connection" and must show a button to retry.
  • If there are any error, must show the message: "Oops error on get messages :(" and must show a button to retry.

Create a QuoteDetail UI

Create a QuoteDetailActivity

  • Show a Quote from parcelable (image, quote text, and autor)
  • If there are any error, must show the message: "Oops error on get Quotes :(" and must show a button to retry.

Network API

This is a example of GET quotes

[
    {
        "id" : "234l23j42j4",
        "author" : "Albert Einstein",
        "imageUrl": "https://i.ytimg.com/vi/nYaRPlEWnXw/mqdefault.jpg",
        "timestamp" : 23423423,
        "quote" : "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe",
        "likes" :  ["id1", "id2"]   
    }
]

This is a example of GET comments by quote id : 234l23j42j4

          [
            {
                "id" : "1",     
                "quote_id" : "234l23j42j4",
                "user" : "id",
                "comment" : "Wooooooooooooow",
                "timestamp" : 234234342,
                "likes" :  ["id1", "id2"]
            },
            {   
                "id" : "2",     
                "quote_id" : "234l23j42j4",
                "user" : "id2",
                "comment" : "Wooooooooooooow",
                "timestamp" : 234234343,
                "likes" :  ["id1", "id2"]
            }
        ]

Quote Detail

When click y any Quote should see the Quote text and author.

Create a QuotesList UI

Create UI Main Activity to #1

View contract and behaviour:

  • Show a Quote List
  • Sorted by Quote timestamp
  • If there are not quote items, must show the message: "There are not Quotes :("
  • If there are any error from network, must show the message: "There are not connection"
    and must show a button to retry.
  • If there are any error, must show the message: "Oops error on get Quotes :("
    and must show a button to retry.

Fix Android Test

https://travis-ci.org/srgtrujillo/quotes/builds/155725278

java.lang.RuntimeException: Waited for the root of the view hierarchy to have window focus and not be requesting layout for over 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Otherwise, something is seriously wrong. Selected Root:
    Root{application-window-token=android.view.ViewRootImpl$W@b2eea308, window-token=android.view.ViewRootImpl$W@b2eea308, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) sim=#100 ty=1 fl=#1810100 pfl=0x8 wanim=0x10302a1}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=480, height=800, has-focus=true, has-focusable=true, has-window-focus=false, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}}
:app:connectedDebugAndroidTest FAILED

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.