Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Morit #2

Merged
merged 5 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.iml
.gradle
/local.properties
/.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
Expand Down
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.example.posyandu

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
18 changes: 15 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
Expand All @@ -11,10 +11,22 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Posyandu"
tools:targetApi="31" >
tools:targetApi="31">
<activity
android:name=".SandiBaruActivity"
android:exported="false" />
<activity
android:name=".VerifikasiResetActivity"
android:exported="false" />
<activity
android:name=".LupaActivity"
android:exported="false" />
<activity
android:name=".LoginActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true" >
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/com/example/posyandu/LoginActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.example.posyandu

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
}
}
37 changes: 37 additions & 0 deletions app/src/main/java/com/example/posyandu/LupaActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.example.posyandu

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import androidx.core.view.children
import com.google.android.material.button.MaterialButton
import com.google.android.material.button.MaterialButtonToggleGroup

class LupaActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_lupa)

val toggleButton = findViewById<MaterialButtonToggleGroup>(R.id.toggleButton)
val defaultCheckedButtonId = R.id.button1 // Replace with the ID of the button you want to be checked by default

// Set the default checked state
toggleButton.check(defaultCheckedButtonId)

toggleButton.addOnButtonCheckedListener { group, checkedId, isChecked ->
val checkedButton: MaterialButton? = group.findViewById(checkedId)

// Uncheck all buttons except the checked one
for (button in group.children) {
if (button != checkedButton && button is MaterialButton) {
button.isChecked = false

}
}
}
}

fun onClick(v: View?) {
TODO("Not yet implemented")
}
itsLeonB marked this conversation as resolved.
Show resolved Hide resolved
}
5 changes: 4 additions & 1 deletion app/src/main/java/com/example/posyandu/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.navigation.NavigationBarView

class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
val userRole = "bidan"
itsLeonB marked this conversation as resolved.
Show resolved Hide resolved

super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

Expand Down Expand Up @@ -58,4 +61,4 @@ class MainActivity : AppCompatActivity() {
.commit()
true
}
}
}
11 changes: 11 additions & 0 deletions app/src/main/java/com/example/posyandu/SandiBaruActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.example.posyandu

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class SandiBaruActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_sandi_baru)
}
}
11 changes: 11 additions & 0 deletions app/src/main/java/com/example/posyandu/VerifikasiResetActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.example.posyandu

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class VerifikasiResetActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_verifikasi_reset)
}
}
6 changes: 6 additions & 0 deletions app/src/main/res/drawable/button_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- res/drawable/rounded_button_background.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="12dp" /> <!-- Adjust the radius as needed for the desired roundness -->
<solid android:color="#000000" /> <!-- Set the background color -->
</shape>
Binary file added app/src/main/res/drawable/ilustrasi_bidan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ilustrasi_remaja.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/mail_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/pass_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- res/drawable/rounded_text_input_layout_background.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/white" />
<corners android:radius="14dp" /> <!-- Adjust the radius as needed for the desired roundness -->
<stroke android:color="#CCCCCC" android:width="1dp" /> <!-- Border color and width -->
</shape>
100 changes: 100 additions & 0 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingHorizontal="20dp"
android:paddingVertical="14dp">

<TextView
android:id="@+id/loginTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/inter_bold"
android:text="Login Sebagai Bidan"
android:textSize="20sp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="14dp"
/>

<ImageView
android:id="@+id/imageBidan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ilustrasi_bidan"
app:layout_constraintTop_toBottomOf="@+id/loginTitle"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginVertical="32dp"
/>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/usernameInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/imageBidan"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginVertical="20dp"
android:hint="Username"
app:boxCornerRadiusBottomStart="12dp"
app:boxCornerRadiusBottomEnd="12dp"
app:boxCornerRadiusTopEnd="12dp"
app:boxCornerRadiusTopStart="12dp"
>
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/passwordInput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="20dp"
app:boxCornerRadiusBottomStart="12dp"
app:boxCornerRadiusBottomEnd="12dp"
app:boxCornerRadiusTopEnd="12dp"
app:boxCornerRadiusTopStart="12dp"
android:hint="Password"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/usernameInput"
app:passwordToggleEnabled="true">

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"/>
</com.google.android.material.textfield.TextInputLayout>

<TextView
android:id="@+id/hyperlinkLupaPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lupa Password?"
android:autoLink="web"
android:linksClickable="true"
app:layout_constraintTop_toBottomOf="@+id/passwordInput"
app:layout_constraintEnd_toEndOf="@+id/passwordInput"
android:paddingVertical="14dp"
/>



<com.google.android.material.button.MaterialButton
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cornerRadius="12dp"
android:text="Login"
app:layout_constraintTop_toBottomOf="@+id/hyperlinkLupaPassword"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:background="@drawable/button_background"
android:fontFamily="@font/inter_bold"
android:textSize="14sp"/>

</androidx.constraintlayout.widget.ConstraintLayout>
Loading