Esempio n. 1
0
 @Override
 // @DebugLog
 public boolean onCreate() {
   DaggerService.<ArtworkComponent>getDaggerComponent(getContext()).inject(this);
   mUriMatcher = ArtworkUris.makeMatcher(mAuthority);
   return true;
 }
Esempio n. 2
0
 public NowPlayingScreenView(Context context, AttributeSet attrs) {
   super(context, attrs);
   lightTheme = ThemeUtils.isLightTheme(getContext());
   if (!isInEditMode()) {
     NowPlayingScreenComponent component = DaggerService.getDaggerComponent(getContext());
     component.inject(this);
   }
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   AppComponent app = DaggerService.getDaggerComponent(getApplicationContext());
   mActivityScope =
       MortarScope.buildChild(getApplicationContext())
           .withService(
               DaggerService.DAGGER_SERVICE,
               DaggerSettingsActivityComponent.builder().appComponent(app).build())
           .build(UUID.randomUUID().toString());
   super.onCreate(savedInstanceState);
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SettingsActivityComponent cmp = DaggerService.getDaggerComponent(getActivity());
    cmp.inject(this);

    mSettings.setCached(true);

    addPreferencesFromResource(R.xml.prefs_service);

    runWhen = (ListPreference) findPreference(ServiceSettings.RUN_WHEN);
    runWhen.setPersistent(false);
    runWhen.setValue(mSettings.runWhen());
    runWhen.setOnPreferenceChangeListener(this);

    onlyOnWifi = (CheckBoxPreference) findPreference(ServiceSettings.ONLY_WIFI);
    onlyOnWifi.setPersistent(false);
    onlyOnWifi.setChecked(mSettings.onlyOnWifi());
    onlyOnWifi.setOnPreferenceChangeListener(this);

    wifiNetwork = (MultiSelectListPreference) findPreference(ServiceSettings.WIFI_NETWORKS);
    wifiNetwork.setPersistent(false);
    String[] ssids = getWifiNetworks();
    wifiNetwork.setEntries(ssids);
    wifiNetwork.setEntryValues(ssids);
    wifiNetwork.setValues(mSettings.allowedWifiNetworks());
    wifiNetwork.setOnPreferenceChangeListener(this);

    onlyCharging = (CheckBoxPreference) findPreference(ServiceSettings.ONLY_CHARGING);
    onlyCharging.setPersistent(false);
    onlyCharging.setChecked(mSettings.onlyWhenCharging());
    onlyCharging.setOnPreferenceChangeListener(this);

    catBetween = (PreferenceCategory) findPreference("cat_between");
    hideShowRunWhenCategories(mSettings.runWhen());

    scheduleStart = (TimePreference) findPreference(ServiceSettings.RANGE_START);
    scheduleStart.setPersistent(false);
    scheduleStart.setValue(mSettings.getScheduledStartTime());
    scheduleStart.setOnPreferenceChangeListener(this);

    scheduleEnd = (TimePreference) findPreference(ServiceSettings.RANGE_END);
    scheduleEnd.setPersistent(false);
    scheduleEnd.setValue(mSettings.getScheduledEndTime());
    scheduleEnd.setOnPreferenceChangeListener(this);

    exportConfig = findPreference("export");
    exportConfig.setOnPreferenceClickListener(this);
    importConfig = findPreference("import");
    importConfig.setOnPreferenceClickListener(this);
  }
Esempio n. 5
0
 public LandingScreenView(Context context, AttributeSet attrs) {
   super(context, attrs);
   LandingScreenComponent component = DaggerService.getDaggerComponent(getContext());
   component.inject(this);
 }
Esempio n. 6
0
 @Override
 protected Object createDaggerComponent(
     Resources resources, MortarScope parentScope, FoldersScreen screen) {
   MusicActivityComponent activityComponent = DaggerService.getDaggerComponent(parentScope);
   return FoldersScreenComponent.FACTORY.call(activityComponent, screen);
 }