kopia lustrzana https://github.com/TeamNewPipe/NewPipe
fix layout
rodzic
6d60e6698a
commit
cd5b60cbed
|
@ -80,6 +80,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
private TextView headerTitleView;
|
private TextView headerTitleView;
|
||||||
private TextView headerSubscribersTextView;
|
private TextView headerSubscribersTextView;
|
||||||
private Button headerSubscribeButton;
|
private Button headerSubscribeButton;
|
||||||
|
private View playlistCtrl;
|
||||||
|
|
||||||
private LinearLayout headerPlayAllButton;
|
private LinearLayout headerPlayAllButton;
|
||||||
private LinearLayout headerPopupButton;
|
private LinearLayout headerPopupButton;
|
||||||
|
@ -140,10 +141,12 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
headerTitleView = headerRootLayout.findViewById(R.id.channel_title_view);
|
headerTitleView = headerRootLayout.findViewById(R.id.channel_title_view);
|
||||||
headerSubscribersTextView = headerRootLayout.findViewById(R.id.channel_subscriber_view);
|
headerSubscribersTextView = headerRootLayout.findViewById(R.id.channel_subscriber_view);
|
||||||
headerSubscribeButton = headerRootLayout.findViewById(R.id.channel_subscribe_button);
|
headerSubscribeButton = headerRootLayout.findViewById(R.id.channel_subscribe_button);
|
||||||
|
playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control);
|
||||||
|
|
||||||
headerPlayAllButton = headerRootLayout.findViewById(R.id.channel_play_all_button);
|
|
||||||
headerPopupButton = headerRootLayout.findViewById(R.id.channel_play_popup_button);
|
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
|
||||||
headerBackgroundButton = headerRootLayout.findViewById(R.id.channel_play_bg_button);
|
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
|
||||||
|
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button);
|
||||||
|
|
||||||
return headerRootLayout;
|
return headerRootLayout;
|
||||||
}
|
}
|
||||||
|
@ -197,6 +200,8 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
ActionBar supportActionBar = activity.getSupportActionBar();
|
ActionBar supportActionBar = activity.getSupportActionBar();
|
||||||
if(useAsFrontPage) {
|
if(useAsFrontPage) {
|
||||||
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
supportActionBar.setDisplayHomeAsUpEnabled(false);
|
||||||
|
menuRssButton.setVisible(false);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
inflater.inflate(R.menu.menu_channel, menu);
|
inflater.inflate(R.menu.menu_channel, menu);
|
||||||
|
|
||||||
|
@ -441,6 +446,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
|
||||||
} else headerSubscribersTextView.setVisibility(View.GONE);
|
} else headerSubscribersTextView.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (menuRssButton != null) menuRssButton.setVisible(!TextUtils.isEmpty(result.feed_url));
|
if (menuRssButton != null) menuRssButton.setVisible(!TextUtils.isEmpty(result.feed_url));
|
||||||
|
playlistCtrl.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
if (!result.errors.isEmpty()) {
|
if (!result.errors.isEmpty()) {
|
||||||
showSnackBarError(result.errors, UserAction.REQUESTED_CHANNEL, NewPipe.getNameOfService(result.service_id), result.url, 0);
|
showSnackBarError(result.errors, UserAction.REQUESTED_CHANNEL, NewPipe.getNameOfService(result.service_id), result.url, 0);
|
||||||
|
|
|
@ -51,10 +51,11 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
|
||||||
private TextView headerUploaderName;
|
private TextView headerUploaderName;
|
||||||
private ImageView headerUploaderAvatar;
|
private ImageView headerUploaderAvatar;
|
||||||
private TextView headerStreamCount;
|
private TextView headerStreamCount;
|
||||||
|
private View playlistCtrl;
|
||||||
|
|
||||||
private LinearLayout headerPlayAllButton;
|
private View headerPlayAllButton;
|
||||||
private LinearLayout headerPopupButton;
|
private View headerPopupButton;
|
||||||
private LinearLayout headerBackgroundButton;
|
private View headerBackgroundButton;
|
||||||
|
|
||||||
public static PlaylistFragment getInstance(int serviceId, String url, String name) {
|
public static PlaylistFragment getInstance(int serviceId, String url, String name) {
|
||||||
PlaylistFragment instance = new PlaylistFragment();
|
PlaylistFragment instance = new PlaylistFragment();
|
||||||
|
@ -82,10 +83,11 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
|
||||||
headerUploaderName = headerRootLayout.findViewById(R.id.uploader_name);
|
headerUploaderName = headerRootLayout.findViewById(R.id.uploader_name);
|
||||||
headerUploaderAvatar = headerRootLayout.findViewById(R.id.uploader_avatar_view);
|
headerUploaderAvatar = headerRootLayout.findViewById(R.id.uploader_avatar_view);
|
||||||
headerStreamCount = headerRootLayout.findViewById(R.id.playlist_stream_count);
|
headerStreamCount = headerRootLayout.findViewById(R.id.playlist_stream_count);
|
||||||
|
playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control);
|
||||||
|
|
||||||
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_play_all_button);
|
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
|
||||||
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_play_popup_button);
|
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
|
||||||
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_play_bg_button);
|
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button);
|
||||||
|
|
||||||
return headerRootLayout;
|
return headerRootLayout;
|
||||||
}
|
}
|
||||||
|
@ -190,6 +192,8 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
playlistCtrl.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
imageLoader.displayImage(result.uploader_avatar_url, headerUploaderAvatar, DISPLAY_AVATAR_OPTIONS);
|
imageLoader.displayImage(result.uploader_avatar_url, headerUploaderAvatar, DISPLAY_AVATAR_OPTIONS);
|
||||||
headerStreamCount.setText(getResources().getQuantityString(R.plurals.videos, (int) result.stream_count, (int) result.stream_count));
|
headerStreamCount.setText(getResources().getQuantityString(R.plurals.videos, (int) result.stream_count, (int) result.stream_count));
|
||||||
|
|
||||||
|
|
|
@ -86,86 +86,10 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="25dp"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/play_control"
|
android:layout_below="@id/channel_metadata">
|
||||||
android:layout_margin="@dimen/software_component_item_padding"
|
|
||||||
android:layout_below="@+id/channel_metadata">
|
|
||||||
|
|
||||||
<LinearLayout
|
<include layout="@layout/playlist_control" />
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:id="@+id/channel_play_bg_button">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/controls_background_title"
|
|
||||||
android:textSize="@dimen/channel_rss_title_size"
|
|
||||||
android:textColor="?attr/colorAccent"
|
|
||||||
android:drawablePadding="4dp"
|
|
||||||
android:drawableLeft="?attr/audio"
|
|
||||||
android:drawableStart="?attr/audio"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View android:id="@+id/anchorLeft"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingTop="3dp"
|
|
||||||
android:paddingBottom="3dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:background="?attr/colorAccent"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:id="@+id/channel_play_all_button">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/play_all"
|
|
||||||
android:textSize="@dimen/channel_rss_title_size"
|
|
||||||
android:textColor="?attr/colorAccent"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View android:id="@+id/anchorRight"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingTop="3dp"
|
|
||||||
android:paddingBottom="3dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:background="?attr/colorAccent"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:id="@+id/channel_play_popup_button">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/controls_popup_title"
|
|
||||||
android:textSize="@dimen/channel_rss_title_size"
|
|
||||||
android:textColor="?attr/colorAccent"
|
|
||||||
android:drawablePadding="4dp"
|
|
||||||
android:drawableLeft="?attr/popup"
|
|
||||||
android:drawableStart="?attr/popup"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
|
@ -0,0 +1,83 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/playlist_ctrl_height"
|
||||||
|
android:id="@+id/playlist_control"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:visibility="invisible">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/playlist_ctrl_play_bg_button"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:background="?attr/selectableItemBackground">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="@string/controls_background_title"
|
||||||
|
android:textSize="@dimen/channel_rss_title_size"
|
||||||
|
android:textColor="?attr/colorAccent"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:drawableLeft="?attr/audio"
|
||||||
|
android:drawableStart="?attr/audio"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View android:id="@+id/anchorLeft"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clickable="false"
|
||||||
|
android:layout_marginBottom="@dimen/playlist_ctrl_seperator_margin"
|
||||||
|
android:layout_marginTop="@dimen/playlist_ctrl_seperator_margin"
|
||||||
|
android:background="?attr/colorAccent"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:id="@+id/playlist_ctrl_play_all_button">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="@string/play_all"
|
||||||
|
android:textSize="@dimen/channel_rss_title_size"
|
||||||
|
android:textColor="?attr/colorAccent"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View android:id="@+id/anchorRight"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:clickable="false"
|
||||||
|
android:layout_marginBottom="@dimen/playlist_ctrl_seperator_margin"
|
||||||
|
android:layout_marginTop="@dimen/playlist_ctrl_seperator_margin"
|
||||||
|
android:background="?attr/colorAccent"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:id="@+id/playlist_ctrl_play_popup_button">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="@string/controls_popup_title"
|
||||||
|
android:textSize="@dimen/channel_rss_title_size"
|
||||||
|
android:textColor="?attr/colorAccent"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:drawableLeft="?attr/popup"
|
||||||
|
android:drawableStart="?attr/popup"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
|
@ -84,86 +84,10 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="25dp"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/play_control"
|
android:layout_below="@id/playlist_meta">
|
||||||
android:layout_margin="@dimen/software_component_item_padding"
|
|
||||||
android:layout_below="@+id/playlist_meta">
|
|
||||||
|
|
||||||
<LinearLayout
|
<include layout="@layout/playlist_control"/>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:id="@+id/playlist_play_bg_button">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/controls_background_title"
|
|
||||||
android:textSize="@dimen/channel_rss_title_size"
|
|
||||||
android:textColor="?attr/colorAccent"
|
|
||||||
android:drawablePadding="4dp"
|
|
||||||
android:drawableLeft="?attr/audio"
|
|
||||||
android:drawableStart="?attr/audio"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View android:id="@+id/anchorLeft"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingTop="3dp"
|
|
||||||
android:paddingBottom="3dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:background="?attr/colorAccent"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:id="@+id/playlist_play_all_button">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/play_all"
|
|
||||||
android:textSize="@dimen/channel_rss_title_size"
|
|
||||||
android:textColor="?attr/colorAccent"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View android:id="@+id/anchorRight"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingTop="3dp"
|
|
||||||
android:paddingBottom="3dp"
|
|
||||||
android:clickable="false"
|
|
||||||
android:background="?attr/colorAccent"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:clickable="true"
|
|
||||||
android:focusable="true"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:id="@+id/playlist_play_popup_button">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="@string/controls_popup_title"
|
|
||||||
android:textSize="@dimen/channel_rss_title_size"
|
|
||||||
android:textColor="?attr/colorAccent"
|
|
||||||
android:drawablePadding="4dp"
|
|
||||||
android:drawableLeft="?attr/popup"
|
|
||||||
android:drawableStart="?attr/popup"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
|
@ -59,6 +59,8 @@
|
||||||
|
|
||||||
<!-- Playlist View Dimensions-->
|
<!-- Playlist View Dimensions-->
|
||||||
<dimen name="playlist_item_thumbnail_stream_count_width">60dp</dimen>
|
<dimen name="playlist_item_thumbnail_stream_count_width">60dp</dimen>
|
||||||
|
<dimen name="playlist_ctrl_height">50dp</dimen>
|
||||||
|
<dimen name="playlist_ctrl_seperator_margin">10dp</dimen>
|
||||||
<!-- Text Size -->
|
<!-- Text Size -->
|
||||||
<dimen name="playlist_item_title_text_size">14sp</dimen>
|
<dimen name="playlist_item_title_text_size">14sp</dimen>
|
||||||
<dimen name="playlist_detail_title_text_size">16sp</dimen>
|
<dimen name="playlist_detail_title_text_size">16sp</dimen>
|
||||||
|
|
Ładowanie…
Reference in New Issue