// Path: decor/src/main/java/com/mounacheikhna/decor/DecorContextWrapper.java
// public class DecorContextWrapper extends ContextWrapper  {
// 
//     private DecorLayoutInflater mInflater;
//     private List<Decorator> mDecorators;
// 
//     /**
//      * @param base ContextBase to Wrap.
//      */
//     public DecorContextWrapper(Context base) {
//         super(base);
//         mDecorators = new ArrayList<>();
//     }
// 
//     /**
//      * wrap the context
//      * @param base ContextBase to Wrap.
//      * @return ContextWrapper to pass back to the activity.
//      */
//     public static DecorContextWrapper wrap(Context base) {
//         return new DecorContextWrapper(base);
//     }
// 
//     public ContextWrapper with(Decorator... decorators) {
//         Collections.addAll(mDecorators, decorators);
//         return this;
//     }
// 
//     @Override
//     public Object getSystemService(String name) {
//         if(LAYOUT_INFLATER_SERVICE.equals(name)) {
//             if(mInflater == null) {
//                 mInflater = new DecorLayoutInflater(LayoutInflater.from(getBaseContext()), this, mDecorators, false);
//             }
//             return mInflater;
//         }
//         return super.getSystemService(name);
//     }
// 
// }
// 
// Path: decorators/src/main/java/com/mounacheikhna/decorators/Decorators.java
// public final class Decorators {
// 
//     /**
//      * Get all the decorators already defined
//      * @return available decorators
//      */
//     public static Decorator[] getAll() {
//         return new Decorator[] {
//             new AutofitDecorator(),
//             new BlurDecorator(),
//             new ColorFilterDecorator(),
//             new ErrorDecorator(),
//             new FontDecorator(),
//             new ReloadTextDecorator()
//         };
//     }
// 
// }


import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.Toast;
import com.mounacheikhna.decor.DecorContextWrapper;
import com.mounacheikhna.decorators.Decorators;
package com.mounacheikhna.decor.samples;



public class SampleActivity extends FragmentActivity /*ActionBarActivity*/ /*Activity*/ {

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

    public void onIvTouch() {
        Toast.makeText(this, " Touch detected ", Toast.LENGTH_SHORT).show();
    }

    public void onRobotLongClick() {
        Toast.makeText(this, " Long click detected ", Toast.LENGTH_SHORT).show();
    }

    @Override
    protected void attachBaseContext(Context newBase) {
        super.attachBaseContext(DecorContextWrapper.wrap(newBase)
// Path: decor/src/main/java/com/mounacheikhna/decor/DecorContextWrapper.java
// public class DecorContextWrapper extends ContextWrapper  {
// 
//     private DecorLayoutInflater mInflater;
//     private List<Decorator> mDecorators;
// 
//     /**
//      * @param base ContextBase to Wrap.
//      */
//     public DecorContextWrapper(Context base) {
//         super(base);
//         mDecorators = new ArrayList<>();
//     }
// 
//     /**
//      * wrap the context
//      * @param base ContextBase to Wrap.
//      * @return ContextWrapper to pass back to the activity.
//      */
//     public static DecorContextWrapper wrap(Context base) {
//         return new DecorContextWrapper(base);
//     }
// 
//     public ContextWrapper with(Decorator... decorators) {
//         Collections.addAll(mDecorators, decorators);
//         return this;
//     }
// 
//     @Override
//     public Object getSystemService(String name) {
//         if(LAYOUT_INFLATER_SERVICE.equals(name)) {
//             if(mInflater == null) {
//                 mInflater = new DecorLayoutInflater(LayoutInflater.from(getBaseContext()), this, mDecorators, false);
//             }
//             return mInflater;
//         }
//         return super.getSystemService(name);
//     }
// 
// }
// 
// Path: decorators/src/main/java/com/mounacheikhna/decorators/Decorators.java
// public final class Decorators {
// 
//     /**
//      * Get all the decorators already defined
//      * @return available decorators
//      */
//     public static Decorator[] getAll() {
//         return new Decorator[] {
//             new AutofitDecorator(),
//             new BlurDecorator(),
//             new ColorFilterDecorator(),
//             new ErrorDecorator(),
//             new FontDecorator(),
//             new ReloadTextDecorator()
//         };
//     }
// 
// }


// Path: samples/src/main/java/com/mounacheikhna/decor/samples/SampleActivity.java
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.Toast;
import com.mounacheikhna.decor.DecorContextWrapper;
import com.mounacheikhna.decorators.Decorators;

package com.mounacheikhna.decor.samples;



public class SampleActivity extends FragmentActivity /*ActionBarActivity*/ /*Activity*/ {

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

    public void onIvTouch() {
        Toast.makeText(this, " Touch detected ", Toast.LENGTH_SHORT).show();
    }

    public void onRobotLongClick() {
        Toast.makeText(this, " Long click detected ", Toast.LENGTH_SHORT).show();
    }

    @Override
    protected void attachBaseContext(Context newBase) {
        super.attachBaseContext(DecorContextWrapper.wrap(newBase)
                .with(Decorators.getAll()));