Example usage for android.graphics PixelFormat RGBA_8888

List of usage examples for android.graphics PixelFormat RGBA_8888

Introduction

In this page you can find the example usage for android.graphics PixelFormat RGBA_8888.

Prototype

int RGBA_8888

To view the source code for android.graphics PixelFormat RGBA_8888.

Click Source Link

Usage

From source file:com.vuze.android.remote.activity.LoginActivity.java

@SuppressWarnings("deprecation")
@Override//from   w  w w.ja  v a 2 s  .co  m
protected void onCreate(Bundle savedInstanceState) {
    // These are an attempt to make the gradient look better on some
    // android devices.  It doesn't on the ones I tested, but it can't hurt to
    // have it here, right?
    getWindow().setFormat(PixelFormat.RGBA_8888);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        Window w = getWindow(); // in Activity's onCreate() for instance
        w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
                WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            w.setNavigationBarColor(ContextCompat.getColor(this, R.color.login_grad_color_2));
        }
    }

    AndroidUtilsUI.onCreate(this);
    super.onCreate(savedInstanceState);

    if (AndroidUtils.DEBUG) {
        Log.d(TAG, "LoginActivity intent = " + getIntent() + "/" + getIntent().getDataString());
    }

    appPreferences = VuzeRemoteApp.getAppPreferences();

    setContentView(R.layout.activity_login);

    textAccessCode = (EditText) findViewById(R.id.editTextAccessCode);
    assert textAccessCode != null;

    RemoteProfile lastUsedRemote = appPreferences.getLastUsedRemote();
    if (lastUsedRemote != null && lastUsedRemote.getRemoteType() == RemoteProfile.TYPE_LOOKUP
            && lastUsedRemote.getAC() != null) {
        textAccessCode.setText(lastUsedRemote.getAC());
        textAccessCode.selectAll();
    }
    textAccessCode.setOnEditorActionListener(new OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            loginButtonClicked(v);
            return true;
        }
    });

    TextView tvLoginCopyright = (TextView) findViewById(R.id.login_copyright);
    if (tvLoginCopyright != null) {
        AndroidUtilsUI.linkify(tvLoginCopyright);
    }

    TextView tvLoginGuide = (TextView) findViewById(R.id.login_guide);
    setupGuideText(tvLoginGuide);
    tvLoginGuide.setFocusable(false);
    TextView tvLoginGuide2 = (TextView) findViewById(R.id.login_guide2);
    setupGuideText(tvLoginGuide2);

    View coreArea = findViewById(R.id.login_core_area);
    if (coreArea != null) {
        coreArea.setVisibility(VuzeRemoteApp.isCoreAllowed() ? View.VISIBLE : View.GONE);
    }

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayShowHomeEnabled(true);
        actionBar.setIcon(R.drawable.ic_launcher);
    }
}

From source file:com.keifermiller.inkbar.activities.IBActivity.java

@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    this.getWindow().setFormat(PixelFormat.RGBA_8888);
}

From source file:net.margaritov.preference.colorpicker.dialog.ColorPickerDialogFragment.java

@NonNull
@Override/*from   w  ww .  j av  a2  s .c om*/
public Dialog onCreateDialog(Bundle savedInstanceState) {

    if (getActivity() != null) {
        final Dialog dialog = new Dialog(getActivity(), android.R.style.Theme_DeviceDefault_Light_Dialog);
        dialog.getWindow().setFormat(PixelFormat.RGBA_8888);

        dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        dialog.setContentView(R.layout.view_color_picker_dialog);

        colorPicker = (ColorPickerView) dialog.findViewById(R.id.color_picker_view);
        oldColor = (ColorPanelView) dialog.findViewById(R.id.color_panel_old);
        newColor = (ColorPanelView) dialog.findViewById(R.id.color_panel_new);
        ((LinearLayout) oldColor.getParent()).setPadding(Math.round(colorPicker.getDrawingOffset()), 0,
                Math.round(colorPicker.getDrawingOffset()), 0);
        colorPicker.setOnColorChangedListener(this);
        oldColor.setColor(initialColor);
        if (savedInstanceState == null) {
            colorPicker.setColor(initialColor, true);
        }

        buttonNegative = (Button) dialog.findViewById(R.id.dialog_button_negative);
        buttonPositive = (Button) dialog.findViewById(R.id.dialog_button_positive);

        buttonNegative.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onDialogButtonClickedListener != null) {
                    onDialogButtonClickedListener.onNegativeButtonClicked(ColorPickerDialogFragment.this);
                }
                dismiss();
            }
        });
        buttonPositive.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onDialogButtonClickedListener != null) {
                    onDialogButtonClickedListener.onPositiveButtonClicked(ColorPickerDialogFragment.this);
                }
                dismiss();
            }
        });
        return dialog;
    } else {
        return super.onCreateDialog(savedInstanceState);
    }
}

From source file:com.chatwing.whitelabel.fragments.ColorPickerDialogFragment.java

private View inflateContentView() {
    getActivity().getWindow().setFormat(PixelFormat.RGBA_8888);
    View v = View.inflate(getActivity(), R.layout.fragment_dialog_color_picker, null);
    mColorPickerView = (ColorPickerView) v.findViewById(R.id.color_picker_view);
    return v;//from  w  w w  .  j a v  a 2  s  .c o  m
}

