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
/** | |
* Created by jayjay on 2016. 11. 27.. | |
*/ | |
public class AbstractClass { | |
public static void main(String[] args) { | |
NormalClass obj1 = new NormalClass(); | |
// SomeInterface obj2 = new SomeInterface(); | |
// SomeAbstractClass obj3 = new A;bstractClass() | |
SomeInterface obj2 = new SomeInterface() { |
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
/** | |
* Created by jayjay on 2016. 9. 11.. | |
*/ | |
public class TestInterface { | |
String msg; | |
int number; | |
float floatNumber; | |
public interface ClickListener { | |
void onClick(); |
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
public class Communication { | |
static Communication instance; | |
private Communication() { | |
} | |
public static Communication getInstance() { | |
if(instance == null) | |
instance = new Communication(); |
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
public class TestForeach { | |
public static void main(String[] args) { | |
String[] msgs = {"aa", "bb", "cc", "dd"}; | |
String[] msg1 = new String[]{"aa", "bb", "cc", "dd"}; | |
final int size = msg1.length; | |
for(int i = 0; i < size; i++) { | |
System.out.println(msgs[i]); | |
} |
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
public class TestList { | |
public static void main(String[] args) { | |
String[] strings = {"hi", "hello", "mine", "you"}; | |
List<String> list = Lists.newArrayList(strings); | |
// item or entry == 항목 | |
System.out.println("list : " + list); | |
final int size = list.size(); | |
for(int i = size - 1; i >= 0; i--) { |
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
/** | |
* Legacy | |
*/ | |
public class ActivityA { | |
public void onCreate(A state) { | |
Volley.getList(new Callback() { | |
public void onSuccess(List<Image> list) { | |
showImageList(List<Image> list); | |
} |
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
public class TestStatic { | |
public static void main(String[] args) { | |
Sample sample1 = new Sample(); | |
Sample sample2 = new Sample(); | |
Sample sample3 = new Sample(); | |
Sample.number1 = 2; | |
Sample.method1(); | |
sample1.setNumber2(1); |
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
public class FileWrapper { | |
int type; // 0 : File, 1 : Directory | |
int depth; // 0~n | |
File file; | |
// contructor for injecting depedency, e.g. File object, type, depth | |
// setters and getters | |
} | |
public class Adapter extends RecyclerView.Adapter<RecyclerView.Holder> { |
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.jayjaylab.android.test.plainjava; | |
import android.support.v4.util.LruCache; | |
import android.util.Log; | |
/** | |
* Created by jayjay on 2016. 8. 6.. | |
*/ | |
public class TestLruCache { | |
static final String TAG = TestLruCache.class.getSimpleName(); |
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
// Instead of using [Endless Scrolling with AdapterViews and RecyclerViews] | |
// (https://github.com/codepath/android_guides/wiki/Endless-Scrolling-with-AdapterViews-and-RecyclerView/_edit) | |
// introduced in codepath. | |
// There's more simple and less computational way to implement endless scrolling. You can replace 1 in if-statement | |
// if(position == getItemCount() - 1) for fine tuning. | |
// Make use of the following code snippet in your project. | |
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { | |
EndlessScrollListener endlessScrollListener | |