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
}
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:
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
View SomeFragment.kt
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser) {
someFunction()
}
}
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
View PostActivity.java
public class PostActivity extends AppCompatActivity{
private Button buttonPrefecture;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.post_activity);
View TabHostActivity.java
public class TabHostActivity extends AppCompatActivity {
TabHost tabHost;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab_host_activity);
TabHost host = (TabHost) findViewById(R.id.tabHost);
host.setup();