package com.ttiglobal.inttilectgpchat.util;

import android.annotation.SuppressLint;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.view.Gravity;
import android.widget.Toast;

import com.ttiglobal.inttilectgpchat.wrappers.Banner;
import com.ttiglobal.inttilectgpchat.wrappers.ErrorResponse;
import com.ttiglobal.inttilectgpchat.wrappers.UserResponse;

import java.util.ArrayList;

public class GlobalData {

    public static String APP_URL = "https://appstore.tti-global.com/services/appstore.php?funname=appversion&appid=";



    public static String SERVER_URL = "https://indiatest.tti-global.com/inttilect_v2gp/_api/";
    public static String REPORT_URL = "https://indiatest.tti-global.com/inttilect_v2gp/#/";
    public static String FAQ_URL = "https://indiatest.tti-global.com/inttilect_v2gp/";
    public static String AppId = "com.ttiglobal.inttilectv2new";
//    public static String SERVER_URL = "https://indiatest.tti-global.com/inttilect_dev/_api/";


//    public static String REPORT_URL = "https://suzukiml-dev.tti-global.com/#/";

    public static UserResponse user = new UserResponse();
    public static ErrorResponse errorResponse = new ErrorResponse();
    public static ArrayList<Banner> BANNERS = new ArrayList<>();
    public static boolean canLogout = false;
    public static SQLiteDatabase sdb;
    public static int width = 0;
    public static String zmEmail = "none", rmEmail = "none", amEmail = "none";


    public static final String PRODUCT_NAME ="product_name" ;
    public static final String CURRENTTIME ="current_time" ;
    public static final String DETAIL_NAME = "DETAIL_NAME";
    public static final String DETAIL_EMAIL = "DETAIL_EMAIL";
    public static final String DETAIL_MOBILE = "DETAIL_MOBILE";
    public static final String SALUTATION_MODEL ="SALUTATION_MODEL" ;
    public static final String FEEDBACK_MODEL ="FEEDBACK_MODEL" ;
    public static final String WOOHOOCATID ="WOOHOOCATID" ;
    public static final String MYLEARNING = "Learning";
    public static final String PAGETITLE = "pageTitle";
    public static final String ISDSELOGIN = "Dse";
    public static final String ISMYLEARNING = "ISMyLearning";
    public static final String SERVER_ERROR = "Kindly check your internet connection.";
    public static final String SELECTED_MODEL_NAME = "SELECTED_MODEL_NAME";
    public static String PREFERENCES_NAME = "MYPREFRE";
    public static String VERSION_CODE = "VERSIONCODE";
    public static String SELECTED_MODEL = "SELECTED_MODEL";
    public static String OLD_VERSION_CODE = "OLD_VERSION_CODE";
    public static String ACCESS_TOKEN = "fak5uxyerpWhy8hW1w1hcmoTcXlH0hpfrJlVhUaJk70SfhPhOQz0cXTpUf6VwwbYgxUyr5hMchEszuJnkjnxghXbw473Ai2RPWph2G3eXIGxcqUxKi50z2c56j8HCbys";
    public static Toast toast;

    public static void openDatabase(Context context) {
        try {
            sdb = new DatabaseHelper(context, "suzuki.db", null, 2).getWritableDatabase();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @SuppressLint("ShowToast")
    public static Toast showToast(Context context, String content, int length) {

        try {
            toast.cancel();
        } catch (Exception e) {
            e.printStackTrace();
        }

        toast = Toast.makeText(context, content, length);
        toast.setGravity(Gravity.CENTER, 0, 0);
        return toast;
    }


}