From source file:at.the.gogo.windig.activities.WindigActivity.java

@Override
public void onAttachedToWindow() {

    super.onAttachedToWindow();
    final Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
}

From source file:net.networksaremadeofstring.rhybudd.RhybuddDock.java

@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
}

From source file:com.nest5.businessClient.AccountsActivity.java

/**
 * Begins the activity.//from   w  w  w.  j a v a 2 s. c  o  m
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFormat(PixelFormat.RGBA_8888);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
    SharedPreferences prefs = Util.getSharedPreferences(mContext);
    String deviceRegistrationID = prefs.getString(Util.DEVICE_REGISTRATION_ID, null);

    if (deviceRegistrationID == null) {
        // Show the 'connect' screen if we are not connected
        setScreenContent(R.layout.connect);
    } else {
        // Show the 'disconnect' screen if we are connected
        setScreenContent(R.layout.disconnect);
    }

}

From source file:com.renard.ocr.documents.creation.crop.CropImageActivity.java

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    EventBus.getDefault().register(this);
    getWindow().setFormat(PixelFormat.RGBA_8888);
    setContentView(R.layout.activity_cropimage);
    ButterKnife.bind(this);
    initToolbar();//from   w w  w.  j  a  v a 2s.c o m
    setToolbarMessage(R.string.crop_title);
    initNavigationAsUp();
    startCropping();
}

From source file:net.margaritov.preference.colorpicker.ColorPickerDialog.java

private void setUp() {
    // To fight color branding.
    getWindow().setFormat(PixelFormat.RGBA_8888);
    getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    //        getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);

    LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    mColorPickerView = inflater.inflate(R.layout.dialog_color_picker, null);

    setContentView(mColorPickerView);/* www  .  j  a  va  2  s .c om*/
    mActionBarMain = (LinearLayout) mColorPickerView.findViewById(R.id.action_bar_main);

    mActionBarEditHex = (LinearLayout) mColorPickerView.findViewById(R.id.action_bar_edit_hex);
    mActionBarEditHex.setVisibility(View.GONE);

    mDivider = mColorPickerView.findViewById(R.id.divider);
    mDivider.setVisibility(View.GONE);

    mBackButton = (ImageButton) mColorPickerView.findViewById(R.id.back);
    mBackButton.setOnClickListener(this);

    mEditHexButton = (ImageButton) mColorPickerView.findViewById(R.id.edit_hex);
    mEditHexButton.setOnClickListener(this);

    mPaletteButton = (ImageButton) mColorPickerView.findViewById(R.id.palette);
    mPaletteButton.setOnClickListener(this);

    mResetButton = (ImageButton) mColorPickerView.findViewById(R.id.reset);
    if (mIsResetButtonEnabled) {
        mResetButton.setOnClickListener(this);
    } else {
        mResetButton.setVisibility(View.GONE);
    }

    mHexBackButton = (ImageButton) mColorPickerView.findViewById(R.id.action_bar_edit_hex_back);
    mHexBackButton.setOnClickListener(this);

    mHex = (EditText) mColorPickerView.findViewById(R.id.hex);
    mHex.setText(ColorPickerPreference.convertToARGB(mInitialColor));

    mSetButton = (ImageButton) mColorPickerView.findViewById(R.id.enter);
    mSetButton.setOnClickListener(this);

    mColorPicker = (ColorPickerView) mColorPickerView.findViewById(R.id.color_picker_view);
    mColorPicker.setOnColorChangedListener(this);

    mPanelViewButtons = new ColorPickerPanelView[8];
    mPanelViewButtons[0] = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.panel_view_1);
    mPanelViewButtons[1] = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.panel_view_2);
    mPanelViewButtons[2] = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.panel_view_3);
    mPanelViewButtons[3] = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.panel_view_4);
    mPanelViewButtons[4] = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.panel_view_5);
    mPanelViewButtons[5] = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.panel_view_6);
    mPanelViewButtons[6] = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.panel_view_7);
    mPanelViewButtons[7] = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.panel_view_8);

    for (int i = 0; i < mPanelViewButtons.length; i++) {
        mPanelViewButtons[i].setOnClickListener(this);
    }

    mOldColor = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.old_color_panel);
    mOldColor.setOnClickListener(this);

    mNewColor = (ColorPickerPanelView) mColorPickerView.findViewById(R.id.new_color_panel);
    mNewColor.setOnClickListener(this);

    mNewColorValue = mInitialColor;
    mOldColor.setColor(mInitialColor);

    setPanelViewButtonsColor();
    setupAnimators();

    mAnimateColorTransition = false;
    mColorPicker.setColor(mInitialColor, true);
}

From source file:net.networksaremadeofstring.rhybudd.RhybuddHome.java

@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();

    try {/* www  . j a va  2  s. c om*/
        Window window = getWindow();
        window.setFormat(PixelFormat.RGBA_8888);
    } catch (Exception e) {
        //TODO Do something although I doubt this will ever happen
    }
}