Skip to content

Instantly share code, notes, and snippets.

View NinoDLC's full-sized avatar

Nino NinoDLC

  • Lyon, France
View GitHub Profile
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 {
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);
@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;
}
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;
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));
}
@NinoDLC
NinoDLC / AndroidManifest.xml
Created March 3, 2021 17:17
DispatcherActivity
<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>
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
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 {
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
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;