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 android.view.View; | |
import androidx.annotation.IdRes; | |
import androidx.test.espresso.UiController; | |
import androidx.test.espresso.ViewAction; | |
import org.hamcrest.Matcher; | |
public class ClickChildViewWithId implements ViewAction { |
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 java.util.Scanner; | |
public class HelloWorld { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int nbEntry = scanner.nextInt(); | |
Rectangle smallYellow = new Rectangle(25, 50, 20, 45); |
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
@NonNull | |
private String mapPhotoReference(@NonNull String photoReference) { | |
//noinspection SpellCheckingInspection | |
return "https://maps.googleapis.com/maps/api/place/photo?maxwidth=1080" | |
+ "&photoreference=" + photoReference | |
+ "&key=" + BuildConfig.GOOGLE_PLACES_KEY; | |
} |
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 androidx.annotation.NonNull; | |
import androidx.lifecycle.ViewModel; | |
import androidx.lifecycle.ViewModelProvider; | |
import java.time.Clock; | |
import fr.delcey.mareu.domain.MeetingRepository; | |
import fr.delcey.mareu.ui.create.CreateMeetingViewModel; | |
import fr.delcey.mareu.ui.meetings.MeetingViewModel; |
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
private void initMeetingsRecyclerView() { | |
final MeetingAdapter adapter = new MeetingAdapter(this); | |
RecyclerView recyclerView = findViewById(R.id.meeting_rv); | |
recyclerView.setLayoutManager(new LinearLayoutManager(this)); | |
recyclerView.setAdapter(adapter); | |
viewModel.getMeetingModelsLiveData().observe(this, meetingModels -> adapter.submitList(meetingModels)); | |
} |
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
<activity | |
android:name=".view.dispatcher.DispatcherActivity" | |
android:theme="@style/Theme.Go4Lunch.NoActionBar.Transparent"> | |
<intent-filter> | |
<action android:name="android.intent.action.MAIN" /> | |
<category android:name="android.intent.category.LAUNCHER" /> | |
</intent-filter> | |
</activity> |
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 kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.test.TestCoroutineDispatcher | |
import kotlinx.coroutines.test.TestCoroutineScope | |
import kotlinx.coroutines.test.resetMain | |
import kotlinx.coroutines.test.runBlockingTest | |
import kotlinx.coroutines.test.setMain | |
import org.junit.rules.TestRule | |
import org.junit.runner.Description | |
import org.junit.runners.model.Statement |
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 android.view.View; | |
import androidx.recyclerview.widget.RecyclerView; | |
import androidx.test.espresso.NoMatchingViewException; | |
import androidx.test.espresso.ViewAssertion; | |
import static org.hamcrest.MatcherAssert.assertThat; | |
import static org.hamcrest.Matchers.is; | |
public class RecyclerViewItemCountAssertion implements ViewAssertion { |
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 kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.test.TestCoroutineDispatcher | |
import kotlinx.coroutines.test.TestCoroutineScope | |
import kotlinx.coroutines.test.resetMain | |
import kotlinx.coroutines.test.runBlockingTest | |
import kotlinx.coroutines.test.setMain | |
import org.junit.rules.TestRule | |
import org.junit.runner.Description | |
import org.junit.runners.model.Statement |
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 NearbyRestaurantsRepository { | |
private static final String TYPE = "restaurant"; | |
// Round the GPS coordinate to avoid re-querying Google for a position that would be only a few meters away | |
private static final int GPS_SCALE = 2; | |
@NonNull | |
private final NearbyRestaurantsApi nearbyRestaurantsApi; |