Skip to content

Instantly share code, notes, and snippets.

View drstranges's full-sized avatar
🎯
Focusing

Roman drstranges

🎯
Focusing
View GitHub Profile
@drstranges
drstranges / CustomTextInputLayout.java
Last active April 21, 2020 07:10
TextInputLayout temporary workaround for helper text showing
package com.example.d_rom.supportdesigndemo.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.support.design.widget.TextInputLayout;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorListenerAdapter;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.text.TextUtils;
public class HashtagEditText extends EditText implements TextWatcher {
private boolean isAddedListener = false;
public HashtagEditText(Context context) {
super(context);
registerListener();
}
public HashtagEditText(Context context, AttributeSet attrs) {
import android.content.SharedPreferences
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
import androidx.lifecycle.LiveData
class SharedPreferenceLiveData<T>(
val prefs: SharedPreferences,
val key: String,
val defaultValue: T,
val valueProvider: (prefs: SharedPreferences, key: String, defValue: T?) -> T?
) : LiveData<T>() {
@drstranges
drstranges / input.txt
Created September 24, 2019 18:00
Work time :)
4
15.01. 17:00
16.01. 12:00
11.02. 14:00
30.01. 10:00
@drstranges
drstranges / main.dart
Last active February 18, 2021 15:59
No scroll on add items on top of SliverList
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
/// This Widget is the main application widget.
class MyApp extends StatelessWidget {
static const String _title = 'No scroll on add items on top of SliverList';
@override
Widget build(BuildContext context) {