forked from recloudstream/cloudstream
		
	voiceactors and fixed flowlayout
This commit is contained in:
		
							parent
							
								
									0c5f223acb
								
							
						
					
					
						commit
						6d97ac1b82
					
				
					 2 changed files with 24 additions and 6 deletions
				
			
		|  | @ -343,6 +343,18 @@ class AniListApi(index: Int) : AccountManager(index), SyncAPI { | ||||||
|                        characters(sort: ROLE page: 1 perPage: 20) { |                        characters(sort: ROLE page: 1 perPage: 20) { | ||||||
|                            edges { |                            edges { | ||||||
|                                role |                                role | ||||||
|  |                                voiceActors { | ||||||
|  |                                    name { | ||||||
|  |                                        userPreferred | ||||||
|  |                                        full | ||||||
|  |                                        native | ||||||
|  |                                    } | ||||||
|  |                                    age | ||||||
|  |                                    image { | ||||||
|  |                                        large | ||||||
|  |                                        medium | ||||||
|  |                                    } | ||||||
|  |                                } | ||||||
|                                node { |                                node { | ||||||
|                                    name { |                                    name { | ||||||
|                                        userPreferred |                                        userPreferred | ||||||
|  |  | ||||||
|  | @ -8,7 +8,7 @@ import com.lagradost.cloudstream3.R | ||||||
| import kotlin.math.max | import kotlin.math.max | ||||||
| 
 | 
 | ||||||
| class FlowLayout : ViewGroup { | class FlowLayout : ViewGroup { | ||||||
|     var itemSpacing : Int = 0 |     var itemSpacing: Int = 0 | ||||||
| 
 | 
 | ||||||
|     constructor(context: Context?) : super(context) |     constructor(context: Context?) : super(context) | ||||||
| 
 | 
 | ||||||
|  | @ -36,7 +36,7 @@ class FlowLayout : ViewGroup { | ||||||
|             val childHeight = child.measuredHeight |             val childHeight = child.measuredHeight | ||||||
| 
 | 
 | ||||||
|             //check if child can be placed in the current row, else go to next line |             //check if child can be placed in the current row, else go to next line | ||||||
|             if (currentChildHookPointx + childWidth > realWidth) { |             if (currentChildHookPointx + childWidth > realWidth && i + 1 < childCount) { | ||||||
|                 //new line |                 //new line | ||||||
|                 currentWidth = max(currentWidth, currentChildHookPointx) |                 currentWidth = max(currentWidth, currentChildHookPointx) | ||||||
| 
 | 
 | ||||||
|  | @ -44,7 +44,8 @@ class FlowLayout : ViewGroup { | ||||||
|                 currentChildHookPointx = 0 |                 currentChildHookPointx = 0 | ||||||
|                 currentChildHookPointy += childHeight |                 currentChildHookPointy += childHeight | ||||||
|             } |             } | ||||||
|             val nextChildHookPointx = currentChildHookPointx + childWidth + if(childWidth == 0) 0 else itemSpacing |             val nextChildHookPointx = | ||||||
|  |                 currentChildHookPointx + childWidth + if (childWidth == 0) 0 else itemSpacing | ||||||
|             val nextChildHookPointy = currentChildHookPointy |             val nextChildHookPointy = currentChildHookPointy | ||||||
|             currentHeight = max(currentHeight, currentChildHookPointy + childHeight) |             currentHeight = max(currentHeight, currentChildHookPointy + childHeight) | ||||||
|             val lp = child.layoutParams as LayoutParams |             val lp = child.layoutParams as LayoutParams | ||||||
|  | @ -54,8 +55,10 @@ class FlowLayout : ViewGroup { | ||||||
|             currentChildHookPointy = nextChildHookPointy |             currentChildHookPointy = nextChildHookPointy | ||||||
|         } |         } | ||||||
|         currentWidth = max(currentChildHookPointx, currentWidth) |         currentWidth = max(currentChildHookPointx, currentWidth) | ||||||
|         setMeasuredDimension(resolveSize(currentWidth, widthMeasureSpec), |         setMeasuredDimension( | ||||||
|             resolveSize(currentHeight, heightMeasureSpec)) |             resolveSize(currentWidth, widthMeasureSpec), | ||||||
|  |             resolveSize(currentHeight, heightMeasureSpec) | ||||||
|  |         ) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     override fun onLayout(b: Boolean, left: Int, top: Int, right: Int, bottom: Int) { |     override fun onLayout(b: Boolean, left: Int, top: Int, right: Int, bottom: Int) { | ||||||
|  | @ -73,7 +76,10 @@ class FlowLayout : ViewGroup { | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     override fun generateDefaultLayoutParams(): LayoutParams { |     override fun generateDefaultLayoutParams(): LayoutParams { | ||||||
|         return LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) |         return LayoutParams( | ||||||
|  |             ViewGroup.LayoutParams.WRAP_CONTENT, | ||||||
|  |             ViewGroup.LayoutParams.WRAP_CONTENT | ||||||
|  |         ) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     override fun generateLayoutParams(p: ViewGroup.LayoutParams): LayoutParams { |     override fun generateLayoutParams(p: ViewGroup.LayoutParams): LayoutParams { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue