Exemplo n.º 1
0
 public void playFile(int paramInt)
 {
   int i = 1;
   if (paramInt < 0);
   FeedViewHolder localFeedViewHolder;
   SdkVideoView localSdkVideoView;
   String str;
   while (true)
   {
     return;
     View localView;
     try
     {
       SLog.i("Playing item: {}", Integer.valueOf(paramInt));
       localView = getViewAtPosition(paramInt);
       if (localView == null)
       {
         SLog.i("Item is not visible: {}", Integer.valueOf(paramInt));
         continue;
       }
     }
     finally
     {
     }
     localFeedViewHolder = (FeedViewHolder)localView.getTag();
     if (localFeedViewHolder != null)
       if ((!localFeedViewHolder.isVideoImageLoaded) && (localFeedViewHolder.hasVideoImage))
       {
         SLog.i("Waiting for video image to load: {}.", localFeedViewHolder.videoImageKey.url);
         bindVideoImage(localFeedViewHolder);
         bindAvatar(localFeedViewHolder);
         playCurrentPosition();
       }
       else
       {
         localSdkVideoView = localFeedViewHolder.videoView;
         if (localSdkVideoView != this.mLastPlayer)
         {
           SLog.i("Pause previous player.");
           pauseCurrentPlayer();
         }
         str = (String)this.mPaths.get(paramInt);
         if (str != null)
           break;
         SLog.i("Path was cleared.");
       }
   }
   if (!localSdkVideoView.isPathPlaying(str))
     if (SystemUtil.isSinglePlayerEnabled(this.mContext))
       if (SdkVideoView.getCurrentUri() != null)
         break label509;
   while (true)
   {
     label194: if (i == 0)
       refreshVideoView(paramInt, localFeedViewHolder);
     localSdkVideoView = localFeedViewHolder.videoView;
     localSdkVideoView.setMute(this.mMuted);
     if ((this.mNeedReleaseOtherPlayers) && (this.currentPlayerCount >= this.maxPlayer))
       releaseOtherPlayers(localFeedViewHolder.videoView);
     SLog.i("Start playing by set path.");
     localSdkVideoView.setTag(Long.valueOf(localFeedViewHolder.post.postId));
     Object[] arrayOfObject2 = new Object[1];
     arrayOfObject2[0] = Long.valueOf(localFeedViewHolder.post.postId);
     CrashUtil.log("Setting video path in feed for post {}", arrayOfObject2);
     localSdkVideoView.setVideoPath(str);
     if ((!localSdkVideoView.isSurfaceReady()) && (localSdkVideoView.getVisibility() != 0))
       localSdkVideoView.setVisibility(0);
     this.currentPlayerCount = (1 + this.currentPlayerCount);
     while (true)
     {
       localSdkVideoView.setPlayingPosition(paramInt);
       localFeedViewHolder.listener.setPosition(paramInt);
       if (localFeedViewHolder.imageListener != null)
         localFeedViewHolder.imageListener.setPosition(paramInt);
       this.mCurrentPlaying = paramInt;
       this.mLastPlayer = localSdkVideoView;
       break;
       if (localSdkVideoView.getPath() == null)
         break label194;
       i = 0;
       break label194;
       if (localFeedViewHolder.videoView.getVisibility() != 0)
         localFeedViewHolder.videoView.setVisibility(0);
       localSdkVideoView.setMute(this.mMuted);
       if (localSdkVideoView.isInPlaybackState())
       {
         SLog.i("Start playing by calling start.");
         localSdkVideoView.start();
       }
       else
       {
         SLog.i("Start playing by set path.");
         localSdkVideoView.setTag(Long.valueOf(localFeedViewHolder.post.postId));
         Object[] arrayOfObject1 = new Object[1];
         arrayOfObject1[0] = Long.valueOf(localFeedViewHolder.post.postId);
         CrashUtil.log("Setting video path in feed for post {}", arrayOfObject1);
         localSdkVideoView.setVideoPath(str);
       }
     }
     label509: i = 0;
   }
 }
