add channel avatar
This commit is contained in:
parent
f3a73ecc4a
commit
c03b106118
4 changed files with 49 additions and 0 deletions
|
@ -129,6 +129,8 @@ public class ChannelActivity extends AppCompatActivity {
|
|||
ImageView channelBanner = (ImageView) findViewById(R.id.channel_banner_image);
|
||||
View channelContentView = (View) findViewById(R.id.channel_content_view);
|
||||
FloatingActionButton feedButton = (FloatingActionButton) findViewById(R.id.channel_rss_fab);
|
||||
ImageView avatarView = (ImageView) findViewById(R.id.channel_avatar_view);
|
||||
ImageView haloView = (ImageView) findViewById(R.id.channel_avatar_halo);
|
||||
|
||||
progressBar.setVisibility(View.GONE);
|
||||
channelContentView.setVisibility(View.VISIBLE);
|
||||
|
@ -142,6 +144,13 @@ public class ChannelActivity extends AppCompatActivity {
|
|||
new FailedThumbnailListener(info.service_id));
|
||||
}
|
||||
|
||||
if(info.avatar_url != null && !info.avatar_url.isEmpty()) {
|
||||
avatarView.setVisibility(View.VISIBLE);
|
||||
haloView.setVisibility(View.VISIBLE);
|
||||
imageLoader.displayImage(info.avatar_url, avatarView,
|
||||
new FailedThumbnailListener(info.service_id));
|
||||
}
|
||||
|
||||
if(info.feed_url != null && !info.feed_url.isEmpty()) {
|
||||
feedButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
|
13
app/src/main/res/drawable/white_circle.xml
Normal file
13
app/src/main/res/drawable/white_circle.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
|
||||
<solid
|
||||
android:color="@android:color/white"/>
|
||||
|
||||
<size
|
||||
android:height="@dimen/channel_avatar_halo_size"
|
||||
android:width="@dimen/channel_avatar_halo_size"/>
|
||||
|
||||
</shape>
|
|
@ -24,6 +24,7 @@
|
|||
app:statusBarScrim="@color/light_youtube_dark_color"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/channel_banner_image"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -33,6 +34,30 @@
|
|||
android:background="@color/light_youtube_dark_color"
|
||||
app:layout_collapseMode="parallax" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/channel_avatar_halo"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="28dp"
|
||||
android:layout_marginStart="28dp"
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:src="@drawable/white_circle"/>
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/channel_avatar_view"
|
||||
android:visibility="gone"
|
||||
android:layout_width="@dimen/channel_avatar_size"
|
||||
android:layout_height="@dimen/channel_avatar_size"
|
||||
android:src="@drawable/buddy"
|
||||
android:layout_marginLeft="30dp"
|
||||
android:layout_marginStart="30dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"/>
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/cannel_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
<dimen name="video_item_detail_uploader_image_size">50dp</dimen>
|
||||
<dimen name="video_item_detail_like_image_height">18sp</dimen>
|
||||
<dimen name="video_item_detail_like_image_width">18sp</dimen>
|
||||
<dimen name="channel_avatar_size">70dp</dimen>
|
||||
<dimen name="channel_avatar_halo_size">74dp</dimen>
|
||||
<!-- Paddings & Margins -->
|
||||
<dimen name="video_item_detail_like_margin">6sp</dimen>
|
||||
<dimen name="video_item_detail_play_fab_margin">20dp</dimen>
|
||||
|
|
Loading…
Reference in a new issue