Skip to content

Instantly share code, notes, and snippets.

Taishi Yamasaki Taishi-Y

Block or report user

Report or block Taishi-Y

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Taishi-Y
Taishi-Y / TypicalViewPagerAdapterTemplate.kt
Created Dec 22, 2017
TypicalViewPagerAdapterTemplate
View TypicalViewPagerAdapterTemplate.kt
import android.content.Context
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter
/**
* Created by taishi-y on 2017/12/20
*/
class ${NAME}(fm: FragmentManager, val context: Context) : FragmentPagerAdapter(fm) {
View TypicalRecyclerViewAdapterTemplate.kt
import android.content.Context
import android.support.v7.widget.CardView
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.view.*
import android.widget.TextView
/**
@Taishi-Y
Taishi-Y / .gitignore
Last active Dec 12, 2017
template of gitignore file for Android Studio project
View .gitignore
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
@Taishi-Y
Taishi-Y / FeedFragment.kt
Created Sep 7, 2017
Rx function on Android
View FeedFragment.kt
class FeedFragment : Fragment() {
var realmSiteInfo: RealmSiteInfo? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val bundle = this.arguments
realmSiteInfo = bundle.getSerializable(ARG_SITE) as RealmSiteInfo
}
@Taishi-Y
Taishi-Y / travis.yml
Created Sep 7, 2017
Travis settings for Android
View travis.yml
language: android
jdk: oraclejdk8
sudo: false
env:
global:
- GRADLE_OPTS="-Xmx512m -XX:MaxPermSize=512m"
- ADB_INSTALL_TIMEOUT=10
- secure: "<SECRET-KEY1>"
- secure: "<SECRET-KEY2>"
install:
@Taishi-Y
Taishi-Y / CustomGsonConverter.kt
Last active Aug 25, 2017
CustomGsonConverter for Retrofit and Realm in Java
View CustomGsonConverter.kt
object CustomGsonConverter {
var token = object : TypeToken<RealmList<RealmInt>>() {}.getType()
var gson = GsonBuilder()
.setExclusionStrategies(object : ExclusionStrategy {
override fun shouldSkipField(f: FieldAttributes): Boolean {
return f.declaringClass == RealmObject::class.java
}
override fun shouldSkipClass(clazz: Class<*>): Boolean {
return false
@Taishi-Y
Taishi-Y / SomeFragment.kt
Created Aug 1, 2017
This is called when the screen is showing
View SomeFragment.kt
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser) {
someFunction()
}
}
@Taishi-Y
Taishi-Y / SomeFragment.kt
Last active Aug 1, 2017
How to set statusbar color in Fragment
View SomeFragment.kt
fun setStatusBarColor(color: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
activity.window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
activity.window.statusBarColor = color
}
}
View MainActivity.java
public class MainActivity extends Activity {
ImageView maru_button,batsu_button,qbutton,rbutton;
private SoundPool mSoundPool;
private int maru_SoundId,batsu_SoundId,q_SoundId,r_SoundId;
InterstitialAd mInterstitialAd;
@Override
protected void onCreate(Bundle savedInstanceState) {
View gist:5f7bb3fd98d31c3a24ce56c48a493e25
http://www.reactnativeexpress.com/
https://facebook.github.io/react-native/docs/getting-started.html
You can’t perform that action at this time.