Example usage for android.view Window setFormat

List of usage examples for android.view Window setFormat

Introduction

In this page you can find the example usage for android.view Window setFormat.

Prototype

public void setFormat(int format) 

Source Link

Document

Set the format of window, as per the PixelFormat types.

Usage

From source file:org.pixmob.freemobile.netstat.ui.MobileNetworkChartActivity.java

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

    // Enable "better" gradients:
    // http://stackoverflow.com/a/2932030/422906
    final Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
    window.getDecorView().getBackground().setDither(true);
}

From source file:com.blork.anpod.activity.HomeActivity.java

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

From source file:at.alladin.rmbt.android.terms.RMBTTermsActivity.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);//from   www .ja v a  2s.c  o  m

    boolean showTermsAndConditions = true;

    if (getIntent().getExtras() != null) {
        final String checkTypeName = getIntent().getExtras().getString(EXTRA_KEY_CHECK_TYPE, null);
        if (checkTypeName != null) {
            checkType = CheckType.valueOf(checkTypeName);
        }

        showTermsAndConditions = getIntent().getExtras().getBoolean(EXTRA_KEY_CHECK_TERMS_AND_COND, true);
    }

    final Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
    window.addFlags(WindowManager.LayoutParams.FLAG_DITHER);

    if (savedInstanceState == null) {
        if (showTermsAndConditions) {
            showTermsCheck();
        } else {
            continueWorkflow();
        }
    }
}

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

@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    try {/*www  .ja  va2 s .co  m*/
        Window window = getWindow();
        window.setFormat(PixelFormat.RGBA_8888);
    } catch (Exception e) {

    }
}

From source file:org.n52.geoar.GeoARActivity.java

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

From source file:com.apptentive.android.sdk.ViewActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    try {//from   ww  w.j  av a2 s .  co  m
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        String activityContentTypeString = getIntent().getStringExtra(ActivityContent.KEY);
        String parseStringExtra = getIntent().getStringExtra("com.parse.Data");

        if (activityContentTypeString != null) {
            Log.v("Started ViewActivity normally for %s.", activityContent);
            activeContentType = ActivityContent.Type.parse(activityContentTypeString);

            try {
                switch (activeContentType) {
                case ABOUT:
                    break;
                case MESSAGE_CENTER:
                    break;
                case INTERACTION:
                    String interactionString = getIntent().getExtras().getCharSequence(Interaction.KEY_NAME)
                            .toString();
                    Interaction interaction = Interaction.Factory.parseInteraction(interactionString);
                    switch (interaction.getType()) {
                    case UpgradeMessage:
                        activityContent = new UpgradeMessageInteractionView(
                                (UpgradeMessageInteraction) interaction);
                        break;
                    case EnjoymentDialog:
                        activityContent = new EnjoymentDialogInteractionView(
                                (EnjoymentDialogInteraction) interaction);
                        break;
                    case RatingDialog:
                        activityContent = new RatingDialogInteractionView(
                                (RatingDialogInteraction) interaction);
                        break;
                    case AppStoreRating:
                        activityContent = new AppStoreRatingInteractionView(
                                (AppStoreRatingInteraction) interaction);
                        break;
                    case FeedbackDialog:
                        activityContent = new FeedbackDialogInteractionView(
                                (FeedbackDialogInteraction) interaction);
                        break;
                    case Survey:
                        activityContent = new SurveyInteractionView((SurveyInteraction) interaction);
                        break;
                    case MessageCenter:
                        // For now, we use the old method.
                        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
                        finish();
                        Apptentive.showMessageCenter(this);
                        return;
                    case TextModal:
                        activityContent = new TextModalInteractionView((TextModalInteraction) interaction);
                        break;
                    case NavigateToLink:
                        activityContent = new NavigateToLinkInteractionView(
                                (NavigateToLinkInteraction) interaction);
                        break;
                    default:
                        break;
                    }
                    if (activityContent == null) {
                        finish();
                    } else {
                        activityContent.onCreate(this, savedInstanceState);
                    }
                    break;
                default:
                    Log.w("No Activity specified. Finishing...");
                    finish();
                    break;
                }
            } catch (Exception e) {
                Log.e("Error starting ViewActivity.", e);
                MetricModule.sendError(this, e, null, null);
            }
        } else
        // If no content was sent to this Activity, then it may have been started from a Parse push notification.
        if (parseStringExtra != null) {
            Log.i("Started ViewActivity from Parse push.");

            // Save off the callback Activity if one was passed in.
            pushCallbackActivityName = ApptentiveInternal.getPushCallbackActivityName();

            // If the callback is null and we got here, then the developer forgot to set it.
            if (pushCallbackActivityName != null) {
                returnToPushCallbackActivity = true;
                JSONObject parseJson = new JSONObject(parseStringExtra);
                String apptentiveStringData = parseJson.optString(Apptentive.APPTENTIVE_PUSH_EXTRA_KEY);
                JSONObject apptentiveJson = new JSONObject(apptentiveStringData);
                ApptentiveInternal.PushAction action = ApptentiveInternal.PushAction
                        .parse(apptentiveJson.getString(ApptentiveInternal.PUSH_ACTION));
                switch (action) {
                case pmc:
                    activeContentType = ActivityContent.Type.MESSAGE_CENTER;
                    break;
                default:
                    break;
                }
            } else {
                Log.a("Push callback Activity was not set. Make sure to call Apptentive.setPushCallback()");
                if (GlobalInfo.isAppDebuggable) {
                    Toast.makeText(this,
                            "Push callback Activity was not set. Make sure to call Apptentive.setPushCallback()",
                            Toast.LENGTH_LONG).show();
                }
                finish();
            }
        } else {
            Log.e("Started ViewActivity in a bad way.");
        }
    } catch (Exception e) {
        Log.e("Error creating ViewActivity.", e);
        MetricModule.sendError(this, e, null, null);
    }
    if (activeContentType == null) {
        finish();
    }
    Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
    window.addFlags(WindowManager.LayoutParams.FLAG_DITHER);
}

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.waz.zclient.MainActivity.java

/**
 * Sets to RGBA_8888 to ensure fluent gradients.
 *///w  ww. j a v a2 s .  co m
@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
}

From source file:org.osm.keypadmapper2.KeypadMapper2Activity.java

@Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
    window.setFlags(WindowManager.LayoutParams.FLAG_DITHER, WindowManager.LayoutParams.FLAG_DITHER);
    Log.d(TAG, "attached to window");
}