Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored to use Previous/Next rather than Choice1 and Choice2 (Prev…
…ious/Next hard-coded as any page). Updated throughout Page and Story classes where needed. Also refactored activity_story.xml to use previousButton and nextButton rather than choiceButton1 and choiceButton2. Choice renamed to Choices - Choices class deals with BOTH CHOICES. Choices uses getNextPage() and getPreviousPage(), it previously only used a getNextPage(). Slightly confusing but both buttons do actually lead to a "next page". IMPORTANT: THIS COMMIT WILL NOT CHECK WHETHER THE PREVIOUS PAGE IS IN FACT A PREVIOUS PAGE (It won't do the maths of current page - 1). Please check next commit if this is the functionality you were looking for.
- Loading branch information
1 parent
7a02c9d
commit db1b082
Showing
6 changed files
with
82 additions
and
76 deletions.
There are no files selected for viewing
30 changes: 0 additions & 30 deletions
30
app/src/main/java/com/harryjamesuk/interactivestory/model/Choice.java
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
app/src/main/java/com/harryjamesuk/interactivestory/model/Choices.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.harryjamesuk.interactivestory.model; | ||
|
||
/** | ||
* Created by Harry on 22/03/2015. | ||
*/ | ||
public class Choices { | ||
|
||
private String mText1; | ||
private String mText2; | ||
|
||
private int mPreviousPage; | ||
private int mNextPage; | ||
|
||
public Choices(int previousPage, String text1, int nextPage, String text2) { | ||
mPreviousPage = previousPage; | ||
mText1 = text1; | ||
mNextPage = nextPage; | ||
mText2 = text2; | ||
} | ||
|
||
public String getText1() { | ||
return mText1; | ||
} | ||
|
||
public void setText1(String text1) { | ||
mText1 = text1; | ||
} | ||
|
||
public String getText2() { | ||
return mText2; | ||
} | ||
|
||
public void setText2(String text2) { | ||
mText2 = text2; | ||
} | ||
|
||
public int getPreviousPage() { | ||
return mPreviousPage; | ||
} | ||
|
||
public void setPreviousPage(int previousPage) { | ||
mPreviousPage = previousPage; | ||
} | ||
|
||
public int getNextPage() { | ||
return mNextPage; | ||
} | ||
|
||
public void setNextPage(int nextPage) { | ||
mNextPage = nextPage; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters