本文整理匯總了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());
}
}
示例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();
}
}
示例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());
}
}
示例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();
}
}
示例5: hideNotify
import org.microemu.android.device.AndroidDeviceDisplay; //導入依賴的package包/類
@Override
public void hideNotify()
{
((AndroidDeviceDisplay) activity.getEmulatorContext().getDeviceDisplay()).removeDisplayRepaintListener((DisplayRepaintListener) view);
super.hideNotify();
}
示例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();
}
});
}
示例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();
}