aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi')
-rw-r--r--app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomData.java9
-rw-r--r--app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomFragment.java8
2 files changed, 8 insertions, 9 deletions
diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomData.java b/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomData.java
index 46f35d8..3799180 100644
--- a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomData.java
+++ b/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomData.java
@@ -16,10 +16,10 @@ public class RoomData {
public RoomData (ArrayList<Player> players, String playerLink, String friendCode) {
this.friendCode = friendCode;
- this.playerLink = getPlayerLink();
+ getPlayerLink();
Document doc = null;
- if (playerLink == null) {
+ if (this.playerLink == null) {
System.out.println("The player link is null for some reason");
} else {
@@ -87,7 +87,7 @@ public class RoomData {
}
}
- public String getPlayerLink() {
+ public void getPlayerLink() {
try {
Document doc = null;
@@ -109,7 +109,7 @@ public class RoomData {
System.out.println("Found friend code");
playerLink = data.split("\"")[3];
System.out.println("Player link: " + playerLink);
-
+ break;
}
}
}
@@ -118,7 +118,6 @@ public class RoomData {
} catch (Exception e) {
e.printStackTrace();
}
- return playerLink;
}
public ArrayList<Player> getPlayers() { return players; }
diff --git a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomFragment.java b/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomFragment.java
index 9592186..e72e38a 100644
--- a/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomFragment.java
+++ b/app/src/main/java/com/example/wiimmterfaceandroid/wiimmfi/RoomFragment.java
@@ -36,7 +36,7 @@ public class RoomFragment extends Fragment {
super.onViewCreated(view, savedInstanceState);
FloatingActionButton refreshButton = view.findViewById(R.id.refresh_button);
TextView headerTextView = view.findViewById(R.id.room_header_text);
- if (header == null || playerLink == null || players == null) {
+ if (players == null) {
header = "This player is not online, not inside a room or does not exist. Click the refresh button to try again, or click on the back button to enter a different friend code.";
}
headerTextView.setText(header);
@@ -51,10 +51,10 @@ public class RoomFragment extends Fragment {
roomData = roomData.refresh();
RoomData newRoomData = roomData.refresh();
players = roomData.getPlayers();
- playerLink = roomData.getPlayerLink();
- String otherPlayerLink = newRoomData.getPlayerLink();
+// playerLink = roomData.getPlayerLink();
+// String otherPlayerLink = newRoomData.getPlayerLink();
header = newRoomData.getRoomHeader();
- if (playerLink == null) {
+ if (header == null) {
header = "This player is not online, not inside a room or does not exist. Click the refresh button to try again, or click on the back button to enter a different friend code.";
}
headerTextView.setText(header);