Example usage for android.graphics PixelFormat RGB_888

List of usage examples for android.graphics PixelFormat RGB_888

Introduction

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

Prototype

int RGB_888

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

Click Source Link

Usage

From source file:com.yahala.ui.LaunchActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    XMPPManager.foreground = false;/*ww w . jav  a 2  s .c  o  m*/
    ApplicationLoader.postInitApplication();

    this.setTheme(R.style.Theme_TMessages);
    try {
        openAnimation = AnimationUtils.loadAnimation(this, R.anim.scale_in);
        closeAnimation = AnimationUtils.loadAnimation(this, R.anim.scale_out);
    } catch (Exception e) {
        FileLog.e("yahala", e);
    }
    // getWindow().setBackgroundDrawableResource(R.drawable.transparent);
    getWindow().setFormat(PixelFormat.RGB_888);

    if (!UserConfig.clientActivated) {
        Intent intent = getIntent();
        if (intent != null && intent.getAction() != null && (Intent.ACTION_SEND.equals(intent.getAction())
                || intent.getAction().equals(Intent.ACTION_SEND_MULTIPLE))) {
            finish();
            return;
        }
        Intent intent2 = new Intent(this, IntroActivity.class);
        startActivity(intent2);
        finish();
        return;
    } else {
        SecurePreferences preferences = new SecurePreferences(this, "preferences", "Blacktow@111", true);
        String locked = preferences.getString("locked", "false");
        String lockedAuthenticated = preferences.getString("clientAuthenticated", "false");
        if (locked.equals("true") && lockedAuthenticated.equals("false")
                && !getIntent().getAction().startsWith("com.yahala.openchat")) {
            Intent intent = getIntent();
            if (intent != null && intent.getAction() != null && (Intent.ACTION_SEND.equals(intent.getAction())
                    || intent.getAction().equals(Intent.ACTION_SEND_MULTIPLE))) {
                finish();
                return;
            }
            Intent intent2 = new Intent(this, UnlockActivity.class);
            startActivity(intent2);
            finish();
            return;
        }

        preferences.put("clientAuthenticated", "false");
        //String user = preferences.getString("userId");
    }

    int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
    if (resourceId > 0) {
        OSUtilities.statusBarHeight = getResources().getDimensionPixelSize(resourceId);
    }

    NotificationCenter.getInstance().postNotificationName(702, this);
    // currentConnectionState = ConnectionsManager.getInstance().connectionState;
    for (BaseFragment fragment : ApplicationLoader.fragmentsStack) {
        if (fragment.fragmentView != null) {
            ViewGroup parent = (ViewGroup) fragment.fragmentView.getParent();
            if (parent != null) {
                parent.removeView(fragment.fragmentView);
            }
            fragment.fragmentView = null;
        }
        fragment.parentActivity = this;
    }
    setContentView(R.layout.application_layout);
    NotificationCenter.getInstance().addObserver(this, 1234);
    NotificationCenter.getInstance().addObserver(this, XMPPManager.connectionStateDidChanged);
    NotificationCenter.getInstance().addObserver(this, XMPPManager.currentUserPresenceDidChanged);
    //NotificationCenter.getInstance().addObserver(this, 701);
    NotificationCenter.getInstance().addObserver(this, 702);
    /* NotificationCenter.getInstance().addObserver(this, 703);*/
    //  NotificationCenter.getInstance().addObserver(this, XmppManager.connectionSuccessful);
    //  NotificationCenter.getInstance().addObserver(this, 1003);
    //  NotificationCenter.getInstance().addObserver(this, GalleryImageViewer.needShowAllMedia);

    ////getSupportActionBar().setLogo(R.drawable.ab_icon_fixed2);

    /* statusView = getLayoutInflater().inflate(R.layout.updating_state_layout, null);
     statusBackground = statusView.findViewById(R.id.back_button_background);
     backStatusButton = statusView.findViewById(R.id.back_button);
     containerView = findViewById(R.id.container);
     statusText = (TextView)statusView.findViewById(R.id.status_text);*/
    connectionStatusLayout = (LinearLayout) findViewById(R.id.connection_status_layout);
    connectionStatus = (TextView) findViewById(R.id.connection_status);
    /*        statusBackground.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        if (ApplicationLoader.fragmentsStack.size() > 1) {
            onBackPressed();
        }
    }
            });*/

    if (XMPPManager.getInstance().connectionState == ConnectionState.ONLINE) {
        connectionStatusLayout.setVisibility(View.GONE);

    }

    if (ApplicationLoader.fragmentsStack.isEmpty()) {
        MainActivity fragment = new MainActivity();
        fragment.onFragmentCreate();
        ApplicationLoader.fragmentsStack.add(fragment);
    }

    // savedInstanceState != null ===>>> possible orientation change
    /* if (savedInstanceState != null && savedInstanceState.containsKey("StatusLayoutIsShowing")) {
       connectionStatusLayout.setVisibility(View.VISIBLE);
     } else {
       connectionStatusLayout.setVisibility(View.GONE);
     }*/
    handleIntent(getIntent(), false, savedInstanceState != null);
}