Modify AppHeaderController to provide UI for notif settings

- The AppHeaderController is no longer a singleton. Each time appheader
  should be updated we will create a new controller. It acts as a
  builder/mutator, user provides customizable inputs, and the controller
  will bind everything to UI when calling done().

Bug: 32442716
Test: RunSettingsRoboTests
Change-Id: Icfc5bcd8bc170a02b57432d864eaddf71db0d5b4
This commit is contained in:
Fan Zhang
2016-10-27 15:50:36 -07:00
parent 6e3b964cf4
commit 1ff25ba7e6
9 changed files with 364 additions and 75 deletions

View File

@@ -16,23 +16,19 @@
package com.android.settings.applications;
import android.app.Fragment;
import android.content.Context;
import android.view.View;
public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvider {
private final Context mContext;
private AppHeaderController mAppHeaderController;
public ApplicationFeatureProviderImpl(Context context) {
mContext = context.getApplicationContext();
}
@Override
public AppHeaderController getAppHeaderController() {
if (mAppHeaderController == null) {
mAppHeaderController = new AppHeaderController(mContext);
}
return mAppHeaderController;
public AppHeaderController newAppHeaderController(Fragment fragment, View appHeader) {
return new AppHeaderController(mContext, fragment, appHeader);
}
}