This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.omarkrostom.arclayoutmanager | |
import android.content.Context | |
import android.view.ViewGroup.LayoutParams.MATCH_PARENT | |
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT | |
import androidx.recyclerview.widget.RecyclerView | |
import kotlin.math.* | |
class ArcLayoutManager( | |
private val context: Context, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun fill(recycler: RecyclerView.Recycler?, state: RecyclerView.State?) { | |
detachAndScrapAttachedViews(recycler ?: return) | |
for (itemIndex in 0 until itemCount) { | |
val view = recycler.getViewForPosition(itemIndex) | |
addView(view) | |
val viewWidth = pxFromDp(context, ITEM_WIDTH) | |
val viewHeight = pxFromDp(context, ITEM_HEIGHT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArcLayoutManager( | |
private val context: Context, | |
private var horizontalOffset: Int = 0 | |
) : RecyclerView.LayoutManager() { | |
override fun generateDefaultLayoutParams(): RecyclerView.LayoutParams = | |
RecyclerView.LayoutParams(MATCH_PARENT, WRAP_CONTENT) | |
override fun canScrollHorizontally(): Boolean = true | |
override fun scrollHorizontallyBy( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.omarkrostom.arclayoutmanager | |
import android.view.ViewGroup | |
import androidx.recyclerview.widget.RecyclerView | |
class ArcLayoutManager: RecyclerView.LayoutManager() { | |
override fun generateDefaultLayoutParams(): RecyclerView.LayoutParams = | |
RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun computeYComponent(viewCenterX: Float, | |
h: Float): Pair<Int, Double> { | |
val screenWidth = context.resources.displayMetrics.widthPixels | |
val s = screenWidth.toDouble() / 2 | |
val radius = (h * h + s * s) / (h * 2) | |
val xScreenFraction = viewCenterX.toDouble() / screenWidth.toDouble() | |
val beta = acos(s / radius) | |
val alpha = beta + (xScreenFraction * (Math.PI - (2 * beta))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok | |
nginx: configuration file /etc/nginx/nginx.conf test is successful | |
# configuration file /etc/nginx/nginx.conf: | |
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
include /etc/nginx/modules-enabled/*.conf; | |
events { | |
worker_connections 768; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.animation.ArgbEvaluator | |
import android.content.Context | |
import android.graphics.ColorMatrix | |
import android.graphics.ColorMatrixColorFilter | |
import android.util.AttributeSet | |
import android.util.Log | |
import android.view.View | |
import android.widget.ImageView | |
import android.widget.TextView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.omarkrostom.arclayoutmanager | |
import android.content.Context | |
import android.view.ViewGroup.LayoutParams.MATCH_PARENT | |
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT | |
import androidx.recyclerview.widget.RecyclerView | |
import kotlin.math.* | |
class ArcLayoutManager( | |
private val context: Context, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here is {MY_APP_BETA} configuration file | |
default_platform(:android) | |
platform :android do | |
desc "Submit a new {MY_APP_BETA} Build to Crashlytics" | |
lane :{MY_APP_BETA} do | |
gradle(task: "clean assemble{MY_APP_BETA}") | |
firebase_app_distribution( | |
app: "{REPLACE_WITH_FIREBASE_API_KEY_FOR_YOUR_PROJET}" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2.1 | |
references: | |
#Android Configuration Block | |
android_config: &android_config | |
working_directory: ~/{MY-APP} | |
docker: | |
- image: circleci/android:api-29 | |
environment: | |
_JAVA_OPTIONS: -Xmx2048m -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap | |
GRADLE_OPTS: -Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dorg.gradle.caching=true -Dorg.gradle.configureondemand=true -Dkotlin.compiler.execution.strategy=in-process -Dkotlin.incremental=false |
NewerOlder