목록전체 글 (1350)
오늘도 공부
Retrofit 사용시 NumberformatException 발생시.. 간혹 숫자로 변환시 빈값으로 들어오는 경우 뱉는 오류 중 하나가 NumberformatException 이다. 이럴경우 Adapter를 하나 등록하면 된다. public class EmptyStringToNumberTypeAdapter extends TypeAdapter { @Override public void write(JsonWriter jsonWriter, Number number) throws IOException { if (number == null) { jsonWriter.nullValue(); return; } jsonWriter.value(number); } @Override public Number read(Jso..
출처 : http://www.cnblogs.com/zhaoyanjun/p/5535651.htmlButton 防抖处理 button = (Button) findViewById( R.id.bt ) ; RxView.clicks( button ) .throttleFirst( 2 , TimeUnit.SECONDS ) //两秒钟之内只取一个点击事件,防抖操作 .subscribe(new Action1() { @Override public void call(Void aVoid) { Toast.makeText(MainActivity.this, "点击了", Toast.LENGTH_SHORT).show(); } }) ; 按钮的长按时间监听 button = (Button) findViewById( R.id.bt ) ; //监听长按时..
Rx CheetSheet] 다중 터치 방지하기 - throttleFirst() http://kunny.github.io/tip/rx/2016/04/08/rx_cheatsheet_throttle_first/
http://eyeahs.github.io/rxjava/blog/2016/10/11/rxjava-wiki-backpressure/
출처 : http://beust.com/weblog/2015/06/01/easy-sqlite-on-android-with-rxjava/Easy SQLite on Android with RxJavaWhenever I consider using an ORM library on my Android projects, I always end up abandoning the idea and rolling my own layer instead for a few reasons:My database models have never reached the level of complexity that ORM’s help with.Every ounce of performance counts on Android and I can..
https://github.com/amitshekhariitbhu/RxJava2-Android-Sampleshttps://github.com/kaushikgopal/RxJava-Android-Samples
Do these modifications to your animation files:enter.xml: exit.xml: You'll have your second activity sliding in from right to the left.For a better understadnig on how to play around with the fromXDelta and toXDelta values for the animations, here is a very basic illustration on the values: This way you can easily understand why you add android:fromXDelta="0%" and android:toXDelta="-100%" for yo..
public class TileBitmapProvider implements BitmapProvider { private final TileProvider provider; private final Bitmap.Config bitmapConfig; private final int backgroundColor; private final BitmapPool bitmapPool; private final Rect frameRect = new Rect(); public TileBitmapProvider(final TileProvider provider, final BitmapPool bitmapPool, final Bitmap.Config bitmapConfig, final int backgroundColor)..
class ViewController: UIViewController { @IBOutlet weak var imgMain: UIImageView! @IBOutlet weak var btnPrev: UIButton! @IBOutlet weak var btnNext: UIButton! var idx = 0 var array_img = ["img1.jpeg" , "img2.jpeg" , "img3.jpeg"] override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. initView(_pos : 0); } func initView(_pos : Int)..
List list = new ArrayList(); Iterator iterator = list.iterator(); // while (iterator.hasNext()) { for (Iterator iterator = list.iterator(); iterator.hasNext();) { String string = iterator.next(); if (string.isEmpty()) { // Remove the current element from the iterator and the list. iterator.remove(); } }