package com.remax.visualnovel.extension

import android.content.Context
import kotlin.math.abs

/**
 * Created by HJW on 2022/9/27
 */

//计算滑动alpha 页面从屏幕顶部开始
internal fun Context.calculateScrollerAlpha(offset: Int, height: Int) = calculateScrollerAlphaFromToolbar(offset, getFullScrollerTopHeight(height))

//计算滑动alpha 页面从导航栏下方开始
internal fun calculateScrollerAlphaFromToolbar(offset: Int, height: Int) = abs(offset.toFloat() / height.toFloat())

