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
blueprint: | |
name: ZHA - Philips Hue Dimmer Switch - V2 | |
description: | | |
Control lights with a Philips Hue Dimmer Switch. | |
The top "on" button behaviour is adjustable. By default it behaves like this: | |
- Press it while the light is off, and the light will turn on to the last set brightness. | |
- Press it again while the light is on, the light will turn to the fixed brightness setting. | |
Dim up/down buttons will change the brightness smoothly and can be pressed |
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 jvk.org.coderswag.adapters | |
import android.content.Context | |
import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.ImageView | |
import android.widget.TextView | |
import jvk.org.coderswag.R |
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 CategoryAdapter(private val context: Context, private val categories: List<Category>) : BaseAdapter() { | |
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View { | |
val categoryView : View | |
val holder : ViewHolder | |
if (convertView == null) { | |
categoryView = LayoutInflater.from(this.context).inflate(R.layout.category_list_item, null) | |
holder = ViewHolder() | |
holder.categoryImage = categoryView.findViewById(R.id.categoryImage) | |
holder.categoryName = categoryView.findViewById(R.id.categoryTitle) |
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 java.io.IOException; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; | |
import com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
public class PingPong { | |
public static void main(String[] args) throws Exception { |