Fix DataUsageSummary formatting
Change-Id: I8b983aad88ddcde88b433def6bc181b8febc2a65
This commit is contained in:
@@ -2690,48 +2690,6 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
summary.setText(string);
|
summary.setText(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* For search
|
|
||||||
*/
|
|
||||||
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
|
||||||
new BaseSearchIndexProvider() {
|
|
||||||
@Override
|
|
||||||
public List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled) {
|
|
||||||
final List<SearchIndexableRaw> result = new ArrayList<SearchIndexableRaw>();
|
|
||||||
|
|
||||||
final Resources res = context.getResources();
|
|
||||||
|
|
||||||
// Add fragment title
|
|
||||||
SearchIndexableRaw data = new SearchIndexableRaw(context);
|
|
||||||
data.title = res.getString(R.string.data_usage_summary_title);
|
|
||||||
data.screenTitle = res.getString(R.string.data_usage_summary_title);
|
|
||||||
result.add(data);
|
|
||||||
|
|
||||||
// Mobile data
|
|
||||||
data = new SearchIndexableRaw(context);
|
|
||||||
data.key = DATA_USAGE_ENABLE_MOBILE_KEY;
|
|
||||||
data.title = res.getString(R.string.data_usage_enable_mobile);
|
|
||||||
data.screenTitle = res.getString(R.string.data_usage_summary_title);
|
|
||||||
result.add(data);
|
|
||||||
|
|
||||||
// Set mobile data limit
|
|
||||||
data = new SearchIndexableRaw(context);
|
|
||||||
data.key = DATA_USAGE_DISABLE_MOBILE_LIMIT_KEY;
|
|
||||||
data.title = res.getString(R.string.data_usage_disable_mobile_limit);
|
|
||||||
data.screenTitle = res.getString(R.string.data_usage_summary_title);
|
|
||||||
result.add(data);
|
|
||||||
|
|
||||||
// Data usage cycle
|
|
||||||
data = new SearchIndexableRaw(context);
|
|
||||||
data.key = DATA_USAGE_CYCLE_KEY;
|
|
||||||
data.title = res.getString(R.string.data_usage_cycle);
|
|
||||||
data.screenTitle = res.getString(R.string.data_usage_summary_title);
|
|
||||||
result.add(data);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private void addMobileTab(Context context, SubscriptionInfo subInfo, boolean isMultiSim) {
|
private void addMobileTab(Context context, SubscriptionInfo subInfo, boolean isMultiSim) {
|
||||||
if (subInfo != null && mMobileTagMap != null) {
|
if (subInfo != null && mMobileTagMap != null) {
|
||||||
if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
|
if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
|
||||||
@@ -2841,4 +2799,46 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
return new SummaryProvider(activity, summaryLoader);
|
return new SummaryProvider(activity, summaryLoader);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For search
|
||||||
|
*/
|
||||||
|
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||||
|
new BaseSearchIndexProvider() {
|
||||||
|
@Override
|
||||||
|
public List<SearchIndexableRaw> getRawDataToIndex(Context context, boolean enabled) {
|
||||||
|
final List<SearchIndexableRaw> result = new ArrayList<SearchIndexableRaw>();
|
||||||
|
|
||||||
|
final Resources res = context.getResources();
|
||||||
|
|
||||||
|
// Add fragment title
|
||||||
|
SearchIndexableRaw data = new SearchIndexableRaw(context);
|
||||||
|
data.title = res.getString(R.string.data_usage_summary_title);
|
||||||
|
data.screenTitle = res.getString(R.string.data_usage_summary_title);
|
||||||
|
result.add(data);
|
||||||
|
|
||||||
|
// Mobile data
|
||||||
|
data = new SearchIndexableRaw(context);
|
||||||
|
data.key = DATA_USAGE_ENABLE_MOBILE_KEY;
|
||||||
|
data.title = res.getString(R.string.data_usage_enable_mobile);
|
||||||
|
data.screenTitle = res.getString(R.string.data_usage_summary_title);
|
||||||
|
result.add(data);
|
||||||
|
|
||||||
|
// Set mobile data limit
|
||||||
|
data = new SearchIndexableRaw(context);
|
||||||
|
data.key = DATA_USAGE_DISABLE_MOBILE_LIMIT_KEY;
|
||||||
|
data.title = res.getString(R.string.data_usage_disable_mobile_limit);
|
||||||
|
data.screenTitle = res.getString(R.string.data_usage_summary_title);
|
||||||
|
result.add(data);
|
||||||
|
|
||||||
|
// Data usage cycle
|
||||||
|
data = new SearchIndexableRaw(context);
|
||||||
|
data.key = DATA_USAGE_CYCLE_KEY;
|
||||||
|
data.title = res.getString(R.string.data_usage_cycle);
|
||||||
|
data.screenTitle = res.getString(R.string.data_usage_summary_title);
|
||||||
|
result.add(data);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user