Skip to content

Instantly share code, notes, and snippets.

Tomasz tmaxxdd

Block or report user

Report or block tmaxxdd

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 dbl.xml
<TextView android:layout_width="wrap_content"
android:text="@{user.firstName}" />
import com.jakewharton.rxbinding.view.RxView;
Button button = (Button) findViewById(;
.subscribe(aVoid -> {
//Perform some work here//
View anko.kt
// Same as findViewById() but simpler to use
val name = find<TextView>(
name.hint = "Enter your name"
name.onClick { /*do something*/ }
View dsl.kt
verticalLayout {
val name = editText()
button("Say Hello") {
onClick { toast("Hello, ${name.text}!") }
class ExampleActivity extends Activity {
@BindView( EditText username;
@BindView( EditText password;
@BindString(R.string.login_error) String loginErrorMessage;
@OnClick( void submit() {
// TODO call server...
View ext_fun_bind.kt
//Import all layout*
final EditText name = (EditText) v.findViewById(;
//Create a TextWatcher and specify that this TextWatcher should be called whenever the EditText’s content changes//
name.addTextChangedListener(new TextWatcher() {
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
public void onTextChanged(CharSequence s, int start, int before, int count) {
//Perform some work//
View firebase_read.kt
//Get path to data according to selected tab
val databaseRef = FirebaseDatabase.getInstance().getReference(ref)
val topics = ArrayList<Topic>()
databaseRef.orderByChild("index").addValueEventListener(object : ValueEventListener {
override fun onDataChange(data: DataSnapshot) {
In the database a child contains more fields
than Topic model. So we have to choose which one we want to match.
View firebase_rules.json
// Simple rules that allow everyone to fetch the data
// and change it only by admin.
"rules": {
".read": true,
".write": false
View firebase_db_init.kt
// This is a reference to the project (root)
// Here you can manage state and logging
val database = FirebaseDatabase.getInstance()
// This is a reference to the specific data.
// Here you can work with your informations.
val myRef = database.getReference("fajne-koty")
You can’t perform that action at this time.