Skip to content

Commit

Permalink
Change how I do internal since Dagger suddenly failed code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tasomaniac committed Jun 2, 2019
1 parent cf0809a commit c8f25f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.tasomaniac.devwidget.extensions.SchedulingStrategy;
import com.tasomaniac.devwidget.settings.Version;

import androidx.core.content.ContextCompat;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
Expand All @@ -37,7 +36,7 @@ static PackageManager packageManager(Application app) {

@Provides
static PowerManager powerManager(Application app) {
return ContextCompat.getSystemService(app, PowerManager.class);
return (PowerManager) app.getSystemService(Context.POWER_SERVICE);
}

@Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.tasomaniac.devwidget.widget.click.HeaderOptionsActivity
import com.tasomaniac.devwidget.widget.click.WidgetRefreshActivity
import javax.inject.Inject

internal class RemoteViewsCreator(
class RemoteViewsCreator internal constructor(
private val app: Application,
private val widgetResources: WidgetResources,
private val opacityPreferences: OpacityPreferences,
Expand Down Expand Up @@ -136,7 +136,7 @@ internal class RemoteViewsCreator(
return backgroundColor and 0xffffff or (opacity * 255 / 100 shl 24)
}

class Factory @Inject constructor(
class Factory @Inject internal constructor(
private val app: Application,
private val widgetResources: WidgetResources,
private val opacityPreferences: OpacityPreferences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dagger.android.ContributesAndroidInjector
abstract class WidgetBindingsModule {

@Binds
internal abstract fun widgetUpdater(widgetUpdater: WidgetUpdaterImpl): WidgetUpdater
abstract fun widgetUpdater(widgetUpdater: WidgetUpdaterImpl): WidgetUpdater

@ContributesAndroidInjector
internal abstract fun widgetProvider(): WidgetProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import io.reactivex.annotations.CheckReturnValue
import java.util.concurrent.TimeUnit
import javax.inject.Inject

internal class WidgetUpdaterImpl @Inject constructor(
class WidgetUpdaterImpl @Inject internal constructor(
override val appWidgetManager: AppWidgetManager,
private val app: Application,
private val remoteViewsCreatorFactory: RemoteViewsCreator.Factory,
Expand Down

0 comments on commit c8f25f1

Please sign in to comment.