Compare commits
No commits in common. "master" and "main" have entirely different histories.
26
.idea/appInsightsSettings.xml
generated
26
.idea/appInsightsSettings.xml
generated
@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="AppInsightsSettings">
|
|
||||||
<option name="tabSettings">
|
|
||||||
<map>
|
|
||||||
<entry key="Firebase Crashlytics">
|
|
||||||
<value>
|
|
||||||
<InsightsFilterSettings>
|
|
||||||
<option name="connection">
|
|
||||||
<ConnectionSetting>
|
|
||||||
<option name="appId" value="PLACEHOLDER" />
|
|
||||||
<option name="mobileSdkAppId" value="" />
|
|
||||||
<option name="projectId" value="" />
|
|
||||||
<option name="projectNumber" value="" />
|
|
||||||
</ConnectionSetting>
|
|
||||||
</option>
|
|
||||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
|
||||||
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
|
||||||
<option name="visibilityType" value="ALL" />
|
|
||||||
</InsightsFilterSettings>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
53
.idea/inspectionProfiles/Project_Default.xml
generated
53
.idea/inspectionProfiles/Project_Default.xml
generated
@ -1,53 +0,0 @@
|
|||||||
<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" />
|
|
||||||
<option name="previewFile" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
|
||||||
<option name="composableFile" value="true" />
|
|
||||||
<option name="previewFile" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
|
||||||
<option name="composableFile" value="true" />
|
|
||||||
<option name="previewFile" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
|
||||||
<option name="composableFile" value="true" />
|
|
||||||
<option name="previewFile" 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" />
|
|
||||||
<option name="previewFile" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
|
|
||||||
<option name="composableFile" value="true" />
|
|
||||||
<option name="previewFile" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
|
||||||
<option name="composableFile" value="true" />
|
|
||||||
<option name="previewFile" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
|
||||||
<option name="composableFile" value="true" />
|
|
||||||
<option name="previewFile" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
|
||||||
<option name="composableFile" value="true" />
|
|
||||||
<option name="previewFile" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
5
.idea/misc.xml
generated
5
.idea/misc.xml
generated
@ -1,10 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<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="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" 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" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
|
17
.idea/runConfigurations.xml
generated
17
.idea/runConfigurations.xml
generated
@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RunConfigurationProducerService">
|
|
||||||
<option name="ignoredProducers">
|
|
||||||
<set>
|
|
||||||
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
|
|
||||||
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
|
|
||||||
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -40,7 +40,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Core dependencies
|
|
||||||
implementation(libs.androidx.core.ktx)
|
implementation(libs.androidx.core.ktx)
|
||||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||||
implementation(libs.androidx.activity.compose)
|
implementation(libs.androidx.activity.compose)
|
||||||
@ -53,15 +53,11 @@ dependencies {
|
|||||||
implementation(libs.material)
|
implementation(libs.material)
|
||||||
implementation(libs.androidx.activity)
|
implementation(libs.androidx.activity)
|
||||||
implementation(libs.androidx.constraintlayout)
|
implementation(libs.androidx.constraintlayout)
|
||||||
|
|
||||||
// Test dependencies
|
|
||||||
testImplementation(libs.junit)
|
testImplementation(libs.junit)
|
||||||
androidTestImplementation(libs.androidx.junit)
|
androidTestImplementation(libs.androidx.junit)
|
||||||
androidTestImplementation(libs.androidx.espresso.core)
|
androidTestImplementation(libs.androidx.espresso.core)
|
||||||
androidTestImplementation(platform(libs.androidx.compose.bom))
|
androidTestImplementation(platform(libs.androidx.compose.bom))
|
||||||
androidTestImplementation(libs.androidx.ui.test.junit4)
|
androidTestImplementation(libs.androidx.ui.test.junit4)
|
||||||
|
|
||||||
// Debug dependencies
|
|
||||||
debugImplementation(libs.androidx.ui.tooling)
|
debugImplementation(libs.androidx.ui.tooling)
|
||||||
debugImplementation(libs.androidx.ui.test.manifest)
|
debugImplementation(libs.androidx.ui.test.manifest)
|
||||||
}
|
}
|
@ -13,10 +13,10 @@
|
|||||||
android:theme="@style/Theme.SIAMobile"
|
android:theme="@style/Theme.SIAMobile"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
<activity
|
<activity
|
||||||
android:name=".Mhs202210715136"
|
android:name=".Mhs000000000000"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".Mhs000000000000"
|
android:name=".Mhs202210715290"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".KHSActivity"
|
android:name=".KHSActivity"
|
||||||
@ -24,6 +24,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
android:label="@string/app_name"
|
||||||
android:theme="@style/Theme.SIAMobile">
|
android:theme="@style/Theme.SIAMobile">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
@ -106,7 +106,7 @@ fun KHSItem(mahasiswaName: String) {
|
|||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val mahasiswaActivityMap = mapOf(
|
val mahasiswaActivityMap = mapOf(
|
||||||
"000000000000 EXAMPLE" to Mhs000000000000::class.java,
|
"000000000000 EXAMPLE" to Mhs000000000000::class.java,
|
||||||
"202210715136 MUHAMAD RAJWA ATHORIQ" to Mhs202210715136::class.java
|
"202210715290 NAJWA MIMA SALSABILA" to Mhs202210715290::class.java
|
||||||
//"202210715185 AHMAD DIMAS RAMADHAN" to Mhs202210715185::class.java,
|
//"202210715185 AHMAD DIMAS RAMADHAN" to Mhs202210715185::class.java,
|
||||||
// silahkan ditambahkan di sini untuk NPM yang lain
|
// silahkan ditambahkan di sini untuk NPM yang lain
|
||||||
)
|
)
|
||||||
@ -138,8 +138,6 @@ fun KHSItem(mahasiswaName: String) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
@ -3,42 +3,20 @@ package com.example.siamobile
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.compose.animation.animateContentSize
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.material3.*
|
||||||
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.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.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import com.example.siamobile.ui.theme.SIAMobileTheme
|
import com.example.siamobile.ui.theme.SIAMobileTheme
|
||||||
|
|
||||||
class Mhs000000000000 : ComponentActivity() {
|
class Mhs000000000000 : ComponentActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
val mahasiswaName = intent.getStringExtra("mahasiswaName") ?: "NPM: xx Nama: Example"
|
val mahasiswaName = intent.getStringExtra("mahasiswaName") ?: "NPM: xx Nama:Example"
|
||||||
setContent {
|
setContent {
|
||||||
SIAMobileTheme {
|
SIAMobileTheme {
|
||||||
DetailMahasiswaScreen(mahasiswaName)
|
DetailMahasiswaScreen(mahasiswaName)
|
||||||
@ -50,24 +28,6 @@ class Mhs000000000000 : ComponentActivity() {
|
|||||||
@Composable
|
@Composable
|
||||||
fun DetailMahasiswaScreen(mahasiswaName: String) {
|
fun DetailMahasiswaScreen(mahasiswaName: String) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val matakuliahList = listOf(
|
|
||||||
Triple(1, "Aljabar Linear", 1),
|
|
||||||
Triple(2, "Character Building", 1),
|
|
||||||
Triple(3, "Dasar Pemrograman", 1),
|
|
||||||
Triple(4, "Fisika", 1),
|
|
||||||
Triple(5, "Kalkulus 1", 1),
|
|
||||||
Triple(6, "Kewarganegaraan", 1),
|
|
||||||
Triple(7, "Pengantar Teknologi Informasi", 1),
|
|
||||||
Triple(8, "Struktur Data dan Algoritma", 1),
|
|
||||||
Triple(9, "Bahasa Indonesia", 2),
|
|
||||||
Triple(10, "Desain dan Analisis Algoritma", 2),
|
|
||||||
Triple(11, "Kalkulus II", 2),
|
|
||||||
Triple(12, "Logika Matematika", 2),
|
|
||||||
Triple(13, "Matematika Diskrit", 2),
|
|
||||||
Triple(14, "Pendidikan Agama", 2),
|
|
||||||
Triple(15, "Sistem Basis Data", 2),
|
|
||||||
Triple(16, "Analisa Numerik", 3)
|
|
||||||
)
|
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@ -87,103 +47,12 @@ fun DetailMahasiswaScreen(mahasiswaName: String) {
|
|||||||
style = MaterialTheme.typography.bodyLarge,
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
fontWeight = FontWeight.Medium
|
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(
|
Button(
|
||||||
onClick = { (context as? ComponentActivity)?.finish() },
|
onClick = { (context as? ComponentActivity)?.finish() },
|
||||||
modifier = Modifier
|
modifier = Modifier.align(Alignment.CenterHorizontally)
|
||||||
.align(Alignment.CenterHorizontally)
|
|
||||||
.padding(top = 16.dp),
|
|
||||||
colors = ButtonDefaults.buttonColors(
|
|
||||||
containerColor = MaterialTheme.colorScheme.primary,
|
|
||||||
contentColor = MaterialTheme.colorScheme.onPrimary
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
Text(text = "Kembali")
|
Text(text = "Kembali")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,189 +0,0 @@
|
|||||||
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 Mhs202210715136 : ComponentActivity() {
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
val mahasiswaName = intent.getStringExtra("mahasiswaName") ?: "NPM: 202210715136 Nama: Muhamad Rajwa Athoriq"
|
|
||||||
setContent {
|
|
||||||
SIAMobileTheme {
|
|
||||||
DetailMahasiswaScreen(mahasiswaName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun DetailMahasiswaScreenOld(mahasiswaName: String) {
|
|
||||||
val context = LocalContext.current
|
|
||||||
val matakuliahList = listOf(
|
|
||||||
Triple(1, "Aljabar Linear", 1),
|
|
||||||
Triple(2, "Character Building", 1),
|
|
||||||
Triple(3, "Dasar Pemrograman", 1),
|
|
||||||
Triple(4, "Fisika", 1),
|
|
||||||
Triple(5, "Kalkulus 1", 1),
|
|
||||||
Triple(6, "Kewarganegaraan", 1),
|
|
||||||
Triple(7, "Pengantar Teknologi Informasi", 1),
|
|
||||||
Triple(8, "Struktur Data dan Algoritma", 1),
|
|
||||||
Triple(9, "Bahasa Indonesia", 2),
|
|
||||||
Triple(10, "Desain dan Analisis Algoritma", 2),
|
|
||||||
Triple(11, "Kalkulus II", 2),
|
|
||||||
Triple(12, "Logika Matematika", 2),
|
|
||||||
Triple(13, "Matematika Diskrit", 2),
|
|
||||||
Triple(14, "Pendidikan Agama", 2),
|
|
||||||
Triple(15, "Sistem Basis Data", 2),
|
|
||||||
Triple(16, "Analisa Numerik", 3)
|
|
||||||
)
|
|
||||||
|
|
||||||
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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
118
app/src/main/java/com/example/siamobile/Mhs202210715290.kt
Normal file
118
app/src/main/java/com/example/siamobile/Mhs202210715290.kt
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
package com.example.siamobile
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.activity.ComponentActivity
|
||||||
|
import androidx.activity.compose.setContent
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.lazy.items
|
||||||
|
import androidx.compose.material3.*
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
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 com.example.siamobile.ui.theme.SIAMobileTheme
|
||||||
|
|
||||||
|
data class MataKuliah(
|
||||||
|
val no: Int,
|
||||||
|
val namaMK: String,
|
||||||
|
val sem: Int,
|
||||||
|
)
|
||||||
|
|
||||||
|
class Mhs202210715290 : ComponentActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
val mahasiswaName = intent.getStringExtra("mahasiswaName") ?: "Nama: Najwa Mima Salsabila\nNPM: 202210715290"
|
||||||
|
setContent {
|
||||||
|
SIAMobileTheme {
|
||||||
|
DetailMahasiswaScreen2(mahasiswaName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun DetailMahasiswaScreen2(mahasiswaName: String) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
|
||||||
|
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))
|
||||||
|
TabelMataKuliah() // Menambahkan tabel mata kuliah
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove Spacer and use a fixed height for the button area
|
||||||
|
Button(
|
||||||
|
onClick = { (context as? ComponentActivity)?.finish() },
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.CenterHorizontally)
|
||||||
|
.padding(top = 16.dp) // Add some padding for spacing
|
||||||
|
.fillMaxWidth() // Make the button full width
|
||||||
|
) {
|
||||||
|
Text(text = "Kembali")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun TabelMataKuliah() {
|
||||||
|
val mataKuliahList = listOf(
|
||||||
|
MataKuliah(1, "Bahasa Indonesia", 2),
|
||||||
|
MataKuliah(2, "Desain dan Analisis Algoritma", 2),
|
||||||
|
MataKuliah(3, "Kalkulus II", 2),
|
||||||
|
MataKuliah(4, "Logika Matematika", 2),
|
||||||
|
MataKuliah(5, "Matematika Diskrit", 2),
|
||||||
|
MataKuliah(6, "Sistem Basis Data", 2)
|
||||||
|
)
|
||||||
|
|
||||||
|
Column(modifier = Modifier.fillMaxWidth()) {
|
||||||
|
// Header Tabel
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(8.dp)
|
||||||
|
.background(Color(0xFFFFC0CB)), // Pink
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text("No", modifier = Modifier.weight(0.1f), fontWeight = FontWeight.Bold, color = Color.White)
|
||||||
|
Text("Mata Kuliah", modifier = Modifier.weight(0.4f), fontWeight = FontWeight.Bold, color = Color.White)
|
||||||
|
Text("Sem", modifier = Modifier.weight(0.1f), fontWeight = FontWeight.Bold, color = Color.White)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Data Tabel
|
||||||
|
LazyColumn {
|
||||||
|
items(mataKuliahList) { mataKuliah ->
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Text(mataKuliah.no.toString(), modifier = Modifier.weight(0.1f))
|
||||||
|
Text(mataKuliah.namaMK, modifier = Modifier.weight(0.4f))
|
||||||
|
Text(mataKuliah.sem.toString(), modifier = Modifier.weight(0.1f))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,10 +0,0 @@
|
|||||||
<?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:id="@+id/main"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".Mhs202210715136">
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,10 +0,0 @@
|
|||||||
<?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:id="@+id/main"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".Mhs202210715136">
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1,5 +1,5 @@
|
|||||||
[versions]
|
[versions]
|
||||||
agp = "8.6.0"
|
agp = "8.4.0"
|
||||||
kotlin = "2.0.0"
|
kotlin = "2.0.0"
|
||||||
coreKtx = "1.15.0"
|
coreKtx = "1.15.0"
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user