(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import android.content.ContentUris; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.net.Uri; |
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="de.mobilej.overlay" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk android:minSdkVersion="14" /> | |
<application android:label="SystemOverlay" > | |
<activity |
package noman.counterhelper; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.TextView; | |
/** | |
* Created by Noman on 11/8/2016. | |
*/ |
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
class ExampleViewModel @ViewModelInject constructor( | |
private val someUseCase: SomeUseCase, | |
@Assisted private val savedStateHandle: SavedStateHandle | |
) : ViewModel() { | |
} |
import androidx.hilt.Assisted | |
import androidx.hilt.lifecycle.ViewModelInject | |
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.SavedStateHandle | |
import androidx.lifecycle.ViewModel | |
class ExampleViewModel @ViewModelInject constructor( | |
private val someUseCase: SomeUseCase, | |
@Assisted private val savedStateHandle: SavedStateHandle | |
) : ViewModel() { |
class ExampleFragment: Fragment(){ | |
val args by navArgs<ExampleFragmentArgs>() | |
//If we don't use Hilt, then create factory for each ViewModel and pass arguments | |
// Which is even worse | |
val viewModel by viewModels<ExampleViewModel> { | |
InjectorUtils.provideExampleViewModelFactory(args.argumentA, args.argumentB) | |
} | |
} |