Skip to content

Instantly share code, notes, and snippets.


Mohammed Audhil Audhil

Block or report user

Report or block Audhil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Audhil /
Created Nov 24, 2019
to increase touch area of a view
RelativeLayout baseLayout;
Button delegate;
private void init() { Runnable() {
public void run() {
View somefile.kt
class MainActivity : AppCompatActivity() {
@Inject lateinit var info: Info
override fun onCreate(savedInstanceState: Bundle?) {
text_view.text = info.text
View AppRepositoryInjectTest.kt
class AppRepositoryInjectTest {
lateinit var appAPIs: AppAPIs
fun setUp() {
val component = DaggerTestAppComponent.builder()
View TestAppComponent.kt
modules = [
interface TestAppComponent : ApplicationComponent {
fun into(appRepositoryTest: AppRepositoryInjectNamedTest)
fun into(appRepositoryTest: AppRepositoryInjectTest)
fun into(baseTest: BaseTest)
View TestApplicationModule.kt
class TestApplicationModule(delegate: GDelegate) : ApplicationModule(delegate) {
override fun giveAppAPIs(): AppAPIs = mockk()
override fun giveRetrofitService(okHttpClient: OkHttpClient): AppAPIs = mockk()
override fun giveOkHttpClient(loggingInterceptor: HttpLoggingInterceptor): OkHttpClient = mockk()
override fun giveLoggingInterceptor(): HttpLoggingInterceptor = mockk()
View build.gradle
apply plugin: ''
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion rootProject.compileSdkVersion
View ApplicationComponent.kt
modules = [
interface ApplicationComponent {
fun inject(into: GDelegate)
fun inject(into: BaseRepository)
fun inject(into: BaseViewModel)
View ApplicationModule.kt
open class ApplicationModule(private val application: GDelegate) {
fun giveContext(): Context = this.application
fun givePackageManager(): PackageManager = application.packageManager
View someotherfile.kt
.enqueue(object : Callback<ResponseBody> {
override fun onFailure(call: Call<ResponseBody>, t: Throwable) {
println("---TTTT :: GET Throwable EXCEPTION:: " + t.message)
override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) {
if (response.isSuccessful) {
View somefile.kt
val jsonObj = JsonObject()
jsonObj.addProperty("title", "rhythm")
jsonObj.addProperty("singer", "meee")
jsonObj.addProperty("text", "Jack and jill went up the hill to fetch a pail of water!")
// POST demo
.enqueue(object : Callback<ResponseBody> {
You can’t perform that action at this time.