Skip to content

Instantly share code, notes, and snippets.

View mseroczynski's full-sized avatar

Michał Seroczyński mseroczynski

View GitHub Profile
@mseroczynski
mseroczynski / 1 ViewBindingDelegates.kt
Created November 2, 2021 15:34 — forked from gmk57/1 ViewBindingDelegates.kt
Kotlin delegates for Android View Binding with usage examples
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.viewbinding.ViewBinding
@mseroczynski
mseroczynski / Jenkinsfile
Created September 12, 2017 14:27 — forked from amaksoft/Jenkinsfile
My example Jenkins Pipeline setup for Android app project
#!/usr/bin/groovy
/*
* Copyright (c) 2016, Andrey Makeev <amaksoft@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
@mseroczynski
mseroczynski / parse.ino
Created March 16, 2017 22:55 — forked from krhoyt/parse.ino
Arduino Yun to Parse.com (Process, curl).
// Original:
// http://hypernephelist.com/2014/08/19/https_on_arduino_yun.html
// Libraries
#include <Process.h>
// Literals
// #define DEBUG
// Constants
@mseroczynski
mseroczynski / OnItemSelectedListener.java
Created February 17, 2017 15:34 — forked from andreynovikov/OnItemSelectedListener.java
Complete working solution for Android action bar tabs with fragments having separate back stack for each tab.
// Custom interface that enables communication between Fragment and its Activity
public interface OnItemSelectedListener
{
public void onItemSelected(String item);
}
@mseroczynski
mseroczynski / Firebase Database API Cheatsheet
Created January 12, 2017 14:09 — forked from odigity/Firebase Database API Cheatsheet
Firebase Database API Cheatsheet
There is no way to store an empty object/array/null value.
There are also no actual arrays. Array values get stored as objects with integer keys.
(If all keys are integers, it will be returned as an array.)
Basically, it's one giant tree of hashes with string keys.
Simply write a value to any location, and the intermediary locations will automatically come into existance.
── Classes ──
DataSnapshot : Container for a subtree of data at a particular location.
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21.
To use the support version of these attributes, remove the android namespace.
For instance, "android:colorControlNormal" becomes "colorControlNormal".
These attributes will be propagated to their corresponding attributes within the android namespace
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
@mseroczynski
mseroczynski / Channel.java
Created September 12, 2016 23:12 — forked from macsystems/Channel.java
If you want to parse an RSS Feed using SimpleXML you can use this as an Start. I used this to parse RSS using RetroFit from Square
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Namespace;
import org.simpleframework.xml.NamespaceList;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.Text;
import java.util.List;
@mseroczynski
mseroczynski / HomeActivity.kt
Created August 31, 2016 08:59 — forked from antoniolg/HomeActivity.kt
Snackbar extensions on Kotlin, to create a useful small DSL.
class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
setSupportActionBar(toolbar)
fab.setOnClickListener {
it.snack("Snack message") {
action("Action") { toast("Action clicked") }
@mseroczynski
mseroczynski / EachDirectoryPath.md
Created April 15, 2016 10:47 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories