Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -26082,7 +26082,7 @@ package android.widget { ctor public ShareActionProvider(android.content.Context); method public android.view.View onCreateActionView(); method public void setShareHistoryFileName(java.lang.String); method public void setShareIntent(android.view.View, android.content.Intent); method public void setShareIntent(android.content.Intent); field public static final java.lang.String DEFAULT_SHARE_HISTORY_FILE_NAME = "share_history.xml"; } core/java/android/view/ActionProvider.java +3 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ import android.content.Context; * {@link android.app.ActionBar} as a substitute for the menu item when the item is * displayed as an action item. Also the provider is responsible for performing a * default action if a menu item placed on the overflow menu of the ActionBar is * selected and none of the menu item callbacks has handled the selection. * selected and none of the menu item callbacks has handled the selection. For this * case the provider can also optionally provide a sub-menu for accomplishing the * task at hand. * </p> * <p> * There are two ways for using an action provider for creating and handling of action views: Loading core/java/android/widget/ActivityChooserModel.java +31 −32 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public class ActivityChooserModel extends DataSetObservable { */ // This cannot be done by a simple comparator since an Activity weight // is computed from history. Note that Activity implements Comparable. public void sort(Intent intent, List<Activity> activities, public void sort(Intent intent, List<ActivityResolveInfo> activities, List<HistoricalRecord> historicalRecords); } Loading Loading @@ -215,7 +215,7 @@ public class ActivityChooserModel extends DataSetObservable { /** * List of activities that can handle the current intent. */ private final List<Activity> mActivitys = new ArrayList<Activity>(); private final List<ActivityResolveInfo> mActivites = new ArrayList<ActivityResolveInfo>(); /** * List with historical choice records. Loading Loading @@ -311,9 +311,6 @@ public class ActivityChooserModel extends DataSetObservable { * @return The model. */ public static ActivityChooserModel get(Context context, String historyFileName) { if (historyFileName == null) { return new ActivityChooserModel(context, historyFileName); } synchronized (sRegistryLock) { ActivityChooserModel dataModel = sDataModelRegistry.get(historyFileName); if (dataModel == null) { Loading Loading @@ -380,7 +377,7 @@ public class ActivityChooserModel extends DataSetObservable { */ public int getActivityCount() { synchronized (mInstanceLock) { return mActivitys.size(); return mActivites.size(); } } Loading @@ -389,12 +386,12 @@ public class ActivityChooserModel extends DataSetObservable { * * @return The activity. * * @see Activity * @see ActivityResolveInfo * @see #setIntent(Intent) */ public ResolveInfo getActivity(int index) { synchronized (mInstanceLock) { return mActivitys.get(index).resolveInfo; return mActivites.get(index).resolveInfo; } } Loading @@ -406,10 +403,10 @@ public class ActivityChooserModel extends DataSetObservable { * @return The index if found, -1 otherwise. */ public int getActivityIndex(ResolveInfo activity) { List<Activity> activities = mActivitys; List<ActivityResolveInfo> activities = mActivites; final int activityCount = activities.size(); for (int i = 0; i < activityCount; i++) { Activity currentActivity = activities.get(i); ActivityResolveInfo currentActivity = activities.get(i); if (currentActivity.resolveInfo == activity) { return i; } Loading @@ -433,8 +430,8 @@ public class ActivityChooserModel extends DataSetObservable { * @see HistoricalRecord */ public Intent chooseActivity(int index) { Activity chosenActivity = mActivitys.get(index); Activity defaultActivity = mActivitys.get(0); ActivityResolveInfo chosenActivity = mActivites.get(index); ActivityResolveInfo defaultActivity = mActivites.get(0); ComponentName chosenName = new ComponentName( chosenActivity.resolveInfo.activityInfo.packageName, Loading @@ -460,8 +457,8 @@ public class ActivityChooserModel extends DataSetObservable { */ public ResolveInfo getDefaultActivity() { synchronized (mInstanceLock) { if (!mActivitys.isEmpty()) { return mActivitys.get(0).resolveInfo; if (!mActivites.isEmpty()) { return mActivites.get(0).resolveInfo; } } return null; Loading @@ -478,8 +475,8 @@ public class ActivityChooserModel extends DataSetObservable { * @param index The index of the activity to set as default. */ public void setDefaultActivity(int index) { Activity newDefaultActivity = mActivitys.get(index); Activity oldDefaultActivity = mActivitys.get(0); ActivityResolveInfo newDefaultActivity = mActivites.get(index); ActivityResolveInfo oldDefaultActivity = mActivites.get(0); final float weight; if (oldDefaultActivity != null) { Loading Loading @@ -572,8 +569,8 @@ public class ActivityChooserModel extends DataSetObservable { */ private void sortActivities() { synchronized (mInstanceLock) { if (mActivitySorter != null && !mActivitys.isEmpty()) { mActivitySorter.sort(mIntent, mActivitys, if (mActivitySorter != null && !mActivites.isEmpty()) { mActivitySorter.sort(mIntent, mActivites, Collections.unmodifiableList(mHistoricalRecords)); notifyChanged(); } Loading Loading @@ -661,14 +658,14 @@ public class ActivityChooserModel extends DataSetObservable { * Loads the activities. */ private void loadActivitiesLocked() { mActivitys.clear(); mActivites.clear(); if (mIntent != null) { List<ResolveInfo> resolveInfos = mContext.getPackageManager().queryIntentActivities(mIntent, 0); final int resolveInfoCount = resolveInfos.size(); for (int i = 0; i < resolveInfoCount; i++) { ResolveInfo resolveInfo = resolveInfos.get(i); mActivitys.add(new Activity(resolveInfo)); mActivites.add(new ActivityResolveInfo(resolveInfo)); } sortActivities(); } else { Loading Loading @@ -797,7 +794,7 @@ public class ActivityChooserModel extends DataSetObservable { /** * Represents an activity. */ public final class Activity implements Comparable<Activity> { public final class ActivityResolveInfo implements Comparable<ActivityResolveInfo> { /** * The {@link ResolveInfo} of the activity. Loading @@ -814,7 +811,7 @@ public class ActivityChooserModel extends DataSetObservable { * * @param resolveInfo activity {@link ResolveInfo}. */ public Activity(ResolveInfo resolveInfo) { public ActivityResolveInfo(ResolveInfo resolveInfo) { this.resolveInfo = resolveInfo; } Loading @@ -834,14 +831,14 @@ public class ActivityChooserModel extends DataSetObservable { if (getClass() != obj.getClass()) { return false; } Activity other = (Activity) obj; ActivityResolveInfo other = (ActivityResolveInfo) obj; if (Float.floatToIntBits(weight) != Float.floatToIntBits(other.weight)) { return false; } return true; } public int compareTo(Activity another) { public int compareTo(ActivityResolveInfo another) { return Float.floatToIntBits(another.weight) - Float.floatToIntBits(weight); } Loading @@ -862,18 +859,18 @@ public class ActivityChooserModel extends DataSetObservable { private final class DefaultSorter implements ActivitySorter { private static final float WEIGHT_DECAY_COEFFICIENT = 0.95f; private final Map<String, Activity> mPackageNameToActivityMap = new HashMap<String, Activity>(); private final Map<String, ActivityResolveInfo> mPackageNameToActivityMap = new HashMap<String, ActivityResolveInfo>(); public void sort(Intent intent, List<Activity> activities, public void sort(Intent intent, List<ActivityResolveInfo> activities, List<HistoricalRecord> historicalRecords) { Map<String, Activity> packageNameToActivityMap = Map<String, ActivityResolveInfo> packageNameToActivityMap = mPackageNameToActivityMap; packageNameToActivityMap.clear(); final int activityCount = activities.size(); for (int i = 0; i < activityCount; i++) { Activity activity = activities.get(i); ActivityResolveInfo activity = activities.get(i); activity.weight = 0.0f; String packageName = activity.resolveInfo.activityInfo.packageName; packageNameToActivityMap.put(packageName, activity); Loading @@ -884,10 +881,12 @@ public class ActivityChooserModel extends DataSetObservable { for (int i = lastShareIndex; i >= 0; i--) { HistoricalRecord historicalRecord = historicalRecords.get(i); String packageName = historicalRecord.activity.getPackageName(); Activity activity = packageNameToActivityMap.get(packageName); ActivityResolveInfo activity = packageNameToActivityMap.get(packageName); if (activity != null) { activity.weight += historicalRecord.weight * nextRecordWeight; nextRecordWeight = nextRecordWeight * WEIGHT_DECAY_COEFFICIENT; } } Collections.sort(activities); Loading core/java/android/widget/ActivityChooserView.java +100 −211 File changed.Preview size limit exceeded, changes collapsed. Show changes core/java/android/widget/CalendarView.java +1 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,7 @@ public class CalendarView extends FrameLayout { com.android.internal.R.styleable.TextAppearance); mDateTextSize = dateTextAppearance.getDimensionPixelSize( R.styleable.TextAppearance_textSize, DEFAULT_DATE_TEXT_SIZE); dateTextAppearance.recycle(); int weekDayTextAppearanceResId = attributesArray.getResourceId( R.styleable.CalendarView_weekDayTextAppearance, Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -26082,7 +26082,7 @@ package android.widget { ctor public ShareActionProvider(android.content.Context); method public android.view.View onCreateActionView(); method public void setShareHistoryFileName(java.lang.String); method public void setShareIntent(android.view.View, android.content.Intent); method public void setShareIntent(android.content.Intent); field public static final java.lang.String DEFAULT_SHARE_HISTORY_FILE_NAME = "share_history.xml"; }
core/java/android/view/ActionProvider.java +3 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ import android.content.Context; * {@link android.app.ActionBar} as a substitute for the menu item when the item is * displayed as an action item. Also the provider is responsible for performing a * default action if a menu item placed on the overflow menu of the ActionBar is * selected and none of the menu item callbacks has handled the selection. * selected and none of the menu item callbacks has handled the selection. For this * case the provider can also optionally provide a sub-menu for accomplishing the * task at hand. * </p> * <p> * There are two ways for using an action provider for creating and handling of action views: Loading
core/java/android/widget/ActivityChooserModel.java +31 −32 Original line number Diff line number Diff line Loading @@ -126,7 +126,7 @@ public class ActivityChooserModel extends DataSetObservable { */ // This cannot be done by a simple comparator since an Activity weight // is computed from history. Note that Activity implements Comparable. public void sort(Intent intent, List<Activity> activities, public void sort(Intent intent, List<ActivityResolveInfo> activities, List<HistoricalRecord> historicalRecords); } Loading Loading @@ -215,7 +215,7 @@ public class ActivityChooserModel extends DataSetObservable { /** * List of activities that can handle the current intent. */ private final List<Activity> mActivitys = new ArrayList<Activity>(); private final List<ActivityResolveInfo> mActivites = new ArrayList<ActivityResolveInfo>(); /** * List with historical choice records. Loading Loading @@ -311,9 +311,6 @@ public class ActivityChooserModel extends DataSetObservable { * @return The model. */ public static ActivityChooserModel get(Context context, String historyFileName) { if (historyFileName == null) { return new ActivityChooserModel(context, historyFileName); } synchronized (sRegistryLock) { ActivityChooserModel dataModel = sDataModelRegistry.get(historyFileName); if (dataModel == null) { Loading Loading @@ -380,7 +377,7 @@ public class ActivityChooserModel extends DataSetObservable { */ public int getActivityCount() { synchronized (mInstanceLock) { return mActivitys.size(); return mActivites.size(); } } Loading @@ -389,12 +386,12 @@ public class ActivityChooserModel extends DataSetObservable { * * @return The activity. * * @see Activity * @see ActivityResolveInfo * @see #setIntent(Intent) */ public ResolveInfo getActivity(int index) { synchronized (mInstanceLock) { return mActivitys.get(index).resolveInfo; return mActivites.get(index).resolveInfo; } } Loading @@ -406,10 +403,10 @@ public class ActivityChooserModel extends DataSetObservable { * @return The index if found, -1 otherwise. */ public int getActivityIndex(ResolveInfo activity) { List<Activity> activities = mActivitys; List<ActivityResolveInfo> activities = mActivites; final int activityCount = activities.size(); for (int i = 0; i < activityCount; i++) { Activity currentActivity = activities.get(i); ActivityResolveInfo currentActivity = activities.get(i); if (currentActivity.resolveInfo == activity) { return i; } Loading @@ -433,8 +430,8 @@ public class ActivityChooserModel extends DataSetObservable { * @see HistoricalRecord */ public Intent chooseActivity(int index) { Activity chosenActivity = mActivitys.get(index); Activity defaultActivity = mActivitys.get(0); ActivityResolveInfo chosenActivity = mActivites.get(index); ActivityResolveInfo defaultActivity = mActivites.get(0); ComponentName chosenName = new ComponentName( chosenActivity.resolveInfo.activityInfo.packageName, Loading @@ -460,8 +457,8 @@ public class ActivityChooserModel extends DataSetObservable { */ public ResolveInfo getDefaultActivity() { synchronized (mInstanceLock) { if (!mActivitys.isEmpty()) { return mActivitys.get(0).resolveInfo; if (!mActivites.isEmpty()) { return mActivites.get(0).resolveInfo; } } return null; Loading @@ -478,8 +475,8 @@ public class ActivityChooserModel extends DataSetObservable { * @param index The index of the activity to set as default. */ public void setDefaultActivity(int index) { Activity newDefaultActivity = mActivitys.get(index); Activity oldDefaultActivity = mActivitys.get(0); ActivityResolveInfo newDefaultActivity = mActivites.get(index); ActivityResolveInfo oldDefaultActivity = mActivites.get(0); final float weight; if (oldDefaultActivity != null) { Loading Loading @@ -572,8 +569,8 @@ public class ActivityChooserModel extends DataSetObservable { */ private void sortActivities() { synchronized (mInstanceLock) { if (mActivitySorter != null && !mActivitys.isEmpty()) { mActivitySorter.sort(mIntent, mActivitys, if (mActivitySorter != null && !mActivites.isEmpty()) { mActivitySorter.sort(mIntent, mActivites, Collections.unmodifiableList(mHistoricalRecords)); notifyChanged(); } Loading Loading @@ -661,14 +658,14 @@ public class ActivityChooserModel extends DataSetObservable { * Loads the activities. */ private void loadActivitiesLocked() { mActivitys.clear(); mActivites.clear(); if (mIntent != null) { List<ResolveInfo> resolveInfos = mContext.getPackageManager().queryIntentActivities(mIntent, 0); final int resolveInfoCount = resolveInfos.size(); for (int i = 0; i < resolveInfoCount; i++) { ResolveInfo resolveInfo = resolveInfos.get(i); mActivitys.add(new Activity(resolveInfo)); mActivites.add(new ActivityResolveInfo(resolveInfo)); } sortActivities(); } else { Loading Loading @@ -797,7 +794,7 @@ public class ActivityChooserModel extends DataSetObservable { /** * Represents an activity. */ public final class Activity implements Comparable<Activity> { public final class ActivityResolveInfo implements Comparable<ActivityResolveInfo> { /** * The {@link ResolveInfo} of the activity. Loading @@ -814,7 +811,7 @@ public class ActivityChooserModel extends DataSetObservable { * * @param resolveInfo activity {@link ResolveInfo}. */ public Activity(ResolveInfo resolveInfo) { public ActivityResolveInfo(ResolveInfo resolveInfo) { this.resolveInfo = resolveInfo; } Loading @@ -834,14 +831,14 @@ public class ActivityChooserModel extends DataSetObservable { if (getClass() != obj.getClass()) { return false; } Activity other = (Activity) obj; ActivityResolveInfo other = (ActivityResolveInfo) obj; if (Float.floatToIntBits(weight) != Float.floatToIntBits(other.weight)) { return false; } return true; } public int compareTo(Activity another) { public int compareTo(ActivityResolveInfo another) { return Float.floatToIntBits(another.weight) - Float.floatToIntBits(weight); } Loading @@ -862,18 +859,18 @@ public class ActivityChooserModel extends DataSetObservable { private final class DefaultSorter implements ActivitySorter { private static final float WEIGHT_DECAY_COEFFICIENT = 0.95f; private final Map<String, Activity> mPackageNameToActivityMap = new HashMap<String, Activity>(); private final Map<String, ActivityResolveInfo> mPackageNameToActivityMap = new HashMap<String, ActivityResolveInfo>(); public void sort(Intent intent, List<Activity> activities, public void sort(Intent intent, List<ActivityResolveInfo> activities, List<HistoricalRecord> historicalRecords) { Map<String, Activity> packageNameToActivityMap = Map<String, ActivityResolveInfo> packageNameToActivityMap = mPackageNameToActivityMap; packageNameToActivityMap.clear(); final int activityCount = activities.size(); for (int i = 0; i < activityCount; i++) { Activity activity = activities.get(i); ActivityResolveInfo activity = activities.get(i); activity.weight = 0.0f; String packageName = activity.resolveInfo.activityInfo.packageName; packageNameToActivityMap.put(packageName, activity); Loading @@ -884,10 +881,12 @@ public class ActivityChooserModel extends DataSetObservable { for (int i = lastShareIndex; i >= 0; i--) { HistoricalRecord historicalRecord = historicalRecords.get(i); String packageName = historicalRecord.activity.getPackageName(); Activity activity = packageNameToActivityMap.get(packageName); ActivityResolveInfo activity = packageNameToActivityMap.get(packageName); if (activity != null) { activity.weight += historicalRecord.weight * nextRecordWeight; nextRecordWeight = nextRecordWeight * WEIGHT_DECAY_COEFFICIENT; } } Collections.sort(activities); Loading
core/java/android/widget/ActivityChooserView.java +100 −211 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/java/android/widget/CalendarView.java +1 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,7 @@ public class CalendarView extends FrameLayout { com.android.internal.R.styleable.TextAppearance); mDateTextSize = dateTextAppearance.getDimensionPixelSize( R.styleable.TextAppearance_textSize, DEFAULT_DATE_TEXT_SIZE); dateTextAppearance.recycle(); int weekDayTextAppearanceResId = attributesArray.getResourceId( R.styleable.CalendarView_weekDayTextAppearance, Loading