-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
786 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 147 additions & 0 deletions
147
app/src/main/java/com/example/charo_android/ui/write/WriteActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
package com.example.charo_android.ui.write | ||
|
||
import android.os.Bundle | ||
import android.view.MotionEvent | ||
import android.view.View | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.example.charo_android.R | ||
import com.example.charo_android.databinding.ActivityWriteBinding | ||
import com.google.android.material.dialog.MaterialAlertDialogBuilder | ||
|
||
|
||
class WriteActivity : AppCompatActivity() { | ||
|
||
private lateinit var binding : ActivityWriteBinding | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
binding = ActivityWriteBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
|
||
//๋ฒํผ selected ์ํ ๋ณํ ํจ์ | ||
setButtonClickEvent() | ||
|
||
//์ง์ญ | ||
val ItemsDo = arrayOf("") | ||
|
||
|
||
// ํ ๋ง | ||
val ItemsTheme = arrayOf("์ฐ", "๋ฐ๋ค", "ํธ์","๊ฐ","๋ด","์ฌ๋ฆ","๊ฐ์","๊ฒจ์ธ","ํด์๋๋ก","๋ฒ๊ฝ","๋จํ","์ฌ์ ","์คํผ๋","์ผ๊ฒฝ","๋์ฌ") | ||
|
||
|
||
binding.btnWriteTheme1.setOnClickListener { | ||
val checkedItem = 1 | ||
MaterialAlertDialogBuilder(this) | ||
.setTitle(resources.getString(R.string.theme1)) | ||
.setNeutralButton("์ทจ์") { dialog, which -> | ||
binding.btnWriteTheme1.setText(resources.getString(R.string.theme1)) | ||
it.isSelected = false | ||
} | ||
.setPositiveButton("ํ์ธ") { dialog, which -> | ||
if(binding.btnWriteTheme1.text.toString() == resources.getString(R.string.theme1)) { | ||
it.isSelected = false | ||
} | ||
it.isSelected = true | ||
} | ||
// Single-choice items (initialized with checked item) | ||
.setSingleChoiceItems(ItemsTheme, checkedItem) { dialog, which -> | ||
//which : index | ||
//ํ ๋ง ๊ณ ๋ฅด๋ฉด ํ ์คํธ ๋ณ๊ฒฝ | ||
binding.btnWriteTheme1.setText(ItemsTheme[which]) | ||
} | ||
.show() | ||
} | ||
binding.btnWriteTheme2.setOnClickListener { | ||
val checkedItem = 1 | ||
MaterialAlertDialogBuilder(this) | ||
.setTitle(resources.getString(R.string.theme2)) | ||
.setNeutralButton("์ทจ์") { dialog, which -> | ||
binding.btnWriteTheme2.setText(resources.getString(R.string.theme2)) | ||
it.isSelected = false | ||
} | ||
.setPositiveButton("ํ์ธ") { dialog, which -> | ||
if(binding.btnWriteTheme1.text.toString() == resources.getString(R.string.theme2)) { | ||
it.isSelected = false | ||
} | ||
it.isSelected = true | ||
} | ||
// Single-choice items (initialized with checked item) | ||
.setSingleChoiceItems(ItemsTheme, checkedItem) { dialog, which -> | ||
//which : index | ||
//ํ ๋ง ๊ณ ๋ฅด๋ฉด ํ ์คํธ ๋ณ๊ฒฝ | ||
binding.btnWriteTheme2.setText(ItemsTheme[which]) | ||
} | ||
.show() | ||
} | ||
binding.btnWriteTheme3.setOnClickListener { | ||
val checkedItem = 1 | ||
MaterialAlertDialogBuilder(this) | ||
.setTitle(resources.getString(R.string.theme3)) | ||
.setNeutralButton("์ทจ์") { dialog, which -> | ||
binding.btnWriteTheme3.setText(resources.getString(R.string.theme3)) | ||
it.isSelected = false | ||
} | ||
.setPositiveButton("ํ์ธ") { dialog, which -> | ||
if(binding.btnWriteTheme3.text.toString() == resources.getString(R.string.theme3)) { | ||
it.isSelected = false | ||
} | ||
it.isSelected = true | ||
} | ||
// Single-choice items (initialized with checked item) | ||
.setSingleChoiceItems(ItemsTheme, checkedItem) { dialog, which -> | ||
//which : index | ||
//ํ ๋ง ๊ณ ๋ฅด๋ฉด ํ ์คํธ ๋ณ๊ฒฝ | ||
binding.btnWriteTheme3.setText(ItemsTheme[which]) | ||
} | ||
.show() | ||
} | ||
|
||
//์ฃผ์ฐจ - ๋ ์ค ํ๋๋ง ์ ํ ๊ฐ๋ฅํ๋๋ก ํ๊ธฐ | ||
|
||
|
||
} | ||
|
||
|
||
|
||
fun setButtonClickEvent() { | ||
|
||
binding.btnWriteCautionHighway.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteCautionPeople.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteCautionDiffi.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteCautionMoun.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteDo.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteSi.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteParkNo.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteParkYes.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteTheme1.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteTheme2.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
binding.btnWriteTheme3.setOnClickListener { | ||
it.isSelected = !it.isSelected | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/example/charo_android/ui/write/WriteMapActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.charo_android.ui.write | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import com.example.charo_android.databinding.ActivityWriteMapBinding | ||
|
||
class WriteMapActivity : AppCompatActivity() { | ||
|
||
private lateinit var binding : ActivityWriteMapBinding | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
binding = ActivityWriteMapBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/ui_write_btn_parking_select_android" android:state_selected="true" /> | ||
<item android:drawable="@drawable/ui_write_btn_parking_unselect_android" android:state_selected="false" /> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/ui_write_btn_warning_unselect_android_2" android:state_selected="true" /> | ||
<item android:drawable="@drawable/ui_write_btn_warning_unselect_android" android:state_selected="false" /> | ||
</selector> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@drawable/ui_write_btn_select_android" android:state_selected="true" /> | ||
<item android:drawable="@drawable/ui_write_btn_unselect_android" android:state_selected="false" /> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.