This file contains hidden or 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
| @Test | |
| public void testHappyCondition() { | |
| webServer.setDispatcher(new MockServerDispatcher().new RequestDispatcher()); | |
| activityRule.launchActivity(new Intent()); | |
| Espresso.onView(withId(R.id.progressBar2)).check(matches(not(isDisplayed()))); | |
| Espresso.onView(withId(R.id.button)).check(matches(not(isDisplayed()))); | |
| Espresso.onView(withId(R.id.textView)).check(matches(isDisplayed())); | |
| Espresso.onView(withId(R.id.errorView)).check(matches(not(isDisplayed()))); |
This file contains hidden or 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
| public class SingleObject { | |
| private static SingleObject instance; | |
| private SingleObject(){ | |
| } | |
| public static SingleObject getInstance(){ | |
| if(instance == null) | |
| instance = new SingleObject(); |
This file contains hidden or 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
| public class MainActivity extends AppCompatActivity { | |
| private Button mButton; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) | |
| { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
This file contains hidden or 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
| public class UserDatabase { | |
| private static UserDatabase db; | |
| private UserDatabase(String nameOfDb){ | |
| // create db here | |
| } | |
| public static UserDatabase getInstance(){ | |
| if(db == null) |
This file contains hidden or 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
| <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context=".MainActivity"> | |
| <Button | |
| android:id="@+id/button" | |
| android:layout_width="wrap_content" |
This file contains hidden or 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 MainActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| button.setOnClickListener { | |
| GlobalScope.launch(context = Dispatchers.Main) { | |
| println("launched coroutine 1") |
This file contains hidden or 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 MainActivity : AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| button.setOnClickListener { | |
| GlobalScope.launch(context = Dispatchers.Main) { | |
| println("launched coroutine 1") | |
| delay(5000) | |
| println("Here after a delay of 5 seconds") |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| import 'material_design_page.dart'; | |
| void main() => | |
| runApp( | |
| MaterialApp(home: MaterialDesignPage(),) | |
| ); |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| class MaterialDesignPage extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: Text("Material Design", textDirection: TextDirection.ltr), | |
| backgroundColor: Colors.green, | |
| actions: <Widget>[ |
This file contains hidden or 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
| syntax = "proto3"; | |
| package pingpong; | |
| message PingRequest { | |
| string ping = 1; | |
| } | |
| message PongResponse { | |
| string pong = 1; |