0% found this document useful (0 votes)
33 views

Suppresslint: / Created by Niccapdevila On 3/26/16.

The document defines a FoodFragment class that extends BaseFragment. The FoodFragment class has an onViewCreated method that sets a click listener on a btn variable to push a new instance of the FoodFragment with an incremented value. It also sets the btn text to include the fragment name and value. A newInstance method is defined to create new fragment instances with an instance argument bundled for configuration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Suppresslint: / Created by Niccapdevila On 3/26/16.

The document defines a FoodFragment class that extends BaseFragment. The FoodFragment class has an onViewCreated method that sets a click listener on a btn variable to push a new instance of the FoodFragment with an incremented value. It also sets the btn text to include the fragment name and value. A newInstance method is defined to create new fragment instances with an instance argument bundled for configuration.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 18

package com.ncapdevi.sample.

fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}
companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View
/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}
companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View
/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

}
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

/**
* Created by niccapdevila on 3/26/16.
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt +
1))
}
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {

fun newInstance(instance: Int): FoodFragment {


val args = Bundle()
args.putInt(BaseFragment.ARGS_INSTANCE, instance)
val fragment = FoodFragment()
fragment.arguments = args
return fragment
}
}

You might also like