change view naming in detail fragment

This commit is contained in:
Christian Schabesberger 2016-08-08 20:21:18 +02:00
parent 7bea94144e
commit 2601bf6d81
5 changed files with 160 additions and 201 deletions

View File

@ -104,7 +104,7 @@ public class StreamInfoWorker {
Log.e(TAG, "------");
}
View rootView = a != null ? a.findViewById(R.id.videoitem_detail) : null;
View rootView = a != null ? a.findViewById(R.id.video_item_detail) : null;
ErrorActivity.reportError(h, a,
streamInfo.errors, null, rootView,
ErrorActivity.ErrorInfo.make(ErrorActivity.REQUESTED_STREAM,

View File

@ -1,7 +1,6 @@
package org.schabi.newpipe.detail;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
@ -27,7 +26,6 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
@ -99,21 +97,19 @@ public class VideoItemDetailFragment extends Fragment {
private int streamingServiceId = -1;
private boolean autoPlayEnabled;
private boolean showNextVideoItem;
private Bitmap videoThumbnail;
private boolean showNextStreamItem;
private View thumbnailWindowLayout;
//this only remains due to downwards compatibility
private FloatingActionButton playVideoButton;
private final Point initialThumbnailPos = new Point(0, 0);
private View rootView = null;
private Bitmap streamThumbnail = null;
private ImageLoader imageLoader = ImageLoader.getInstance();
private DisplayImageOptions displayImageOptions =
new DisplayImageOptions.Builder().cacheInMemory(true).build();
private View rootView = null;
private InfoListAdapter similarStreamsAdapter = null;
public interface OnInvokeCreateOptionsMenuListener {
@ -124,54 +120,55 @@ public class VideoItemDetailFragment extends Fragment {
private void updateInfo(final StreamInfo info) {
try {
Context c = getContext();
Activity a = getActivity();
RelativeLayout textContentLayout =
(RelativeLayout) activity.findViewById(R.id.detailTextContentLayout);
(RelativeLayout) activity.findViewById(R.id.detail_text_content_layout);
final TextView videoTitleView =
(TextView) activity.findViewById(R.id.detailVideoTitleView);
TextView uploaderView = (TextView) activity.findViewById(R.id.detailUploaderView);
TextView viewCountView = (TextView) activity.findViewById(R.id.detailViewCountView);
TextView thumbsUpView = (TextView) activity.findViewById(R.id.detailThumbsUpCountView);
(TextView) activity.findViewById(R.id.detail_video_title_view);
TextView uploaderView = (TextView) activity.findViewById(R.id.detail_uploader_view);
TextView viewCountView = (TextView) activity.findViewById(R.id.detail_view_count_view);
TextView thumbsUpView = (TextView) activity.findViewById(R.id.detail_thumbs_up_count_view);
TextView thumbsDownView =
(TextView) activity.findViewById(R.id.detailThumbsDownCountView);
TextView uploadDateView = (TextView) activity.findViewById(R.id.detailUploadDateView);
TextView descriptionView = (TextView) activity.findViewById(R.id.detailDescriptionView);
FrameLayout nextVideoFrame =
(FrameLayout) activity.findViewById(R.id.detailNextVideoFrame);
(TextView) activity.findViewById(R.id.detail_thumbs_down_count_view);
TextView uploadDateView = (TextView) activity.findViewById(R.id.detail_upload_date_view);
TextView descriptionView = (TextView) activity.findViewById(R.id.detail_description_view);
RecyclerView nextStreamView =
(RecyclerView) activity.findViewById(R.id.detail_next_stream_content);
RelativeLayout nextVideoRootFrame =
(RelativeLayout) activity.findViewById(R.id.detailNextVideoRootLayout);
Button nextVideoButton = (Button) activity.findViewById(R.id.detailNextVideoButton);
TextView similarTitle = (TextView) activity.findViewById(R.id.detailSimilarTitle);
(RelativeLayout) activity.findViewById(R.id.detail_next_stream_root_layout);
TextView similarTitle = (TextView) activity.findViewById(R.id.detail_similar_title);
Button backgroundButton = (Button)
activity.findViewById(R.id.detailVideoThumbnailWindowBackgroundButton);
activity.findViewById(R.id.detail_stream_thumbnail_window_background_button);
View topView = activity.findViewById(R.id.detailTopView);
View nextVideoView = null;
Button channelButton = (Button) activity.findViewById(R.id.channelButton);
if(info.next_video != null) {
nextVideoView.setVisibility(View.GONE);
} else {
activity.findViewById(R.id.detailNextVidButtonAndContentLayout).setVisibility(View.GONE);
activity.findViewById(R.id.detailNextVideoTitle).setVisibility(View.GONE);
activity.findViewById(R.id.detailNextVideoButton).setVisibility(View.GONE);
}
Button channelButton = (Button) activity.findViewById(R.id.channel_button);
progressBar.setVisibility(View.GONE);
if(nextVideoView != null) {
nextVideoFrame.addView(nextVideoView);
if(info.next_video != null) {
InfoListAdapter adapter = new InfoListAdapter(a, rootView);
nextStreamView.setAdapter(adapter);
nextStreamView.setLayoutManager(new LinearLayoutManager(a));
adapter.setOnItemSelectedListener(new InfoListAdapter.OnItemSelectedListener() {
@Override
public void selected(String url) {
openStreamUrl(url);
}
});
} else {
nextStreamView.setVisibility(View.GONE);
activity.findViewById(R.id.detail_similar_title).setVisibility(View.GONE);
}
initThumbnailViews(info, nextVideoFrame);
textContentLayout.setVisibility(View.VISIBLE);
if (android.os.Build.VERSION.SDK_INT < 18) {
playVideoButton.setVisibility(View.VISIBLE);
} else {
ImageView playArrowView = (ImageView) activity.findViewById(R.id.playArrowView);
ImageView playArrowView = (ImageView) activity.findViewById(R.id.play_arrow_view);
playArrowView.setVisibility(View.VISIBLE);
}
if (!showNextVideoItem) {
if (!showNextStreamItem) {
nextVideoRootFrame.setVisibility(View.GONE);
similarTitle.setVisibility(View.GONE);
}
@ -182,7 +179,7 @@ public class VideoItemDetailFragment extends Fragment {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == android.view.MotionEvent.ACTION_UP) {
ImageView arrow = (ImageView) activity.findViewById(R.id.toggleDescriptionView);
ImageView arrow = (ImageView) activity.findViewById(R.id.toggle_description_view);
View extra = activity.findViewById(R.id.detailExtraView);
if (extra.getVisibility() == View.VISIBLE) {
extra.setVisibility(View.GONE);
@ -202,29 +199,29 @@ public class VideoItemDetailFragment extends Fragment {
if(!info.uploader.isEmpty()) {
uploaderView.setText(info.uploader);
} else {
activity.findViewById(R.id.detailUploaderWrapView).setVisibility(View.GONE);
activity.findViewById(R.id.detail_uploader_view).setVisibility(View.GONE);
}
if(info.view_count >= 0) {
viewCountView.setText(Localization.localizeViewCount(info.view_count, c));
viewCountView.setText(Localization.localizeViewCount(info.view_count, a));
} else {
viewCountView.setVisibility(View.GONE);
}
if(info.dislike_count >= 0) {
thumbsDownView.setText(Localization.localizeNumber(info.dislike_count, c));
thumbsDownView.setText(Localization.localizeNumber(info.dislike_count, a));
} else {
thumbsDownView.setVisibility(View.INVISIBLE);
activity.findViewById(R.id.detailThumbsDownImgView).setVisibility(View.GONE);
activity.findViewById(R.id.detail_thumbs_down_count_view).setVisibility(View.GONE);
}
if(info.like_count >= 0) {
thumbsUpView.setText(Localization.localizeNumber(info.like_count, c));
thumbsUpView.setText(Localization.localizeNumber(info.like_count, a));
} else {
thumbsUpView.setVisibility(View.GONE);
activity.findViewById(R.id.detailThumbsUpImgView).setVisibility(View.GONE);
activity.findViewById(R.id.detail_thumbs_up_img_view).setVisibility(View.GONE);
thumbsDownView.setVisibility(View.GONE);
activity.findViewById(R.id.detailThumbsDownImgView).setVisibility(View.GONE);
activity.findViewById(R.id.detail_thumbs_down_img_view).setVisibility(View.GONE);
}
if(!info.upload_date.isEmpty()) {
uploadDateView.setText(Localization.localizeDate(info.upload_date, c));
uploadDateView.setText(Localization.localizeDate(info.upload_date, a));
} else {
uploadDateView.setVisibility(View.GONE);
}
@ -244,25 +241,16 @@ public class VideoItemDetailFragment extends Fragment {
}
}
nextVideoButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent detailIntent =
new Intent(getActivity(), VideoItemDetailActivity.class);
/*detailIntent.putExtra(
VideoItemDetailFragment.ARG_ITEM_ID, currentVideoInfo.nextVideo.id); */
detailIntent.putExtra(
VideoItemDetailFragment.VIDEO_URL, info.next_video.webpage_url);
detailIntent.putExtra(VideoItemDetailFragment.STREAMING_SERVICE, streamingServiceId);
startActivity(detailIntent);
}
});
textContentLayout.setVisibility(View.VISIBLE);
if(info.next_video == null) {
activity.findViewById(R.id.detail_next_stream_title).setVisibility(View.GONE);
}
if(info.related_streams != null && !info.related_streams.isEmpty()) {
initSimilarVideos(info);
} else {
activity.findViewById(R.id.detailSimilarTitle).setVisibility(View.GONE);
activity.findViewById(R.id.detail_similar_title).setVisibility(View.GONE);
activity.findViewById(R.id.similar_streams_view).setVisibility(View.GONE);
}
@ -302,18 +290,18 @@ public class VideoItemDetailFragment extends Fragment {
channelButton.setVisibility(Button.GONE);
}
initThumbnailViews(info);
} catch (java.lang.NullPointerException e) {
Log.w(TAG, "updateInfo(): Fragment closed before thread ended work... or else");
e.printStackTrace();
}
}
private void initThumbnailViews(final StreamInfo info, View nextVideoFrame) {
ImageView videoThumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView);
private void initThumbnailViews(final StreamInfo info) {
ImageView videoThumbnailView = (ImageView) activity.findViewById(R.id.detail_thumbnail_view);
ImageView uploaderThumb
= (ImageView) activity.findViewById(R.id.detailUploaderThumbnailView);
ImageView nextVideoThumb =
(ImageView) nextVideoFrame.findViewById(R.id.itemThumbnailView);
= (ImageView) activity.findViewById(R.id.detail_uploader_thumbnail_view);
if(info.thumbnail_url != null && !info.thumbnail_url.isEmpty()) {
imageLoader.displayImage(info.thumbnail_url, videoThumbnailView,
@ -333,7 +321,7 @@ public class VideoItemDetailFragment extends Fragment {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
videoThumbnail = loadedImage;
streamThumbnail = loadedImage;
}
@Override
@ -348,11 +336,6 @@ public class VideoItemDetailFragment extends Fragment {
uploaderThumb, displayImageOptions,
new ImageErrorLoadingListener(activity, rootView, info.service_id));
}
if(info.thumbnail_url != null && !info.thumbnail_url.isEmpty() && info.next_video != null) {
imageLoader.displayImage(info.next_video.thumbnail_url,
nextVideoThumb, displayImageOptions,
new ImageErrorLoadingListener(activity, rootView, info.service_id));
}
}
private void setupActionBarHandler(final StreamInfo info) {
@ -461,9 +444,9 @@ public class VideoItemDetailFragment extends Fragment {
info.audio_streams.get(getPreferredAudioStreamId(info));
if (!useExternalAudioPlayer && android.os.Build.VERSION.SDK_INT >= 18) {
//internal music player: explicit intent
if (!BackgroundPlayer.isRunning && videoThumbnail != null) {
if (!BackgroundPlayer.isRunning && streamThumbnail != null) {
ActivityCommunicator.getCommunicator()
.backgroundPlayerThumbnail = videoThumbnail;
.backgroundPlayerThumbnail = streamThumbnail;
intent = new Intent(activity, BackgroundPlayer.class);
intent.setAction(Intent.ACTION_VIEW);
@ -549,8 +532,8 @@ public class VideoItemDetailFragment extends Fragment {
private void onErrorBlockedByGema() {
Button backgroundButton = (Button)
activity.findViewById(R.id.detailVideoThumbnailWindowBackgroundButton);
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView);
activity.findViewById(R.id.detail_stream_thumbnail_window_background_button);
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detail_thumbnail_view);
progressBar.setVisibility(View.GONE);
thumbnailView.setImageBitmap(BitmapFactory.decodeResource(
@ -570,7 +553,7 @@ public class VideoItemDetailFragment extends Fragment {
}
private void onNotSpecifiedContentError() {
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView);
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detail_thumbnail_view);
progressBar.setVisibility(View.GONE);
thumbnailView.setImageBitmap(BitmapFactory.decodeResource(
getResources(), R.drawable.not_available_monkey));
@ -579,7 +562,7 @@ public class VideoItemDetailFragment extends Fragment {
}
private void onNotSpecifiedContentErrorWithMessage(int resourceId) {
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView);
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detail_thumbnail_view);
progressBar.setVisibility(View.GONE);
thumbnailView.setImageBitmap(BitmapFactory.decodeResource(
getResources(), R.drawable.not_available_monkey));
@ -605,7 +588,7 @@ public class VideoItemDetailFragment extends Fragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
activity = (AppCompatActivity) getActivity();
showNextVideoItem = PreferenceManager.getDefaultSharedPreferences(getActivity())
showNextStreamItem = PreferenceManager.getDefaultSharedPreferences(getActivity())
.getBoolean(activity.getString(R.string.show_next_video_key), true);
@ -642,7 +625,7 @@ public class VideoItemDetailFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_videoitem_detail, container, false);
progressBar = (ProgressBar) rootView.findViewById(R.id.detailProgressBar);
progressBar = (ProgressBar) rootView.findViewById(R.id.detail_progress_bar);
actionBarHandler = new ActionBarHandler(activity);
actionBarHandler.setupNavMenu(activity);
@ -658,11 +641,11 @@ public class VideoItemDetailFragment extends Fragment {
super.onActivityCreated(savedInstanceBundle);
Activity a = getActivity();
if (android.os.Build.VERSION.SDK_INT < 18) {
playVideoButton = (FloatingActionButton) a.findViewById(R.id.playVideoButton);
playVideoButton = (FloatingActionButton) a.findViewById(R.id.play_video_button);
}
thumbnailWindowLayout = a.findViewById(R.id.detailVideoThumbnailWindowLayout);
thumbnailWindowLayout = a.findViewById(R.id.detail_stream_thumbnail_window_layout);
Button backgroundButton = (Button)
a.findViewById(R.id.detailVideoThumbnailWindowBackgroundButton);
a.findViewById(R.id.detail_stream_thumbnail_window_background_button);
// Sometimes when this fragment is not visible it still gets initiated
// then we must not try to access objects of this fragment.
@ -676,7 +659,7 @@ public class VideoItemDetailFragment extends Fragment {
autoPlayEnabled = getArguments().getBoolean(AUTO_PLAY);
if(Build.VERSION.SDK_INT >= 18) {
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView);
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detail_thumbnail_view);
thumbnailView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
// This is used to synchronize the thumbnailWindowButton and the playVideoButton
// inside the ScrollView with the actual size of the thumbnail.
@ -706,11 +689,7 @@ public class VideoItemDetailFragment extends Fragment {
similarStreamsAdapter.setOnItemSelectedListener(new InfoListAdapter.OnItemSelectedListener() {
@Override
public void selected(String url) {
Intent detailIntent = new Intent(activity, VideoItemDetailActivity.class);
detailIntent.putExtra(VideoItemDetailFragment.VIDEO_URL, url);
detailIntent.putExtra(
VideoItemDetailFragment.STREAMING_SERVICE, streamingServiceId);
activity.startActivity(detailIntent);
openStreamUrl(url);
}
});
}
@ -814,4 +793,12 @@ public class VideoItemDetailFragment extends Fragment {
Toast.makeText(VideoItemDetailFragment.this.getActivity(),
stringResource, Toast.LENGTH_LONG).show();
}
private void openStreamUrl(String url) {
Intent detailIntent = new Intent(activity, VideoItemDetailActivity.class);
detailIntent.putExtra(VideoItemDetailFragment.VIDEO_URL, url);
detailIntent.putExtra(
VideoItemDetailFragment.STREAMING_SERVICE, streamingServiceId);
activity.startActivity(detailIntent);
}
}

View File

@ -8,10 +8,10 @@
style="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/videoitem_detail">
android:id="@+id/video_item_detail">
<com.nirhart.parallaxscroll.views.ParallaxScrollView
android:id="@+id/detailMainContent"
android:id="@+id/detail_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"
@ -23,12 +23,12 @@
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/detailVideoThumbnailWindowLayout"
android:id="@+id/detail_stream_thumbnail_window_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">
<ImageView android:id="@+id/detailThumbnailView"
<ImageView android:id="@+id/detail_thumbnail_view"
android:contentDescription="@string/detail_thumbnail_view_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -40,13 +40,13 @@
android:background="@android:color/black"
android:src="@drawable/dummy_thumbnail_dark"/>
<ProgressBar android:id="@+id/detailProgressBar"
<ProgressBar android:id="@+id/detail_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"/>
<ImageView android:id="@+id/playArrowView"
<ImageView android:id="@+id/play_arrow_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
@ -55,18 +55,17 @@
android:visibility="invisible"/>
<Button
android:id="@+id/detailVideoThumbnailWindowBackgroundButton"
android:id="@+id/detail_stream_thumbnail_window_background_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<RelativeLayout android:id="@+id/detailTextContentLayout"
<RelativeLayout android:id="@+id/detail_text_content_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detailVideoThumbnailWindowLayout"
android:layout_below="@id/detail_stream_thumbnail_window_layout"
android:background="@color/light_background_color"
android:visibility="gone">
@ -75,7 +74,7 @@
android:layout_height="wrap_content"
android:id="@+id/detailTopView">
<TextView android:id="@+id/detailVideoTitleView"
<TextView android:id="@+id/detail_video_title_view"
android:layout_width="0dp"
android:layout_weight=".7"
android:layout_height="wrap_content"
@ -89,7 +88,7 @@
<ImageView
android:layout_width="15dp"
android:layout_height="30dp"
android:id="@+id/toggleDescriptionView"
android:id="@+id/toggle_description_view"
android:src="@drawable/arrow_down"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
@ -99,7 +98,7 @@
</LinearLayout>
<TextView android:id="@+id/detailViewCountView"
<TextView android:id="@+id/detail_view_count_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_views_text_size"
@ -115,14 +114,14 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/detailViewCountView"
android:layout_below="@id/detail_view_count_view"
android:id="@+id/detailExtraView"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:visibility="gone">
<TextView android:id="@+id/detailUploadDateView"
<TextView android:id="@+id/detail_upload_date_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_upload_date_text_size"
@ -130,12 +129,12 @@
android:text="Upload date"
android:layout_marginTop="3dp" />
<TextView android:id="@+id/detailDescriptionView"
<TextView android:id="@+id/detail_description_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_description_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_below="@id/detailUploadDateView"
android:layout_below="@id/detail_upload_date_view"
android:text="Description............."
android:layout_marginTop="3dp" />
</RelativeLayout>
@ -143,27 +142,27 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout"
android:id="@+id/stream_info_layout"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_below="@+id/detailExtraView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="5dp">
<ImageView android:id="@+id/detailThumbsUpImgView"
<ImageView android:id="@+id/detail_thumbs_up_img_view"
android:contentDescription="@string/detail_likes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
android:src="@drawable/thumbs_up" />
<TextView android:id="@+id/detailThumbsUpCountView"
<TextView android:id="@+id/detail_thumbs_up_count_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="200" />
<ImageView android:id="@+id/detailThumbsDownImgView"
<ImageView android:id="@+id/detail_thumbs_down_img_view"
android:contentDescription="@string/detail_dislikes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
@ -171,7 +170,7 @@
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"/>
<TextView android:id="@+id/detailThumbsDownCountView"
<TextView android:id="@+id/detail_thumbs_down_count_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size"
@ -182,21 +181,21 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/detailUploaderFrame"
android:layout_below="@+id/linearLayout">
android:id="@+id/detail_uploader_frame"
android:layout_below="@id/stream_info_layout">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/detailUploaderLayout"
android:id="@+id/detail_uploader_layout"
android:layout_marginTop="12dp">
<View
android:background="#000"
android:layout_width="match_parent"
android:layout_height="1px" />
<de.hdodenhof.circleimageview.CircleImageView android:id="@+id/detailUploaderThumbnailView"
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/detail_uploader_thumbnail_view"
android:contentDescription="@string/detail_uploader_thumbnail_view_description"
android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@dimen/video_item_detail_uploader_image_size"
@ -208,7 +207,7 @@
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"/>
<TextView android:id="@+id/detailUploaderView"
<TextView android:id="@+id/detail_uploader_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
@ -216,8 +215,8 @@
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Uploader"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/detailUploaderThumbnailView"
android:layout_toEndOf="@+id/detailUploaderThumbnailView"
android:layout_toRightOf="@+id/detail_uploader_thumbnail_view"
android:layout_toEndOf="@+id/detail_uploader_thumbnail_view"
android:layout_marginLeft="15dp"
android:layout_marginStart="28dp" />
@ -225,28 +224,26 @@
android:background="#000"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@id/detailUploaderThumbnailView"/>
android:layout_below="@id/detail_uploader_thumbnail_view"/>
</RelativeLayout>
<Button
android:layout_marginTop="11dp"
android:id="@+id/channelButton"
android:layout_marginTop="13dp"
android:id="@+id/channel_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"/>
</FrameLayout>
<RelativeLayout android:id="@+id/detailNextVideoRootLayout"
<RelativeLayout android:id="@+id/detail_next_stream_root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal|bottom"
android:layout_below="@+id/detailUploaderFrame"
android:layout_below="@+id/detail_uploader_frame"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp">
<TextView android:id="@+id/detailNextVideoTitle"
<TextView
android:id="@+id/detail_next_stream_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
@ -255,37 +252,25 @@
android:text="@string/next_video_title"
android:textAllCaps="true" />
<RelativeLayout android:id="@+id/detailNextVidButtonAndContentLayout"
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detailNextVideoTitle">
<FrameLayout
android:id="@+id/detailNextVideoFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/detailNextVideoButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/detailNextVideoFrame"
android:layout_alignBottom="@id/detailNextVideoFrame"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<TextView android:id="@+id/detailSimilarTitle"
android:layout_height="wrap_content"
android:id="@+id/detail_next_stream_content"/>
<TextView android:id="@+id/detail_similar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="@dimen/video_item_detail_next_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/similar_videos_btn_text"
android:layout_below="@id/detailNextVidButtonAndContentLayout"
android:layout_below="@id/detail_next_stream_content"
android:textAllCaps="true" />
<android.support.v7.widget.RecyclerView
android:id="@+id/similar_streams_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@id/detailSimilarTitle"/>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detail_similar_title"/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

View File

@ -8,10 +8,10 @@
style="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/videoitem_detail">
android:id="@+id/video_item_detail">
<com.nirhart.parallaxscroll.views.ParallaxScrollView
android:id="@+id/detailMainContent"
android:id="@+id/detail_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"
@ -23,12 +23,12 @@
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/detailVideoThumbnailWindowLayout"
android:id="@+id/detail_stream_thumbnail_window_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">
<ImageView android:id="@+id/detailThumbnailView"
<ImageView android:id="@+id/detail_thumbnail_view"
android:contentDescription="@string/detail_thumbnail_view_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -40,14 +40,14 @@
android:background="@android:color/black"
android:src="@drawable/dummy_thumbnail_dark"/>
<ProgressBar android:id="@+id/detailProgressBar"
<ProgressBar android:id="@+id/detail_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/playVideoButton"
android:id="@+id/play_video_button"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -57,18 +57,17 @@
android:layout_margin="@dimen/video_item_detail_play_fab_margin"/>
<Button
android:id="@+id/detailVideoThumbnailWindowBackgroundButton"
android:id="@+id/detail_stream_thumbnail_window_background_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<RelativeLayout android:id="@+id/detailTextContentLayout"
<RelativeLayout android:id="@+id/detail_text_content_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detailVideoThumbnailWindowLayout"
android:layout_below="@id/detail_stream_thumbnail_window_layout"
android:background="@color/light_background_color"
android:visibility="gone">
@ -77,7 +76,7 @@
android:layout_height="wrap_content"
android:id="@+id/detailTopView">
<TextView android:id="@+id/detailVideoTitleView"
<TextView android:id="@+id/detail_video_title_view"
android:layout_width="0dp"
android:layout_weight=".7"
android:layout_height="wrap_content"
@ -91,7 +90,7 @@
<ImageView
android:layout_width="15dp"
android:layout_height="30dp"
android:id="@+id/toggleDescriptionView"
android:id="@+id/toggle_description_view"
android:src="@drawable/arrow_down"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
@ -101,7 +100,7 @@
</LinearLayout>
<TextView android:id="@+id/detailViewCountView"
<TextView android:id="@+id/detail_view_count_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_views_text_size"
@ -117,14 +116,14 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/detailViewCountView"
android:layout_below="@id/detail_view_count_view"
android:id="@+id/detailExtraView"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:visibility="gone">
<TextView android:id="@+id/detailUploadDateView"
<TextView android:id="@+id/detail_upload_date_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_upload_date_text_size"
@ -132,12 +131,12 @@
android:text="Upload date"
android:layout_marginTop="3dp" />
<TextView android:id="@+id/detailDescriptionView"
<TextView android:id="@+id/detail_description_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_description_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_below="@id/detailUploadDateView"
android:layout_below="@id/detail_upload_date_view"
android:text="Description............."
android:layout_marginTop="3dp" />
</RelativeLayout>
@ -145,27 +144,27 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout"
android:id="@+id/stream_info_layout"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_below="@+id/detailExtraView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="5dp">
<ImageView android:id="@+id/detailThumbsUpImgView"
<ImageView android:id="@+id/detail_thumbs_up_img_view"
android:contentDescription="@string/detail_likes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
android:src="@drawable/thumbs_up" />
<TextView android:id="@+id/detailThumbsUpCountView"
<TextView android:id="@+id/detail_thumbs_up_count_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="200" />
<ImageView android:id="@+id/detailThumbsDownImgView"
<ImageView android:id="@+id/detail_thumbs_down_img_view"
android:contentDescription="@string/detail_dislikes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
@ -173,7 +172,7 @@
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"/>
<TextView android:id="@+id/detailThumbsDownCountView"
<TextView android:id="@+id/detail_thumbs_down_count_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size"
@ -184,12 +183,12 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/detailUploaderFrame"
android:layout_below="@+id/linearLayout">
android:id="@+id/detail_uploader_frame"
android:layout_below="@id/stream_info_layout">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/detailUploaderWrapView"
android:id="@+id/detail_uploader_layout"
android:layout_marginTop="12dp">
<View
@ -197,7 +196,8 @@
android:layout_width="match_parent"
android:layout_height="1px" />
<de.hdodenhof.circleimageview.CircleImageView android:id="@+id/detailUploaderThumbnailView"
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/detail_uploader_thumbnail_view"
android:contentDescription="@string/detail_uploader_thumbnail_view_description"
android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@dimen/video_item_detail_uploader_image_size"
@ -209,7 +209,7 @@
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"/>
<TextView android:id="@+id/detailUploaderView"
<TextView android:id="@+id/detail_uploader_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
@ -217,8 +217,8 @@
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Uploader"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/detailUploaderThumbnailView"
android:layout_toEndOf="@+id/detailUploaderThumbnailView"
android:layout_toRightOf="@+id/detail_uploader_thumbnail_view"
android:layout_toEndOf="@+id/detail_uploader_thumbnail_view"
android:layout_marginLeft="15dp"
android:layout_marginStart="28dp" />
@ -226,25 +226,26 @@
android:background="#000"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@id/detailUploaderThumbnailView"/>
android:layout_below="@id/detail_uploader_thumbnail_view"/>
</RelativeLayout>
<Button
android:layout_marginTop="13dp"
android:id="@+id/channelButton"
android:id="@+id/channel_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"/>
</FrameLayout>
<RelativeLayout android:id="@+id/detailNextVideoRootLayout"
<RelativeLayout android:id="@+id/detail_next_stream_root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal|bottom"
android:layout_below="@id/linearLayout"
android:layout_below="@+id/detail_uploader_frame"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp">
<TextView android:id="@+id/detailNextVideoTitle"
<TextView
android:id="@+id/detail_next_stream_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
@ -253,37 +254,25 @@
android:text="@string/next_video_title"
android:textAllCaps="true" />
<RelativeLayout android:id="@+id/detailNextVidButtonAndContentLayout"
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detailNextVideoTitle">
<FrameLayout
android:id="@+id/detailNextVideoFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/detailNextVideoButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/detailNextVideoFrame"
android:layout_alignBottom="@id/detailNextVideoFrame"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<TextView android:id="@+id/detailSimilarTitle"
android:layout_height="wrap_content"
android:id="@+id/detail_next_stream_content"/>
<TextView android:id="@+id/detail_similar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="@dimen/video_item_detail_next_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/similar_videos_btn_text"
android:layout_below="@id/detailNextVidButtonAndContentLayout"
android:layout_below="@id/detail_next_stream_content"
android:textAllCaps="true" />
<android.support.v7.widget.RecyclerView
android:id="@+id/similar_streams_view"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detailSimilarTitle"/>
android:layout_below="@id/detail_similar_title"/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>

View File

@ -104,7 +104,5 @@
android:id="@+id/item_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/detailNextVideoFrame"
android:layout_alignBottom="@id/detailNextVideoFrame"
android:background="?attr/selectableItemBackground"/>
</FrameLayout>