Skip to content

Commit

Permalink
Renamed Fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Peal committed May 22, 2022
1 parent 229855f commit 3fc065f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.gpeal.droidconanvilsample.app
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.gpeal.droidconanvilsample.feature.weatherui.R
import com.gpeal.droidconanvilsample.feature.weatherui.WeatherFragmentSimple
import com.gpeal.droidconanvilsample.feature.weatherui.WeatherFragmentWithViewModel

class MainActivity : AppCompatActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import com.squareup.anvil.annotations.ContributesTo

@ContributesTo(WeatherScope::class)
interface WeatherBindings {
fun inject(fragment: WeatherFragmentSimple)
fun inject(fragment: WeatherFragmentFragmentScoped)
fun inject(vm: WeatherViewModel)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.gpeal.droidconanvilsample.lib.daggerscopes.utils.bindings
import com.gpeal.droidconanvilsample.lib.daggerscopes.utils.fragmentComponent
import javax.inject.Inject

class WeatherFragmentSimple : Fragment(R.layout.weather_fragment), DaggerComponentOwner {
class WeatherFragmentFragmentScoped : Fragment(R.layout.weather_fragment), DaggerComponentOwner {
override val daggerComponent: WeatherComponent by fragmentComponent { _, app ->
// If you want a ViewModel scoped component, just instantiate this component inside of your ViewModel.
// You instantiate this component anywhere, really.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.gpeal.droidconanvilsample.feature.weatherui

import android.app.Application
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.ViewModel
import com.gpeal.droidconanvilsample.lib.daggerscopes.utils.DaggerComponentOwner
import com.gpeal.droidconanvilsample.lib.daggerscopes.utils.bindings
import com.gpeal.droidconanvilsample.lib.weatherdata.WeatherRepository
Expand Down
2 changes: 1 addition & 1 deletion feature.weatherui/src/main/res/layout/weather_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".WeatherFragmentSimple">
tools:context=".WeatherFragmentFragmentScoped">

<TextView
android:id="@+id/message"
Expand Down

0 comments on commit 3fc065f

Please sign in to comment.