Android Open Source - Patio Main Activity






From Project

Back to project page Patio.

License

The source code is released under:

MIT License

If you think the Android project Patio listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.asantibanez.android.patiodemo;
/*from   w  w w.ja  va  2 s .  c om*/
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import com.andressantibanez.android.patio.Patio;


public class MainActivity extends Activity implements Patio.PatioCallbacks {

    public static final int REQUEST_CODE_TAKE_PICTURE = 1000;
    public static final int REQUEST_CODE_ATTACH_PICTURE = 2000;

    private Patio mPatio;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mPatio = (Patio) findViewById(R.id.patio);
        mPatio.setCallbacksListener(this);
    }

    @Override
    public void onTakePictureClick() {
        Intent intent = mPatio.getTakePictureIntent();
        startActivityForResult(intent, REQUEST_CODE_TAKE_PICTURE);
    }

    @Override
    public void onAddPictureClick() {
        Intent intent = mPatio.getAttachPictureIntent();
        startActivityForResult(intent, REQUEST_CODE_ATTACH_PICTURE);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if(resultCode == Activity.RESULT_OK && requestCode == REQUEST_CODE_ATTACH_PICTURE) {
            mPatio.handleAttachPictureResult(data);
        }
        if(resultCode == Activity.RESULT_OK && requestCode == REQUEST_CODE_TAKE_PICTURE) {
            mPatio.handleTakePictureResult(data);
        }
    }
}




Java Source Code List

com.andressantibanez.android.patio.ApplicationTest.java
com.andressantibanez.android.patio.PatioThumbnail.java
com.andressantibanez.android.patio.PatioUtils.java
com.andressantibanez.android.patio.Patio.java
com.asantibanez.android.patiodemo.ApplicationTest.java
com.asantibanez.android.patiodemo.MainActivity.java