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

Commit 477687c1 authored by Xavier Ducrohet's avatar Xavier Ducrohet Committed by Android (Google) Code Review
Browse files

Merge "Fix SDK layout rendering in Eclipse." into jb-mr1-dev

parents 11dea4d7 6dfd0b39
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ public class SystemClock_Delegate {
     * @return elapsed nanoseconds since boot.
     */
    @LayoutlibDelegate
    /*package*/ static long elapsedRealtimeNano() {
    /*package*/ static long elapsedRealtimeNanos() {
        return System.nanoTime() - sBootTimeNano;
    }

+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.view;

import com.android.tools.layoutlib.annotations.LayoutlibDelegate;

/**
 * Delegate used to provide new implementation of a select few methods of {@link Choreographer}
 *
 * Through the layoutlib_create tool, the original  methods of Choreographer have been
 * replaced by calls to methods of the same name in this delegate class.
 *
 */
public class Choreographer_Delegate {

    @LayoutlibDelegate
    public static float getRefreshRate() {
        return 60.f;
    }
}
+5 −3
Original line number Diff line number Diff line
@@ -16,11 +16,8 @@

package android.view;

import com.android.layoutlib.bridge.android.BridgeWindowManager;
import com.android.layoutlib.bridge.impl.RenderAction;
import com.android.tools.layoutlib.annotations.LayoutlibDelegate;

import android.os.RemoteException;

/**
 * Delegate used to provide new implementation of a select few methods of {@link Display}
@@ -31,4 +28,9 @@ import android.os.RemoteException;
 */
public class Display_Delegate {

    @LayoutlibDelegate
    static void updateDisplayInfoLocked(Display theDisplay) {
        // do nothing
    }

}
+15 −12
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.layoutlib.bridge.android;
package android.view;

import com.android.internal.view.IInputContext;
import com.android.internal.view.IInputMethodClient;
@@ -28,7 +28,6 @@ import android.os.IRemoteCallback;
import android.os.RemoteException;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Display_Delegate;
import android.view.Gravity;
import android.view.IApplicationToken;
import android.view.IDisplayContentChangeListener;
@@ -45,16 +44,21 @@ import java.util.List;
 * Basic implementation of {@link IWindowManager} so that {@link Display} (and
 * {@link Display_Delegate}) can return a valid instance.
 */
public class BridgeWindowManager implements IWindowManager {
public class IWindowManagerImpl implements IWindowManager {

    private final Configuration mConfig;
    private final DisplayMetrics mMetrics;
    private final int mRotation;
    private final boolean mHasSystemNavBar;
    private final boolean mHasNavigationBar;

    public BridgeWindowManager(Configuration config, DisplayMetrics metrics, int rotation) {
    public IWindowManagerImpl(Configuration config, DisplayMetrics metrics, int rotation,
            boolean hasSystemNavBar, boolean hasNavigationBar) {
        mConfig = config;
        mMetrics = metrics;
        mRotation = rotation;
        mHasSystemNavBar = hasSystemNavBar;
        mHasNavigationBar = hasNavigationBar;
    }

    // custom API.
@@ -70,14 +74,18 @@ public class BridgeWindowManager implements IWindowManager {
        return mRotation;
    }

    // ---- unused implementation of IWindowManager ----
    @Override
    public boolean hasNavigationBar() {
        return mHasNavigationBar;
    }

    @Override
    public boolean hasSystemNavBar() throws RemoteException {
        // TODO Auto-generated method stub
        return false;
        return mHasSystemNavBar;
    }

    // ---- unused implementation of IWindowManager ----

    @Override
    public void addAppToken(int arg0, IApplicationToken arg1, int arg2, int arg3, boolean arg4,
                            boolean arg5)
@@ -434,11 +442,6 @@ public class BridgeWindowManager implements IWindowManager {
    public void dismissKeyguard() {
    }

    @Override
    public boolean hasNavigationBar() {
        return false; // should this return something else?
    }

    @Override
    public void lockNow(Bundle options) {
        // TODO Auto-generated method stub
+43 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.view;

import com.android.tools.layoutlib.annotations.LayoutlibDelegate;

/**
 * Delegate used to provide new implementation of a select few methods of
 * {@link WindowManagerGlobal}
 *
 * Through the layoutlib_create tool, the original  methods of WindowManagerGlobal have been
 * replaced by calls to methods of the same name in this delegate class.
 *
 */
public class WindowManagerGlobal_Delegate {

    private static IWindowManager sService;

    @LayoutlibDelegate
    public static IWindowManager getWindowManagerService() {
        return sService;
    }

    // ---- internal implementation stuff ----

    public static void setWindowManagerService(IWindowManager service) {
        sService = service;
    }
}
Loading