This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@override | |
void initState() { | |
// TODO: implement initState | |
super.initState(); | |
Geolocator.requestPermission(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun mailGonder(){ | |
var kullanici=FirebaseAuth.getInstance().currentUser | |
if (kullanici != null){ | |
kullanici.sendEmailVerification() | |
.addOnCompleteListener(object : OnCompleteListener<Void>{ | |
override fun onComplete(p0: Task<Void>) { | |
if(p0.isSuccessful){ | |
Toast.makeText(this@RegisterActivity,"Mailinizi kontrol edin, mailinizi onaylayın", Toast.LENGTH_SHORT).show() | |
}else{ | |
Toast.makeText(this@RegisterActivity,"Mail gönderilirken sorun oluştu "+p0.exception?.message, Toast.LENGTH_SHORT).show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun yeniUyeKayit(mail: String, sifre: String) { | |
progressBarGoster() | |
FirebaseAuth.getInstance().createUserWithEmailAndPassword(mail,sifre) | |
.addOnCompleteListener(object:OnCompleteListener<AuthResult>{ | |
override fun onComplete(p0: Task<AuthResult>) { | |
if(p0.isSuccessful){ | |
Toast.makeText(this@RegisterActivity,"Üye kaydedildi:"+FirebaseAuth.getInstance().currentUser?.email, Toast.LENGTH_SHORT).show() | |
mailGonder() | |
FirebaseAuth.getInstance().signOut() | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
btn_Kayit.setOnClickListener { | |
if(et_Mail.text.isNotEmpty() && et_Sifre.text.isNotEmpty() && et_Sifre_Tekrar.text.isNotEmpty()){ | |
if (et_Sifre.text.toString().equals(et_Sifre_Tekrar.text.toString())){ | |
yeniUyeKayit(et_Mail.text.toString(), et_Sifre.text.toString()) | |
}else{ | |
Toast.makeText(this,"Şifreler aynı değil", Toast.LENGTH_SHORT).show() | |
} | |
}else{ | |
Toast.makeText(this,"Boş alanları doldurunuz", Toast.LENGTH_SHORT).show() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun progressBarGoster(){ | |
progress_Login.visibility = View.VISIBLE | |
} | |
private fun progressBarGizle(){ | |
progress_Login.visibility = View.INVISIBLE | |
} | |
override fun onStart() { | |
super.onStart() | |
FirebaseAuth.getInstance().addAuthStateListener(mAuthStateListener) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun initAuthStateListener(){ | |
mAuthStateListener=object : FirebaseAuth.AuthStateListener{ | |
override fun onAuthStateChanged(p0: FirebaseAuth) { | |
var kullanici=p0.currentUser | |
if (kullanici != null){ | |
if(kullanici.isEmailVerified){ | |
Toast.makeText(this@LoginActivity,"Mail onaylandı giriş yapabilirsiniz", Toast.LENGTH_SHORT).show() | |
var intent=Intent(this@LoginActivity,MainActivity::class.java) | |
startActivity(intent) | |
finish() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
btn_Giris.setOnClickListener { | |
if (et_Mail.text.isNotEmpty() && et_Sifre.text.isNotEmpty()){ | |
progressBarGoster() | |
// Firebase kütüphanesinden email ve password parametrelerine tanımladığımız edit textleri Stringe çeviriyoruz. | |
FirebaseAuth.getInstance().signInWithEmailAndPassword(et_Mail.text.toString(),et_Sifre.text.toString()) | |
.addOnCompleteListener(object:OnCompleteListener<AuthResult>{ | |
// Kullanıcı başarılı giriş yaptığında bildirim oluşturuyoruz. | |
override fun onComplete(p0: Task<AuthResult>) { | |
if(p0.isSuccessful){ | |
progressBarGizle() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<TextView | |
android:layout_width="wrap_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".RegisterActivity"> | |
<EditText | |
android:id="@+id/et_Mail" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".LoginActivity"> | |
<ImageView | |
android:id="@+id/imageView" |
NewerOlder