Skip to content

Instantly share code, notes, and snippets.

View NinoDLC's full-sized avatar

Nino NinoDLC

  • Lyon, France
View GitHub Profile
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import android.view.View;
import androidx.annotation.IdRes;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import androidx.test.espresso.NoMatchingViewException;
import androidx.test.espresso.ViewAssertion;
private List<MainUiModel> sortAndFilterMeetings(
@Nullable List<Meeting> meetings,
@Nullable Map<Room, Boolean> selectedRooms
) {
List<MainUiModel> result = new ArrayList<>();
if (meetings == null || selectedRooms == null) {
return result;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
mBottomNavigationBar = findViewById(R.id.main_bottom_navigation_menu);
setupBottomNavigationBar();
Toolbar toolbar = findViewById(R.id.main_toolbar);
setSupportActionBar(toolbar);
mDrawer = findViewById(R.id.main_drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,
mDrawer,
toolbar,
R.string.navigation_drawer_open,
R.string.navigation_drawer_close);
mDrawer.addDrawerListener(toggle);
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
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:id="@+id/main_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
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:id="@+id/main_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
>
package fr.delcey.p5.pojo.query;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "fr.delcey.p5"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
private NYTimesService() {
HttpLoggingInterceptor loggerInterceptor = new HttpLoggingInterceptor();
loggerInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(loggerInterceptor)
.addInterceptor(new Interceptor() {
@NonNull
@Override
public Response intercept(@NonNull Chain chain) throws IOException {
Request request = chain.request();