Skip to content

Instantly share code, notes, and snippets.

View yasszu's full-sized avatar

Yasuhiro Suzuki yasszu

View GitHub Profile
@yasszu
yasszu / main.md
Last active December 18, 2017 09:20
android.content.res.Resources$NotFoundException: File res/drawable/ic_star.xml from drawable resource ID #0x7f02010a. If the resource you are trying to use is a vector resource, you may be referencing it in an unsupported way. See AppCompatDelegate.setCompatVectorFromResourcesEnabled() for more info.

< API 21ではVector Resourceを参照することができない

  • ApplicationのonCreateで"AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)"を追加
  • android:srcをapp:srcCompatに変更する
@yasszu
yasszu / OnScrollListener.java
Last active February 27, 2021 04:38
RecyclerView Auto Scroll Loader
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class OnScrollListener extends RecyclerView.OnScrollListener {
private LinearLayoutManager mLayoutManager;
private int mVisibleThreshold = 2;
private int mPreviousItemCount = 0;
private boolean mLoading = true;
@yasszu
yasszu / NumberPickerDialog.java
Created January 16, 2017 07:09
NumberPickerDialog
package com.sample.view;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.util.DisplayMetrics;
import android.util.Log;
@yasszu
yasszu / PagerAdapter.java
Created September 28, 2016 08:43
FragmentPagerAdapter
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;
public class PagerAdapter extends FragmentPagerAdapter {
private Context mContext;
@yasszu
yasszu / 0_reuse_code.js
Created August 9, 2016 00:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console