This file contains 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 HorizontalRecycleViewHolder extends RecyclerView.ViewHolder { | |
private RecyclerView mHorizontalRecyclerView; | |
private HorizontalRecyclerViewAdapter mHorizontalRecyclerViewAdapter; | |
public HorizontalRecycleViewHolder(View itemView) { | |
super(itemView); | |
// RecyclerView | |
mHorizontalRecyclerView = itemView.findViewById(R.id.horizontal_recycler_view); |
This file contains 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
List<Instance> list; | |
// ↓ | |
ArrayList<Instance> list; |
This file contains 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 ExoPlayerActivity extends FragmentActivity implements TextureView.SurfaceTextureListener { | |
private ExoPlayerActivityBinding binding; | |
private SimpleExoPlayer simpleExoPlayer; | |
// Apple sample HLS | |
private static final String videoUrl = "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"; | |
private Timer playerTimer; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
This file contains 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
// Scale Focusが当たった時やTapした時など | |
// XとYの大きさが100msかけて大きくなる | |
textView.animate().scaleX(2f).scaleY(2f).setDuration(1000); |
This file contains 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
ViewConfiguration.get(context).hasPermanentMenuKey() |
This file contains 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
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { | |
@Override | |
public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
super.onScrolled(recyclerView, dx, dy); | |
int totalCount = recyclerView.getAdapter().getItemCount(); //合計のアイテム数 | |
int childCount = recyclerView.getChildCount(); // RecyclerViewに表示されてるアイテム数 | |
RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager(); | |
if (layoutManager instanceof GridLayoutManager) { // GridLayoutManager |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setEnabled(true); // NegativeButtonを有効に | |
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true); // PoitiveButtonを有効に | |
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setEnabled(false); // NegativeButtonを無効に | |
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false); // PoitiveButtonを無効に |
This file contains 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 CircleView extends View { | |
private Paint paint; | |
public CircleView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
paint = new Paint(); | |
} | |
public CircleView(Context context) { | |
super(context); |
This file contains 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 CustomReceiver extends ParsePushBroadcastReceiver { | |
@Override | |
protected void onPushReceive(Context context, Intent intent) { | |
JSONObject pushData = null; | |
try { | |
pushData = new JSONObject(intent.getStringExtra(KEY_PUSH_DATA)); | |
Log.d("pushData", pushData.toString()); | |
String url = pushData.getString("url"); | |
Uri uri = Uri.parse(url); |
NewerOlder