// Path: app/src/main/java/com/ge/protein/data/api/ApiConstants.java
// public final class ApiConstants {
// 
//     private ApiConstants() {
//         throw new AssertionError("No construction for constant class");
//     }
// 
//     // general constants of Dribbble API
//     public static final String DRIBBBLE_V1_BASE_URL = "https://api.dribbble.com";
//     public static final String DRIBBBLE_AUTHORIZE_URL = "https://dribbble.com/oauth/authorize";
//     public static final String DRIBBBLE_GET_ACCESS_TOKEN_URL = "https://dribbble.com/oauth/token";
// 
//     // for both flavor open and play
//     public static final String DRIBBBLE_AUTHORIZE_CALLBACK_URI = "x-protein-oauth-dribbble://callback";
//     public static final String DRIBBBLE_AUTHORIZE_CALLBACK_URI_SCHEMA = "x-protein-oauth-dribbble";
//     public static final String DRIBBBLE_AUTHORIZE_CALLBACK_URI_HOST = "callback";
//     public static final String DRIBBBLE_AUTHORIZE_SCOPE = "public write comment upload";
// 
//     public static final int PER_PAGE = 20;
// }
// 
// Path: app/src/main/java/com/ge/protein/mvp/BaseFragment.java
// public class BaseFragment extends RxFragment {
// }


import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.CookieManager;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.ge.protein.BuildConfig;
import com.ge.protein.R;
import com.ge.protein.data.api.ApiConstants;
import com.ge.protein.mvp.BaseFragment;
import butterknife.BindView;
import butterknife.ButterKnife;

    public static AuthFragment newInstance() {
        return new AuthFragment();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle
            savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_auth, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        toolbar.setTitle(R.string.label_auth);
        swipeRefreshLayout.setOnRefreshListener(this);
        progressBar.setProgressTintList(
                ResourcesCompat.getColorStateList(getResources(), R.color.colorAccent, getActivity().getTheme()));

        cleanWebView();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            webview.setWebViewClient(new WebViewClient() {
                @Override
                public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                    Uri uri = request.getUrl();
// Path: app/src/main/java/com/ge/protein/data/api/ApiConstants.java
// public final class ApiConstants {
// 
//     private ApiConstants() {
//         throw new AssertionError("No construction for constant class");
//     }
// 
//     // general constants of Dribbble API
//     public static final String DRIBBBLE_V1_BASE_URL = "https://api.dribbble.com";
//     public static final String DRIBBBLE_AUTHORIZE_URL = "https://dribbble.com/oauth/authorize";
//     public static final String DRIBBBLE_GET_ACCESS_TOKEN_URL = "https://dribbble.com/oauth/token";
// 
//     // for both flavor open and play
//     public static final String DRIBBBLE_AUTHORIZE_CALLBACK_URI = "x-protein-oauth-dribbble://callback";
//     public static final String DRIBBBLE_AUTHORIZE_CALLBACK_URI_SCHEMA = "x-protein-oauth-dribbble";
//     public static final String DRIBBBLE_AUTHORIZE_CALLBACK_URI_HOST = "callback";
//     public static final String DRIBBBLE_AUTHORIZE_SCOPE = "public write comment upload";
// 
//     public static final int PER_PAGE = 20;
// }
// 
// Path: app/src/main/java/com/ge/protein/mvp/BaseFragment.java
// public class BaseFragment extends RxFragment {
// }


// Path: app/src/main/java/com/ge/protein/auth/AuthFragment.java
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.CookieManager;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.ge.protein.BuildConfig;
import com.ge.protein.R;
import com.ge.protein.data.api.ApiConstants;
import com.ge.protein.mvp.BaseFragment;
import butterknife.BindView;
import butterknife.ButterKnife;


    public static AuthFragment newInstance() {
        return new AuthFragment();
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle
            savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_auth, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        toolbar.setTitle(R.string.label_auth);
        swipeRefreshLayout.setOnRefreshListener(this);
        progressBar.setProgressTintList(
                ResourcesCompat.getColorStateList(getResources(), R.color.colorAccent, getActivity().getTheme()));

        cleanWebView();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            webview.setWebViewClient(new WebViewClient() {
                @Override
                public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                    Uri uri = request.getUrl();
                    if (ApiConstants.DRIBBBLE_AUTHORIZE_CALLBACK_URI_SCHEMA.equals(uri.getScheme())