This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added currently live panel and better animations
- Loading branch information
1 parent
911bdd5
commit 00ddb25
Showing
7 changed files
with
140 additions
and
22 deletions.
There are no files selected for viewing
Binary file not shown.
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
35 changes: 35 additions & 0 deletions
35
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/GetCurrentShow.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,35 @@ | ||
package de.markhaehnel.rbtv.rocketbeanstv; | ||
|
||
import android.content.Context; | ||
import android.os.AsyncTask; | ||
|
||
import org.json.JSONException; | ||
import org.json.JSONObject; | ||
|
||
public class GetCurrentShow extends AsyncTask<Void, String, String> { | ||
String lastVisibleShow = ""; | ||
protected String doInBackground(Void... voids) { | ||
while (true) { | ||
try { | ||
try { | ||
String response = HttpRequest.get("http://api.twitch.tv/api/channels/rocketbeanstv").body(); | ||
JSONObject json = new JSONObject(response); | ||
publishProgress(json.getString("status")); | ||
} catch (JSONException e) { | ||
e.printStackTrace(); | ||
} | ||
Thread.sleep(15000); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
|
||
protected void onProgressUpdate(String... strings) { | ||
String currentShow = strings[0]; | ||
if (currentShow.length() != 0) { | ||
lastVisibleShow = currentShow; | ||
MainActivity.getInstance().showCurrentShow(currentShow); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<resources> | ||
<string name="app_name">Rocket Beans TV</string> | ||
<string name="error_accessToken">Ups, da ist etwas schief gelaufen. Hat Twitch etwa Probleme?\n\nVersuch es später erneut.</string> | ||
<string name="error_twitchError">Ups, da ist etwas schief gelaufen. Hat Twitch etwa Probleme?\n\nVersuch es später erneut.</string> | ||
<string name="error_noInternet">Anscheinend hast du keine Verbindung zum Internet.\nDadurch kann leider keine Verbindung zum Stream aufgebaut werden.</string> | ||
<string name="error_unknown">Ein unbekannter Fehler ist aufgetreteten.\n\nBitte versuche es später erneut.</string> | ||
</resources> |