-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package bttv; | ||
|
||
import tv.twitch.android.feature.theatre.common.PlayerCoordinatorPresenter; | ||
import tv.twitch.android.feature.theatre.metadata.MetadataViewEvent; | ||
import tv.twitch.android.models.channel.ChannelModel; | ||
|
||
public class SubscribeRedirect { | ||
public static void openSubscribePage(PlayerCoordinatorPresenter presenter, MetadataViewEvent.SubscribeButtonClicked event) { | ||
ChannelModel channel = event.channelModel; | ||
String url = getUrl(channel); | ||
Util.launchBrowser(presenter.activity, url); | ||
} | ||
|
||
private static String getUrl(ChannelModel channel) { | ||
String name = channel.component2(); | ||
return "https://www.twitch.tv/subs/" + name; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package bttv.api; | ||
|
||
import android.util.Log; | ||
|
||
import tv.twitch.android.feature.theatre.common.PlayerCoordinatorPresenter; | ||
import tv.twitch.android.feature.theatre.metadata.MetadataViewEvent; | ||
|
||
public class SubscribeRedirect { | ||
public static final String TAG = "LBTTVSubRedir"; | ||
|
||
public static void subscribe(PlayerCoordinatorPresenter presenter, MetadataViewEvent.SubscribeButtonClicked event) { | ||
try { | ||
Log.d(TAG, "subscribe()"); | ||
bttv.SubscribeRedirect.openSubscribePage(presenter, event); | ||
} catch (Throwable e) { | ||
Log.e(TAG, "subscribe: ", e); | ||
} | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
...ch/src/main/java/tv/twitch/android/feature/theatre/common/PlayerCoordinatorPresenter.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,5 @@ | ||
package tv.twitch.android.feature.theatre.common; | ||
|
||
public abstract class PlayerCoordinatorPresenter { | ||
public androidx.fragment.app.FragmentActivity activity; | ||
} |
7 changes: 7 additions & 0 deletions
7
mod/twitch/src/main/java/tv/twitch/android/feature/theatre/metadata/MetadataViewEvent.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,7 @@ | ||
package tv.twitch.android.feature.theatre.metadata; | ||
|
||
public class MetadataViewEvent { | ||
public static final class SubscribeButtonClicked extends MetadataViewEvent { | ||
public tv.twitch.android.models.channel.ChannelModel channelModel; | ||
} | ||
} |
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