Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- prevQuoteButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- /* Snackbar.make(view, "Previous Quote", Snackbar.LENGTH_LONG)
- .setAction("Action", null).show();*/
- if(prevIndex != 0) {
- prevIndex--;
- previousQuoteHelper(prevIndex);
- }
- else {
- Toast.makeText(MainActivity.this, "Get a new Quote!", Toast.LENGTH_SHORT).show();
- }
- }
- });
- /*
- * Helper method for previous quote button
- * @param prevIndex
- */
- public void previousQuoteHelper(int prevIndex) {
- currentQuote = quoteList.get(prevIndex);
- quoteTextView.setText(currentQuote.getQuote() +"n"+ currentQuote.getAuthor());
- if(currentQuote.isFave()) {
- //set action bar icon to red
- }
- else {
- //change action bar icon to white
- }
- // isPreviousQuote = true;
- Log.v("PREVIOUS:", prevIndex +" "+ currentQuote.getQuote() +" "+ currentQuote.isFave());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement