Skip to content

Instantly share code, notes, and snippets.

@gokmenbayram
gokmenbayram / SmsReceiver.kt
Created September 24, 2021 08:21
SmsReceiver.kt
class SmsReceiver: BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
}
}
@gokmenbayram
gokmenbayram / build.gradle(:app)
Created September 24, 2021 08:16
build.gradle(:app)
implementation 'com.google.android.gms:play-services-auth:19.2.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:17.5.1'
@gokmenbayram
gokmenbayram / MainActivity.kt
Created August 20, 2021 15:01
MainActivity
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.main)
val action: String? = intent?.action
val data: Uri? = intent?.data
}
@gokmenbayram
gokmenbayram / AndroidManifest.xml
Last active August 20, 2021 14:50
AndroidManifest
<activity
android:name=".MainActivity">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="https"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
prepareUI()
}
}
OutlinedTextField(
value = password,
onValueChange = { password = it },
label = { Text("Şifre") },
singleLine = true,
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password)
)
@Preview
@Composable
fun prepareUI() {
var username by remember { mutableStateOf("") }
var password by remember { mutableStateOf("") }
Column (
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
@gokmenbayram
gokmenbayram / OnBackPressedFrament.kt
Last active July 5, 2021 13:06
OnBackPressedFrament.kt
import android.content.Context
import androidx.activity.OnBackPressedCallback
import androidx.annotation.NonNull
import androidx.fragment.app.Fragment
class OnBackPressedFrament : Fragment() {
override fun onAttach(@NonNull context: Context) {
super.onAttach(context)
val callback = object : OnBackPressedCallback(true) {
class MainActivity : AppCompatActivity() {
lateinit var arrayTxt: TextView
var list = ArrayList<String>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
arrayTxt = findViewById(R.id.array_txt)
<?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"
android:background="@color/background_color">
<TextView