This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.novoda.espresso"> | |
<!-- For espresso testing purposes, this is removed in live builds, but not in dev builds --> | |
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE" /> | |
<!-- ... --> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# From: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository | |
export DEBIAN_FRONTEND=noninteractive | |
echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes | |
sudo apt-get update | |
sudo apt-get install \ | |
apt-transport-https \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.novoda.espresso; | |
import android.os.SystemClock; | |
import android.test.ActivityInstrumentationTestCase2; | |
import com.mypackage.EntryPointActivity; | |
public class EspressoInstrumentationTestCase extends ActivityInstrumentationTestCase2<EntryPointActivity> { | |
private SystemAnimations systemAnimations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _ViewModel { | |
final String pageTitle; | |
final List<_ItemViewModel> items; | |
final Function onNewItem; | |
final String newItemToolTip; | |
_ViewModel(this.pageTitle, this.items, this.onNewItem, this.newItemToolTip, this.newItemIcon); | |
factory _ViewModel.create(Store<AppState> store) { | |
List<_ItemViewModel> items = store.state.toDos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DisplayListWithNewItemAction {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AppState appReducer(AppState state, action) => AppState(toDoListReducer(state.toDos, action), listStateReducer(state.listState, action)); | |
final Reducer<List<ToDoItem>> toDoListReducer = // Boilerplate ignored | |
final Reducer<ListState> listStateReducer = combineReducers<ListState>([ | |
TypedReducer<ListState, DisplayListOnlyAction>(_displayListOnly), | |
TypedReducer<ListState, DisplayListWithNewItemAction>(_displayListWithNewItem), | |
]); | |
ListState _displayListOnly(ListState listState, DisplayListOnlyAction action) => ListState.listOnly; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ToDoListPage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => StoreConnector<AppState, _ViewModel>( | |
converter: (Store<AppState> store) => _ViewModel.create(store), | |
builder: (BuildContext context, _ViewModel viewModel) => Scaffold( | |
appBar: AppBar( | |
title: Text(viewModel.pageTitle), | |
), | |
body: ListView(children: viewModel.items.map((_ItemViewModel item) => _createWidget(item)).toList()), | |
floatingActionButton: FloatingActionButton( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppState { | |
final List<ToDoItem> toDos; | |
final ListState listState; | |
AppState(this.toDos, this.listState); | |
factory AppState.initial() => AppState(List.unmodifiable([]), ListState.listOnly); | |
} | |
enum ListState { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() => runApp(ToDoListApp()); | |
class ToDoListApp extends StatelessWidget { | |
final Store<AppState> store = Store<AppState>( | |
appReducer, /* Function defined in the reducers file */ | |
initialState: AppState.initial(), | |
middleware: createStoreMiddleware(), | |
); | |
@override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
048065b862d831ce6162907fd624ecdf97a91ea30a19a327263d19e2bb687812d2450bfc639ae6ab5d453c14e112869cbc6b8aa972890a6c6b854fd3c6938b3db5 |
NewerOlder