當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。