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
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val intent = Intent(this, SampleAppTemplateActivity::class.java) | |
intent.putExtra(Constants.TITLE.name, getString(R.string.title)) | |
intent.putExtra(Constants.GITHUB_URL.name, "https://github.com/username/repo") | |
intent.putExtra(Constants.HOMEPAGE_URL.name(), "https://github.com/username/repo/README.md"); | |
intent.putExtra(Constants.PLAYSTORE_PACKAGE_NAME.name(), "com.name.appname"); |
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
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar"> | |
<item name="colorPrimary">@color/colorPrimary</item> | |
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | |
<item name="colorAccent">@color/colorAccent</item> | |
</style> |
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
<application | |
android:theme="@style/AppTheme"> | |
<activity android:name="com.psoffritti.librarysampleapptemplate.core.SampleAppTemplateActivity" /> | |
<activity android:name=".MainActivity"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> |
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
dependencies { | |
implementation "com.psoffritti.librarysampleapptemplate:core:$latest_version" | |
} |
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
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" > | |
<com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView | |
android:id="@+id/youtube_player_view" | |
android:layout_width="match_parent" |
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
YouTubePlayerView youTubePlayerView = findViewById(R.id.youtube_player_view); | |
getLifecycle().addObserver(youTubePlayerView); | |
youTubePlayerView.addYouTubePlayerListener(new AbstractYouTubePlayerListener() { | |
@Override | |
public void onReady(@NonNull YouTubePlayer youTubePlayer) { | |
String videoId = "S0Q4gqBUs7c"; | |
youTubePlayer.loadVideo(videoId, 0f); | |
} | |
}); |
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
YouTubePlayerView youTubePlayerView = findViewById(R.id.youtube_player_view); | |
getLifecycle().addObserver(youTubePlayerView); |
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
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" > | |
<com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView | |
android:id="@+id/youtube_player_view" | |
android:layout_width="match_parent" |
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
dependencies { | |
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:last_version' | |
} |
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
class CustomUiController { | |
private boolean isPlaying = false; | |
CustomUiController(View customPlayerUI, YouTubePlayer youTubePlayer) { | |
playPauseButton = customPlayerUI.findViewById(R.id.play_pause_button); | |
playPauseButton.setOnClickListener( view -> { | |
if(isPlaying) youTubePlayer.pause(); | |
else youTubePlayer.play(); |
NewerOlder