package com.me.harris.androidanimations.ui;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v4.util.Pair;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;

import com.me.harris.androidanimations.R;
import com.me.harris.androidanimations.apidemo.BouncingBalls;
import com.me.harris.androidanimations.apidemo.MaterialWitness;
import com.me.harris.androidanimations.apidemo.ShadowCardDrag;
import com.me.harris.androidanimations.canvas.activity.CanvasActivity;
import com.me.harris.androidanimations.databinding.ActivityMainBinding;
import com.me.harris.androidanimations.drawableAnimations.DrawableAnimationActivity;
import com.me.harris.androidanimations.propertyanimations.PropertyAnimationActivity;
import com.me.harris.androidanimations.ui.recyclerview.adapter.MainActivityAdapter;
import com.me.harris.androidanimations.ui.recyclerview.itemDecoration.MainAdapterItemDecoration;
import com.me.harris.androidanimations.viewAnimations.ViewAnimationActivity;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    ActivityMainBinding binding;
    private MainActivityAdapter mAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
        mAdapter = new MainActivityAdapter(R.layout.item_main);
        List<Pair<String, Class>> list = new ArrayList<>();
        list.add(new Pair<String, Class>("ViewAnimation", ViewAnimationActivity.class));
        list.add(new Pair<String, Class>("DrawableAnimation", DrawableAnimationActivity.class));
        list.add(new Pair<String, Class>("PropertyAnimation", PropertyAnimationActivity.class));
        list.add(new Pair<String, Class>("BouncingBalls", BouncingBalls.class));
        list.add(new Pair<String, Class>("ShadowCard", ShadowCardDrag.class));
        list.add(new Pair<String, Class>("CardImageView", MaterialWitness.class));
        list.add(new Pair<String, Class>("Canvas", CanvasActivity.class));
        mAdapter.setmDatas(list);
        binding.recyclerView.setAdapter(mAdapter);
        binding.recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
        binding.recyclerView.addItemDecoration(new MainAdapterItemDecoration(this));
        binding.toolbar.setTitle(getClass().getSimpleName());
    }


}

@@ -108,16 +108,46 @@
 Bundle;%0A
+import android.os.StrictMode;%0A
 import a
@@ -277,16 +277,68 @@
 nager;%0A%0A
+import com.me.harris.androidanimations.BuildConfig;%0A
 import c
@@ -1386,16 +1386,637 @@
 tate) %7B%0A
+        if (BuildConfig.DEBUG) %7B%0A            StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()%0A                    .detectDiskReads()%0A                    .detectDiskWrites()%0A                    .detectNetwork()   // or .detectAll() for all detectable problems%0A                    .penaltyLog()%0A                    .build());%0A            StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()%0A                    .detectLeakedSqlLiteObjects()%0A                    .detectLeakedClosableObjects()%0A                    .penaltyLog()%0A                    .penaltyDeath()%0A                    .build());%0A        %7D%0A
         

add strictMode