Exemplo n.º 2
0
 private void bindView(FeedViewHolder paramFeedViewHolder)
 {
   final VinePost localVinePost = paramFeedViewHolder.post;
   int i = paramFeedViewHolder.position;
   if (shouldShowThumbnail(i))
   {
     SLog.d("Should show thumbnail... {} {}.", Integer.valueOf(i), Integer.valueOf(this.mCurrentPlaying));
     paramFeedViewHolder.videoLoadImage.setVisibility(0);
     paramFeedViewHolder.videoView.setVisibility(4);
   }
   bindAvatar(paramFeedViewHolder);
   bindVideoImage(paramFeedViewHolder);
   long l;
   if ((!paramFeedViewHolder.post.isExplicit()) || (this.mDismissedWarnings.contains(Integer.valueOf(i))))
   {
     paramFeedViewHolder.videoImage.setVisibility(0);
     if (localVinePost.repost == null)
       break label406;
     paramFeedViewHolder.revineContainer.setVisibility(0);
     paramFeedViewHolder.revineLine.setVisibility(0);
     l = localVinePost.repost.userId;
     if (l != this.mAppController.getActiveId())
       break label254;
     paramFeedViewHolder.revineLine.setText(this.mContext.getString(2131624262));
   }
   label153: label254: SpannableStringBuilder localSpannableStringBuilder2;
   label406: VineEntity localVineEntity1;
   label584: RelativeLayout localRelativeLayout1;
   label667: RelativeLayout localRelativeLayout2;
   label979: label1110: boolean bool1;
   while (true)
     if (!TextUtils.isEmpty(localVinePost.description))
     {
       paramFeedViewHolder.description.setVisibility(0);
       if ((localVinePost.transientEntities == null) && (localVinePost.entities != null))
       {
         localVinePost.transientEntities = new ArrayList();
         Iterator localIterator2 = localVinePost.entities.iterator();
         while (true)
           if (localIterator2.hasNext())
           {
             VineEntity localVineEntity2 = (VineEntity)localIterator2.next();
             localVinePost.transientEntities.add(localVineEntity2.clone());
             continue;
             paramFeedViewHolder.videoImage.setVisibility(4);
             break;
             if (localVinePost.repost.username != null)
             {
               Context localContext = this.mContext;
               Object[] arrayOfObject2 = new Object[1];
               arrayOfObject2[0] = localVinePost.repost.username;
               String str3 = localContext.getString(2131624261, arrayOfObject2);
               SpannableStringBuilder localSpannableStringBuilder3 = new SpannableStringBuilder(str3);
               StyledClickableSpan localStyledClickableSpan4 = new StyledClickableSpan(8, Long.valueOf(l), this.mSpanClickListener);
               int j = str3.indexOf(localVinePost.repost.username);
               if (j < 0)
                 j = 0;
               int k = localSpannableStringBuilder3.length();
               Util.safeSetSpan(localSpannableStringBuilder3, localStyledClickableSpan4, j, k, 33);
               paramFeedViewHolder.revineLine.setMovementMethod(LinkMovementMethod.getInstance());
               paramFeedViewHolder.revineLine.setText(localSpannableStringBuilder3);
               break label153;
             }
             paramFeedViewHolder.revineLine.setVisibility(8);
             break label153;
             paramFeedViewHolder.revineContainer.setVisibility(8);
             break label153;
           }
       }
       ArrayList localArrayList = localVinePost.transientEntities;
       if (localArrayList != null)
       {
         paramFeedViewHolder.description.setMovementMethod(LinkMovementMethod.getInstance());
         if (localVinePost.descriptionSb == null)
         {
           localVinePost.descriptionSb = new SpannableStringBuilder(localVinePost.description);
           localSpannableStringBuilder2 = localVinePost.descriptionSb;
           try
           {
             Util.adjustEntities(localArrayList, localSpannableStringBuilder2, 0, false);
             Iterator localIterator1 = localArrayList.iterator();
             while (localIterator1.hasNext())
             {
               localVineEntity1 = (VineEntity)localIterator1.next();
               if (!localVineEntity1.isUserType())
                 break label1296;
               StyledClickableSpan localStyledClickableSpan2 = new StyledClickableSpan(1, Long.valueOf(localVineEntity1.id), this.mSpanClickListener);
               localStyledClickableSpan2.setColor(this.mVineGreen);
               Util.safeSetSpan(localSpannableStringBuilder2, localStyledClickableSpan2, localVineEntity1.start, localVineEntity1.end, 33);
             }
           }
           catch (Exception localException)
           {
             CrashUtil.logException(localException);
           }
         }
         else
         {
           paramFeedViewHolder.description.setText(localVinePost.descriptionSb);
           Resources localResources = this.mContext.getResources();
           if ((localVinePost.venueData == null) || (TextUtils.isEmpty(localVinePost.venueData.venueName)))
             break label1380;
           paramFeedViewHolder.location.setText(localVinePost.venueData.venueName.toUpperCase());
           Drawable localDrawable = localResources.getDrawable(VineVenue.iconMap.get(localVinePost.venueData.displayType));
           paramFeedViewHolder.locationIcon.setImageDrawable(localDrawable);
           paramFeedViewHolder.locationContainer.setVisibility(0);
           paramFeedViewHolder.listener.setPosition(i);
           if (paramFeedViewHolder.imageListener != null)
             paramFeedViewHolder.imageListener.setPosition(i);
           String str1 = localVinePost.username;
           if (str1 == null)
           {
             str1 = "";
             CrashUtil.logException(new VineException("Invalid user name for post " + localVinePost.userId));
           }
           SpannableStringBuilder localSpannableStringBuilder1 = new SpannableStringBuilder(str1);
           Util.safeSetSpan(localSpannableStringBuilder1, this.mBoldSpan, 0, str1.length(), 33);
           StyledClickableSpan localStyledClickableSpan1 = new StyledClickableSpan(1, Long.valueOf(localVinePost.userId), this.mSpanClickListener);
           localStyledClickableSpan1.setColor(localResources.getColor(2131296374));
           Util.safeSetSpan(localSpannableStringBuilder1, localStyledClickableSpan1, 0, str1.length(), 33);
           ImageView localImageView = paramFeedViewHolder.userImage;
           View.OnClickListener local4 = new View.OnClickListener()
           {
             public void onClick(View paramAnonymousView)
             {
               ProfileActivity.start(FeedAdapter.this.mContext, localVinePost.userId, FeedAdapter.this.mFollowEventSource);
             }
           };
           localImageView.setOnClickListener(local4);
           paramFeedViewHolder.username.setMovementMethod(LinkMovementMethod.getInstance());
           paramFeedViewHolder.username.setText(localSpannableStringBuilder1);
           paramFeedViewHolder.timestamp.setText(Util.getRelativeTimeString(localResources, localVinePost.created, false));
           ImageButton localImageButton = paramFeedViewHolder.comment;
           View.OnClickListener local5 = new View.OnClickListener()
           {
             public void onClick(View paramAnonymousView)
             {
               FeedAdapter.this.mContext.startActivity(new Intent(FeedAdapter.this.mContext, CommentsActivity.class).putExtra("post_id", localVinePost.postId).putExtra("post_author_id", localVinePost.userId).putExtra("hide_keyboard", false));
             }
           };
           localImageButton.setOnClickListener(local5);
           localRelativeLayout1 = paramFeedViewHolder.likersContainer;
           localRelativeLayout2 = paramFeedViewHolder.commentsContainer;
           RelativeLayout localRelativeLayout3 = paramFeedViewHolder.compactLikesCommentsContainer;
           if (this.mCompactLikesComments)
             break label1429;
           localRelativeLayout3.setVisibility(8);
           if ((localVinePost.likes.items == null) || (localVinePost.likes.items.isEmpty()))
             break label1392;
           localRelativeLayout1.setVisibility(0);
           setStyledLikers(paramFeedViewHolder, localVinePost.likesCount, localVinePost.likes);
           setRevinersCount(paramFeedViewHolder);
           if ((localVinePost.comments.items == null) || (localVinePost.comments.items.isEmpty()))
             break label1419;
           localRelativeLayout2.setVisibility(0);
           setStyledComments(paramFeedViewHolder, localVinePost.comments);
           if (localVinePost.commentsCount <= 5)
             break label1402;
           paramFeedViewHolder.commentType = 2;
           Object[] arrayOfObject1 = new Object[1];
           arrayOfObject1[0] = Util.numberFormat(localResources, -5 + localVinePost.commentsCount);
           String str2 = localResources.getString(2131624382, arrayOfObject1);
           paramFeedViewHolder.olderCommentsContainer.setVisibility(0);
           paramFeedViewHolder.olderComments.setText(str2);
           RelativeLayout localRelativeLayout4 = paramFeedViewHolder.olderCommentsContainer;
           View.OnClickListener local6 = new View.OnClickListener()
           {
             public void onClick(View paramAnonymousView)
             {
               FeedAdapter.this.mContext.startActivity(new Intent(FeedAdapter.this.mContext, CommentsActivity.class).putExtra("post_id", localVinePost.postId).putExtra("post_author_id", localVinePost.userId).putExtra("hide_keyboard", true));
             }
           };
           localRelativeLayout4.setOnClickListener(local6);
           if (!this.mLikeCache.contains(localVinePost.postId))
             break label1449;
           bool1 = this.mLikeCache.isLike(localVinePost.postId);
           localVinePost.setFlagLiked(bool1);
           label1143: if (!bool1)
             break label1488;
           paramFeedViewHolder.liked.setImageResource(2130837714);
         }
       }
     }
   while (true)
   {
     paramFeedViewHolder.liked.setTag(Long.valueOf(localVinePost.postId));
     paramFeedViewHolder.liked.setOnClickListener(this.mViewClickListener);
     paramFeedViewHolder.more.setTag(localVinePost);
     paramFeedViewHolder.more.setOnClickListener(this.mViewClickListener);
     if ((localVinePost.userId != this.mAppController.getActiveId()) && (!localVinePost.isPrivate()))
       break label1501;
     paramFeedViewHolder.revine.setVisibility(8);
     initVideoView(i, paramFeedViewHolder);
     if ((!this.mFirstPlayed) && (i == 0) && (!localVinePost.isExplicit()))
     {
       play(0);
       if ((SLog.sLogsOn) && (this.mStartLoadingTime > 0L))
         SLog.i("Time since started loading to request 0th video to play: {}ms", Long.valueOf(timeSinceStartLoadingTime()));
       this.mFirstPlayed = true;
     }
     return;
     label1296: if (!localVineEntity1.isTagType())
       break;
     StyledClickableSpan localStyledClickableSpan3 = new StyledClickableSpan(4, localVineEntity1.title, this.mSpanClickListener);
     localStyledClickableSpan3.setColor(this.mVineGreen);
     Util.safeSetSpan(localSpannableStringBuilder2, localStyledClickableSpan3, localVineEntity1.start, localVineEntity1.end, 33);
     break;
     paramFeedViewHolder.description.setText(localVinePost.description);
     break label584;
     paramFeedViewHolder.description.setVisibility(8);
     break label584;
     label1380: paramFeedViewHolder.locationContainer.setVisibility(8);
     break label667;
     label1392: localRelativeLayout1.setVisibility(8);
     break label979;
     label1402: paramFeedViewHolder.olderCommentsContainer.setVisibility(8);
     paramFeedViewHolder.commentType = 1;
     break label1110;
     label1419: localRelativeLayout2.setVisibility(8);
     break label1110;
     label1429: setStyledCompactLikesComments(paramFeedViewHolder, localVinePost.likesCount, localVinePost.commentsCount, localVinePost.revinersCount);
     break label1110;
     label1449: bool1 = localVinePost.isLiked();
     if (bool1)
     {
       this.mLikeCache.like(localVinePost.postId);
       break label1143;
     }
     this.mLikeCache.unlike(localVinePost.postId);
     break label1143;
     label1488: paramFeedViewHolder.liked.setImageResource(2130837647);
   }
   label1501: paramFeedViewHolder.revine.setVisibility(0);
   boolean bool2;
   if (this.mRevineCache.contains(localVinePost.postId))
   {
     bool2 = this.mRevineCache.isRevined(localVinePost.postId);
     localVinePost.setFlagRevined(bool2);
     label1542: if (!bool2)
       break label1652;
     paramFeedViewHolder.revine.setImageResource(2130837684);
   }
   while (true)
   {
     paramFeedViewHolder.revine.setTag(localVinePost);
     paramFeedViewHolder.revine.setOnClickListener(this.mViewClickListener);
     break;
     if ((localVinePost.myRepostId > 0L) || (localVinePost.isRevined()));
     for (bool2 = true; ; bool2 = false)
     {
       if (!bool2)
         break label1638;
       this.mRevineCache.putMyRepostId(localVinePost.postId, localVinePost.myRepostId);
       this.mRevineCache.revine(localVinePost.postId);
       break;
     }
     label1638: this.mRevineCache.unRevine(localVinePost.postId);
     break label1542;
     label1652: paramFeedViewHolder.revine.setImageResource(2130837682);
   }
 }