Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jephte Colin Draketheb4dass

🏠
Working from home
View GitHub Profile
View ObservableViewModel.kt
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View ConsumableDetailViewModel.kt
package com.jephtecolin.kwii.ui.consumable_detail
import androidx.databinding.Bindable
import androidx.databinding.Observable
import androidx.databinding.ObservableDouble
import androidx.databinding.PropertyChangeRegistry
import androidx.lifecycle.LiveData
import androidx.lifecycle.MediatorLiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
View ConsumableDetailFragment.kt
package com.jephtecolin.kwii.ui.consumable_detail
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.databinding.Observable
import androidx.databinding.ObservableDouble
View item_checkbox.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="toppings"
type="com.jephtecolin.model.Topping[]" />
<variable
name="listener"
type="com.jephtecolin.kwii.ui.custom.OnCheckedChangeListener" />
View CheckBoxGroupBindingAdapters.kt
package com.jephtecolin.kwii.util
import androidx.databinding.BindingAdapter
import androidx.databinding.InverseBindingAdapter
import androidx.databinding.InverseBindingListener
import com.jephtecolin.kwii.ui.custom.CheckBoxGroup
import com.jephtecolin.kwii.ui.custom.OnCheckedChangeListener
import com.jephtecolin.model.Topping
import timber.log.Timber
View CheckboxCustom.kt
package com.jephtecolin.kwii.ui.custom
import android.content.Context
import android.util.AttributeSet
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.appcompat.widget.AppCompatCheckBox
import androidx.appcompat.widget.AppCompatTextView
import com.jephtecolin.kwii.R
View CheckBoxGroup.kt
package com.jephtecolin.kwii.ui.custom
import android.content.Context
import android.util.AttributeSet
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.databinding.Bindable
import com.jephtecolin.kwii.R
import com.jephtecolin.kwii.util.TAG
import com.jephtecolin.model.Topping
@Draketheb4dass
Draketheb4dass / attribSelect.html
Created Dec 4, 2019
Dom manipulation attribute selector
View attribSelect.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Changing attributes</title>
<style>
p .animal {
color: red;
}
@Draketheb4dass
Draketheb4dass / attrStyle.html
Created Dec 4, 2019
Dom manipulation styling element
View attrStyle.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Changing styles</title>
<style>
p .animal {
color: red;
}
@Draketheb4dass
Draketheb4dass / findbyTagClass.html
Created Dec 4, 2019
Dom manipulation with getElementsByClassName
View findbyTagClass.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Finding multiple DOM elements by tag or class name</title>
</head>
<body>
<h1 id="heading">All about dogs</h1>