Class in dart
-
All elem
-
Constructors
Bicycle(this.wheel, this.speed, this.gear);
package `in`.rahul.jetpackex | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.material3.MaterialTheme | |
import androidx.compose.material3.Surface |
#set ($USER_NAME = "Rahul Khatri") | |
#set ($GITHUB = "github.com/rahulkhatri19") | |
/** | |
* Created by ${USER_NAME} on ${DAY}, ${MONTH_NAME_FULL}, ${YEAR}. | |
* ${GITHUB} | |
**/ | |
Build With Build version code and Name | |
In build.gradle (app) file |
{ | |
"AllFood": { | |
"flower": { | |
"01": { | |
"advantages": "broccoli decreases the risk of obesity, reduce allergic reactions, and overall mortality, it is a powerful antioxidant and anti-ageing vegetable.", | |
"diseaseHeal": "Cancer, Cholesterol, Bone health, heart disease, diabetes, stroke, hypertension and inflammation.", | |
"foodImage": "https://firebasestorage.googleapis.com/v0/b/vegcartpro.appspot.com/o/food%2Fbroccoli.jpg?alt=media&token=d1cb439d-af6f-40c7-ae62-72d7bef2bd64", | |
"foodName": "Broccoli", | |
"foodNameHindi": "ब्रोकोली", | |
"id": "flower_01", |
package `in`.rahul.kotlinlearning | |
import android.content.Intent | |
import android.graphics.Color | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.support.v7.app.AlertDialog | |
import android.view.View | |
import android.widget.Button | |
import android.widget.Toast |
fun FindWinner(){ | |
var winner= -1 | |
// row 1 | |
if (Player1.contains(1)&& Player1.contains(2)&& Player1.contains(3)){ | |
winner=1 | |
} | |
if (Player2.contains(1)&& Player2.contains(2)&& Player2.contains(3)){ | |
winner=2 | |
} | |
// row 2 |
var Player1= ArrayList<Int>() | |
var Player2= ArrayList<Int>() | |
var ActivePlayer=1 | |
fun GameLogic(cellId:Int, btnSelected: Button){ | |
if (ActivePlayer == 1){ | |
btnSelected.text="X" | |
btnSelected.setBackgroundColor(Color.GRAY) | |
Player1.add(cellId) | |
ActivePlayer=2 | |
protected fun btnTicTac(view: View){ | |
val btnSelected = view as Button | |
var cellID= 0 | |
when(btnSelected.id){ | |
R.id.btnTicTac1 -> cellID=1 | |
R.id.btnTicTac2 -> cellID=2 | |
R.id.btnTicTac3 -> cellID=3 | |
R.id.btnTicTac4 -> cellID=4 | |
R.id.btnTicTac5 -> cellID=5 | |
R.id.btnTicTac6 -> cellID=6 |
<?xml version="1.0" encoding="utf-8"?> | |
<TableLayout 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:gravity="center" | |
android:background="#dadada" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".TicTacToy"> | |
<TableRow |