Skip to content

Instantly share code, notes, and snippets.

View amoozeshbebin's full-sized avatar

iliya amoozeshbebin

View GitHub Profile
@amoozeshbebin
amoozeshbebin / neumorphism design card.kt
Created November 9, 2023 08:43
neumorphism design card
dependencies:
implementation ("com.github.fornewid:neumorphism:0.3.2")
maven { url = uri("https://www.jitpack.io" ) }
activity_main.xml:
<?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"
@amoozeshbebin
amoozeshbebin / Grid View.kt
Created November 7, 2023 18:07
Grid View
MainActivity.kt:
package com.iliyadev.gridview
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.AdapterView
import android.widget.GridView
import android.widget.Toast
import com.iliyadev.gridview.adapters.PlayerAdapter
@amoozeshbebin
amoozeshbebin / List View.kt
Created November 6, 2023 14:06
List View in xml and kotlin
mainactivity.kt:
package com.iliyadev.myapplication
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ArrayAdapter
import android.widget.Button
import android.widget.ListView
@amoozeshbebin
amoozeshbebin / inventory console project.kt
Created November 4, 2023 10:29
inventory console project
file Main.kt:
var productList = mutableListOf<Product>()
fun main(args: Array<String>) {
val handler = ProductHandler()
val reader = ReadFileCoroutine()
val writer = WriteFileCoroutine()
@amoozeshbebin
amoozeshbebin / Employees program.kt
Last active October 28, 2023 17:05
Employees project
main activity:
fun main(){
var employees = mutableListOf<Employee>()
while (true){
when(getMenu()){
1->{
println("نام را وارد کنید")
var firstName = readLine()!!
@amoozeshbebin
amoozeshbebin / Navigation Fragment in jetpack.kt
Last active May 3, 2024 17:24
Navigation Fragment in jetpack
Implementation:
implementation("androidx.navigation:navigation-compose:2.7.2")
➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖
➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖
➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖
MainActivity.kt:
import android.annotation.SuppressLint
import androidx.compose.material3.ExperimentalMaterial3Api
import android.os.Bundle
@amoozeshbebin
amoozeshbebin / Navigation Bar In Jetpack Compose
Created September 10, 2023 07:54
Navigation Bar In Jetpack Compose
@OptIn(ExperimentalMaterial3Api::class)
@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
@Preview
@Composable
fun hi() {
var selectedItem by remember { mutableIntStateOf(0) }
val items = listOf("Songs", "Artists", "Playlists")
Scaffold {
NavigationBar(modifier = Modifier.padding(top = 765.dp)) {
items.forEachIndexed { index, item ->
@amoozeshbebin
amoozeshbebin / Intent in jetpack compose
Created September 8, 2023 10:43
Intent in jetpack compose
onClick = {
Intent(
applicationContext,
text::class.java
).also { startActivity(it) }
@amoozeshbebin
amoozeshbebin / password textfield jetpack
Created September 8, 2023 07:13
Password Text Field In JetpackCompose
var password by rememberSaveable { mutableStateOf("") }
var passwordVisibility by remember { mutableStateOf(false) }
val icon = if (passwordVisibility)
painterResource(id = R.drawable.baseline_visibility_24)
else
painterResource(id = R.drawable.baseline_visibility_off_24)
OutlinedTextField(
value = password, onValueChange = {
password = it
@amoozeshbebin
amoozeshbebin / Top App Bar & Menu Bottom with menu & Floating Action button jetpack
Last active September 9, 2023 07:28
Top App Bar & Menu Bottom with menu & Floating Action button jetpack
import androidx.compose.material.icons.filled.Call
import androidx.compose.material.icons.filled.Clear
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.ExperimentalMaterial3Api
import android.content.Intent
import android.graphics.drawable.Icon
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Arrangement