Read network policy earlier, fix ugly scrollbar.
Read policy before creating options menu, so we correctly populate checkboxes. Also clean up Preference views so we don't crash when returning from app details. Change-Id: I52c38a3016ea669e27b325bfb6ae1620d2a5ca53
This commit is contained in:
@@ -40,7 +40,8 @@
|
|||||||
android:id="@android:id/list"
|
android:id="@android:id/list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dip"
|
android:layout_height="0dip"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1"
|
||||||
|
android:smoothScrollbar="false" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -135,6 +135,7 @@ public class DataUsageSummary extends Fragment {
|
|||||||
final Context context = getActivity();
|
final Context context = getActivity();
|
||||||
final String subscriberId = getActiveSubscriberId(context);
|
final String subscriberId = getActiveSubscriberId(context);
|
||||||
mPolicyModifier = new NetworkPolicyModifier(mPolicyService, subscriberId);
|
mPolicyModifier = new NetworkPolicyModifier(mPolicyService, subscriberId);
|
||||||
|
mPolicyModifier.read();
|
||||||
|
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
@@ -194,9 +195,6 @@ public class DataUsageSummary extends Fragment {
|
|||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
// read current policy state from service
|
|
||||||
mPolicyModifier.read();
|
|
||||||
|
|
||||||
// this kicks off chain reaction which creates tabs, binds the body to
|
// this kicks off chain reaction which creates tabs, binds the body to
|
||||||
// selected network, and binds chart, cycles and detail list.
|
// selected network, and binds chart, cycles and detail list.
|
||||||
updateTabs();
|
updateTabs();
|
||||||
@@ -233,6 +231,14 @@ public class DataUsageSummary extends Fragment {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
super.onDestroyView();
|
||||||
|
|
||||||
|
mDataEnabledView = null;
|
||||||
|
mDisableAtLimitView = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rebuild all tabs based on {@link NetworkPolicyModifier} and
|
* Rebuild all tabs based on {@link NetworkPolicyModifier} and
|
||||||
* {@link #mShowWifi}, hiding the tabs entirely when applicable. Selects
|
* {@link #mShowWifi}, hiding the tabs entirely when applicable. Selects
|
||||||
|
Reference in New Issue
Block a user