android / android/xr-unity-samples
Vicky
- Dominant language
- C#
- Stars
- 59
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
package com.vicky.aivideogeneration
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
VickyApp()
}
}
}
@Composable
fun VickyApp() {
MaterialTheme {
var topic by remember { mutableStateOf("") }
var selectedMode by remember { mutableStateOf("किताबी भाषा") }
var voice by remember { mutableStateOf("पुरुष — दमदार") }
var emotion by remember { mutableStateOf("सामान्य") }
var duration by remember { mutableStateOf("60 सेकंड") }
var generating by remember { mutableStateOf(false) }
var completed by remember { mutableStateOf(false) }
LazyColumn(
modifier = Modifier
.fillMaxSize()
.background(Color(0xFFF5F7FB))
) {
item {
Header()
}
item {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(14.dp),
shape = RoundedCornerShape(20.dp)
) {
Column(
modifier = Modifier.padding(18.dp)
) {
Text(
"📝 अपना Topic या कहानी लिखें",
fontSize = 18.sp,
fontWeight = FontWeight.Bold
)
Spacer(Modifier.height(10.dp))
OutlinedTextField(
value = topic,
onValueChange = { topic = it },
modifier = Modifier.fillMaxWidth(),
minLines = 4,
placeholder = {
Text("जैसे: चंपारण का इतिहास बताओ...")
}
)
Spacer(Modifier.height(20.dp))
Text(
"🎬 Video Style",
fontWeight = FontWeight.Bold,
fontSize = 17.sp
)
Spacer(Modifier.height(10.dp))
ModeSelector(
selectedMode = selectedMode,
onSelected = { selectedMode = it }
)
Spacer(Modifier.height(20.dp))
Dropdown(
title = "🗣️ Hindi Voice",
selected = voice,
options = listOf(
"पुरुष — दमदार",
"पुरुष — दोस्ताना",
"महिला — मधुर",
"महिला — Presenter",
"बुज़ुर्ग — कहानी"
),
onSelected = { voice = it }
)
Dropdown(
title = "🎭 Emotion",
selected = emotion,
options = listOf(
"सामान्य",
"जोशीला",
"गंभीर",
"खुश",
"रहस्यमय"
),
onSelected = { emotion = it }
)
Dropdown(
title = "⏱️ Video Length",
selected = duration,
options = listOf(
"15 सेकंड",
"30 सेकंड",
"60 सेकंड",
"90 सेकंड",
"2 मिनट"
),
onSelected = { duration = it }
)
Spacer(Modifier.height(18.dp))
Button(
onClick = {
if (topic.isNotBlank()) {
generating = true
completed = false
}
},
modifier = Modifier
.fillMaxWidth()
.height(56.dp),
shape = RoundedCornerShape(15.dp),
colors = ButtonDefaults.buttonColors(
containerColor = Color(0xFF6D28D9)
)
) {
Text(
"✨ Magic से Video बनाओ",
fontSize = 17.sp,
fontWeight = FontWeight.Bold
)
}
if (generating) {
Spacer(Modifier.height(18.dp))
LinearProgressIndicator(
modifier = Modifier.fillMaxWidth()
)
Spacer(Modifier.height(10.dp))
Text(
"🧠 AI Script → 🎬 Scenes → 🎙️ Voice → 🎵 Music → 📝 Subtitles",
fontSize = 13.sp
)
LaunchedEffect(Unit) {
kotlinx.coroutines.delay(2500)
generating = false
completed = true
}
}
if (completed) {
VideoResult(
topic = topic,
mode = selectedMode,
voice = voice,
emotion = emotion,
duration = duration
)
}
}
}
}
item {
FeatureCard()
}
}
}
}
@Composable
fun Header() {
Box(
modifier = Modifier
.fillMaxWidth()
.background(
Brush.linearGradient(
listOf(
Color(0xFF6D28D9),
Color(0xFF2563EB)
)
)
)
.padding(22.dp)
) {
Column {
Text(
"✨ Vicky AI Video Generation",
color = Color.White,
fontSize = 24.sp,
fontWeight = FontWeight.Bold
)
Text(
"आपकी कहानी, AI की आवाज़ और वीडियो में",
color = Color.White.copy(alpha = .9f),
fontSize = 14.sp
)
}
}
}
@Composable
fun ModeSelector(
selectedMode: String,
onSelected: (String) -> Unit
) {
val modes = listOf(
"📚\nकिताबी भाषा",
"🎥\nReal Life",
"🚶\nघूम-घूमकर"
)
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
modes.forEach { item ->
val name = item.substringAfter("\n")
Card(
modifier = Modifier
.weight(1f)
.clickable {
onSelected(name)
},
shape = RoundedCornerShape(14.dp),
colors = CardDefaults.cardColors(
containerColor =
if (selectedMode == name)
Color(0xFFEDE9FE)
else
Color.White
)
) {
Text(
item,
modifier = Modifier
.fillMaxWidth()
.padding(10.dp),
fontSize = 13.sp,
textAlign = androidx.compose.ui.text.style.TextAlign.Center
)
}
}
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun Dropdown(
title: String,
selected: String,
options: List,
onSelected: (String) -> Unit
) {
var expanded by remember { mutableStateOf(false) }
Text(
title,
fontWeight = FontWeight.Bold,
modifier = Modifier.padding(top = 12.dp, bottom = 7.dp)
)
ExposedDropdownMenuBox(
expanded = expanded,
onExpandedChange = {
expanded = !expanded
}
) {
OutlinedTextField(
value = selected,
onValueChange = {},
readOnly = true,
modifier = Modifier
.fillMaxWidth()
.menuAnchor()
)
ExposedDropdownMenu(
expanded = expanded,
onDismissRequest = {
expanded = false
}
) {
options.forEach { option ->
DropdownMenuItem(
text = { Text(option) },
onClick = {
onSelected(option)
expanded = false
}
)
}
}
}
}
@Composable
fun VideoResult(
topic: String,
mode: String,
voice: String,
emotion: String,
duration: String
) {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(top = 18.dp),
colors = CardDefaults.cardColors(
containerColor = Color(0xFF111827)
),
shape = RoundedCornerShape(18.dp)
) {
Column(
modifier = Modifier.padding(18.dp)
) {
Text(
"🎉 Video तैयार है!",
color = Color.White,
fontSize = 20.sp,
fontWeight = FontWeight.Bold
)
Spacer(Modifier.height(10.dp))
Text(
"Topic: $topic",
color = Color.White
)
Text(
"Style: $mode",
color = Color.White
)
Text(
"Voice: $voice",
color = Color.White
)
Text(
"Emotion: $emotion",
color = Color.White
)
Text(
"Length: $duration",
color = Color.White
)
Spacer(Modifier.height(15.dp))
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp)
) {
Button(onClick = {}) {
Text("▶️ Preview")
}
Button(onClick = {}) {
Text("📥 Download")
}
Button(onClick = {}) {
Text("✨ Magic Fix")
}
}
}
}
}
@Composable
fun FeatureCard() {
Card(
modifier = Modifier
.fillMaxWidth()
.padding(14.dp),
shape = RoundedCornerShape(20.dp)
) {
Column(
modifier = Modifier.padding(18.dp)
) {
Text(
"🪄 Magic Features",
fontSize = 18.sp,
fontWeight = FontWeight.Bold
)
Spacer(Modifier.height(8.dp))
Text(
"AI Script • Hindi Voice • AI Image • AI Video • " +
"Music • Automatic Editing • Subtitles • " +
"AI Presenter • Photo → Video • Thumbnail • " +
"Title • Reels/Shorts • Magic Fix"
)
}
}
}
Contributor guide
Research direction
The issue contains a large Kotlin Android UI implementation centered on MainActivity and VickyApp, but it does not state what should be changed. First clarify the intended feature, repository location, and acceptance criteria; no completion check or test path is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100