-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from tukcomCD2024/Android_Qdesign
Android qdesign
- Loading branch information
Showing
25 changed files
with
550 additions
and
379 deletions.
There are no files selected for viewing
59 changes: 0 additions & 59 deletions
59
android/app/src/main/java/com/coop/sharenote/AlertFragment.kt
This file was deleted.
Oops, something went wrong.
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
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
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
63 changes: 63 additions & 0 deletions
63
android/app/src/main/java/com/coop/sharenote/SearchNoteListAdapter_f.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,63 @@ | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.TextView | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.coop.sharenote.Note | ||
import com.coop.sharenote.R | ||
|
||
class SearchNoteListAdapter_f(private val onItemClick: (String) -> Unit) : | ||
RecyclerView.Adapter<SearchNoteListAdapter_f.NoteViewHolder>() { | ||
|
||
private val noteList = mutableListOf<Note>() | ||
private var filteredNoteList = mutableListOf<Note>() | ||
|
||
init { | ||
filteredNoteList.addAll(noteList) | ||
} | ||
|
||
inner class NoteViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), View.OnClickListener { | ||
init { | ||
itemView.setOnClickListener(this) | ||
} | ||
|
||
override fun onClick(v: View?) { | ||
val position = adapterPosition | ||
if (position != RecyclerView.NO_POSITION) { | ||
val clickedNoteId = filteredNoteList[position].Id | ||
onItemClick(clickedNoteId) | ||
} | ||
} | ||
|
||
val titleTextView: TextView = itemView.findViewById(R.id.titleTextView) | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NoteViewHolder { | ||
val itemView = LayoutInflater.from(parent.context).inflate(R.layout.item_search_note_f, parent, false) | ||
return NoteViewHolder(itemView) | ||
} | ||
|
||
override fun onBindViewHolder(holder: NoteViewHolder, position: Int) { | ||
val currentItem = filteredNoteList[position] | ||
// 아이템의 제목 설정 | ||
holder.titleTextView.text = currentItem.title | ||
} | ||
|
||
override fun getItemCount() = filteredNoteList.size | ||
|
||
fun setNotes(notes: List<Note>) { | ||
noteList.clear() | ||
noteList.addAll(notes) | ||
filter("") | ||
} | ||
|
||
fun filter(query: String) { | ||
filteredNoteList.clear() | ||
if (query.isEmpty()) { | ||
filteredNoteList.addAll(noteList) | ||
} else { | ||
filteredNoteList.addAll(noteList.filter { it.title.contains(query, ignoreCase = true) }) | ||
} | ||
notifyDataSetChanged() | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<solid android:color="#CCE1FF"/> | ||
<corners | ||
android:bottomLeftRadius="12dp" | ||
android:bottomRightRadius="12dp" | ||
android:topLeftRadius="12dp" | ||
android:topRightRadius="12dp" /> | ||
|
||
</shape> |
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,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<solid android:color="#F08080"/> | ||
<corners | ||
android:bottomLeftRadius="12dp" | ||
android:bottomRightRadius="12dp" | ||
android:topLeftRadius="12dp" | ||
android:topRightRadius="12dp" /> | ||
|
||
</shape> |
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,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<solid android:color="@color/white"/> | ||
<corners | ||
android:bottomLeftRadius="12dp" | ||
android:bottomRightRadius="12dp" | ||
android:topLeftRadius="12dp" | ||
android:topRightRadius="12dp" /> | ||
|
||
</shape> |
Oops, something went wrong.