private void updateImage(CompoundImageView v) {
        if (v == mSelectedThumbnail)
            return;

        if (null != mSelectedThumbnail) {
            mSelectedThumbnail.setChecked(false);
        }

        mImage.setChecked(false);
        mSelectedThumbnail = v;
        mSelectedThumbnail.setChecked(true);

        switch (mSelectedThumbnail.getId()) {
            case R.id.thumbnail_1:
                mImage.setImageResource(R.drawable.c1);
                updateCode(getString(R.string.java_code_template, "R.drawable.c1"));
                break;
            case R.id.thumbnail_2:
                mImage.setImageResource(R.drawable.c2);
                updateCode(getString(R.string.java_code_template, "R.drawable.c2"));
                break;
            case R.id.thumbnail_no_image:
                mImage.setImageDrawable(null);
                updateCode(getString(R.string.java_code_template, "null"));
                break;
            case R.id.thumbnail_from_cloud:
                Toast.makeText(this, R.string.loading_remote_image, Toast.LENGTH_SHORT).show();
                Picasso.with(this)
                        .load("https://raw.githubusercontent.com/subinkrishna/CircularImageView/master/art/cat_original.jpg")
                        .noFade()
                        .placeholder(R.drawable.placeholder)
                        .resize(mCivSize, mCivSize)
                        .memoryPolicy(MemoryPolicy.NO_CACHE)
                        .centerCrop()
                        .into(mImage);
                updateCode(getString(R.string.picasso_code_template));
                break;
        }
    }
private void updateImage ( CompoundImageView v ) { if ( v == mSelectedThumbnail ) return ; if ( null != mSelectedThumbnail ) { mSelectedThumbnail . setChecked ( false ) ; } mImage . setChecked ( false ) ; mSelectedThumbnail = v ; mSelectedThumbnail . setChecked ( true ) ; switch ( mSelectedThumbnail . getId ( ) ) { case R . id . thumbnail_1 : mImage . setImageResource ( R . drawable . c1 ) ; updateCode ( getString ( R . string . java_code_template , "R.drawable.c1" ) ) ; break ; case R . id . thumbnail_2 : mImage . setImageResource ( R . drawable . c2 ) ; updateCode ( getString ( R . string . java_code_template , "R.drawable.c2" ) ) ; break ; case R . id . thumbnail_no_image : mImage . setImageDrawable ( null ) ; updateCode ( getString ( R . string . java_code_template , "null" ) ) ; break ; case R . id . thumbnail_from_cloud : Toast . makeText ( this , R . string . loading_remote_image , Toast . LENGTH_SHORT ) . show ( ) ; Picasso . with ( this ) . load ( "https://raw.githubusercontent.com/subinkrishna/CircularImageView/master/art/cat_original.jpg" ) . noFade ( ) . placeholder ( R . drawable . placeholder ) . resize ( mCivSize , mCivSize ) . memoryPolicy ( MemoryPolicy . NO_CACHE ) . centerCrop ( ) . into ( mImage ) ; updateCode ( getString ( R . string . picasso_code_template ) ) ; break ; } }
Updates image (CircularImageView) on selecting a thumbnail

@param v