package com.youra.qlicker.Acitvitys;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;

import com.youra.qlicker.Acitvitys.EER.EERStartActivity;
import com.youra.qlicker.Acitvitys.EspacePerso.EPgetEmailActivity;
import com.youra.qlicker.Fragments.LoginFragment;
import com.youra.qlicker.R;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;


public class LoginActivity extends AppCompatActivity {

    private TextView btn_creat ;

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

        btn_creat = (TextView)findViewById(R.id.btn_creat);


        btn_creat.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {


                Intent intent = new Intent(LoginActivity.this , EERStartActivity.class);
                startActivity( intent );

            }
        });

          ///set fragment
            FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
            Fragment fragment = getSupportFragmentManager().findFragmentByTag("login_fragmnet");

            if (fragment != null){
                ft.replace(R.id.frame, fragment   );
            }else {
                ft.replace(R.id.frame, new LoginFragment() , "login_fragmnet" );
            }

            ft.addToBackStack(null);
            ft.commit();




    }
}