Skip to content

Instantly share code, notes, and snippets.

<?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
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;
}
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]>]?
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()
@FabianTerhorst
FabianTerhorst / vue-draggable-resizable.vue
Last active July 7, 2020 17:14 — forked from dvago/vue-draggable-resizable.vue
Vue Draggable Resizable - Body limits
<template>
<div
:style="style"
:class="[{
[classNameActive]: enabled,
[classNameDragging]: dragging,
[classNameResizing]: resizing,
[classNameDraggable]: draggable,
[classNameResizable]: resizable
}, className]"
{"device":[{"id":100,"name":"Heizung","subtype":"heating","roomid":6,"productid":855,"protocol":"max","states":{"batteryboolean":"battery-ok","temperature":14.2,"temperaturetarget":14,"valve":10},"statedefinitions":{"batteryboolean":{"key":"batteryboolean","type":"options","thresholdable":false,"graphGroupName":"","triggerable":false,"unitkey":"","translatable":true,"options":["battery-ok","battery-low"]},"temperature":{"key":"temperature","type":"float","thresholdable":true,"graphGroupName":"primary","triggerable":false,"unitkey":"celsius","translatable":false,"options":[]},"temperaturetarget":{"key":"temperaturetarget","type":"float","thresholdable":false,"graphGroupName":"primary","triggerable":false,"unitkey":"celsius","translatable":false,"options":[]},"valve":{"key":"valve","type":"float","thresholdable":true,"graphGroupName":"second","triggerable":false,"unitkey":"percent","translatable":false,"options":[]}},"gatewayid":99,"lastafterseconds":30,"lastdelayseconds":30,"ts":{"i":1662651658001453000,"laste