This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle | |
import android.os.Parcelable | |
import android.support.v7.widget.RecyclerView | |
/** | |
* We have to handle restoring a recyclerviews scroll position oneself. | |
* Add a extension field so we don't have to handle the key ourselves anymore | |
* Add a post to avoid some bug where recyclerview does not restore scroll position | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Intent | |
import android.os.Bundle | |
import android.os.Parcelable | |
import java.io.Serializable | |
/** | |
* Intent(context, MyActivity::class.java).withExtras( | |
* KEY_HOGE to "hoge", | |
* KEY_FOO to "foo" | |
* ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.app; | |
import android.view.MotionEvent; | |
import android.view.View; | |
public final class SelectorTouchListener implements View.OnTouchListener { | |
@Override | |
public boolean onTouch(View v, MotionEvent event) { | |
switch (event.getAction()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.util.AttributeSet; | |
import android.widget.ImageView; | |
/** | |
* Created by Eoin Fogarty on 2015/11/06. | |
* | |
* Clamps an image ratio |