Search in sources :

Example 96 with Window

use of android.view.Window in project android_frameworks_base by AOSPA.

the class Activity method onPostResume.

/**
     * Called when activity resume is complete (after {@link #onResume} has
     * been called). Applications will generally not implement this method;
     * it is intended for system classes to do final setup after application
     * resume code has run.
     *
     * <p><em>Derived classes must call through to the super class's
     * implementation of this method.  If they do not, an exception will be
     * thrown.</em></p>
     *
     * @see #onResume
     */
@CallSuper
protected void onPostResume() {
    final Window win = getWindow();
    if (win != null)
        win.makeActive();
    if (mActionBar != null)
        mActionBar.setShowHideAnimationEnabled(true);
    mCalled = true;
}
Also used : PhoneWindow(com.android.internal.policy.PhoneWindow) Window(android.view.Window) CallSuper(android.annotation.CallSuper)

Example 97 with Window

use of android.view.Window in project android_frameworks_base by AOSPA.

the class BrightnessDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final Window window = getWindow();
    window.setGravity(Gravity.TOP);
    window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
    window.requestFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.quick_settings_brightness_dialog);
    final ImageView icon = (ImageView) findViewById(R.id.brightness_icon);
    final ToggleSlider slider = (ToggleSlider) findViewById(R.id.brightness_slider);
    mBrightnessController = new BrightnessController(this, icon, slider);
}
Also used : Window(android.view.Window) ImageView(android.widget.ImageView)

Example 98 with Window

use of android.view.Window in project android_frameworks_base by AOSPA.

the class ActivityTransitionState method setEnterActivityOptions.

public void setEnterActivityOptions(Activity activity, ActivityOptions options) {
    final Window window = activity.getWindow();
    if (window == null) {
        return;
    }
    // ensure Decor View has been created so that the window features are activated
    window.getDecorView();
    if (window.hasFeature(Window.FEATURE_ACTIVITY_TRANSITIONS) && options != null && mEnterActivityOptions == null && mEnterTransitionCoordinator == null && options.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) {
        mEnterActivityOptions = options;
        mIsEnterTriggered = false;
        if (mEnterActivityOptions.isReturning()) {
            restoreExitedViews();
            int result = mEnterActivityOptions.getResultCode();
            if (result != 0) {
                activity.onActivityReenter(result, mEnterActivityOptions.getResultData());
            }
        }
    }
}
Also used : Window(android.view.Window)

Example 99 with Window

use of android.view.Window in project android_frameworks_base by ResurrectionRemix.

the class OnTheGoDialog method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Window window = getWindow();
    window.setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY);
    window.getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
    window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
    window.requestFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.quick_settings_onthego_dialog);
    setCanceledOnTouchOutside(true);
    final ContentResolver resolver = mContext.getContentResolver();
    final SeekBar mSlider = (SeekBar) findViewById(R.id.alpha_slider);
    final float value = Settings.System.getFloat(resolver, Settings.System.ON_THE_GO_ALPHA, 0.5f);
    final int progress = ((int) (value * 100));
    mSlider.setProgress(progress);
    mSlider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
            sendAlphaBroadcast(String.valueOf(i + 10));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            removeAllOnTheGoDialogCallbacks();
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
        }
    });
    if (!OnTheGoUtils.hasFrontCamera(getContext())) {
        findViewById(R.id.onthego_category_1).setVisibility(View.GONE);
    } else {
        final Switch mServiceToggle = (Switch) findViewById(R.id.onthego_service_toggle);
        final boolean restartService = Settings.System.getInt(resolver, Settings.System.ON_THE_GO_SERVICE_RESTART, 0) == 1;
        mServiceToggle.setChecked(restartService);
        mServiceToggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                Settings.System.putInt(resolver, Settings.System.ON_THE_GO_SERVICE_RESTART, (b ? 1 : 0));
                dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
            }
        });
        final Switch mCamSwitch = (Switch) findViewById(R.id.onthego_camera_toggle);
        final boolean useFrontCam = (Settings.System.getInt(resolver, Settings.System.ON_THE_GO_CAMERA, 0) == 1);
        mCamSwitch.setChecked(useFrontCam);
        mCamSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                Settings.System.putInt(resolver, Settings.System.ON_THE_GO_CAMERA, (b ? 1 : 0));
                sendCameraBroadcast();
                dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
            }
        });
    }
}
Also used : Window(android.view.Window) SeekBar(android.widget.SeekBar) Switch(android.widget.Switch) CompoundButton(android.widget.CompoundButton) ContentResolver(android.content.ContentResolver)

Example 100 with Window

use of android.view.Window in project android_frameworks_base by ResurrectionRemix.

the class DecorView method getStackId.

/**
     * Returns the Id of the stack which contains this window.
     * Note that if no stack can be determined - which usually means that it was not
     * created for an activity - the fullscreen stack ID will be returned.
     * @return Returns the stack id which contains this window.
     **/
private int getStackId() {
    int workspaceId = INVALID_STACK_ID;
    final Window.WindowControllerCallback callback = mWindow.getWindowControllerCallback();
    if (callback != null) {
        try {
            workspaceId = callback.getWindowStackId();
        } catch (RemoteException ex) {
            Log.e(mLogTag, "Failed to get the workspace ID of a PhoneWindow.");
        }
    }
    if (workspaceId == INVALID_STACK_ID) {
        return FULLSCREEN_WORKSPACE_STACK_ID;
    }
    return workspaceId;
}
Also used : Window(android.view.Window) PopupWindow(android.widget.PopupWindow) RemoteException(android.os.RemoteException) Paint(android.graphics.Paint)

Aggregations

Window (android.view.Window)310 View (android.view.View)69 WindowManager (android.view.WindowManager)56 TextView (android.widget.TextView)34 TargetApi (android.annotation.TargetApi)26 ImageView (android.widget.ImageView)25 Activity (android.app.Activity)17 Dialog (android.app.Dialog)17 ViewGroup (android.view.ViewGroup)17 ColorDrawable (android.graphics.drawable.ColorDrawable)16 AdapterView (android.widget.AdapterView)16 PhoneWindow (com.android.internal.policy.PhoneWindow)15 Intent (android.content.Intent)11 Context (android.content.Context)10 LayoutInflater (android.view.LayoutInflater)10 WindowDecorActionBar (com.android.internal.app.WindowDecorActionBar)10 RemoteException (android.os.RemoteException)9 DisplayMetrics (android.util.DisplayMetrics)9 LinearLayout (android.widget.LinearLayout)9 PopupWindow (android.widget.PopupWindow)8