rbarman / Brainy-Quote-App

Brainy Quote Android Application
1 stars 0 forks source link

Animation onSwipe left and right. #29

Open rbarman opened 10 years ago

rbarman commented 10 years ago

A general principle for Apps is that it must be responsive to user touch. We currently have a toast message every time the user swipes left and right which does show some sense of responsiveness to the user. However the toast message is very bland and should be used sparingly. If the user were to swipe through quotes very quickly, there would be toasts overlapping the previous toasts and the user would see a toast message for t * n seconds where t is the time per toast and n is the number of toasts. The user could just click anywhere on the activity page to get rid of a toast but they would have to do it n times. This is not a good experience for the user.

I think we should have some sort of animation or transition between new quotes. We can however keep a toast message stating "there are no previous quotes" if the user attempts to get a previous quote on the first quote, but all other toast messages should be removed.

chan96 commented 10 years ago

I agree for using a toast only if the user swipes when there are no more previous quotes. To solve the issue of responsiveness, we could do this:

  1. Use an animating progress circle that appears in the center of the screen until a quote is fully loaded.
  2. On random quote activity, pull and then store, all quotes from a single page, into an arraylist or linked list. This way, new quotes can be accessed quickly from memory, instead of having to constantly reconnect to the internet. We could maintain 2 lists. One will store all unviewed quotes, and another will store viewed quotes. As a user views an unseen quote, the quote is removed from the unviewed quote arraylist/linkedlist and gets added to the viewed quote list. If there are no more new quotes to show, reconnect to the next page and repeat (a similar method could be used for specific quote activity). This way, we can more easily keep track of which quotes to show the user if he/she swipes left or right.

What do you think?

rbarman commented 10 years ago
  1. That or some sort of page animation. I will look at some view animation classes
  2. Currently specific quote activity will connect and pull all quotes and authors on a page if we are on a new page of quotes. I have arraylist quotes that holds all quotes on page and arraylist author that holds all author on page. Also a value quotesOnPage is created and is the size of these arraylists. These 3 values are recreated everytime we connect to a url or are on a new page. There is also an index value set to 0 on every reconnect. So on every left swipe, index++ and we set the textview to author and quote lists at the index value. Same thing for swipe right except index--. I determine we are on a new page if index==quotesOnPage.

So that is all currently done for specific search. We COULD do something like that for random quote..... pull all quotes from a random page and random topic, but the consecutive quotes technically wont be random.

rbarman commented 10 years ago

I'm not really sure how what you were saying for (2) deal with responsiveness though

chan96 commented 10 years ago

For (2), I mean responsiveness in the sense that quotes can be displayed instantly, since they are already stored in a list. Yea, pulling quotes consecutively from a random page isn't 100% random. What if we pull all quotes from a random page and then use a random number generator with a range of the max number of quotes pulled from that page? If the same number has been generated, generate another number (otherwise the user would see the same quote).

rbarman commented 10 years ago

Consecutive quotes still wont really random. We can connect to page from a random keywoard (age) and display various index values, but the user is only seeing quotes about age. The user would have to relaunch the random quote activity to get a random quote from a random keyword

chan96 commented 10 years ago

Ah, I see. Never mind then.