Skip to content

Instantly share code, notes, and snippets.

Fabian Terhorst FabianTerhorst

Block or report user

Report or block FabianTerhorst

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CollectionJsonAdapter.kt
package de.everhome.sdk.json
abstract class CollectionJsonAdapter<C : MutableCollection<T>, T>(private val elementAdapter: JsonAdapter<T>) : JsonAdapter<C>() {
override fun fromJson(reader: JsonReader): C? {
if (reader.peek() != Token.BEGIN_ARRAY) {
reader.skipValue()
return null
}
val result = newCollection()
View NestedVerticalCellCollectionViewLayout.swift
open class NestedVerticalCellCollectionViewLayout<V: LayoutAdapterCollectionView, C: Collection>: BaseLayout<V>, ConfigurableLayout where C.Iterator.Element == Layout {
private let sectionLayouts: [Section<C>]
public init(sectionLayouts: [Section<C>], alignment: Alignment = .topFill, viewReuseId: String? = nil, config: ((V) -> Void)? = nil) {
self.sectionLayouts = sectionLayouts
super.init(alignment: alignment, flexibility: Flexibility(horizontal: nil, vertical: Flexibility.defaultFlex), viewReuseId: viewReuseId, config: config)
}
private var cachedSectionLayoutMeasurement: [Section<[LayoutMeasurement]>]?
View FloatingActionButtonBehavior.java
public class FloatingActionButtonBehavior extends CoordinatorLayout.Behavior<FloatingActionButton> {
public FloatingActionButtonBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean layoutDependsOn(CoordinatorLayout parent, FloatingActionButton child, View dependency) {
return dependency instanceof Snackbar.SnackbarLayout;// || dependency instanceof RecyclerView;
}
View Layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/md_white_1000"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
You can’t perform that action at this time.