Skip to content

Instantly share code, notes, and snippets.

View Kiolk's full-sized avatar
🏠
Working from home

Yauheni Slizh Kiolk

🏠
Working from home
View GitHub Profile

Multiple modules

In order to add support for multiple modules:

  1. Add moxy-compiler dependency to each module that uses Moxy.
  2. In each library/subproject that uses a Moxy, you must add an annotation processor argument moxyReflectorPackage.
    For built-in annotationProcessor from gradle android plugin 2.2+:
    android {
        ...
        defaultConfig {
@FedericoPonzi
FedericoPonzi / big-o-java-collections.md
Last active December 30, 2023 18:05
Big O notation for java's collections

The book Java Generics and Collections has this information (pages: 188, 211, 222, 240).

List implementations:

                      get  add  contains next remove(0) iterator.remove
ArrayList             O(1) O(1) O(n)     O(1) O(n)      O(n)
LinkedList O(n) O(1) O(n) O(1) O(1) O(1)
@grennis
grennis / RoundedCornerLayout.java
Created April 22, 2016 14:00
Android Rounded Corner Layout
// This layout will display its children with rounded corners
// It works with Glide image library placeholders and animations
// It assumes your background is a solid color. If you need the corners to be truly transparent,
// this solution will not work for you.
package com.myapp.ui;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
@atoennis
atoennis / SomeFragment.java
Last active April 23, 2020 06:30
Solution to having nested scrolling within Android. In this scenario a multiline EditText resides within a root level ScrollView. In order to have scroll momentum, the EditText itself doesn't scroll but it is wrapped within a ScrollView.
// When the EditText is touched, disable touches on it's ScrollView's parents.
// Once the user lifts up their finger, enable touches on on the ScrollView's parents once again.
@OnTouch(R.id.edit_text)
boolean handleNoteFieldTouch(View v, MotionEvent event) {
v.getParent().getParent().requestDisallowInterceptTouchEvent(true);
switch (event.getAction() & MotionEvent.ACTION_MASK){
case MotionEvent.ACTION_UP:
v.getParent().getParent().requestDisallowInterceptTouchEvent(false);
break;