Java Examples for android.view.WindowManager.LayoutParams
The following java examples will help you to understand the usage of android.view.WindowManager.LayoutParams. These source code samples are taken from different open source projects.
Example 1
| Project: simiasque-master File: OverlayView.java View source code |
static WindowManager.LayoutParams createLayoutParams(int height) { final WindowManager.LayoutParams params = new WindowManager.LayoutParams(MATCH_PARENT, height, TYPE_SYSTEM_ERROR, FLAG_NOT_FOCUSABLE | FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_NO_LIMITS | FLAG_NOT_TOUCH_MODAL | FLAG_LAYOUT_INSET_DECOR, TRANSLUCENT); params.gravity = Gravity.TOP; return params; }
Example 2
| Project: spikes-master File: OverlayView.java View source code |
static WindowManager.LayoutParams createLayoutParams(Resources resources) { final WindowManager.LayoutParams params = new WindowManager.LayoutParams(MATCH_PARENT, retrieveStatusBarHeight(resources) + SAFETY_MARGIN, TYPE_SYSTEM_ERROR, FLAG_NOT_FOCUSABLE | FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_NO_LIMITS | FLAG_NOT_TOUCH_MODAL | FLAG_LAYOUT_INSET_DECOR, TRANSLUCENT); params.gravity = Gravity.TOP; return params; }
Example 3
| Project: ViewInspector-master File: ViewInspectorToolbar.java View source code |
public static WindowManager.LayoutParams createLayoutParams(Context context) { Resources res = context.getResources(); int width = res.getDimensionPixelSize(R.dimen.view_inspector_toolbar_header_width) + res.getDimensionPixelSize(R.dimen.view_inspector_toolbar_icon_width) * TOOLBAR_MENU_ITEMS; int height = res.getDimensionPixelSize(R.dimen.view_inspector_toolbar_height); if (Build.VERSION.SDK_INT == 23) { // MARSHMALLOW height = res.getDimensionPixelSize(R.dimen.view_inspector_toolbar_height_m); } final WindowManager.LayoutParams params = new WindowManager.LayoutParams(width, height, TYPE_SYSTEM_ERROR, FLAG_NOT_FOCUSABLE | FLAG_NOT_TOUCH_MODAL | FLAG_LAYOUT_NO_LIMITS | FLAG_LAYOUT_INSET_DECOR | FLAG_LAYOUT_IN_SCREEN, TRANSLUCENT); params.gravity = Gravity.TOP | Gravity.RIGHT; return params; }
Example 4
| Project: android_frameworks_base-master File: WindowState.java View source code |
@Override
public boolean getNeedsMenuLw(WindowManagerPolicy.WindowState bottom) {
int index = -1;
WindowState ws = this;
WindowList windows = getWindowList();
while (true) {
if (ws.mAttrs.needsMenuKey != WindowManager.LayoutParams.NEEDS_MENU_UNSET) {
return ws.mAttrs.needsMenuKey == WindowManager.LayoutParams.NEEDS_MENU_SET_TRUE;
}
// assume no menu is needed.
if (ws == bottom) {
return false;
}
// First, we may need to determine the starting position.
if (index < 0) {
index = windows.indexOf(ws);
}
index--;
if (index < 0) {
return false;
}
ws = windows.get(index);
}
}Example 5
| Project: platform_frameworks_base-master File: WindowState.java View source code |
@Override
public boolean getNeedsMenuLw(WindowManagerPolicy.WindowState bottom) {
int index = -1;
WindowState ws = this;
WindowList windows = getWindowList();
while (true) {
if (ws.mAttrs.needsMenuKey != WindowManager.LayoutParams.NEEDS_MENU_UNSET) {
return ws.mAttrs.needsMenuKey == WindowManager.LayoutParams.NEEDS_MENU_SET_TRUE;
}
// assume no menu is needed.
if (ws == bottom) {
return false;
}
// First, we may need to determine the starting position.
if (index < 0) {
index = windows.indexOf(ws);
}
index--;
if (index < 0) {
return false;
}
ws = windows.get(index);
}
}Example 6
| Project: JD-Test-master File: DialogUtil.java View source code |
/**
* 有�消回调的进度dialog
* @param context
* @param msg
* @return
*/
public static Dialog createLoadingDialog(Activity context, String msg, DialogInterface.OnCancelListener listener) {
final Dialog dialog = new Dialog(context, R.style.NoBackGroundDialog);
dialog.show();
dialog.setCanceledOnTouchOutside(false);
if (listener != null)
dialog.setOnCancelListener(listener);
Window window = dialog.getWindow();
assert window != null;
window.setGravity(Gravity.CENTER);
int width = ScreenUtil.getWidth(context) * 2 / 3;
window.setLayout(width, android.view.WindowManager.LayoutParams.WRAP_CONTENT);
View view = context.getLayoutInflater().inflate(R.layout.loading_dialog, null);
// æ??示文å—
TextView tipTextView = (TextView) view.findViewById(R.id.tipTextView);
if (!TextUtils.isEmpty(msg)) {
// è®¾ç½®åŠ è½½ä¿¡æ?¯
tipTextView.setText(msg);
}
//
window.setContentView(view);
return dialog;
}Example 7
| Project: android_packages_apps_settings-master File: FlashlightActivity.java View source code |
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setBackgroundColor(Color.WHITE);
setContentView(linearLayout);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
final Window window = getWindow();
LayoutParams attrs = window.getAttributes();
attrs.screenBrightness = 1;
window.setAttributes(attrs);
}Example 8
| Project: sandro-master File: CoreService.java View source code |
@Override
public void onCreate() {
super.onCreate();
// mWindowManager = (WindowManager) this.getSystemService(Context.WINDOW_SERVICE);
// scrapView = new ScrapView(this);
// scrapView.setBackgroundColor(0xffffffff);
//
// LayoutParams params = new LayoutParams();
// params.width = WindowManager.LayoutParams.FILL_PARENT;
// params.height = WindowManager.LayoutParams.FILL_PARENT;
// mWindowManager.addView(scrapView, params);
}Example 9
| Project: springy-heads-master File: WindowManagerContainer.java View source code |
protected WindowManager.LayoutParams createContainerLayoutParams(boolean focusable) { int focusableFlag; if (focusable) { focusableFlag = FLAG_NOT_TOUCH_MODAL; } else { focusableFlag = FLAG_NOT_TOUCHABLE | FLAG_NOT_FOCUSABLE; } WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(MATCH_PARENT, MATCH_PARENT, TYPE_PHONE, focusableFlag, PixelFormat.TRANSLUCENT); layoutParams.x = 0; layoutParams.y = 0; layoutParams.gravity = Gravity.TOP | Gravity.START; return layoutParams; }
Example 10
| Project: springy-master File: WindowManagerContainer.java View source code |
protected WindowManager.LayoutParams createContainerLayoutParams(boolean focusable) { int focusableFlag; if (focusable) { focusableFlag = FLAG_NOT_TOUCH_MODAL; } else { focusableFlag = FLAG_NOT_TOUCHABLE | FLAG_NOT_FOCUSABLE; } WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(MATCH_PARENT, MATCH_PARENT, TYPE_PHONE, focusableFlag, PixelFormat.TRANSLUCENT); layoutParams.x = 0; layoutParams.y = 0; layoutParams.gravity = Gravity.TOP | Gravity.START; return layoutParams; }
Example 11
| Project: devicehive-android-master File: ParameterDialog.java View source code |
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.parameter_dialog, container);
nameEdit = (EditText) view.findViewById(R.id.name_edit);
valueEdit = (EditText) view.findViewById(R.id.value_edit);
final Button okButton = (Button) view.findViewById(R.id.ok_button);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ParameterDialogListener activity = (ParameterDialogListener) getActivity();
activity.onFinishEditingParameter(nameEdit.getText().toString(), valueEdit.getText().toString());
ParameterDialog.this.dismiss();
}
});
getDialog().setTitle("New Parameter");
nameEdit.requestFocus();
getDialog().getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
return view;
}Example 12
| Project: FanXin3.0-master File: UBrightnessHelper.java View source code |
@Override
public void setValue(int level, boolean isTouch) {
if (isZero() && isTouch) {
level = mHistoryLevel;
}
if (level < 0) {
level = 0;
} else if (level > mMaxLevel) {
level = mMaxLevel;
}
float tempValue = level;
if (mContext != null && mContext instanceof Activity) {
LayoutParams lp = ((Activity) (mContext)).getWindow().getAttributes();
lp.screenBrightness = tempValue / mMaxLevel;
((Activity) (mContext)).getWindow().setAttributes(lp);
updateValue();
if (!isZero()) {
mHistoryLevel = mCurrentLevel;
}
if (mListener != null) {
mListener.onUpdateUI();
}
}
}Example 13
| Project: FriendsHost-master File: FHGuideActivity.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
zActivity = this;
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(R.layout.fh_guide_layout);
//this.getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
Button stopBtn = (Button) this.findViewById(R.id.tabStartBtn);
stopBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Pref.setMyBoolPref(zActivity.getApplicationContext(), Const.VIEW_GUIDE, true);
zActivity.finish();
}
});
}Example 14
| Project: reddit-is-fun-master File: ThreadClickDialog.java View source code |
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.thread_click_dialog);
Display display = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
if (display.getOrientation() == Configuration.ORIENTATION_LANDSCAPE)
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
setCanceledOnTouchOutside(true);
}Example 15
| Project: ivotingverification-master File: LoadingSpinner.java View source code |
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (isWhite) {
setContentView(R.layout.dialog_loading);
} else {
setContentView(R.layout.dialog_loading_black);
}
setCancelable(false);
iv = (ImageView) findViewById(R.id.spinner_img);
iv.startAnimation(AnimationUtils.loadAnimation(cx, R.anim.spinner));
tv = (TextView) findViewById(R.id.loading);
if (C.typeFace != null) {
tv.setTypeface(C.typeFace);
}
tv.setText(C.loading);
if (isWhite) {
tv.setTextColor(Util.generateHexColorValue(C.loadingWindowForeground));
} else {
tv.setTextColor(Color.BLACK);
}
LayoutParams params = getWindow().getAttributes();
params.height = LayoutParams.FILL_PARENT;
params.width = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
}Example 16
| Project: Telecine-master File: OverlayView.java View source code |
static WindowManager.LayoutParams createLayoutParams(Context context) { int width = context.getResources().getDimensionPixelSize(R.dimen.overlay_width); final WindowManager.LayoutParams params = new WindowManager.LayoutParams(width, WRAP_CONTENT, TYPE_SYSTEM_ERROR, FLAG_NOT_FOCUSABLE | FLAG_NOT_TOUCH_MODAL | FLAG_LAYOUT_NO_LIMITS | FLAG_LAYOUT_INSET_DECOR | FLAG_LAYOUT_IN_SCREEN, TRANSLUCENT); params.gravity = Gravity.TOP | gravityEndLocaleHack(); return params; }
Example 17
| Project: myrom_frameworks_policies-master File: PhoneWindowManager.java View source code |
/** {@inheritDoc} */
public int checkAddPermission(WindowManager.LayoutParams attrs) {
int type = attrs.type;
if (type < WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW || type > WindowManager.LayoutParams.LAST_SYSTEM_WINDOW) {
return WindowManagerImpl.ADD_OKAY;
}
String permission = null;
switch(type) {
case TYPE_TOAST:
// monitor/control what they are doing.
break;
case TYPE_INPUT_METHOD:
case TYPE_WALLPAPER:
// The window manager will check these.
break;
case TYPE_PHONE:
case TYPE_PRIORITY_PHONE:
case TYPE_SYSTEM_ALERT:
case TYPE_SYSTEM_ERROR:
case TYPE_SYSTEM_OVERLAY:
permission = android.Manifest.permission.SYSTEM_ALERT_WINDOW;
break;
default:
permission = android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
}
if (permission != null) {
if (mContext.checkCallingOrSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
return WindowManagerImpl.ADD_PERMISSION_DENIED;
}
}
return WindowManagerImpl.ADD_OKAY;
}Example 18
| Project: platform_frameworks_policies_base-master File: PhoneWindowManager.java View source code |
public void updateSettings() {
ContentResolver resolver = mContext.getContentResolver();
boolean updateRotation = false;
View addView = null;
View removeView = null;
synchronized (mLock) {
mEndcallBehavior = Settings.System.getInt(resolver, Settings.System.END_BUTTON_BEHAVIOR, Settings.System.END_BUTTON_BEHAVIOR_DEFAULT);
mIncallPowerBehavior = Settings.Secure.getInt(resolver, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT);
mFancyRotationAnimation = Settings.System.getInt(resolver, "fancy_rotation_anim", 0) != 0 ? 0x80 : 0;
int accelerometerDefault = Settings.System.getInt(resolver, Settings.System.ACCELEROMETER_ROTATION, DEFAULT_ACCELEROMETER_ROTATION);
if (mAccelerometerDefault != accelerometerDefault) {
mAccelerometerDefault = accelerometerDefault;
updateOrientationListenerLp();
}
if (mSystemReady) {
int pointerLocation = Settings.System.getInt(resolver, Settings.System.POINTER_LOCATION, 0);
if (mPointerLocationMode != pointerLocation) {
mPointerLocationMode = pointerLocation;
if (pointerLocation != 0) {
if (mPointerLocationView == null) {
mPointerLocationView = new PointerLocationView(mContext);
mPointerLocationView.setPrintCoords(false);
addView = mPointerLocationView;
}
} else {
removeView = mPointerLocationView;
mPointerLocationView = null;
}
}
}
// use screen off timeout setting as the timeout for the lockscreen
mLockScreenTimeout = Settings.System.getInt(resolver, Settings.System.SCREEN_OFF_TIMEOUT, 0);
String imId = Settings.Secure.getString(resolver, Settings.Secure.DEFAULT_INPUT_METHOD);
boolean hasSoftInput = imId != null && imId.length() > 0;
if (mHasSoftInput != hasSoftInput) {
mHasSoftInput = hasSoftInput;
updateRotation = true;
}
}
if (updateRotation) {
updateRotation(0);
}
if (addView != null) {
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
lp.type = WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
lp.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
lp.format = PixelFormat.TRANSLUCENT;
lp.setTitle("PointerLocation");
WindowManagerImpl wm = (WindowManagerImpl) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.addView(addView, lp);
}
if (removeView != null) {
WindowManagerImpl wm = (WindowManagerImpl) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.removeView(removeView);
}
}Example 19
| Project: WS171-frameworks-policies-base-master File: PhoneWindowManager.java View source code |
/** {@inheritDoc} */
public int checkAddPermission(WindowManager.LayoutParams attrs) {
int type = attrs.type;
if (type < WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW || type > WindowManager.LayoutParams.LAST_SYSTEM_WINDOW) {
return WindowManagerImpl.ADD_OKAY;
}
String permission = null;
switch(type) {
case TYPE_TOAST:
// monitor/control what they are doing.
break;
case TYPE_INPUT_METHOD:
// The window manager will check this.
break;
case TYPE_PHONE:
case TYPE_PRIORITY_PHONE:
case TYPE_SYSTEM_ALERT:
case TYPE_SYSTEM_ERROR:
case TYPE_SYSTEM_OVERLAY:
permission = android.Manifest.permission.SYSTEM_ALERT_WINDOW;
break;
default:
permission = android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
}
if (permission != null) {
if (mContext.checkCallingOrSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
return WindowManagerImpl.ADD_PERMISSION_DENIED;
}
}
return WindowManagerImpl.ADD_OKAY;
}Example 20
| Project: property-db-master File: WindowManagerService.java View source code |
boolean updateWallpaperOffsetLocked(WindowState wallpaperWin, int dw, int dh, boolean sync) {
boolean changed = false;
boolean rawChanged = false;
float wpx = mLastWallpaperX >= 0 ? mLastWallpaperX : 0.5f;
float wpxs = mLastWallpaperXStep >= 0 ? mLastWallpaperXStep : -1.0f;
int availw = wallpaperWin.mFrame.right - wallpaperWin.mFrame.left - dw;
int offset = availw > 0 ? -(int) (availw * wpx + .5f) : 0;
changed = wallpaperWin.mXOffset != offset;
if (changed) {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Update wallpaper " + wallpaperWin + " x: " + offset);
wallpaperWin.mXOffset = offset;
}
if (wallpaperWin.mWallpaperX != wpx || wallpaperWin.mWallpaperXStep != wpxs) {
wallpaperWin.mWallpaperX = wpx;
wallpaperWin.mWallpaperXStep = wpxs;
rawChanged = true;
}
float wpy = mLastWallpaperY >= 0 ? mLastWallpaperY : 0.5f;
float wpys = mLastWallpaperYStep >= 0 ? mLastWallpaperYStep : -1.0f;
int availh = wallpaperWin.mFrame.bottom - wallpaperWin.mFrame.top - dh;
offset = availh > 0 ? -(int) (availh * wpy + .5f) : 0;
if (wallpaperWin.mYOffset != offset) {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Update wallpaper " + wallpaperWin + " y: " + offset);
changed = true;
wallpaperWin.mYOffset = offset;
}
if (wallpaperWin.mWallpaperY != wpy || wallpaperWin.mWallpaperYStep != wpys) {
wallpaperWin.mWallpaperY = wpy;
wallpaperWin.mWallpaperYStep = wpys;
rawChanged = true;
}
if (rawChanged && (wallpaperWin.mAttrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS) != 0) {
try {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Report new wp offset " + wallpaperWin + " x=" + wallpaperWin.mWallpaperX + " y=" + wallpaperWin.mWallpaperY);
if (sync) {
mWaitingOnWallpaper = wallpaperWin;
}
wallpaperWin.mClient.dispatchWallpaperOffsets(wallpaperWin.mWallpaperX, wallpaperWin.mWallpaperY, wallpaperWin.mWallpaperXStep, wallpaperWin.mWallpaperYStep, sync);
if (sync) {
if (mWaitingOnWallpaper != null) {
long start = SystemClock.uptimeMillis();
if ((mLastWallpaperTimeoutTime + WALLPAPER_TIMEOUT_RECOVERY) < start) {
try {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Waiting for offset complete...");
mWindowMap.wait(WALLPAPER_TIMEOUT);
} catch (InterruptedException e) {
}
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Offset complete!");
if ((start + WALLPAPER_TIMEOUT) < SystemClock.uptimeMillis()) {
Slog.i(TAG, "Timeout waiting for wallpaper to offset: " + wallpaperWin);
mLastWallpaperTimeoutTime = start;
}
}
mWaitingOnWallpaper = null;
}
}
} catch (RemoteException e) {
}
}
return changed;
}Example 21
| Project: FastAccess-master File: FloatingDrawerView.java View source code |
private void setupParams(@NonNull WindowManager windowManager) {
this.windowManager = windowManager;
originalParams = new WindowManager.LayoutParams(TYPE_PRIORITY_PHONE, FLAG_WATCH_OUTSIDE_TOUCH | FLAG_NOT_TOUCH_MODAL, TRANSLUCENT);
Point szWindow = new Point();
windowManager.getDefaultDisplay().getSize(szWindow);
updateParams(ViewHelper.isLandscape(drawerHolder.appDrawer.getResources()) ? 2 : 1, false);
originalParams.gravity = Gravity.CENTER;
windowManager.addView(drawerHolder.appDrawer, originalParams);
drawerHolder.appDrawer.animate().scaleX(1f).scaleY(1f);
}Example 22
| Project: -abase-reader-master File: FBReader_.java View source code |
private void init_(Bundle savedInstanceState) {
OnViewChangedNotifier.registerOnViewChangedListener(this);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN, android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
menu = MenuPop_.getInstance_(this);
}Example 23
| Project: FBreader-master File: FBReader_.java View source code |
private void init_(Bundle savedInstanceState) {
OnViewChangedNotifier.registerOnViewChangedListener(this);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN, android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
menu = MenuPop_.getInstance_(this);
}Example 24
| Project: Pixelesque-master File: ColorSelectorActivity.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTheme(R.style.myBackgroundStyle);
setContentView(R.layout.colordialog);
setupFromIntent();
if (this.side == RIGHT) {
getWindow().setGravity(Gravity.RIGHT);
android.view.WindowManager.LayoutParams p = getWindow().getAttributes();
p.x = offset;
getWindow().setAttributes(p);
} else if (this.side == BOTTOM) {
getWindow().setGravity(Gravity.BOTTOM);
android.view.WindowManager.LayoutParams p = getWindow().getAttributes();
p.y = offset;
getWindow().setAttributes(p);
}
box = findViewById(R.id.popupbox);
btnOld = (Button) findViewById(R.id.button_old);
btnOld.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
btnNew = (Button) findViewById(R.id.button_new);
btnNew.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (listener != null) {
listener.colorChanged(color);
}
history.selectColor(color);
Intent resultIntent = new Intent();
resultIntent.putExtra(RESULT_COLOR, color);
setResult(Activity.RESULT_OK, resultIntent);
finish();
}
});
content = (ColorSelectorView) findViewById(R.id.content);
//content.setDialog(this);
content.setOnColorChangedListener(new ColorSelectorView.OnColorChangedListener() {
@Override
public void colorChanged(int color) {
colorChangedInternal(color);
}
});
history = (HistorySelectorView) findViewById(R.id.historyselector);
history.setOnColorChangedListener(new HistorySelectorView.OnColorChangedListener() {
@Override
public void colorChanged(int color) {
colorChangedInternal(color);
content.setColor(color);
}
});
btnOld.setBackgroundColor(initColor);
btnOld.setTextColor(~initColor | 0xFF000000);
content.setColor(initColor);
}Example 25
| Project: cornerstone-master File: PhoneWindowManager.java View source code |
public void updateSettings() {
ContentResolver resolver = mContext.getContentResolver();
boolean updateRotation = false;
View addView = null;
View removeView = null;
synchronized (mLock) {
mEndcallBehavior = Settings.System.getInt(resolver, Settings.System.END_BUTTON_BEHAVIOR, Settings.System.END_BUTTON_BEHAVIOR_DEFAULT);
mIncallPowerBehavior = Settings.Secure.getInt(resolver, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT);
int accelerometerDefault = Settings.System.getInt(resolver, Settings.System.ACCELEROMETER_ROTATION, DEFAULT_ACCELEROMETER_ROTATION);
// set up rotation lock state
mUserRotationMode = (accelerometerDefault == 0) ? WindowManagerPolicy.USER_ROTATION_LOCKED : WindowManagerPolicy.USER_ROTATION_FREE;
mUserRotation = Settings.System.getInt(resolver, Settings.System.USER_ROTATION, Surface.ROTATION_0);
if (mAccelerometerDefault != accelerometerDefault) {
mAccelerometerDefault = accelerometerDefault;
updateOrientationListenerLp();
}
mOrientationListener.setLogEnabled(Settings.System.getInt(resolver, Settings.System.WINDOW_ORIENTATION_LISTENER_LOG, 0) != 0);
if (mSystemReady) {
int pointerLocation = Settings.System.getInt(resolver, Settings.System.POINTER_LOCATION, 0);
if (mPointerLocationMode != pointerLocation) {
mPointerLocationMode = pointerLocation;
if (pointerLocation != 0) {
if (mPointerLocationView == null) {
mPointerLocationView = new PointerLocationView(mContext);
mPointerLocationView.setPrintCoords(false);
addView = mPointerLocationView;
}
} else {
removeView = mPointerLocationView;
mPointerLocationView = null;
}
}
}
// use screen off timeout setting as the timeout for the lockscreen
mLockScreenTimeout = Settings.System.getInt(resolver, Settings.System.SCREEN_OFF_TIMEOUT, 0);
String imId = Settings.Secure.getString(resolver, Settings.Secure.DEFAULT_INPUT_METHOD);
boolean hasSoftInput = imId != null && imId.length() > 0;
if (mHasSoftInput != hasSoftInput) {
mHasSoftInput = hasSoftInput;
updateRotation = true;
}
}
if (updateRotation) {
updateRotation(true);
}
if (addView != null) {
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
lp.type = WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY;
lp.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
lp.format = PixelFormat.TRANSLUCENT;
lp.setTitle("PointerLocation");
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL;
wm.addView(addView, lp);
if (mPointerLocationInputChannel == null) {
try {
mPointerLocationInputChannel = mWindowManager.monitorInput("PointerLocationView");
InputQueue.registerInputChannel(mPointerLocationInputChannel, mPointerLocationInputHandler, mHandler.getLooper().getQueue());
} catch (RemoteException ex) {
Slog.e(TAG, "Could not set up input monitoring channel for PointerLocation.", ex);
}
}
}
if (removeView != null) {
if (mPointerLocationInputChannel != null) {
InputQueue.unregisterInputChannel(mPointerLocationInputChannel);
mPointerLocationInputChannel.dispose();
mPointerLocationInputChannel = null;
}
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.removeView(removeView);
}
}Example 26
| Project: frameworks_base_disabled-master File: PhoneWindowManager.java View source code |
private void enablePointerLocation() {
if (mPointerLocationView == null) {
mPointerLocationView = new PointerLocationView(mContext);
mPointerLocationView.setPrintCoords(false);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
lp.type = WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY;
lp.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
lp.format = PixelFormat.TRANSLUCENT;
lp.setTitle("PointerLocation");
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL;
wm.addView(mPointerLocationView, lp);
mPointerLocationInputChannel = mWindowManagerFuncs.monitorInput("PointerLocationView");
mPointerLocationInputEventReceiver = new PointerLocationInputEventReceiver(mPointerLocationInputChannel, Looper.myLooper(), mPointerLocationView);
}
}Example 27
| Project: android-15-master File: PhoneWindowManager.java View source code |
public void updateSettings() {
ContentResolver resolver = mContext.getContentResolver();
boolean updateRotation = false;
View addView = null;
View removeView = null;
synchronized (mLock) {
mEndcallBehavior = Settings.System.getInt(resolver, Settings.System.END_BUTTON_BEHAVIOR, Settings.System.END_BUTTON_BEHAVIOR_DEFAULT);
mIncallPowerBehavior = Settings.Secure.getInt(resolver, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT);
int accelerometerDefault = Settings.System.getInt(resolver, Settings.System.ACCELEROMETER_ROTATION, DEFAULT_ACCELEROMETER_ROTATION);
// set up rotation lock state
mUserRotationMode = (accelerometerDefault == 0) ? WindowManagerPolicy.USER_ROTATION_LOCKED : WindowManagerPolicy.USER_ROTATION_FREE;
mUserRotation = Settings.System.getInt(resolver, Settings.System.USER_ROTATION, Surface.ROTATION_0);
if (mAccelerometerDefault != accelerometerDefault) {
mAccelerometerDefault = accelerometerDefault;
updateOrientationListenerLp();
}
mOrientationListener.setLogEnabled(Settings.System.getInt(resolver, Settings.System.WINDOW_ORIENTATION_LISTENER_LOG, 0) != 0);
if (mSystemReady) {
int pointerLocation = Settings.System.getInt(resolver, Settings.System.POINTER_LOCATION, 0);
if (mPointerLocationMode != pointerLocation) {
mPointerLocationMode = pointerLocation;
if (pointerLocation != 0) {
if (mPointerLocationView == null) {
mPointerLocationView = new PointerLocationView(mContext);
mPointerLocationView.setPrintCoords(false);
addView = mPointerLocationView;
}
} else {
removeView = mPointerLocationView;
mPointerLocationView = null;
}
}
}
// use screen off timeout setting as the timeout for the lockscreen
mLockScreenTimeout = Settings.System.getInt(resolver, Settings.System.SCREEN_OFF_TIMEOUT, 0);
String imId = Settings.Secure.getString(resolver, Settings.Secure.DEFAULT_INPUT_METHOD);
boolean hasSoftInput = imId != null && imId.length() > 0;
if (mHasSoftInput != hasSoftInput) {
mHasSoftInput = hasSoftInput;
updateRotation = true;
}
}
if (updateRotation) {
updateRotation(true);
}
if (addView != null) {
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
lp.type = WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY;
lp.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
lp.format = PixelFormat.TRANSLUCENT;
lp.setTitle("PointerLocation");
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL;
wm.addView(addView, lp);
if (mPointerLocationInputChannel == null) {
try {
mPointerLocationInputChannel = mWindowManager.monitorInput("PointerLocationView");
InputQueue.registerInputChannel(mPointerLocationInputChannel, mPointerLocationInputHandler, mHandler.getLooper().getQueue());
} catch (RemoteException ex) {
Slog.e(TAG, "Could not set up input monitoring channel for PointerLocation.", ex);
}
}
}
if (removeView != null) {
if (mPointerLocationInputChannel != null) {
InputQueue.unregisterInputChannel(mPointerLocationInputChannel);
mPointerLocationInputChannel.dispose();
mPointerLocationInputChannel = null;
}
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.removeView(removeView);
}
}Example 28
| Project: framework_base_policy-master File: PhoneWindowManager.java View source code |
public void updateSettings() {
ContentResolver resolver = mContext.getContentResolver();
boolean updateRotation = false;
View addView = null;
View removeView = null;
synchronized (mLock) {
mEndcallBehavior = Settings.System.getInt(resolver, Settings.System.END_BUTTON_BEHAVIOR, Settings.System.END_BUTTON_BEHAVIOR_DEFAULT);
mIncallPowerBehavior = Settings.Secure.getInt(resolver, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT);
int accelerometerDefault = Settings.System.getInt(resolver, Settings.System.ACCELEROMETER_ROTATION, DEFAULT_ACCELEROMETER_ROTATION);
// set up rotation lock state
mUserRotationMode = (accelerometerDefault == 0) ? WindowManagerPolicy.USER_ROTATION_LOCKED : WindowManagerPolicy.USER_ROTATION_FREE;
mUserRotation = Settings.System.getInt(resolver, Settings.System.USER_ROTATION, Surface.ROTATION_0);
if (mAccelerometerDefault != accelerometerDefault) {
mAccelerometerDefault = accelerometerDefault;
updateOrientationListenerLp();
}
mOrientationListener.setLogEnabled(Settings.System.getInt(resolver, Settings.System.WINDOW_ORIENTATION_LISTENER_LOG, 0) != 0);
if (mSystemReady) {
int pointerLocation = Settings.System.getInt(resolver, Settings.System.POINTER_LOCATION, 0);
if (mPointerLocationMode != pointerLocation) {
mPointerLocationMode = pointerLocation;
if (pointerLocation != 0) {
if (mPointerLocationView == null) {
mPointerLocationView = new PointerLocationView(mContext);
mPointerLocationView.setPrintCoords(false);
addView = mPointerLocationView;
}
} else {
removeView = mPointerLocationView;
mPointerLocationView = null;
}
}
}
// use screen off timeout setting as the timeout for the lockscreen
mLockScreenTimeout = Settings.System.getInt(resolver, Settings.System.SCREEN_OFF_TIMEOUT, 0);
String imId = Settings.Secure.getString(resolver, Settings.Secure.DEFAULT_INPUT_METHOD);
boolean hasSoftInput = imId != null && imId.length() > 0;
if (mHasSoftInput != hasSoftInput) {
mHasSoftInput = hasSoftInput;
updateRotation = true;
}
}
if (updateRotation) {
updateRotation(true);
}
if (addView != null) {
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
lp.type = WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY;
lp.flags = WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
lp.format = PixelFormat.TRANSLUCENT;
lp.setTitle("PointerLocation");
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL;
wm.addView(addView, lp);
if (mPointerLocationInputChannel == null) {
try {
mPointerLocationInputChannel = mWindowManager.monitorInput("PointerLocationView");
InputQueue.registerInputChannel(mPointerLocationInputChannel, mPointerLocationInputHandler, mHandler.getLooper().getQueue());
} catch (RemoteException ex) {
Slog.e(TAG, "Could not set up input monitoring channel for PointerLocation.", ex);
}
}
}
if (removeView != null) {
if (mPointerLocationInputChannel != null) {
InputQueue.unregisterInputChannel(mPointerLocationInputChannel);
mPointerLocationInputChannel.dispose();
mPointerLocationInputChannel = null;
}
WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.removeView(removeView);
}
}Example 29
| Project: AdDetector-master File: MyWindowManager.java View source code |
/**
* create a float window
*
* @param context
* must be the application's Context.
*/
public static void createBigWindow(Context context) {
WindowManager windowManager = getWindowManager(context);
int screenWidth = windowManager.getDefaultDisplay().getWidth();
int screenHeight = windowManager.getDefaultDisplay().getHeight();
if (mWindow == null) {
mWindow = new FloatWindow(context);
if (mWindowParams == null) {
mWindowParams = new LayoutParams();
mWindowParams.x = screenWidth / 2 - FloatWindow.viewWidth / 2;
mWindowParams.y = screenHeight / 2 - FloatWindow.viewHeight / 2;
mWindowParams.type = LayoutParams.TYPE_PHONE;
mWindowParams.format = PixelFormat.RGBA_8888;
mWindowParams.gravity = Gravity.LEFT | Gravity.TOP;
mWindowParams.width = FloatWindow.viewWidth;
mWindowParams.height = FloatWindow.viewHeight;
}
windowManager.addView(mWindow, mWindowParams);
}
}Example 30
| Project: ALLGO-master File: GridViewActivity.java View source code |
@SuppressLint("InlinedApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= 19) {
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gridview);
GridView gridView = (GridView) findViewById(R.id.activity_gridview_gv);
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(new MyAdapter(this, getItems()));
swingBottomInAnimationAdapter.setAbsListView(gridView);
swingBottomInAnimationAdapter.setInitialDelayMillis(300);
gridView.setAdapter(swingBottomInAnimationAdapter);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}Example 31
| Project: android-whereyougo-master File: UtilsGUI.java View source code |
public static void setWindowFloatingRight(Activity activity) {
int height = Math.min(Const.SCREEN_WIDTH, Const.SCREEN_HEIGHT);
// set sizes to window
android.view.WindowManager.LayoutParams params = activity.getWindow().getAttributes();
// set width
params.width = UtilsGUI.getDialogWidth();
params.height = height;
// set location
params.x = (int) (Const.SCREEN_WIDTH - params.width - Utils.getDpPixels(10.0f));
//params.y = 10;//(Const.SCREEN_HEIGHT - height) / 4;
// commit
activity.getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
}Example 32
| Project: AndroidLapTimer-master File: SensitivityDialogActivity.java View source code |
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sensitivity);
findViewById(R.id.button_sensitivity_close).setOnClickListener(this);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
String currentValue = getPreferences(MODE_PRIVATE).getString("sensitivity", "15");
bar = (SeekBar) findViewById(R.id.seekbar_sensitivity);
bar.setOnSeekBarChangeListener(this);
barValue = (TextView) findViewById(R.id.seekbar_sensitivity_value);
barValue.setText(currentValue);
bar.setProgress(Integer.valueOf(currentValue));
// settare il valore nel timer a (25-barValue)
// barra 20 = 5
// barra 15 = 10
// barra 10 = 15
// barra 5 = 20
// barra 0 = 25
}Example 33
| Project: DebugOverlay-Android-master File: OverlayViewManager.java View source code |
public void showDebugSystemOverlay() {
if (config.isAllowSystemLayer() && rootView == null) {
if (!canDrawOnSystemLayer(context, getWindowTypeForOverlay(true))) {
Toast.makeText(context, R.string.debugoverlay_overlay_permission_prompt, Toast.LENGTH_LONG).show();
requestDrawOnSystemLayerPermission(context);
overlayPermissionRequested = true;
return;
}
overlayPermissionRequested = false;
rootView = createRoot();
int layoutParamsWidth = WindowManager.LayoutParams.WRAP_CONTENT;
for (OverlayModule overlayModule : overlayModules) {
View view = overlayModule.createView(rootView, config.getTextColor(), config.getTextSize(), config.getTextAlpha());
if (view.getParent() == null) {
if (view.getLayoutParams() != null && view.getLayoutParams().width == MATCH_PARENT) {
layoutParamsWidth = WindowManager.LayoutParams.MATCH_PARENT;
}
rootView.addView(view);
}
}
WindowManager.LayoutParams params = createLayoutParams(config.isAllowSystemLayer(), layoutParamsWidth, null);
windowManager.addView(rootView, params);
}
}Example 34
| Project: ebook-reader-master File: Brightness.java View source code |
public void onStopTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
android.provider.Settings.System.putInt(cResolver, android.provider.Settings.System.SCREEN_BRIGHTNESS, brightness);
LayoutParams layoutpars = window.getAttributes();
layoutpars.screenBrightness = brightness / (float) 255;
window.setAttributes(layoutpars);
}Example 35
| Project: findyourfriend-master File: EmergenceActivity.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_emergency);
getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
init();
txtTicker = (TextView) findViewById(R.id.txtTicker);
findViewById(R.id.btnCancel).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
isStop = true;
}
});
counter = 10;
final Handler handler = new Handler();
final Runnable r = new Runnable() {
public void run() {
if (counter >= 0 && !isStop) {
txtTicker.setText(counter + "");
// play sound
if (isSound)
SoundManager.getInstance().playSound(getApplicationContext());
if (isVibrate) {
if (counter > 0)
vibrator.vibrate(300);
else
vibrator.vibrate(800);
}
counter--;
handler.postDelayed(this, 1000);
} else {
if (!isStop) {
// excute
sendWarning();
Utility.showMessage(getApplicationContext(), "đã gá»i yêu cầu trợ giúp");
}
finish();
}
}
};
handler.postDelayed(r, 0);
}Example 36
| Project: GlassTunes-master File: ScreenSlideActivity.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_screen_slide);
mPager = (ViewPager) findViewById(R.id.pager);
mPager.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
select();
}
});
mPagerAdapter = onCreatePagerAdapter();
mPager.setAdapter(mPagerAdapter);
mPageIndicator = (PageIndicator) findViewById(R.id.vpi);
if (mInitialItem > 0) {
mPageIndicator.setViewPager(mPager, mInitialItem);
} else {
mPageIndicator.setViewPager(mPager);
}
mGestureDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
mPager.performClick();
return true;
}
;
});
}Example 37
| Project: hplookball-master File: AuthDialog.java View source code |
private void initView() {
View v = LayoutInflater.from(mContext).inflate(R.layout.dialog_authorize, null);
lay_qq_channel = (LinearLayout) v.findViewById(R.id.auth_qq_layout);
lay_phone_channel = (LinearLayout) v.findViewById(R.id.auth_phone_layout);
lay_hupu_channel = (LinearLayout) v.findViewById(R.id.auth_hupu_layout);
unBind = (TextView) v.findViewById(R.id.un_login);
unBind.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
lay_qq_channel.setOnClickListener(new channelListener());
lay_phone_channel.setOnClickListener(new channelListener());
lay_hupu_channel.setOnClickListener(new channelListener());
unBind.setOnClickListener(new channelListener());
titleView = (TextView) v.findViewById(R.id.txt_explanation);
titleView.setText(DialogTitleStr);
setContentView(v);
WindowManager m = mAct.getWindowManager();
// 为获��幕宽�高
Display d = m.getDefaultDisplay();
// 获�对�框当�的�数值
LayoutParams p = getWindow().getAttributes();
//p.height = (int) (d.getHeight() * 1.0); // 高度设置为�幕的1.0
// 宽度设置为�幕的0.92
p.width = (int) (d.getWidth() * 0.92);
// p.alpha = 1.0f; //设置本身�明度
// p.dimAmount = 0.0f; //设置黑暗度
// 设置生效
getWindow().setAttributes(p);
getWindow().setGravity(Gravity.CENTER);
}Example 38
| Project: keepassdroid-master File: LockCloseHideActivity.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Several gingerbread devices have problems with FLAG_SECURE
int ver = BuildCompat.getSdkVersion();
if (ver >= BuildCompat.VERSION_CODE_ICE_CREAM_SANDWICH || ver < BuildCompat.VERSION_CODE_GINGERBREAD) {
getWindow().setFlags(LayoutParams.FLAG_SECURE, LayoutParams.FLAG_SECURE);
}
}Example 39
| Project: lyricsplayer.android-master File: PlayerActivity.java View source code |
public void run() {
btnPlayPause.setImageResource(R.drawable.player_play);
sbProgress.setProgress(0);
tvElapsedTime.setText(currentSong.getElapsedTimeString());
tvRemainingTime.setText(currentSong.getRemainingTimeString());
getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}Example 40
| Project: MultiWii_EZ_GUI-master File: FilePickerActivity.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.file_picker_layout);
getWindow().setLayout(LayoutParams.MATCH_PARENT, /* width */
LayoutParams.WRAP_CONTENT);
SPFiles = (Spinner) findViewById(R.id.spinnerFiles);
extension = "mission";
loadFilesNamesToSpinner(extension);
}Example 41
| Project: quick-settings-master File: ScreenLightActivity.java View source code |
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.flashlight);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
SettingsApplication app = (SettingsApplication) getApplication();
String value = app.getPreferences().getString(Constants.PREF_FLASHLIGHT_SWITCH, "0");
switch(Integer.parseInt(value)) {
case 1:
mSwitchDetector = new DelaySwitchDetector(this);
break;
case 2:
mSwitchDetector = new ShakeSwitchDeterctor(this);
break;
default:
mSwitchDetector = new OrientationSwitchDetector(this);
break;
}
mMessage = (TextView) findViewById(R.id.text);
mMessage.setText(mSwitchDetector.getTextId());
}Example 42
| Project: SmileEssence-Lite-master File: SimpleMenuDialog.java View source code |
public Dialog create() {
dispose();
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
if (titleView == null) {
builder.setTitle(title);
} else {
builder.setCustomTitle(titleView);
}
List<MenuCommand> list1 = getMenuList();
List<MenuCommand> list2 = new ArrayList<MenuCommand>();
for (MenuCommand command : list1) {
boolean isEnabled = true;
if (command instanceof IHideable) {
PreferenceHelper pref = Client.getPreferenceHelper();
isEnabled = pref.getPreferenceValue(command.getClass().getSimpleName(), EnumValueType.BOOLEAN, false);
}
if (command.getDefaultVisibility() && isEnabled) {
list2.add(command);
}
}
ListView listview = new ListView(activity);
MenuListAdapter adapter = new MenuListAdapter(activity);
adapter.addAll(list2);
adapter.forceNotifyAdapter();
listview.setAdapter(adapter);
builder.setView(listview);
dialog = builder.create();
LayoutParams lp = dialog.getWindow().getAttributes();
DisplayMetrics metrics = activity.getResources().getDisplayMetrics();
lp.width = (int) (metrics.widthPixels * 0.9);
lp.gravity = Gravity.CENTER;
lp.height = (int) (metrics.heightPixels * 0.8);
return dialog;
}Example 43
| Project: youtui-core-master File: YtShareDialog.java View source code |
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
LayoutParams lp = new LayoutParams();
WindowManager manager = activity.getWindowManager();
Display display = manager.getDefaultDisplay();
lp.width = display.getWidth() * 7 / 8;
setContentView(new ShareView(activity, data, listener, platform).setOnBackListener(this), lp);
}Example 44
| Project: legacy-patchrom-master File: PhoneWindowManager.java View source code |
public void updateSettings() {
ContentResolver resolver = mContext.getContentResolver();
boolean updateRotation = false;
View addView = null;
View removeView = null;
synchronized (mLock) {
mEndcallBehavior = Settings.System.getInt(resolver, Settings.System.END_BUTTON_BEHAVIOR, Settings.System.END_BUTTON_BEHAVIOR_DEFAULT);
mIncallPowerBehavior = Settings.Secure.getInt(resolver, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT);
mFancyRotationAnimation = Settings.System.getInt(resolver, "fancy_rotation_anim", 0) != 0 ? 0x80 : 0;
int accelerometerDefault = Settings.System.getInt(resolver, Settings.System.ACCELEROMETER_ROTATION, DEFAULT_ACCELEROMETER_ROTATION);
if (mAccelerometerDefault != accelerometerDefault) {
mAccelerometerDefault = accelerometerDefault;
updateOrientationListenerLp();
}
if (mSystemReady) {
int pointerLocation = Settings.System.getInt(resolver, Settings.System.POINTER_LOCATION, 0);
if (mPointerLocationMode != pointerLocation) {
mPointerLocationMode = pointerLocation;
if (pointerLocation != 0) {
if (mPointerLocationView == null) {
mPointerLocationView = new PointerLocationView(mContext);
mPointerLocationView.setPrintCoords(false);
addView = mPointerLocationView;
}
} else {
removeView = mPointerLocationView;
mPointerLocationView = null;
}
}
}
// use screen off timeout setting as the timeout for the lockscreen
mLockScreenTimeout = Settings.System.getInt(resolver, Settings.System.SCREEN_OFF_TIMEOUT, 0);
String imId = Settings.Secure.getString(resolver, Settings.Secure.DEFAULT_INPUT_METHOD);
boolean hasSoftInput = imId != null && imId.length() > 0;
if (mHasSoftInput != hasSoftInput) {
mHasSoftInput = hasSoftInput;
updateRotation = true;
}
}
if (updateRotation) {
updateRotation(0);
}
if (addView != null) {
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
lp.type = WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY;
lp.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
lp.format = PixelFormat.TRANSLUCENT;
lp.setTitle("PointerLocation");
WindowManagerImpl wm = (WindowManagerImpl) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.addView(addView, lp);
if (mPointerLocationInputChannel == null) {
try {
mPointerLocationInputChannel = mWindowManager.monitorInput("PointerLocationView");
InputQueue.registerInputChannel(mPointerLocationInputChannel, mPointerLocationInputHandler, mHandler.getLooper().getQueue());
} catch (RemoteException ex) {
Slog.e(TAG, "Could not set up input monitoring channel for PointerLocation.", ex);
}
}
}
if (removeView != null) {
if (mPointerLocationInputChannel != null) {
InputQueue.unregisterInputChannel(mPointerLocationInputChannel);
mPointerLocationInputChannel.dispose();
mPointerLocationInputChannel = null;
}
WindowManagerImpl wm = (WindowManagerImpl) mContext.getSystemService(Context.WINDOW_SERVICE);
wm.removeView(removeView);
}
}Example 45
| Project: android-sdk-sources-for-api-level-23-master File: WindowManagerService.java View source code |
boolean updateWallpaperOffsetLocked(WindowState wallpaperWin, int dw, int dh, boolean sync) {
boolean changed = false;
boolean rawChanged = false;
float wpx = mLastWallpaperX >= 0 ? mLastWallpaperX : 0.5f;
float wpxs = mLastWallpaperXStep >= 0 ? mLastWallpaperXStep : -1.0f;
int availw = wallpaperWin.mFrame.right - wallpaperWin.mFrame.left - dw;
int offset = availw > 0 ? -(int) (availw * wpx + .5f) : 0;
if (mLastWallpaperDisplayOffsetX != Integer.MIN_VALUE) {
offset += mLastWallpaperDisplayOffsetX;
}
changed = wallpaperWin.mXOffset != offset;
if (changed) {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Update wallpaper " + wallpaperWin + " x: " + offset);
wallpaperWin.mXOffset = offset;
}
if (wallpaperWin.mWallpaperX != wpx || wallpaperWin.mWallpaperXStep != wpxs) {
wallpaperWin.mWallpaperX = wpx;
wallpaperWin.mWallpaperXStep = wpxs;
rawChanged = true;
}
float wpy = mLastWallpaperY >= 0 ? mLastWallpaperY : 0.5f;
float wpys = mLastWallpaperYStep >= 0 ? mLastWallpaperYStep : -1.0f;
int availh = wallpaperWin.mFrame.bottom - wallpaperWin.mFrame.top - dh;
offset = availh > 0 ? -(int) (availh * wpy + .5f) : 0;
if (mLastWallpaperDisplayOffsetY != Integer.MIN_VALUE) {
offset += mLastWallpaperDisplayOffsetY;
}
if (wallpaperWin.mYOffset != offset) {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Update wallpaper " + wallpaperWin + " y: " + offset);
changed = true;
wallpaperWin.mYOffset = offset;
}
if (wallpaperWin.mWallpaperY != wpy || wallpaperWin.mWallpaperYStep != wpys) {
wallpaperWin.mWallpaperY = wpy;
wallpaperWin.mWallpaperYStep = wpys;
rawChanged = true;
}
if (rawChanged && (wallpaperWin.mAttrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS) != 0) {
try {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Report new wp offset " + wallpaperWin + " x=" + wallpaperWin.mWallpaperX + " y=" + wallpaperWin.mWallpaperY);
if (sync) {
mWaitingOnWallpaper = wallpaperWin;
}
wallpaperWin.mClient.dispatchWallpaperOffsets(wallpaperWin.mWallpaperX, wallpaperWin.mWallpaperY, wallpaperWin.mWallpaperXStep, wallpaperWin.mWallpaperYStep, sync);
if (sync) {
if (mWaitingOnWallpaper != null) {
long start = SystemClock.uptimeMillis();
if ((mLastWallpaperTimeoutTime + WALLPAPER_TIMEOUT_RECOVERY) < start) {
try {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Waiting for offset complete...");
mWindowMap.wait(WALLPAPER_TIMEOUT);
} catch (InterruptedException e) {
}
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Offset complete!");
if ((start + WALLPAPER_TIMEOUT) < SystemClock.uptimeMillis()) {
Slog.i(TAG, "Timeout waiting for wallpaper to offset: " + wallpaperWin);
mLastWallpaperTimeoutTime = start;
}
}
mWaitingOnWallpaper = null;
}
}
} catch (RemoteException e) {
}
}
return changed;
}Example 46
| Project: FineDay-master File: MainActivity_.java View source code |
private void init_(Bundle savedInstanceState) {
OnViewChangedNotifier.registerOnViewChangedListener(this);
fadeIn = AnimationUtils.loadAnimation(this, anim.fade_in);
app = MyApp_.getInstance();
getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN, android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
weaterLogic = WeaterLogic_.getInstance_(this);
adapter = WeaterAdapter_.getInstance_(this);
}Example 47
| Project: godot-master File: GodotAdMob.java View source code |
@Override
public void run() {
//if(android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.JELLY_BEAN)
//{
// activity.getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
// android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
//}
AdRequest.Builder adBuilder = new AdRequest.Builder();
adBuilder.tagForChildDirectedTreatment(true);
if (!isRealAd) {
adBuilder.addTestDevice(AdRequest.DEVICE_ID_EMULATOR);
adBuilder.addTestDevice(getAdmobDeviceId());
}
request = adBuilder.build();
adListener = new AdListener() {
@Override
public void onAdLoaded() {
Log.d("godot", "AdMob: OnAdLoaded");
}
@Override
public void onAdFailedToLoad(int errorCode) {
String str;
switch(errorCode) {
case AdRequest.ERROR_CODE_INTERNAL_ERROR:
str = "ERROR_CODE_INTERNAL_ERROR";
break;
case AdRequest.ERROR_CODE_INVALID_REQUEST:
str = "ERROR_CODE_INVALID_REQUEST";
break;
case AdRequest.ERROR_CODE_NETWORK_ERROR:
str = "ERROR_CODE_NETWORK_ERROR";
break;
case AdRequest.ERROR_CODE_NO_FILL:
str = "ERROR_CODE_NO_FILL";
break;
default:
str = "Code: " + errorCode;
break;
}
Log.w("godot", "AdMob: onAdFailedToLoad->" + str);
}
};
setBannerView();
}Example 48
| Project: simple_weather-master File: MainActivity_.java View source code |
private void init_(Bundle savedInstanceState) {
OnViewChangedNotifier.registerOnViewChangedListener(this);
fadeIn = AnimationUtils.loadAnimation(this, anim.fade_in);
app = MyApp_.getInstance();
getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN, android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
weaterLogic = WeaterLogic_.getInstance_(this);
adapter = WeaterAdapter_.getInstance_(this);
}Example 49
| Project: Spika-Android-master File: Tutorial.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.hookup_tutorial);
sInstance = this;
LayoutParams params = getWindow().getAttributes();
params.height = LayoutParams.MATCH_PARENT;
params.width = LayoutParams.MATCH_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
setDuration(LONG_ANIM_DURATION);
mTutorialLayout = (RelativeLayout) findViewById(R.id.rlTutorial);
mTutorialText = (TextView) findViewById(R.id.tvTutorialText);
mTutorialText.setText(getIntent().getStringExtra(TEXT));
setTranslateAnimations();
startTranslateAnimations();
}Example 50
| Project: TaroReader-master File: UIUtil.java View source code |
public static void wait(String key, Runnable action, Context context) {
synchronized (ourMonitor) {
final String message = ZLResource.resource("dialog").getResource("waitMessage").getResource(key).getValue();
ourTaskQueue.offer(new Pair(action, message));
if (ourProgress == null) {
// ourProgress = ProgressDialog.show(context, null, message, true, false);
// LayoutInflater inflater = from(context);
// LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.loading, null);
// ImageView image = new ImageView(context);
// image.setBackgroundResource(R.drawable.loading);
// LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
// image.setLayoutParams(params);
ourProgress = new AlertDialog.Builder(context).create();
ourProgress.show();
ourProgress.getWindow().setGravity(Gravity.CENTER);
ourProgress.getWindow().setLayout(android.view.WindowManager.LayoutParams.FILL_PARENT, android.view.WindowManager.LayoutParams.FILL_PARENT);
ourProgress.getWindow().setContentView(R.layout.loading);
// ourProgress.setView(layout, 0, 0, 0, 0);
} else {
return;
}
}
final AlertDialog currentProgress = ourProgress;
new Thread(new Runnable() {
public void run() {
while ((ourProgress == currentProgress) && !ourTaskQueue.isEmpty()) {
Pair p = ourTaskQueue.poll();
p.Action.run();
synchronized (ourMonitor) {
ourProgressHandler.sendEmptyMessage(0);
try {
ourMonitor.wait();
} catch (InterruptedException e) {
}
}
}
}
}).start();
}Example 51
| Project: an2linuxclient-master File: WifiDialogNew.java View source code |
@Override
void saveWifiServerToDatabase(boolean newCertificate) {
ServerDatabaseHandler dbHandler = ServerDatabaseHandler.getInstance(getActivity());
long rowId;
if (newCertificate) {
long certificateId = dbHandler.getCertificateId(TlsHelper.certificateToBytes(serverCert));
boolean certificateAlreadyInDatabase = certificateId != -1;
if (certificateAlreadyInDatabase) {
Toast.makeText(getActivity(), R.string.certificate_already_in_database, Toast.LENGTH_LONG).show();
rowId = dbHandler.addWifiServer(new WifiServer(ipOrHostname, portNumber, ssidWhitelist), certificateId);
} else {
rowId = dbHandler.addWifiServer(new WifiServer(serverCert, ipOrHostname, portNumber, ssidWhitelist));
}
} else {
rowId = dbHandler.addWifiServer(new WifiServer(ipOrHostname, portNumber, ssidWhitelist), spinnerSelectedCertificateId);
}
serverAdapterListCallbacks.addServer(dbHandler.getWifiServer(rowId));
getActivity().getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
getDialog().cancel();
}Example 52
| Project: andevcon-2014-jl-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 53
| Project: android-1-master File: TestBubbleActivity.java View source code |
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
getDimension();
bubbleView = getLayoutInflater().inflate(R.layout.overlay_pop, null);
tvKnow = (TextView) bubbleView.findViewById(R.id.bubble_btn);
tvKnow.setText(Html.fromHtml("<u>" + "我知�了" + "</u>"));
tvBubContent = (TextView) bubbleView.findViewById(R.id.bubble_text);
tvBubContent.setText("上次程åº?异常退出,æ£åœ¨ä¼ 输历å?²æ•°æ?®...");
tvKnow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bubbleAlert.cancel();
}
});
int tmpWidth = SCREEN_WIDTH / 5 * 3;
int tmpHeight = SCREEN_HEIGHT / 8;
System.out.println("tmpWidth=****=" + tmpWidth);
System.out.println("tmpHeight=++++=" + tmpHeight);
//设置TextView宽度
tvKnow.setMinWidth(tmpWidth);
tvBubContent.setMaxWidth(tmpWidth);
//ä»¥æŒ‡å®šçš„æ ·å¼?åˆ?始化dialog
bubbleAlert = new Dialog(this, R.style.bubble_dialog);
//获�所在window
Window win = bubbleAlert.getWindow();
//获�LayoutParams
LayoutParams params = win.getAttributes();
//设置xå??æ ‡
params.x = -(SCREEN_WIDTH / 8);
//设置yå??æ ‡
params.y = -tmpHeight;
params.width = tmpWidth;
//设置生效
win.setAttributes(params);
bubbleAlert.setCancelable(false);
bubbleAlert.setContentView(bubbleView);
bubbleAlert.show();
}Example 54
| Project: android-priority-jobqueue-examples-master File: EditNameDialog.java View source code |
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_edit_name, container);
// EventBus.getDefault().registerSticky(this, LoggedInEvent.class);
mEditText = (EditText) view.findViewById(R.id.txt_your_name);
cancel = (Button) view.findViewById(R.id.cancel);
add = (Button) view.findViewById(R.id.add);
getDialog().setTitle("Enter the Text:");
// Show soft keyboard automatically
mEditText.requestFocus();
getDialog().getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
mEditText.setOnEditorActionListener(this);
return view;
}Example 55
| Project: Android_Example_Projects-master File: GridViewActivity.java View source code |
@SuppressLint("InlinedApi")
@Override
protected void onCreate(final Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gridview);
GridView gridView = (GridView) findViewById(R.id.activity_gridview_gv);
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(new MyAdapter(this, getItems()));
swingBottomInAnimationAdapter.setAbsListView(gridView);
swingBottomInAnimationAdapter.setInitialDelayMillis(300);
gridView.setAdapter(swingBottomInAnimationAdapter);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}Example 56
| Project: ApiDemos-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 57
| Project: ApkLauncher-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 58
| Project: ApkLauncher_legacy-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 59
| Project: dttv-android-master File: IndexActivity.java View source code |
public void open_pager(View v) {
/*Intent intent = new Intent();
intent.setClass(this, MainActivity.class);
startActivity(intent);*/
/*PopWindowCompnent compnent = new PopWindowCompnent(this,this);
compnent.show(v, true);*/
View view = LayoutInflater.from(this).inflate(R.layout.effect_popwindow, null);
ListView listView = (ListView) view.findViewById(R.id.pop_listview);
TextView textView = (TextView) view.findViewById(R.id.pop_window_txt);
float textSize = textView.getTextSize();
Log.i("textSize", "----textSize is:" + textSize);
textView.setTextSize(textSize < 18 ? 18 : 21);
PopupWindow popupWindow = new PopupWindow(view, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
//popupWindow.setBackgroundDrawable(R.drawable.)
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, Constant.gEqulizerPresets);
popupWindow.setAnimationStyle(R.style.pop_win_style);
ColorDrawable dw = new ColorDrawable(0xb0000000);
popupWindow.setBackgroundDrawable(dw);
listView.setAdapter(adapter);
//popupWindow.showAsDropDown(v);
int location[] = new int[2];
v.getLocationOnScreen(location);
int _x = location[0];
int _y = location[1] - popupWindow.getHeight();
popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, _x, _y);
//popupWindow.showAsDropDown(v, _x, _y);
}Example 60
| Project: felix-on-android-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 61
| Project: frostwire-android-master File: ShareIndicationDialog.java View source code |
private void initComponents() {
getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.dialog_share_indication);
setCancelable(true);
buttonDone = (Button) findViewById(R.id.dialog_share_indicator_button_done);
buttonDone.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dismiss();
getPreferences().edit().putBoolean(Constants.PREF_KEY_GUI_SHOW_SHARE_INDICATION, checkShow.isChecked()).commit();
}
});
checkShow = (CheckBox) findViewById(R.id.dialog_share_indicator_check_show);
checkShow.setChecked(getPreferences().getBoolean(Constants.PREF_KEY_GUI_SHOW_SHARE_INDICATION, true));
}Example 62
| Project: GradleCodeLab-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 63
| Project: iAndroid_ios6ui-master File: RotationLoadDialog.java View source code |
public static RotationLoadDialog createDialog(Context context) {
if (mDialog == null) {
mDialog = new RotationLoadDialog(context, R.style.rotation_load_dialog);
mDialog.setContentView(R.layout.rotation_load_dialog);
mDialog.getWindow().getAttributes().gravity = Gravity.CENTER;
LayoutParams p = mDialog.getWindow().getAttributes();
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display d = wm.getDefaultDisplay();
p.width = (int) (d.getWidth() * 0.61);
mDialog.getWindow().setAttributes(p);
}
return mDialog;
}Example 64
| Project: iAndroid_ios7_ui-master File: RotationLoadDialog.java View source code |
public static RotationLoadDialog createDialog(Context context) {
if (mDialog == null) {
mDialog = new RotationLoadDialog(context, R.style.rotation_load_dialog);
mDialog.setContentView(R.layout.rotation_load_dialog);
mDialog.getWindow().getAttributes().gravity = Gravity.CENTER;
LayoutParams p = mDialog.getWindow().getAttributes();
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display d = wm.getDefaultDisplay();
p.width = (int) (d.getWidth() * 0.61);
mDialog.getWindow().setAttributes(p);
}
return mDialog;
}Example 65
| Project: LightMe-master File: GuideViewManager.java View source code |
public void add(View guideView, int gravity, int posX, int posY, long autoCloseTimeDelay, boolean closeAble) {
mGuideView = guideView;
mGuideView.measure(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
winParams.width = mGuideView.getMeasuredWidth();
winParams.height = mGuideView.getMeasuredHeight();
winParams.gravity = gravity;
winParams.x = posX;
winParams.y = posY;
wm.addView(guideView, winParams);
guideView.setOnTouchListener(this);
guideView.setOnClickListener(this);
if (autoCloseTimeDelay > 0) {
autoCloseTask = new TimerTask() {
@Override
public void run() {
handler.sendEmptyMessage(AUTO_CLOSE_MSG);
autoCloseTask = null;
}
};
timer.schedule(autoCloseTask, autoCloseTimeDelay);
}
}Example 66
| Project: MySnippetRepo-master File: ExpressionActivity.java View source code |
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_expression);
tv = (TextView) findViewById(R.id.text);
et = (EditText) findViewById(R.id.edit);
bt = (Button) findViewById(R.id.button);
bt2 = (Button) findViewById(R.id.button2);
final SelectExpressionDialog sed = new SelectExpressionDialog(ExpressionActivity.this, R.style.ExpressionDialog);
sed.setCanceledOnTouchOutside(true);
Window window = sed.getWindow();
LayoutParams lp = window.getAttributes();
lp.y = Gravity.BOTTOM;
window.setAttributes(lp);
final String[] stringarray = getResources().getStringArray(SmileyParser.DEFAULT_SMILEY_TEXTS);
final int[] expressions = SmileyParser.DEFAULT_SMILEY_RES_IDS;
bt.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
sed.show();
ExpressionChooserAdapter eca = new ExpressionChooserAdapter(ExpressionActivity.this, expressions, stringarray);
GridView gv = (GridView) sed.findViewById(R.id.expressions_chooser);
gv.setAdapter(eca);
gv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> apv, View v, int position, long id) {
GridView gv = (GridView) apv;
String str = (String) gv.getItemAtPosition(position);
SmileyParser smileparser = new SmileyParser(ExpressionActivity.this);
et.setText(smileparser.replace(et.getText().append(str)));
et.setSelection(et.getText().length());
cacheSelectedExpression = et.getText().toString();
sed.dismiss();
}
});
}
});
bt2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
tv.setText(cacheSelectedExpression);
}
});
}Example 67
| Project: ulti-master File: ItemManipulationsExamplesActivity.java View source code |
@SuppressLint("InlinedApi")
@Override
protected void onCreate(final Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.list_anim_activity_examples_itemmanipulations);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}Example 68
| Project: UltimateAndroid-master File: ItemManipulationsExamplesActivity.java View source code |
@SuppressLint("InlinedApi")
@Override
protected void onCreate(final Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.list_anim_activity_examples_itemmanipulations);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}Example 69
| Project: zip4j-master File: PasswordDialog.java View source code |
/*
* (non-Javadoc)
* @see android.support.v4.app.DialogFragment#onCreateDialog(android.os.Bundle)
*/
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.zip_password_fragment, null, false);
EditText passwordEdit = (EditText) view.findViewById(R.id.zip_password_edittext);
mPasswordEdit = passwordEdit;
passwordEdit.requestFocus();
passwordEdit.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (EditorInfo.IME_ACTION_DONE == actionId) {
mListener.onOkButtonPressed(mZipEntry, mPasswordEdit.getText().toString());
PasswordDialog.this.dismiss();
return true;
}
return false;
}
});
if (savedInstanceState != null) {
String password = savedInstanceState.getString(KEY_PASSWORD);
if (!TextUtils.isEmpty(password)) {
mPasswordEdit.setText(password);
}
}
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("Encrypted zip file");
builder.setPositiveButton(android.R.string.ok, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
mListener.onOkButtonPressed(mZipEntry, mPasswordEdit.getText().toString());
}
});
builder.setView(view);
Dialog d = builder.create();
d.getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
return d;
}Example 70
| Project: cnAndroidDocs-master File: WindowManagerService.java View source code |
boolean updateWallpaperOffsetLocked(WindowState wallpaperWin, int dw, int dh, boolean sync) {
boolean changed = false;
boolean rawChanged = false;
float wpx = mLastWallpaperX >= 0 ? mLastWallpaperX : 0.5f;
float wpxs = mLastWallpaperXStep >= 0 ? mLastWallpaperXStep : -1.0f;
int availw = wallpaperWin.mFrame.right - wallpaperWin.mFrame.left - dw;
int offset = availw > 0 ? -(int) (availw * wpx + .5f) : 0;
changed = wallpaperWin.mXOffset != offset;
if (changed) {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Update wallpaper " + wallpaperWin + " x: " + offset);
wallpaperWin.mXOffset = offset;
}
if (wallpaperWin.mWallpaperX != wpx || wallpaperWin.mWallpaperXStep != wpxs) {
wallpaperWin.mWallpaperX = wpx;
wallpaperWin.mWallpaperXStep = wpxs;
rawChanged = true;
}
float wpy = mLastWallpaperY >= 0 ? mLastWallpaperY : 0.5f;
float wpys = mLastWallpaperYStep >= 0 ? mLastWallpaperYStep : -1.0f;
int availh = wallpaperWin.mFrame.bottom - wallpaperWin.mFrame.top - dh;
offset = availh > 0 ? -(int) (availh * wpy + .5f) : 0;
if (wallpaperWin.mYOffset != offset) {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Update wallpaper " + wallpaperWin + " y: " + offset);
changed = true;
wallpaperWin.mYOffset = offset;
}
if (wallpaperWin.mWallpaperY != wpy || wallpaperWin.mWallpaperYStep != wpys) {
wallpaperWin.mWallpaperY = wpy;
wallpaperWin.mWallpaperYStep = wpys;
rawChanged = true;
}
if (rawChanged && (wallpaperWin.mAttrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_WANTS_OFFSET_NOTIFICATIONS) != 0) {
try {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Report new wp offset " + wallpaperWin + " x=" + wallpaperWin.mWallpaperX + " y=" + wallpaperWin.mWallpaperY);
if (sync) {
mWaitingOnWallpaper = wallpaperWin;
}
wallpaperWin.mClient.dispatchWallpaperOffsets(wallpaperWin.mWallpaperX, wallpaperWin.mWallpaperY, wallpaperWin.mWallpaperXStep, wallpaperWin.mWallpaperYStep, sync);
if (sync) {
if (mWaitingOnWallpaper != null) {
long start = SystemClock.uptimeMillis();
if ((mLastWallpaperTimeoutTime + WALLPAPER_TIMEOUT_RECOVERY) < start) {
try {
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Waiting for offset complete...");
mWindowMap.wait(WALLPAPER_TIMEOUT);
} catch (InterruptedException e) {
}
if (DEBUG_WALLPAPER)
Slog.v(TAG, "Offset complete!");
if ((start + WALLPAPER_TIMEOUT) < SystemClock.uptimeMillis()) {
Slog.i(TAG, "Timeout waiting for wallpaper to offset: " + wallpaperWin);
mLastWallpaperTimeoutTime = start;
}
}
mWaitingOnWallpaper = null;
}
}
} catch (RemoteException e) {
}
}
return changed;
}Example 71
| Project: XobotOS-master File: IWindowSession.java View source code |
@Override
public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException {
switch(code) {
case INTERFACE_TRANSACTION:
{
reply.writeString(DESCRIPTOR);
return true;
}
case TRANSACTION_add:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
int _arg1;
_arg1 = data.readInt();
android.view.WindowManager.LayoutParams _arg2;
if ((0 != data.readInt())) {
_arg2 = android.view.WindowManager.LayoutParams.CREATOR.createFromParcel(data);
} else {
_arg2 = null;
}
int _arg3;
_arg3 = data.readInt();
android.graphics.Rect _arg4;
_arg4 = new android.graphics.Rect();
android.view.InputChannel _arg5;
_arg5 = new android.view.InputChannel();
int _result = this.add(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5);
reply.writeNoException();
reply.writeInt(_result);
if ((_arg4 != null)) {
reply.writeInt(1);
_arg4.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
if ((_arg5 != null)) {
reply.writeInt(1);
_arg5.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
return true;
}
case TRANSACTION_addWithoutInputChannel:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
int _arg1;
_arg1 = data.readInt();
android.view.WindowManager.LayoutParams _arg2;
if ((0 != data.readInt())) {
_arg2 = android.view.WindowManager.LayoutParams.CREATOR.createFromParcel(data);
} else {
_arg2 = null;
}
int _arg3;
_arg3 = data.readInt();
android.graphics.Rect _arg4;
_arg4 = new android.graphics.Rect();
int _result = this.addWithoutInputChannel(_arg0, _arg1, _arg2, _arg3, _arg4);
reply.writeNoException();
reply.writeInt(_result);
if ((_arg4 != null)) {
reply.writeInt(1);
_arg4.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
return true;
}
case TRANSACTION_remove:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
this.remove(_arg0);
reply.writeNoException();
return true;
}
case TRANSACTION_relayout:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
int _arg1;
_arg1 = data.readInt();
android.view.WindowManager.LayoutParams _arg2;
if ((0 != data.readInt())) {
_arg2 = android.view.WindowManager.LayoutParams.CREATOR.createFromParcel(data);
} else {
_arg2 = null;
}
int _arg3;
_arg3 = data.readInt();
int _arg4;
_arg4 = data.readInt();
int _arg5;
_arg5 = data.readInt();
boolean _arg6;
_arg6 = (0 != data.readInt());
android.graphics.Rect _arg7;
_arg7 = new android.graphics.Rect();
android.graphics.Rect _arg8;
_arg8 = new android.graphics.Rect();
android.graphics.Rect _arg9;
_arg9 = new android.graphics.Rect();
android.content.res.Configuration _arg10;
_arg10 = new android.content.res.Configuration();
android.view.Surface _arg11;
_arg11 = new android.view.Surface();
int _result = this.relayout(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11);
reply.writeNoException();
reply.writeInt(_result);
if ((_arg7 != null)) {
reply.writeInt(1);
_arg7.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
if ((_arg8 != null)) {
reply.writeInt(1);
_arg8.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
if ((_arg9 != null)) {
reply.writeInt(1);
_arg9.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
if ((_arg10 != null)) {
reply.writeInt(1);
_arg10.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
if ((_arg11 != null)) {
reply.writeInt(1);
_arg11.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
return true;
}
case TRANSACTION_outOfMemory:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
boolean _result = this.outOfMemory(_arg0);
reply.writeNoException();
reply.writeInt(((_result) ? (1) : (0)));
return true;
}
case TRANSACTION_setTransparentRegion:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
android.graphics.Region _arg1;
if ((0 != data.readInt())) {
_arg1 = android.graphics.Region.CREATOR.createFromParcel(data);
} else {
_arg1 = null;
}
this.setTransparentRegion(_arg0, _arg1);
reply.writeNoException();
return true;
}
case TRANSACTION_setInsets:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
int _arg1;
_arg1 = data.readInt();
android.graphics.Rect _arg2;
if ((0 != data.readInt())) {
_arg2 = android.graphics.Rect.CREATOR.createFromParcel(data);
} else {
_arg2 = null;
}
android.graphics.Rect _arg3;
if ((0 != data.readInt())) {
_arg3 = android.graphics.Rect.CREATOR.createFromParcel(data);
} else {
_arg3 = null;
}
android.graphics.Region _arg4;
if ((0 != data.readInt())) {
_arg4 = android.graphics.Region.CREATOR.createFromParcel(data);
} else {
_arg4 = null;
}
this.setInsets(_arg0, _arg1, _arg2, _arg3, _arg4);
reply.writeNoException();
return true;
}
case TRANSACTION_getDisplayFrame:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
android.graphics.Rect _arg1;
_arg1 = new android.graphics.Rect();
this.getDisplayFrame(_arg0, _arg1);
reply.writeNoException();
if ((_arg1 != null)) {
reply.writeInt(1);
_arg1.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
return true;
}
case TRANSACTION_finishDrawing:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
this.finishDrawing(_arg0);
reply.writeNoException();
return true;
}
case TRANSACTION_setInTouchMode:
{
data.enforceInterface(DESCRIPTOR);
boolean _arg0;
_arg0 = (0 != data.readInt());
this.setInTouchMode(_arg0);
reply.writeNoException();
return true;
}
case TRANSACTION_getInTouchMode:
{
data.enforceInterface(DESCRIPTOR);
boolean _result = this.getInTouchMode();
reply.writeNoException();
reply.writeInt(((_result) ? (1) : (0)));
return true;
}
case TRANSACTION_performHapticFeedback:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
int _arg1;
_arg1 = data.readInt();
boolean _arg2;
_arg2 = (0 != data.readInt());
boolean _result = this.performHapticFeedback(_arg0, _arg1, _arg2);
reply.writeNoException();
reply.writeInt(((_result) ? (1) : (0)));
return true;
}
case TRANSACTION_prepareDrag:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
int _arg1;
_arg1 = data.readInt();
int _arg2;
_arg2 = data.readInt();
int _arg3;
_arg3 = data.readInt();
android.view.Surface _arg4;
_arg4 = new android.view.Surface();
android.os.IBinder _result = this.prepareDrag(_arg0, _arg1, _arg2, _arg3, _arg4);
reply.writeNoException();
reply.writeStrongBinder(_result);
if ((_arg4 != null)) {
reply.writeInt(1);
_arg4.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
return true;
}
case TRANSACTION_performDrag:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
android.os.IBinder _arg1;
_arg1 = data.readStrongBinder();
float _arg2;
_arg2 = data.readFloat();
float _arg3;
_arg3 = data.readFloat();
float _arg4;
_arg4 = data.readFloat();
float _arg5;
_arg5 = data.readFloat();
android.content.ClipData _arg6;
if ((0 != data.readInt())) {
_arg6 = android.content.ClipData.CREATOR.createFromParcel(data);
} else {
_arg6 = null;
}
boolean _result = this.performDrag(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
reply.writeNoException();
reply.writeInt(((_result) ? (1) : (0)));
return true;
}
case TRANSACTION_reportDropResult:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
boolean _arg1;
_arg1 = (0 != data.readInt());
this.reportDropResult(_arg0, _arg1);
reply.writeNoException();
return true;
}
case TRANSACTION_dragRecipientEntered:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
this.dragRecipientEntered(_arg0);
reply.writeNoException();
return true;
}
case TRANSACTION_dragRecipientExited:
{
data.enforceInterface(DESCRIPTOR);
android.view.IWindow _arg0;
_arg0 = android.view.IWindow.Stub.asInterface(data.readStrongBinder());
this.dragRecipientExited(_arg0);
reply.writeNoException();
return true;
}
case TRANSACTION_setWallpaperPosition:
{
data.enforceInterface(DESCRIPTOR);
android.os.IBinder _arg0;
_arg0 = data.readStrongBinder();
float _arg1;
_arg1 = data.readFloat();
float _arg2;
_arg2 = data.readFloat();
float _arg3;
_arg3 = data.readFloat();
float _arg4;
_arg4 = data.readFloat();
this.setWallpaperPosition(_arg0, _arg1, _arg2, _arg3, _arg4);
reply.writeNoException();
return true;
}
case TRANSACTION_wallpaperOffsetsComplete:
{
data.enforceInterface(DESCRIPTOR);
android.os.IBinder _arg0;
_arg0 = data.readStrongBinder();
this.wallpaperOffsetsComplete(_arg0);
reply.writeNoException();
return true;
}
case TRANSACTION_sendWallpaperCommand:
{
data.enforceInterface(DESCRIPTOR);
android.os.IBinder _arg0;
_arg0 = data.readStrongBinder();
java.lang.String _arg1;
_arg1 = data.readString();
int _arg2;
_arg2 = data.readInt();
int _arg3;
_arg3 = data.readInt();
int _arg4;
_arg4 = data.readInt();
android.os.Bundle _arg5;
if ((0 != data.readInt())) {
_arg5 = android.os.Bundle.CREATOR.createFromParcel(data);
} else {
_arg5 = null;
}
boolean _arg6;
_arg6 = (0 != data.readInt());
android.os.Bundle _result = this.sendWallpaperCommand(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
reply.writeNoException();
if ((_result != null)) {
reply.writeInt(1);
_result.writeToParcel(reply, android.os.Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
} else {
reply.writeInt(0);
}
return true;
}
case TRANSACTION_wallpaperCommandComplete:
{
data.enforceInterface(DESCRIPTOR);
android.os.IBinder _arg0;
_arg0 = data.readStrongBinder();
android.os.Bundle _arg1;
if ((0 != data.readInt())) {
_arg1 = android.os.Bundle.CREATOR.createFromParcel(data);
} else {
_arg1 = null;
}
this.wallpaperCommandComplete(_arg0, _arg1);
reply.writeNoException();
return true;
}
}
return super.onTransact(code, data, reply, flags);
}Example 72
| Project: android-apidemos-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 73
| Project: android-flash-card-master File: UpdateStatusResultDialog.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHandler = new Handler();
setContentView(R.layout.update_post_response);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
mOutput = (TextView) findViewById(R.id.apiOutput);
mOutput.setText(values.toString());
mUsefulTip = (TextView) findViewById(R.id.usefulTip);
mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
mViewPostButton = (Button) findViewById(R.id.view_post_button);
mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
final String postId = values.getString("post_id");
mViewPostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: view_post_tag
*/
Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
}
});
mDeletePostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: delete_post_tag
*/
Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE", new WallPostDeleteListener(), null);
}
});
}Example 74
| Project: android-maven-plugin-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 75
| Project: android-open-project-demo-master File: GridViewActivity.java View source code |
@SuppressLint("InlinedApi")
@Override
protected void onCreate(final Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
super.onCreate(savedInstanceState);
setTitle("Gridview动画");
setContentView(R.layout.activity_gridview);
GridView gridView = (GridView) findViewById(R.id.activity_gridview_gv);
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(new MyAdapter(this, getItems()));
swingBottomInAnimationAdapter.setAbsListView(gridView);
swingBottomInAnimationAdapter.setInitialDelayMillis(300);
gridView.setAdapter(swingBottomInAnimationAdapter);
}Example 76
| Project: android-project-Demo-master File: GridViewActivity.java View source code |
@SuppressLint("InlinedApi")
@Override
protected void onCreate(final Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
super.onCreate(savedInstanceState);
setTitle("Gridview动画");
setContentView(R.layout.activity_gridview);
GridView gridView = (GridView) findViewById(R.id.activity_gridview_gv);
SwingBottomInAnimationAdapter swingBottomInAnimationAdapter = new SwingBottomInAnimationAdapter(new MyAdapter(this, getItems()));
swingBottomInAnimationAdapter.setAbsListView(gridView);
swingBottomInAnimationAdapter.setInitialDelayMillis(300);
gridView.setAdapter(swingBottomInAnimationAdapter);
}Example 77
| Project: Android-SDK-Samples-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 78
| Project: android-speedtest-mapper-master File: InputDialogFragment.java View source code |
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_dialog_input, container);
mEditText = (EditText) view.findViewById(R.id.txt_input_area);
mDoneButton = (Button) view.findViewById(R.id.btn_process_input_data);
getDialog().setTitle(getText(R.string.lbl_input_heading));
// Show soft keyboard automatically
mEditText.requestFocus();
getDialog().getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
mEditText.setOnEditorActionListener(this);
mDoneButton.setOnClickListener(this);
return view;
}Example 79
| Project: AndroidFBPhotoPicker-master File: UpdateStatusResultDialog.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHandler = new Handler();
setContentView(R.layout.update_post_response);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
mOutput = (TextView) findViewById(R.id.apiOutput);
mOutput.setText(values.toString());
mUsefulTip = (TextView) findViewById(R.id.usefulTip);
mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
mViewPostButton = (Button) findViewById(R.id.view_post_button);
mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
final String postId = values.getString("post_id");
mViewPostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: view_post_tag
*/
Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
}
});
mDeletePostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: delete_post_tag
*/
Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE", new WallPostDeleteListener(), null);
}
});
}Example 80
| Project: apidemo-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 81
| Project: astrid-master File: UpdateStatusResultDialog.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHandler = new Handler();
setContentView(R.layout.update_post_response);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
mOutput = (TextView) findViewById(R.id.apiOutput);
mOutput.setText(values.toString());
mUsefulTip = (TextView) findViewById(R.id.usefulTip);
mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
mViewPostButton = (Button) findViewById(R.id.view_post_button);
mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
final String postId = values.getString("post_id");
mViewPostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: view_post_tag
*/
Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
}
});
mDeletePostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: delete_post_tag
*/
Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE", new WallPostDeleteListener(), null);
}
});
}Example 82
| Project: AudioPlayer-master File: DesktopLrc.java View source code |
public void newWindow(Context context) {
mWM = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
this.setOnTouchListener(this);
wmParams = new WindowManager.LayoutParams();
wmParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT | WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
wmParams.format = 1;
wmParams.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL | LayoutParams.FLAG_NOT_FOCUSABLE;
wmParams.width = LayoutParams.MATCH_PARENT;
wmParams.height = (int) (3 * TextSize);
// 将本æŒè¯?æŽ§ä»¶æ·»åŠ åˆ°çª—å?£
mWM.addView(this, wmParams);
}Example 83
| Project: Brink-master File: UpdateStatusResultDialog.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHandler = new Handler();
setContentView(R.layout.update_post_response);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
mOutput = (TextView) findViewById(R.id.apiOutput);
mOutput.setText(values.toString());
mUsefulTip = (TextView) findViewById(R.id.usefulTip);
mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
mViewPostButton = (Button) findViewById(R.id.view_post_button);
mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
final String postId = values.getString("post_id");
mViewPostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: view_post_tag
*/
Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
}
});
mDeletePostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: delete_post_tag
*/
Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE", new WallPostDeleteListener(), null);
}
});
}Example 84
| Project: cordova-plugin-screen-locker-master File: ScreenLocker.java View source code |
@Override
public void run() {
Window window = cordova.getActivity().getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
window.clearFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
window.clearFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
if (wakeLock.isHeld()) {
wakeLock.release();
}
Log.v(TAG, "ScreenLocker received SUCCESS:" + action);
callbackContext.success();
}Example 85
| Project: CSipSimple-master File: PickupSipUri.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pickup_uri);
//Set window size
// LayoutParams params = getWindow().getAttributes();
// params.width = LayoutParams.FILL_PARENT;
// getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
//Set title
// TODO -- use dialog instead
// ((TextView) findViewById(R.id.my_title)).setText(R.string.pickup_sip_uri);
// ((ImageView) findViewById(R.id.my_icon)).setImageResource(android.R.drawable.ic_menu_call);
okBtn = (Button) findViewById(R.id.ok);
okBtn.setOnClickListener(this);
Button btn = (Button) findViewById(R.id.cancel);
btn.setOnClickListener(this);
sipUri = (EditSipUri) findViewById(R.id.sip_uri);
sipUri.getTextField().setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView tv, int action, KeyEvent arg2) {
if (action == EditorInfo.IME_ACTION_GO) {
sendPositiveResult();
return true;
}
return false;
}
});
sipUri.setShowExternals(false);
}Example 86
| Project: CSipSimple-old-master File: PickupSipUri.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pickup_uri);
//Set window size
// LayoutParams params = getWindow().getAttributes();
// params.width = LayoutParams.FILL_PARENT;
// getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
//Set title
// TODO -- use dialog instead
// ((TextView) findViewById(R.id.my_title)).setText(R.string.pickup_sip_uri);
// ((ImageView) findViewById(R.id.my_icon)).setImageResource(android.R.drawable.ic_menu_call);
okBtn = (Button) findViewById(R.id.ok);
okBtn.setOnClickListener(this);
Button btn = (Button) findViewById(R.id.cancel);
btn.setOnClickListener(this);
sipUri = (EditSipUri) findViewById(R.id.sip_uri);
sipUri.getTextField().setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView tv, int action, KeyEvent arg2) {
if (action == EditorInfo.IME_ACTION_GO) {
sendPositiveResult();
return true;
}
return false;
}
});
sipUri.setShowExternals(false);
}Example 87
| Project: FacebookNewsfeedSample-Android-master File: UpdateStatusResultDialog.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHandler = new Handler();
setContentView(R.layout.update_post_response);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
mOutput = (TextView) findViewById(R.id.apiOutput);
mOutput.setText(values.toString());
mUsefulTip = (TextView) findViewById(R.id.usefulTip);
mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
mViewPostButton = (Button) findViewById(R.id.view_post_button);
mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
final String postId = values.getString("post_id");
mViewPostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: view_post_tag
*/
Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
}
});
mDeletePostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: delete_post_tag
*/
Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE", new WallPostDeleteListener(), null);
}
});
}Example 88
| Project: FeedMeAndroid-master File: UpdateStatusResultDialog.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHandler = new Handler();
setContentView(R.layout.update_post_response);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
mOutput = (TextView) findViewById(R.id.apiOutput);
mOutput.setText(values.toString());
mUsefulTip = (TextView) findViewById(R.id.usefulTip);
mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
mViewPostButton = (Button) findViewById(R.id.view_post_button);
mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
final String postId = values.getString("post_id");
mViewPostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: view_post_tag
*/
Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
}
});
mDeletePostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: delete_post_tag
*/
Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE", new WallPostDeleteListener(), null);
}
});
}Example 89
| Project: focus-bluetooth-android-master File: UpdateStatusResultDialog.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHandler = new Handler();
setContentView(R.layout.update_post_response);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
mOutput = (TextView) findViewById(R.id.apiOutput);
mOutput.setText(values.toString());
mUsefulTip = (TextView) findViewById(R.id.usefulTip);
mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
mViewPostButton = (Button) findViewById(R.id.view_post_button);
mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
final String postId = values.getString("post_id");
mViewPostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: view_post_tag
*/
Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
}
});
mDeletePostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: delete_post_tag
*/
Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE", new WallPostDeleteListener(), null);
}
});
}Example 90
| Project: gnucash-android-master File: PasscodeLockActivity.java View source code |
@Override
protected void onResume() {
super.onResume();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
boolean isPassEnabled = prefs.getBoolean(UxArgument.ENABLED_PASSCODE, false);
if (isPassEnabled) {
getWindow().addFlags(LayoutParams.FLAG_SECURE);
} else {
getWindow().clearFlags(LayoutParams.FLAG_SECURE);
}
// Only for Android Lollipop that brings a few changes to the recent apps feature
if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) != 0) {
GnuCashApplication.PASSCODE_SESSION_INIT_TIME = 0;
}
// see ExportFormFragment.onPause()
boolean skipPasscode = prefs.getBoolean(UxArgument.SKIP_PASSCODE_SCREEN, false);
prefs.edit().remove(UxArgument.SKIP_PASSCODE_SCREEN).apply();
String passCode = prefs.getString(UxArgument.PASSCODE, "");
if (isPassEnabled && !isSessionActive() && !passCode.trim().isEmpty() && !skipPasscode) {
Log.v(TAG, "Show passcode screen");
Intent intent = new Intent(this, PasscodeLockScreenActivity.class).setAction(getIntent().getAction()).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK).putExtra(UxArgument.PASSCODE_CLASS_CALLER, this.getClass().getName());
if (getIntent().getExtras() != null)
intent.putExtras(getIntent().getExtras());
startActivity(intent);
}
}Example 91
| Project: luper-master File: UpdateStatusResultDialog.java View source code |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mHandler = new Handler();
setContentView(R.layout.update_post_response);
LayoutParams params = getWindow().getAttributes();
params.width = LayoutParams.FILL_PARENT;
params.height = LayoutParams.FILL_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
mOutput = (TextView) findViewById(R.id.apiOutput);
mOutput.setText(values.toString());
mUsefulTip = (TextView) findViewById(R.id.usefulTip);
mUsefulTip.setMovementMethod(LinkMovementMethod.getInstance());
mViewPostButton = (Button) findViewById(R.id.view_post_button);
mDeletePostButton = (Button) findViewById(R.id.delete_post_button);
final String postId = values.getString("post_id");
mViewPostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: view_post_tag
*/
Utility.mAsyncRunner.request(postId, new WallPostRequestListener());
}
});
mDeletePostButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* Source tag: delete_post_tag
*/
Utility.mAsyncRunner.request(postId, new Bundle(), "DELETE", new WallPostDeleteListener(), null);
}
});
}Example 92
| Project: Magnet-master File: MagnetOnTouchTest.java View source code |
@Before
public void setUp() throws Exception {
Display displayMock = mock(Display.class);
Resources resourcesMock = mock(Resources.class);
Context contextMock = mock(Context.class);
DisplayMetrics displayMetricsMock = mock(DisplayMetrics.class);
int initialX = 2;
int initialY = 4;
displayMetricsMock.widthPixels = initialX;
displayMetricsMock.heightPixels = initialY;
removeViewMock = mock(RemoveView.class);
WindowManager windowManagerMock = mock(WindowManager.class);
IconCallback iconCallbackMock = mock(IconCallback.class);
ImageView iconViewMock = mock(ImageView.class);
LayoutParams paramsMock = mock(LayoutParams.class);
doReturn(windowManagerMock).when(contextMock).getSystemService(Context.WINDOW_SERVICE);
doReturn(displayMetricsMock).when(resourcesMock).getDisplayMetrics();
doReturn(displayMock).when(windowManagerMock).getDefaultDisplay();
doReturn(resourcesMock).when(contextMock).getResources();
whenNew(RemoveView.class).withArguments(contextMock).thenReturn(removeViewMock);
whenNew(DisplayMetrics.class).withNoArguments().thenReturn(displayMetricsMock);
whenNew(LayoutParams.class).withAnyArguments().thenReturn(paramsMock);
GestureDetector gestureDetectorMock = mock(GestureDetector.class);
whenNew(GestureDetector.class).withAnyArguments().thenReturn(gestureDetectorMock);
motionEventMock = mock(MotionEvent.class);
doReturn(false).when(gestureDetectorMock).onTouchEvent(motionEventMock);
moveAnimatorMock = mock(Magnet.MoveAnimator.class);
magnet = Magnet.newBuilder(contextMock).setIconView(iconViewMock).setIconCallback(iconCallbackMock).setRemoveIconResId(R.drawable.trash).setRemoveIconShadow(R.drawable.bottom_shadow).setShouldFlingAway(true).setShouldStickToWall(true).setRemoveIconShouldBeResponsive(true).setInitialPosition(initialX, initialY).build();
setInternalState(magnet, "mAnimator", moveAnimatorMock);
setInternalState(magnet, "mLayoutParams", paramsMock);
viewMock = mock(View.class);
}Example 93
| Project: mobile-spec-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 94
| Project: new-biubiu-for-android-master File: PopupUtil.java View source code |
/**
* create a popup menu
* @param context
* @param contentView
* @return
*/
public static Dialog makePopup(Context context, View contentView) {
Dialog dialog = new Dialog(context, R.style.popupDialog);
Window window = dialog.getWindow();
WindowManager.LayoutParams windowParams = new WindowManager.LayoutParams();
int[] size = getScreenSize(context);
windowParams.x = 0;
windowParams.y = size[HEIGHT];
//设置window的布局�数
window.setAttributes(windowParams);
// window.setBackgroundDrawableResource(R.drawable.alert_dialog_background);
dialog.setCanceledOnTouchOutside(true);
dialog.setContentView(contentView);
// 显示的大�是contentView 的大�
dialog.getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
return dialog;
}Example 95
| Project: njtransit-master File: JumpDialog.java View source code |
public void onClick(View v) {
onLetterSelect(c);
if (alpha && c.equals("#")) {
LayoutParams lp = new LayoutParams();
Display display = getWindow().getWindowManager().getDefaultDisplay();
lp.width = display.getWidth();
lp.height = display.getHeight();
JumpDialog.this.dismiss();
JumpDialog.this.setContentView(getLayoutInflater().inflate(R.layout.new_jumper_number, null), lp);
alpha = !alpha;
JumpDialog.this.show();
return;
}
if (!alpha && c.equals("A")) {
LayoutParams lp = new LayoutParams();
Display display = getWindow().getWindowManager().getDefaultDisplay();
lp.width = display.getWidth();
lp.height = display.getHeight();
JumpDialog.this.dismiss();
JumpDialog.this.setContentView(getLayoutInflater().inflate(R.layout.new_jumper, null), lp);
JumpDialog.this.show();
alpha = !alpha;
return;
} else {
listener.onJump(c);
JumpDialog.this.dismiss();
}
}Example 96
| Project: photogallery-master File: PhotoFullDialog.java View source code |
@Override
public void onResume() {
ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.height = WindowManager.LayoutParams.MATCH_PARENT;
getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
super.onResume();
}Example 97
| Project: platform_development-master File: List9.java View source code |
public void run() {
mReady = true;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_APPLICATION, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, PixelFormat.TRANSLUCENT);
mWindowManager.addView(mDialogText, lp);
}Example 98
| Project: pps_android-master File: FootView.java View source code |
/**
* ³õʼ»¯½çÃæ
* @param pContext
*/
public void initView(Context pContext) {
mWindowManager = (WindowManager) pContext.getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
this.setImageResource(imgId);
screenWidth = mWindowManager.getDefaultDisplay().getWidth();
windowManagerParams.type = LayoutParams.TYPE_PHONE;
// ±³¾°É«Í¸Ã÷
windowManagerParams.format = PixelFormat.RGBA_8888;
windowManagerParams.flags = LayoutParams.FLAG_NOT_TOUCH_MODAL | LayoutParams.FLAG_NOT_FOCUSABLE;
//Ðü¸¡¿òÔÚÆÁÄ»µÄ×óÉÏ·½
windowManagerParams.gravity = Gravity.LEFT | Gravity.TOP;
//ÒÔÆÁÄ»×óÉÏ·½ÎªÆðµã
windowManagerParams.x = 0;
windowManagerParams.y = 20;
windowManagerParams.width = LayoutParams.WRAP_CONTENT;
windowManagerParams.height = LayoutParams.WRAP_CONTENT;
}Example 99
| Project: Protocoder-master File: NewTaskSchedulerFragment.java View source code |
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setTitle("title").setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
doOK();
}
}).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
});
View view = getActivity().getLayoutInflater().inflate(R.layout.fragment_dialog_new_task_scheduler, null);
mEditText = (EditText) view.findViewById(R.id.dialog_new_project_name_input);
// Show soft keyboard automatically
mEditText.requestFocus();
mEditText.setOnEditorActionListener(this);
AlertDialog dialog = builder.create();
dialog.setView(view);
dialog.setTitle("New project");
dialog.getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
return dialog;
}Example 100
| Project: Qmusic-master File: TipsDialogFragment.java View source code |
@Override
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
LayoutParams params = window.getAttributes();
if (RelativeLayout.ALIGN_RIGHT == alignType) {
int[] screenSize = BUtilities.getScreenSize(getActivity());
params.gravity = Gravity.RIGHT | Gravity.TOP;
params.x = screenSize[0] - location[0] - location[2];
params.y = location[1] + location[4];
} else if (RelativeLayout.ALIGN_LEFT == alignType) {
params.gravity = Gravity.LEFT | Gravity.TOP;
params.x = location[0];
params.y = location[1] + location[4];
} else if (RelativeLayout.ALIGN_TOP == alignType) {
params.gravity = Gravity.LEFT | Gravity.TOP;
params.x = location[0];
// TODO how to get the dialog height?
DisplayMetrics displayMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
params.y = location[1] + location[4] - location[3] - (int) (54 * displayMetrics.density);
}
params.width = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
params.height = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
params.alpha = 0.9f;
// params.horizontalMargin = 0.1f;/*�离边界的百分比*/
// params.horizontalWeight = 0;// 0.5f;
params.windowAnimations = R.style.b_dialog_menu_animation_style;
window.setAttributes(params);
}Example 101
| Project: Roid-Library-master File: RLDialog.java View source code |
/**
*
*/
public void createView() {
super.setContentView(getView());
window = getWindow();
layoutParams = window.getAttributes();
super.setCanceledOnTouchOutside(true);
window.addFlags(LayoutParams.FLAG_DIM_BEHIND);
layoutParams.alpha = 0.98765f;
layoutParams.dimAmount = 0.4321f;
window.setWindowAnimations(R.style.ANIMATIONS_SCALE_FADE);
}