// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataObserver.java
// public interface DataObserver<DATA> {
// 
//     /**
//      * Watch if the data of {@link DataProvider} is changed.
//      *
//      * @param data
//      */
//     void onDataChanged(DATA data);
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/impl/Cornerstone.java
// public class Cornerstone extends AbstractDataProviderManager {
// 
//     private static Cornerstone sInstance;
// 
//     private Cornerstone() {
//         // Make Cornerstone singleton.
//     }
// 
//     /**
//      * Use singleton here.
//      *
//      * @return
//      */
//     public static Cornerstone getInstance() {
//         if (sInstance == null) {
//             synchronized (Cornerstone.class) {
//                 if (sInstance == null) {
//                     sInstance = new Cornerstone();
//                 }
//             }
//         }
//         return sInstance;
//     }
// 
//     public static void registerProvider(String key, Class<? extends DataProvider> providerClazz) {
//         getInstance().register(key, providerClazz);
//     }
// 
//     public static DataProvider obtainProvider(String key) {
//         return getInstance().obtain(key);
//     }
// 
//     public static void releaseProvider(String key) {
//         getInstance().release(key);
//     }
// }
// 
// Path: app/src/main/java/com/kifile/android/sample/cornerstone/data/HttpSampleProvider.java
// public class HttpSampleProvider extends AbstractDataProvider<String> {
// 
//     public static final String KEY = HttpSampleProvider.class.getName();
// 
//     public HttpSampleProvider() {
//         HttpFetcher fetcher = new HttpFetcher(HttpFetcher.METHOD_GET, "https://baidu.com");
//         setAsync(true);
//         setFetcher(new InputStream2StringConverter(fetcher));
//     }
// }


import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.kifile.android.cornerstone.core.DataObserver;
import com.kifile.android.cornerstone.impl.Cornerstone;
import com.kifile.android.sample.cornerstone.data.HttpSampleProvider;
package com.kifile.android.sample.cornerstone;



public class HttpActivity extends AppCompatActivity {

    private HttpSampleProvider mProvider;

    FloatingActionButton fab;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mProvider = (HttpSampleProvider) Cornerstone.obtainProvider(HttpSampleProvider.KEY);
        setContentView(R.layout.activity_http);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
// Path: framework/src/main/java/com/kifile/android/cornerstone/core/DataObserver.java
// public interface DataObserver<DATA> {
// 
//     /**
//      * Watch if the data of {@link DataProvider} is changed.
//      *
//      * @param data
//      */
//     void onDataChanged(DATA data);
// }
// 
// Path: framework/src/main/java/com/kifile/android/cornerstone/impl/Cornerstone.java
// public class Cornerstone extends AbstractDataProviderManager {
// 
//     private static Cornerstone sInstance;
// 
//     private Cornerstone() {
//         // Make Cornerstone singleton.
//     }
// 
//     /**
//      * Use singleton here.
//      *
//      * @return
//      */
//     public static Cornerstone getInstance() {
//         if (sInstance == null) {
//             synchronized (Cornerstone.class) {
//                 if (sInstance == null) {
//                     sInstance = new Cornerstone();
//                 }
//             }
//         }
//         return sInstance;
//     }
// 
//     public static void registerProvider(String key, Class<? extends DataProvider> providerClazz) {
//         getInstance().register(key, providerClazz);
//     }
// 
//     public static DataProvider obtainProvider(String key) {
//         return getInstance().obtain(key);
//     }
// 
//     public static void releaseProvider(String key) {
//         getInstance().release(key);
//     }
// }
// 
// Path: app/src/main/java/com/kifile/android/sample/cornerstone/data/HttpSampleProvider.java
// public class HttpSampleProvider extends AbstractDataProvider<String> {
// 
//     public static final String KEY = HttpSampleProvider.class.getName();
// 
//     public HttpSampleProvider() {
//         HttpFetcher fetcher = new HttpFetcher(HttpFetcher.METHOD_GET, "https://baidu.com");
//         setAsync(true);
//         setFetcher(new InputStream2StringConverter(fetcher));
//     }
// }


// Path: app/src/main/java/com/kifile/android/sample/cornerstone/HttpActivity.java
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.kifile.android.cornerstone.core.DataObserver;
import com.kifile.android.cornerstone.impl.Cornerstone;
import com.kifile.android.sample.cornerstone.data.HttpSampleProvider;

package com.kifile.android.sample.cornerstone;



public class HttpActivity extends AppCompatActivity {

    private HttpSampleProvider mProvider;

    FloatingActionButton fab;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mProvider = (HttpSampleProvider) Cornerstone.obtainProvider(HttpSampleProvider.KEY);
        setContentView(R.layout.activity_http);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)