Android Open Source - EtsyBlurExample Main Activity






From Project

Back to project page EtsyBlurExample.

License

The source code is released under:

Apache License

If you think the Android project EtsyBlurExample 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

/*
 * Copyright 2014 Michael Evans <michaelcevans10@gmail.com>
 */*from   www .j av a  2s  .c o m*/
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.michaelevans.etsyblur.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;

import org.michaelevans.etsyblur.utils.BlurTask;
import org.michaelevans.etsyblur.utils.Constants;
import org.michaelevans.etsyblur.utils.ImageAdapter;
import org.michaelevans.etsyblur.R;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        GridView grid = (GridView) findViewById(R.id.grid);
        grid.setAdapter(new ImageAdapter(this));

        grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                Intent i = new Intent(MainActivity.this, DetailsActivity.class);
                i.putExtra(Constants.DROID_ID, Constants.THUMBNAILS[position]);
                new BlurTask(MainActivity.this, i, R.id.container).execute();
            }
        });
    }
}




Java Source Code List

org.michaelevans.etsyblur.ApplicationTest.java
org.michaelevans.etsyblur.ui.DetailsActivity.java
org.michaelevans.etsyblur.ui.MainActivity.java
org.michaelevans.etsyblur.utils.BlurTask.java
org.michaelevans.etsyblur.utils.Blur.java
org.michaelevans.etsyblur.utils.Constants.java
org.michaelevans.etsyblur.utils.ImageAdapter.java
org.michaelevans.etsyblur.utils.Utils.java