diff options
Diffstat (limited to 'org.fox.ttrss/src/main')
5 files changed, 28 insertions, 4 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 6355356e..63b12cb6 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -1355,6 +1355,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, Intent intent = new Intent(m_activity, VideoPlayerActivity.class); intent.putExtra("streamUri", article.flavorStreamUri); intent.putExtra("title", article.title); + intent.putExtra("coverSrc", article.flavorImageUri); startActivity(intent); m_activity.overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/VideoPlayerActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/VideoPlayerActivity.java index 6e6c947d..6e4c88a9 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/VideoPlayerActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/VideoPlayerActivity.java @@ -17,9 +17,12 @@ import android.view.SurfaceHolder; import android.view.SurfaceView;
import android.view.View;
import android.widget.FrameLayout;
+import android.widget.ImageView;
import android.widget.MediaController;
import android.widget.PopupMenu;
+import com.nostra13.universalimageloader.core.ImageLoader;
+
import java.io.IOException;
@@ -29,6 +32,7 @@ public class VideoPlayerActivity extends CommonActivity { private String m_streamUri;
private MediaPlayer mediaPlayer;
private SurfaceView surfaceView;
+ private String m_coverUri;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -45,14 +49,24 @@ public class VideoPlayerActivity extends CommonActivity { getSupportActionBar().hide();
surfaceView = (SurfaceView) findViewById(R.id.video_player);
- registerForContextMenu(surfaceView);
setTitle(getIntent().getStringExtra("title"));
if (savedInstanceState == null) {
m_streamUri = getIntent().getStringExtra("streamUri");
+ m_coverUri = getIntent().getStringExtra("coverSrc");
} else {
m_streamUri = savedInstanceState.getString("streamUri");
+ m_coverUri = savedInstanceState.getString("coverSrc");
+ }
+
+ ImageView coverView = (ImageView)findViewById(R.id.video_player_cover);
+
+ if (m_coverUri != null) {
+ ImageLoader imageLoader = ImageLoader.getInstance();
+ imageLoader.displayImage(m_coverUri, coverView);
+ } else {
+ coverView.setVisibility(View.GONE);
}
findViewById(R.id.video_player_overflow).setOnClickListener(new View.OnClickListener() {
@@ -174,6 +188,9 @@ public class VideoPlayerActivity extends CommonActivity { View loadingBar = findViewById(R.id.video_loading);
if (loadingBar != null) loadingBar.setVisibility(View.GONE);
+ View coverView = findViewById(R.id.video_player_cover);
+ if (coverView != null) coverView.setVisibility(View.GONE);
+
resizeSurface();
mp.setLooping(true);
mp.start();
@@ -209,6 +226,7 @@ public class VideoPlayerActivity extends CommonActivity { super.onSaveInstanceState(out);
out.putString("streamUri", m_streamUri);
+ out.putString("coverSrc", m_coverUri);
}
diff --git a/org.fox.ttrss/src/main/res/layout/activity_video_player.xml b/org.fox.ttrss/src/main/res/layout/activity_video_player.xml index 55ca6866..08353c68 100644 --- a/org.fox.ttrss/src/main/res/layout/activity_video_player.xml +++ b/org.fox.ttrss/src/main/res/layout/activity_video_player.xml @@ -2,7 +2,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
- android:background="?android:colorBackground"
+ android:background="@android:color/black"
tools:context="org.fox.ttrss.VideoPlayerActivity">
<FrameLayout
@@ -17,6 +17,11 @@ android:id="@+id/video_player"
android:transitionName="TRANSITION:ARTICLE_VIDEO_PLAYER" />
+ <ImageView
+ android:id="@+id/video_player_cover"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
+
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/org.fox.ttrss/src/main/res/layout/activity_youtube_player.xml b/org.fox.ttrss/src/main/res/layout/activity_youtube_player.xml index afd37335..3d2c9c9a 100644 --- a/org.fox.ttrss/src/main/res/layout/activity_youtube_player.xml +++ b/org.fox.ttrss/src/main/res/layout/activity_youtube_player.xml @@ -2,7 +2,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" - android:background="?android:colorBackground" + android:background="@android:color/black" tools:context="org.fox.ttrss.VideoPlayerActivity"> <FrameLayout diff --git a/org.fox.ttrss/src/main/res/layout/article_images_pager.xml b/org.fox.ttrss/src/main/res/layout/article_images_pager.xml index 8744af67..eaaca37a 100755 --- a/org.fox.ttrss/src/main/res/layout/article_images_pager.xml +++ b/org.fox.ttrss/src/main/res/layout/article_images_pager.xml @@ -3,7 +3,7 @@ android:id="@+id/article_images" android:layout_width="fill_parent" android:animateLayoutChanges="true" - android:background="?headlinesBackground" + android:background="@android:color/black" android:layout_height="fill_parent"> <org.fox.ttrss.ArticleImagesPager |