-
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.
[MVP] Implement new Memo app design: #55
- Loading branch information
1 parent
b7f0034
commit cfdac94
Showing
106 changed files
with
23,714 additions
and
187 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
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 |
---|---|---|
|
@@ -19,4 +19,6 @@ interface ArkAudioRecorder { | |
fun maxAmplitude(): Int | ||
|
||
fun getRecording(): Path | ||
|
||
fun getRecordingSize(): Long | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.arkbuilders.arkmemo.models | ||
|
||
import android.os.Parcelable | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
data class Tag(val value: String) : Parcelable |
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
33 changes: 33 additions & 0 deletions
33
app/src/main/java/dev/arkbuilders/arkmemo/ui/adapters/TagAdapter.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,33 @@ | ||
package dev.arkbuilders.arkmemo.ui.adapters | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import by.kirich1409.viewbindingdelegate.viewBinding | ||
import dev.arkbuilders.arkmemo.databinding.AdapterTagBinding | ||
import dev.arkbuilders.arkmemo.models.Tag | ||
|
||
class TagAdapter( | ||
private val tags: List<Tag>, | ||
): RecyclerView.Adapter<TagAdapter.TagViewHolder>() { | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TagViewHolder { | ||
val binding = AdapterTagBinding.inflate(LayoutInflater.from(parent.context)) | ||
return TagViewHolder(binding.root) | ||
} | ||
|
||
override fun onBindViewHolder(holder: TagViewHolder, position: Int) { | ||
val tag = tags[position] | ||
holder.title.text = tag.value | ||
} | ||
|
||
override fun getItemCount() = tags.size | ||
|
||
inner class TagViewHolder(itemView: View): RecyclerView.ViewHolder(itemView) { | ||
private val binding by viewBinding { | ||
AdapterTagBinding.bind(itemView) | ||
} | ||
val title = binding.tvTag | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
app/src/main/java/dev/arkbuilders/arkmemo/ui/dialogs/CommonActionDialog.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,61 @@ | ||
package dev.arkbuilders.arkmemo.ui.dialogs | ||
|
||
import android.app.Dialog | ||
import android.os.Bundle | ||
import android.view.WindowManager | ||
import androidx.annotation.StringRes | ||
import androidx.fragment.app.DialogFragment | ||
import dev.arkbuilders.arkmemo.R | ||
import dev.arkbuilders.arkmemo.databinding.DialogCommonActionBinding | ||
|
||
class CommonActionDialog(@StringRes private val title: Int, | ||
@StringRes private val message: Int, | ||
@StringRes private val positiveText: Int, | ||
@StringRes private val negativeText: Int, | ||
private val isAlert: Boolean = false, | ||
private val onPositiveClick: (() -> Unit)? = null, | ||
private val onNegativeClicked: (() -> Unit)? = null, | ||
private val onCloseClicked: (() -> Unit)? = null): DialogFragment() { | ||
|
||
companion object { | ||
val TAG = CommonActionDialog::class.java.name | ||
} | ||
private lateinit var mBinding: DialogCommonActionBinding | ||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
mBinding = DialogCommonActionBinding.inflate(layoutInflater) | ||
val dialog = Dialog(requireContext(), R.style.MemoDialog) | ||
dialog.window?.setLayout( | ||
WindowManager.LayoutParams.MATCH_PARENT, | ||
WindowManager.LayoutParams.WRAP_CONTENT | ||
) | ||
dialog.setContentView(mBinding.root) | ||
if (isAlert) { | ||
mBinding.tvPositive.setTextAppearance(R.style.AlertButton) | ||
mBinding.tvPositive.setBackgroundResource(R.drawable.bg_red_button) | ||
} | ||
initViews() | ||
return dialog | ||
} | ||
|
||
private fun initViews() { | ||
mBinding.tvTitle.setText(title) | ||
mBinding.tvMessage.setText(message) | ||
mBinding.tvPositive.setText(positiveText) | ||
mBinding.tvNegative.setText(negativeText) | ||
mBinding.ivClose.setOnClickListener { | ||
onCloseClicked?.invoke() | ||
dismiss() | ||
} | ||
|
||
mBinding.tvPositive.setOnClickListener { | ||
onPositiveClick?.invoke() | ||
dismiss() | ||
} | ||
|
||
mBinding.tvNegative.setOnClickListener { | ||
onNegativeClicked?.invoke() | ||
dismiss() | ||
} | ||
} | ||
|
||
} |
41 changes: 0 additions & 41 deletions
41
app/src/main/java/dev/arkbuilders/arkmemo/ui/dialogs/NoteDeleteDialog.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.