Add shadow to searchbar when user scrolls vertically

Bug: 63528057
Test: robotests

Change-Id: Ib85676d78b43be38aab1eacd0820d0755a601f60
(cherry picked from commit e651ddf9e6)
This commit is contained in:
Fan Zhang
2017-07-19 16:44:28 -07:00
parent e4c9b7162d
commit ee8d574c26
8 changed files with 78 additions and 19 deletions

View File

@@ -40,6 +40,7 @@ import com.android.settings.dashboard.suggestions.SuggestionDismissController;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
import com.android.settings.dashboard.suggestions.SuggestionsChecks;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.widget.ActionBarShadowController;
import com.android.settingslib.drawer.CategoryKey;
import com.android.settingslib.drawer.DashboardCategory;
import com.android.settingslib.drawer.SettingsDrawerActivity;
@@ -192,12 +193,14 @@ public class DashboardSummary extends InstrumentedFragment
mDashboard.setHasFixedSize(true);
mDashboard.addItemDecoration(new DashboardDecorator(getContext()));
mDashboard.setListener(this);
Log.d(TAG, "adapter created");
mAdapter = new DashboardAdapter(getContext(), bundle, mConditionManager.getConditions(),
mSuggestionParser, this /* SuggestionDismissController.Callback */);
mDashboard.setAdapter(mAdapter);
mDashboard.setItemAnimator(new DashboardItemAnimator());
mSummaryLoader.setSummaryConsumer(mAdapter);
ActionBarShadowController.attachToRecyclerView(
getActivity().findViewById(R.id.search_bar_container), getLifecycle(), mDashboard);
if (DEBUG_TIMING) {
Log.d(TAG, "onViewCreated took "
+ (System.currentTimeMillis() - startTime) + " ms");

View File

@@ -44,7 +44,7 @@ public class CellularDataCondition extends Condition {
setActive(false);
return;
}
setActive(!telephony.getDataEnabled());
setActive(!telephony.isDataEnabled());
}
@Override

View File

@@ -25,7 +25,6 @@ import android.provider.Settings;
import android.support.annotation.NonNull;
import android.util.Log;
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.Settings.AmbientDisplayPickupSuggestionActivity;
import com.android.settings.Settings.AmbientDisplaySuggestionActivity;
@@ -54,7 +53,6 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
private final SuggestionRanker mSuggestionRanker;
private final MetricsFeatureProvider mMetricsFeatureProvider;
private final AmbientDisplayConfiguration mAmbientDisplayConfig;
@Override
public boolean isSmartSuggestionEnabled(Context context) {
@@ -96,7 +94,6 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
new SuggestionFeaturizer(new EventStore(appContext)));
mMetricsFeatureProvider = FeatureFactory.getFactory(appContext)
.getMetricsFeatureProvider();
mAmbientDisplayConfig = new AmbientDisplayConfiguration(appContext);
}
@Override