当前位置: 首页>>代码示例>>Java>>正文


Java AndroidDeviceDisplay类代码示例

本文整理汇总了Java中org.microemu.android.device.AndroidDeviceDisplay的典型用法代码示例。如果您正苦于以下问题:Java AndroidDeviceDisplay类的具体用法?Java AndroidDeviceDisplay怎么用?Java AndroidDeviceDisplay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AndroidDeviceDisplay类属于org.microemu.android.device包,在下文中一共展示了AndroidDeviceDisplay类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConfigurationChanged

import org.microemu.android.device.AndroidDeviceDisplay; //导入依赖的package包/类
@Override
public void onConfigurationChanged(Configuration newConfig) {
	super.onConfigurationChanged(newConfig);
	
	Drawable phoneCallIcon = getResources().getDrawable(android.R.drawable.stat_sys_phone_call);
	int statusBarHeight = 0;
	if (!windowFullscreen) {
		statusBarHeight = phoneCallIcon.getIntrinsicHeight();
	}
	
       Display display = getWindowManager().getDefaultDisplay();
	AndroidDeviceDisplay deviceDisplay = (AndroidDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay();
	deviceDisplay.setSize(display.getWidth(), display.getHeight() - statusBarHeight);
	MIDletAccess ma = MIDletBridge.getMIDletAccess();
	if (ma == null) {
		return;
	}
	DisplayAccess da = ma.getDisplayAccess();
	if (da != null) {
		da.sizeChanged();
		deviceDisplay.repaint(0, 0, deviceDisplay.getFullWidth(), deviceDisplay.getFullHeight());
	}
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:24,代码来源:MicroEmulatorActivity.java

示例2: onSizeChanged

import org.microemu.android.device.AndroidDeviceDisplay; //导入依赖的package包/类
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
	super.onSizeChanged(w, h, oldw, oldh);
	
	AndroidDeviceDisplay deviceDisplay = (AndroidDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay();
	deviceDisplay.setSize(w, h);

      	if (gameCanvasBitmap == null || gameCanvasBitmap.getWidth() != w || gameCanvasBitmap.getHeight() != h) {
       	if (gameCanvasBitmap != null) {
       		gameCanvasBitmap.recycle();
       	}
       	gameCanvasBitmap = Bitmap.createBitmap(deviceDisplay.getFullWidth(), deviceDisplay.getFullHeight(), Bitmap.Config.ARGB_8888);
       }
       if (gameCanvasGraphics != null) {
       	gameCanvasGraphics.reset(new android.graphics.Canvas(gameCanvasBitmap));
       }
	
	MIDletAccess ma = MIDletBridge.getMIDletAccess();
	if (ma == null) {
		return;
	}
	DisplayAccess da = ma.getDisplayAccess();
	if (da != null) {
		da.sizeChanged();
	}
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:27,代码来源:AndroidCanvasUI.java

示例3: onConfigurationChanged

import org.microemu.android.device.AndroidDeviceDisplay; //导入依赖的package包/类
@Override
public void onConfigurationChanged(Configuration newConfig) {
	super.onConfigurationChanged(newConfig);
	
	Drawable phoneCallIcon = getResources().getDrawable(android.R.drawable.stat_sys_phone_call);
	int statusBarHeight = 0;
	if (!windowFullscreen) {
		statusBarHeight = phoneCallIcon.getIntrinsicHeight();
	}
	
       Display display = getWindowManager().getDefaultDisplay();
	AndroidDeviceDisplay deviceDisplay = (AndroidDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay();
	deviceDisplay.displayRectangleWidth = display.getWidth();
	deviceDisplay.displayRectangleHeight = display.getHeight() - statusBarHeight;
	MIDletAccess ma = MIDletBridge.getMIDletAccess();
	if (ma == null) {
		return;
	}
	DisplayAccess da = ma.getDisplayAccess();
	if (da != null) {
		da.sizeChanged();
		deviceDisplay.repaint(0, 0, deviceDisplay.getFullWidth(), deviceDisplay.getFullHeight());
	}
}
 
开发者ID:BombusMod,项目名称:BombusMod,代码行数:25,代码来源:MicroEmulatorActivity.java

示例4: onSizeChanged

import org.microemu.android.device.AndroidDeviceDisplay; //导入依赖的package包/类
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
	super.onSizeChanged(w, h, oldw, oldh);
	
	AndroidDeviceDisplay deviceDisplay = (AndroidDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay();
	deviceDisplay.displayRectangleWidth = w;
	deviceDisplay.displayRectangleHeight = h;
	MIDletAccess ma = MIDletBridge.getMIDletAccess();
	if (ma == null) {
		return;
	}
	DisplayAccess da = ma.getDisplayAccess();
	if (da != null) {
		da.sizeChanged();
	}
}
 
开发者ID:BombusMod,项目名称:BombusMod,代码行数:17,代码来源:AndroidCanvasUI.java

示例5: hideNotify

import org.microemu.android.device.AndroidDeviceDisplay; //导入依赖的package包/类
@Override
public void hideNotify()
{
    ((AndroidDeviceDisplay) activity.getEmulatorContext().getDeviceDisplay()).removeDisplayRepaintListener((DisplayRepaintListener) view);
    
    super.hideNotify();
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:8,代码来源:AndroidCanvasUI.java

示例6: showNotify

import org.microemu.android.device.AndroidDeviceDisplay; //导入依赖的package包/类
@Override
public void showNotify()
{
    super.showNotify();
    
    activity.post(new Runnable() {
        public void run() {
      ((AndroidDeviceDisplay) activity.getEmulatorContext().getDeviceDisplay()).addDisplayRepaintListener((DisplayRepaintListener) view);
      ((Canvas) displayable).repaint();
        }
    });
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:13,代码来源:AndroidCanvasUI.java

示例7: onCreate

import org.microemu.android.device.AndroidDeviceDisplay; //导入依赖的package包/类
@Override
protected void onCreate(Bundle icicle) {
	super.onCreate(icicle);
	
	// Query the activity property android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
	TypedArray ta = getTheme().obtainStyledAttributes(new int[] { android.R.attr.windowFullscreen });
	windowFullscreen = ta.getBoolean(0, false);
	
	Drawable phoneCallIcon = getResources().getDrawable(android.R.drawable.stat_sys_phone_call);
	int statusBarHeight = 0;
	if (!windowFullscreen) {
		statusBarHeight = phoneCallIcon.getIntrinsicHeight();
	}
	
       Display display = getWindowManager().getDefaultDisplay();
       final int width = display.getWidth();
       final int height = display.getHeight() - statusBarHeight;

       emulatorContext = new EmulatorContext() {

           private InputMethod inputMethod = new AndroidInputMethod();

           private DeviceDisplay deviceDisplay = new AndroidDeviceDisplay(MicroEmulatorActivity.this, this, width, height);
           
           private FontManager fontManager = new AndroidFontManager(getResources().getDisplayMetrics());

           public DisplayComponent getDisplayComponent() {
               // TODO consider removal of EmulatorContext.getDisplayComponent()
               System.out.println("MicroEmulator.emulatorContext::getDisplayComponent()");
               return null;
           }

           public InputMethod getDeviceInputMethod() {
               return inputMethod;
           }

           public DeviceDisplay getDeviceDisplay() {
               return deviceDisplay;
           }

           public FontManager getDeviceFontManager() {
               return fontManager;
           }

           public InputStream getResourceAsStream(Class origClass, String name) {
               try {
                   if (name.startsWith("/")) {
                       return MicroEmulatorActivity.this.getAssets().open(name.substring(1));
                   } else {
                       Package p = origClass.getPackage();
                       if (p == null) {
                           return MicroEmulatorActivity.this.getAssets().open(name);
                       } else {
                       	String folder = origClass.getPackage().getName().replace('.', '/');
                           return MicroEmulatorActivity.this.getAssets().open(folder + "/" + name);
                       }
                   }
               } catch (IOException e) {
                   Logger.debug(e);
                   return null;
               }
           }

           public boolean platformRequest(String url) throws ConnectionNotFoundException 
           {
               try {
                   startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
               } catch (ActivityNotFoundException e) {
                   throw new ConnectionNotFoundException();
               }

               return true;
           }
                   
       };
	
	activityThread = Thread.currentThread();
}
 
开发者ID:Helltar,项目名称:AMPASIDE,代码行数:79,代码来源:MicroEmulatorActivity.java


注:本文中的org.microemu.android.device.AndroidDeviceDisplay类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。