Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-194
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021–194
2021-194
Commits
46b5255d
Commit
46b5255d
authored
Jul 05, 2021
by
Anupama Balasooriya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create and implement youtube player activity
parent
664d4141
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
16 deletions
+31
-16
app/build.gradle
app/build.gradle
+1
-0
app/src/main/java/com/sliit/smartserviceassistant/spareparts/SuggestYoutubeVideos.java
...martserviceassistant/spareparts/SuggestYoutubeVideos.java
+16
-0
app/src/main/res/layout/activity_suggest_youtube_videos.xml
app/src/main/res/layout/activity_suggest_youtube_videos.xml
+12
-14
build.gradle
build.gradle
+1
-1
gradle/wrapper/gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+1
-1
No files found.
app/build.gradle
View file @
46b5255d
...
@@ -37,4 +37,5 @@ dependencies {
...
@@ -37,4 +37,5 @@ dependencies {
testImplementation
'junit:junit:4.+'
testImplementation
'junit:junit:4.+'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.ext:junit:1.1.2'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.3.0'
implementation
'com.pierfrancescosoffritti.androidyoutubeplayer:core:10.0.5'
}
}
\ No newline at end of file
app/src/main/java/com/sliit/smartserviceassistant/spareparts/SuggestYoutubeVideos.java
View file @
46b5255d
package
com.sliit.smartserviceassistant.spareparts
;
package
com.sliit.smartserviceassistant.spareparts
;
import
androidx.annotation.NonNull
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
com.pierfrancescosoffritti.androidyoutubeplayer.core.player.YouTubePlayer
;
import
com.pierfrancescosoffritti.androidyoutubeplayer.core.player.listeners.AbstractYouTubePlayerListener
;
import
com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
;
import
com.sliit.smartserviceassistant.R
;
import
com.sliit.smartserviceassistant.R
;
public
class
SuggestYoutubeVideos
extends
AppCompatActivity
{
public
class
SuggestYoutubeVideos
extends
AppCompatActivity
{
...
@@ -12,5 +16,17 @@ public class SuggestYoutubeVideos extends AppCompatActivity {
...
@@ -12,5 +16,17 @@ public class SuggestYoutubeVideos extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_suggest_youtube_videos
);
setContentView
(
R
.
layout
.
activity_suggest_youtube_videos
);
YouTubePlayerView
youTubePlayerView
=
findViewById
(
R
.
id
.
youtube_player_view
);
getLifecycle
().
addObserver
(
youTubePlayerView
);
youTubePlayerView
.
addYouTubePlayerListener
(
new
AbstractYouTubePlayerListener
()
{
@Override
public
void
onReady
(
@NonNull
YouTubePlayer
youTubePlayer
)
{
String
videoId
=
"p3CcfIjycBA"
;
youTubePlayer
.
loadVideo
(
videoId
,
0
);
}
});
}
}
}
}
\ No newline at end of file
app/src/main/res/layout/activity_suggest_youtube_videos.xml
View file @
46b5255d
...
@@ -7,25 +7,23 @@
...
@@ -7,25 +7,23 @@
tools:context=
".spareparts.SuggestYoutubeVideos"
>
tools:context=
".spareparts.SuggestYoutubeVideos"
>
<LinearLayout
<LinearLayout
android:orientation=
"vertical"
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_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<RelativeLayout
<com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
android:id=
"@+id/youtube_player_view"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"30dp"
app:autoPlay=
"false"
android:layout_marginRight=
"30dp"
app:showSeekBar=
"true"
android:layout_marginTop=
"100dp"
>
<androidx.recyclerview.widget.RecyclerView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
app:showVideoDuration=
"true"
app:showVideoCurrentTime=
"true"
app:showYouTubeButton=
"false"
app:showFullScreenButton=
"true"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</ScrollView>
\ No newline at end of file
build.gradle
View file @
46b5255d
...
@@ -5,7 +5,7 @@ buildscript {
...
@@ -5,7 +5,7 @@ buildscript {
jcenter
()
jcenter
()
}
}
dependencies
{
dependencies
{
classpath
"com.android.tools.build:gradle:4.1.3"
classpath
'com.android.tools.build:gradle:4.2.2'
// NOTE: Do not place your application dependencies here; they belong
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// in the individual module build.gradle files
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
46b5255d
...
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
...
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-6.
5
-bin.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-6.
7.1
-bin.zip
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment