ISMA COMMIT

This commit is contained in:
ismarauu 2025-01-09 22:40:19 +07:00
parent 6f1a5bed2f
commit 2d873a8a5c
9 changed files with 364 additions and 10 deletions

2
.idea/compiler.xml generated
View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="21" />
<bytecodeTargetLevel target="17" />
</component>
</project>

1
.idea/gradle.xml generated
View File

@ -4,7 +4,6 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules">

View File

@ -0,0 +1,44 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
</profile>
</component>

8
.idea/misc.xml generated
View File

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<list size="1">
<item index="0" class="java.lang.String" itemvalue="androidx.compose.runtime.Composable" />
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -12,6 +12,9 @@
android:supportsRtl="true"
android:theme="@style/Theme.SIAMobile"
tools:targetApi="31">
<activity
android:name=".Mhs202210715298"
android:exported="false" />
<activity
android:name=".Mhs000000000000"
android:exported="false" />
@ -21,7 +24,6 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.SIAMobile">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View File

@ -105,7 +105,8 @@ fun KHSScreen() {
fun KHSItem(mahasiswaName: String) {
val context = LocalContext.current
val mahasiswaActivityMap = mapOf(
"000000000000 EXAMPLE" to Mhs000000000000::class.java
"000000000000 EXAMPLE" to Mhs000000000000::class.java,
"202210715298 ISMA RAUDHATUL JANAH" to Mhs202210715298::class.java
//"202210715185 AHMAD DIMAS RAMADHAN" to Mhs202210715185::class.java,
// silahkan ditambahkan di sini untuk NPM yang lain
)

View File

@ -3,20 +3,42 @@ package com.example.siamobile
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.*
import androidx.compose.material3.*
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.siamobile.ui.theme.SIAMobileTheme
class Mhs000000000000 : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val mahasiswaName = intent.getStringExtra("mahasiswaName") ?: "NPM: xx Nama:Example"
val mahasiswaName = intent.getStringExtra("mahasiswaName") ?: "NPM: xx Nama: Example"
setContent {
SIAMobileTheme {
DetailMahasiswaScreen(mahasiswaName)
@ -28,6 +50,15 @@ class Mhs000000000000 : ComponentActivity() {
@Composable
fun DetailMahasiswaScreen(mahasiswaName: String) {
val context = LocalContext.current
val matakuliahList = listOf(
Triple(1, "Manajemen Sekuriti", 5),
Triple(2, "Pembelajaran Mesin", 5),
Triple(3, "Interaksi Manusia dan Komputer", 5),
Triple(4, "Pemrograman Mobile", 5),
Triple(5, "Kecerdasan Buatan", 5),
Triple(6, "Keamanan Siber", 5),
Triple(7, "Manajemen Proyek Perangkat Lunak", 5)
)
Column(
modifier = Modifier
@ -47,12 +78,103 @@ fun DetailMahasiswaScreen(mahasiswaName: String) {
style = MaterialTheme.typography.bodyLarge,
fontWeight = FontWeight.Medium
)
Spacer(modifier = Modifier.height(16.dp))
// Table Header
Row(
modifier = Modifier
.fillMaxWidth()
.background(MaterialTheme.colorScheme.primaryContainer, RoundedCornerShape(8.dp))
.padding(vertical = 8.dp, horizontal = 16.dp),
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = "No",
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onPrimaryContainer
),
modifier = Modifier.weight(0.2f)
)
Text(
text = "Mata Kuliah",
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onPrimaryContainer
),
modifier = Modifier.weight(0.6f)
)
Text(
text = "Sem.",
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onPrimaryContainer
),
modifier = Modifier.weight(0.2f)
)
}
Spacer(modifier = Modifier.height(8.dp))
// Table Rows
LazyColumn(
modifier = Modifier.fillMaxWidth()
) {
items(matakuliahList) { (no, course, semester) ->
var isSelected by remember { mutableStateOf(false) }
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 4.dp)
.clickable {
isSelected = !isSelected
}
.background(
if (isSelected) MaterialTheme.colorScheme.secondaryContainer
else Color.Transparent,
RoundedCornerShape(8.dp)
)
.padding(vertical = 12.dp, horizontal = 16.dp)
.animateContentSize(),
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = no.toString(),
style = MaterialTheme.typography.bodyMedium,
fontSize = 16.sp,
modifier = Modifier.weight(0.2f)
)
Text(
text = course,
style = MaterialTheme.typography.bodyMedium,
fontSize = 16.sp,
modifier = Modifier.weight(0.6f)
)
Text(
text = semester.toString(),
style = MaterialTheme.typography.bodyMedium,
fontSize = 16.sp,
modifier = Modifier.weight(0.2f)
)
}
}
}
}
// Interactive Back Button with visual feedback
Button(
onClick = { (context as? ComponentActivity)?.finish() },
modifier = Modifier.align(Alignment.CenterHorizontally)
modifier = Modifier
.align(Alignment.CenterHorizontally)
.padding(top = 16.dp),
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.primary,
contentColor = MaterialTheme.colorScheme.onPrimary
)
) {
Text(text = "Kembali")
}
}
}

View File

@ -0,0 +1,180 @@
package com.example.siamobile
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.siamobile.ui.theme.SIAMobileTheme
class Mhs202210715298 : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val mahasiswaName = intent.getStringExtra("mahasiswaName") ?: "NPM: 202210715298 Nama: Isma Raudhatul Janah"
setContent {
SIAMobileTheme {
DetailMahasiswaScreen(mahasiswaName)
}
}
}
}
@Composable
fun DetailMahasiswaScreenIsma(mahasiswaName: String) {
val context = LocalContext.current
val matakuliahList = listOf(
Triple(1, "Manajemen Sekuriti", 5),
Triple(2, "Pembelajaran Mesin", 5),
Triple(3, "Interaksi Manusia dan Komputer", 5),
Triple(4, "Pemrograman Mobile", 5),
Triple(5, "Kecerdasan Buatan", 5),
Triple(6, "Keamanan Siber", 5),
Triple(7, "Manajemen Proyek Perangkat Lunak", 5)
)
Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
verticalArrangement = Arrangement.SpaceBetween
) {
Column {
Text(
text = "KHS Mahasiswa",
style = MaterialTheme.typography.headlineMedium,
fontWeight = FontWeight.Bold
)
Spacer(modifier = Modifier.height(8.dp))
Text(
text = mahasiswaName,
style = MaterialTheme.typography.bodyLarge,
fontWeight = FontWeight.Medium
)
Spacer(modifier = Modifier.height(16.dp))
// Table Header
Row(
modifier = Modifier
.fillMaxWidth()
.background(MaterialTheme.colorScheme.primaryContainer, RoundedCornerShape(8.dp))
.padding(vertical = 8.dp, horizontal = 16.dp),
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = "No",
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onPrimaryContainer
),
modifier = Modifier.weight(0.2f)
)
Text(
text = "Mata Kuliah",
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onPrimaryContainer
),
modifier = Modifier.weight(0.6f)
)
Text(
text = "Sem.",
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onPrimaryContainer
),
modifier = Modifier.weight(0.2f)
)
}
Spacer(modifier = Modifier.height(8.dp))
// Table Rows
LazyColumn(
modifier = Modifier.fillMaxWidth()
) {
items(matakuliahList) { (no, course, semester) ->
var isSelected by remember { mutableStateOf(false) }
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 4.dp)
.clickable {
isSelected = !isSelected
}
.background(
if (isSelected) MaterialTheme.colorScheme.secondaryContainer
else Color.Transparent,
RoundedCornerShape(8.dp)
)
.padding(vertical = 12.dp, horizontal = 16.dp)
.animateContentSize(),
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = no.toString(),
style = MaterialTheme.typography.bodyMedium,
fontSize = 16.sp,
modifier = Modifier.weight(0.2f)
)
Text(
text = course,
style = MaterialTheme.typography.bodyMedium,
fontSize = 16.sp,
modifier = Modifier.weight(0.6f)
)
Text(
text = semester.toString(),
style = MaterialTheme.typography.bodyMedium,
fontSize = 16.sp,
modifier = Modifier.weight(0.2f)
)
}
}
}
}
// Interactive Back Button with visual feedback
Button(
onClick = { (context as? ComponentActivity)?.finish() },
modifier = Modifier
.align(Alignment.CenterHorizontally)
.padding(top = 16.dp),
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.primary,
contentColor = MaterialTheme.colorScheme.onPrimary
)
) {
Text(text = "Kembali")
}
}
}

View File

@ -1,5 +1,5 @@
[versions]
agp = "8.7.2"
agp = "8.6.0"
kotlin = "2.0.0"
coreKtx = "1.15.0"
junit = "4.13.2"