Skip to content

Instantly share code, notes, and snippets.

View Foreman76's full-sized avatar
😀

Alexey Pozdniakov Foreman76

😀
View GitHub Profile
@Foreman76
Foreman76 / main.kt
Created February 5, 2021 06:29
reflect
package ru.int24.testreflection
import kotlin.reflect.full.memberProperties
import kotlin.reflect.full.primaryConstructor
data class DomenModel(
val id: Int = 1,
val name: String = "Alex",
val subName: String = "Pozdnyakov"
package ru.int24.ownbarbershop
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import retrofit2.HttpException
import ru.int24.ownbarbershop.models.domen.DomServices
import ru.int24.ownbarbershop.models.netresult.NetResult
import ru.int24.ownbarbershop.network.UseRetrofit
import ru.int24.ownbarbershop.network.getHeaders
import ru.int24.ownbarbershop.network.safeApiCall
package ru.int24.ownbarbershop
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import retrofit2.HttpException
import ru.int24.ownbarbershop.models.domen.DomServices
import ru.int24.ownbarbershop.models.netresult.NetResult
import ru.int24.ownbarbershop.network.UseRetrofit
import ru.int24.ownbarbershop.network.getHeaders
import ru.int24.ownbarbershop.network.safeApiCall
package ru.int24.scandm.adapters
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import ru.int24.scandm.R
import ru.int24.scandm.models.DBDocument
@Foreman76
Foreman76 / NetworkModule.kt
Created March 21, 2021 08:34
unsafeOkHTTP
package ru.int24.ownbarbershop.di
import android.os.Build
import dagger.Module
import dagger.Provides
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import ru.int24.ownbarbershop.config.DefConfig
package ru.int24.ownbarbershop
import android.os.Bundle
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.appcompat.app.ActionBar
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.NavHostFragment
package ru.int24.ownbarbershop.fragments.viewmodels
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import ru.int24.ownbarbershop.models.domen.DomSettings
import ru.int24.ownbarbershop.repositories.UsesCaseBaseRepositoryImpl
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/frameLayout9"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.RecordDetailFragment">
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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">
<androidx.fragment.app.FragmentContainerView
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}
android {
compileSdk 30