package cz.lamorak.wordgame;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.TextView;

/**
 * Created by ondrej on 5.4.2017.
 */

public class GameActivity extends AppCompatActivity {

    private TextView countdown;
    private TextView wordOriginal;
    private TextView wordGuess;
    private Button wrongButton;
    private Button correctButton;

    public static void call(final Context context) {
        final Intent intent = new Intent(context, GameActivity.class);
        context.startActivity(intent);
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_game);

        countdown = (TextView) findViewById(R.id.countdown);
        wordOriginal = (TextView) findViewById(R.id.word_original);
        wordGuess = (TextView) findViewById(R.id.word_guess);
        correctButton = (Button) findViewById(R.id.button_correct);
        wrongButton = (Button) findViewById(R.id.button_wrong);
    }
}

@@ -268,16 +268,262 @@
 tView;%0A%0A
+import java.util.Collections;%0Aimport java.util.List;%0Aimport cz.lamorak.wordgame.model.Word;%0Aimport io.reactivex.android.schedulers.AndroidSchedulers;%0Aimport io.reactivex.disposables.CompositeDisposable;%0Aimport io.reactivex.schedulers.Schedulers;%0A
 /**%0A * C
@@ -612,16 +612,92 @@
 vity %7B%0A%0A
+    private CompositeDisposable disposables;%0A    private List%3CWord%3E words;%0A%0A
     priv
@@ -1195,16 +1195,66 @@
 game);%0A%0A
+        disposables = new CompositeDisposable();%0A%0A
         
@@ -1500,24 +1500,24 @@
 n_correct);%0A
-
         wron
@@ -1567,16 +1567,604 @@
 _wrong);
+%0A%0A        disposables.add(%0A                WordGameApp.getServiceProvider()%0A                        .getWordService()%0A                        .loadWords()%0A                        .doOnNext(Collections::shuffle)%0A                        .subscribeOn(Schedulers.io())%0A                        .observeOn(AndroidSchedulers.mainThread())%0A                        .subscribe(this::startGame)%0A        );%0A    %7D%0A%0A    @Override%0A    protected void onPause() %7B%0A        super.onPause();%0A        disposables.clear();%0A    %7D%0A%0A    private void startGame(final List%3CWord%3E words) %7B%0A        this.words = words;
 %0A    %7D%0A%7D

Implement word loading in game activity