Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3be63c09 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Infrastructure for supporting wallpaper previews.

Various things that will allow us to show previews of wallpapers.
Also some fixes to animations across wallpapers.
parent e13ec26e
Loading
Loading
Loading
Loading
+90 −0
Original line number Diff line number Diff line
@@ -15944,6 +15944,17 @@
<parameter name="data" type="android.content.Intent">
</parameter>
</method>
<method name="onAttachedToWindow"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onChildTitleChanged"
 return="void"
 abstract="false"
@@ -16147,6 +16158,17 @@
 visibility="protected"
>
</method>
<method name="onDetachedFromWindow"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onKeyDown"
 return="boolean"
 abstract="false"
@@ -19677,6 +19699,17 @@
 visibility="public"
>
</method>
<method name="onAttachedToWindow"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onContentChanged"
 return="void"
 abstract="false"
@@ -19785,6 +19818,17 @@
<parameter name="featureId" type="int">
</parameter>
</method>
<method name="onDetachedFromWindow"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onKeyDown"
 return="boolean"
 abstract="false"
@@ -21731,6 +21775,30 @@
 visibility="public"
>
</method>
<method name="onQueryPackageManager"
 return="java.util.List&lt;android.content.pm.ResolveInfo&gt;"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
<parameter name="queryIntent" type="android.content.Intent">
</parameter>
</method>
<method name="onSetContentView"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
</method>
</class>
<class name="LauncherActivity.IconResizer"
 extends="java.lang.Object"
@@ -154617,6 +154685,17 @@
<parameter name="event" type="android.view.MotionEvent">
</parameter>
</method>
<method name="onAttachedToWindow"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onContentChanged"
 return="void"
 abstract="true"
@@ -154656,6 +154735,17 @@
<parameter name="featureId" type="int">
</parameter>
</method>
<method name="onDetachedFromWindow"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="onMenuItemSelected"
 return="boolean"
 abstract="true"
+21 −0
Original line number Diff line number Diff line
@@ -1930,10 +1930,31 @@ public class Activity extends ContextThemeWrapper
     * 
     * @see #hasWindowFocus()
     * @see #onResume
     * @see View#onWindowFocusChanged(boolean)
     */
    public void onWindowFocusChanged(boolean hasFocus) {
    }
    
    /**
     * Called when the main window associated with the activity has been
     * attached to the window manager.
     * See {@link View#onAttachedToWindow() View.onAttachedToWindow()}
     * for more information.
     * @see View#onAttachedToWindow
     */
    public void onAttachedToWindow() {
    }
    
    /**
     * Called when the main window associated with the activity has been
     * detached from the window manager.
     * See {@link View#onDetachedFromWindow() View.onDetachedFromWindow()}
     * for more information.
     * @see View#onDetachedFromWindow
     */
    public void onDetachedFromWindow() {
    }
    
    /**
     * Returns true if this activity's <em>main</em> window currently has window focus.
     * Note that this is not the same as the view itself having focus.
+6 −0
Original line number Diff line number Diff line
@@ -576,6 +576,12 @@ public class Dialog implements DialogInterface, Window.Callback,
    public void onWindowFocusChanged(boolean hasFocus) {
    }

    public void onAttachedToWindow() {
    }
    
    public void onDetachedFromWindow() {
    }
    
    /**
     * Called to process key events.  You can override this to intercept all 
     * key events before they are dispatched to the window.  Be sure to call 
+25 −9
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.app;

import android.content.Context;
import android.content.Intent;
import android.content.pm.ComponentInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
@@ -70,13 +71,15 @@ public abstract class LauncherActivity extends ListActivity {
        ListItem(PackageManager pm, ResolveInfo resolveInfo, IconResizer resizer) {
            this.resolveInfo = resolveInfo;
            label = resolveInfo.loadLabel(pm);
            if (label == null && resolveInfo.activityInfo != null) {
            ComponentInfo ci = resolveInfo.activityInfo;
            if (ci == null) ci = resolveInfo.serviceInfo;
            if (label == null && ci != null) {
                label = resolveInfo.activityInfo.name;
            }
            
            icon = resizer.createIconThumbnail(resolveInfo.loadIcon(pm));
            packageName = resolveInfo.activityInfo.applicationInfo.packageName;
            className = resolveInfo.activityInfo.name;
            packageName = ci.applicationInfo.packageName;
            className = ci.name;
        }

        public ListItem() {
@@ -325,8 +328,7 @@ public abstract class LauncherActivity extends ListActivity {
    
        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        setProgressBarIndeterminateVisibility(true);
        setContentView(com.android.internal.R.layout.activity_list);
        
        onSetContentView();
            
        mIntent = new Intent(getTargetIntent());
        mIntent.setComponent(null);
@@ -338,10 +340,17 @@ public abstract class LauncherActivity extends ListActivity {
        setProgressBarIndeterminateVisibility(false);
    }

    /**
     * Override to call setContentView() with your own content view to
     * customize the list layout.
     */
    protected void onSetContentView() {
        setContentView(com.android.internal.R.layout.activity_list);
    }

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        Intent intent = ((ActivityAdapter)mAdapter).intentForPosition(position);

        Intent intent = intentForPosition(position);
        startActivity(intent);
    }
    
@@ -373,13 +382,20 @@ public abstract class LauncherActivity extends ListActivity {
        return new Intent();
    }

    /**
     * Perform query on package manager for list items.  The default
     * implementation queries for activities.
     */
    protected List<ResolveInfo> onQueryPackageManager(Intent queryIntent) {
        return mPackageManager.queryIntentActivities(queryIntent, /* no flags */ 0);
    }
    
    /**
     * Perform the query to determine which results to show and return a list of them.
     */
    public List<ListItem> makeListItems() {
        // Load all matching activities and sort correctly
        List<ResolveInfo> list = mPackageManager.queryIntentActivities(mIntent,
                /* no flags */ 0);
        List<ResolveInfo> list = onQueryPackageManager(mIntent);
        Collections.sort(list, new ResolveInfo.DisplayNameComparator(mPackageManager));
        
        IconResizer resizer = new IconResizer();
+2 −1
Original line number Diff line number Diff line
@@ -23,5 +23,6 @@ import android.service.wallpaper.IWallpaperConnection;
 */
oneway interface IWallpaperService {
    void attach(IWallpaperConnection connection,
    		IBinder windowToken, int reqWidth, int reqHeight);
    		IBinder windowToken, int windowType, boolean isPreview,
    		int reqWidth, int reqHeight);
}
Loading