package com.ttiglobal.inttilectgpchat;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import android.widget.TextView;

import com.ttiglobal.inttilectgpchat.util.GlobalData;
import com.ttiglobal.inttilectgpchat.util.StorePreference;

public class ProductHomeActivity extends AppCompatActivity {
    Handler handler;
    TextView txtFname;
    private StorePreference storePreference;

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

    private void initViews() {

        storePreference = new StorePreference(this);
        handler = new Handler();
        txtFname = findViewById(R.id.firstname);
        String upperString = "";
        if (storePreference.getStringValue(GlobalData.PRODUCT_NAME) != null || !storePreference.getStringValue(GlobalData.PRODUCT_NAME).equalsIgnoreCase(""))
        txtFname.setText(storePreference.getStringValue(GlobalData.PRODUCT_NAME));

        handler.postDelayed(new Runnable() {

            @Override
            public void run() {
                startExploreMoreActivity();
            }
        }, 3000);
    }

    private void startExploreMoreActivity() {
        startActivity(new Intent(ProductHomeActivity.this, ProductExplorerActivity.class));
        finish();
    }
}
