-
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.
Browse files
Browse the repository at this point in the history
Feature/#23 story api
- Loading branch information
Showing
43 changed files
with
757 additions
and
115 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
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
70 changes: 70 additions & 0 deletions
70
common-ui/src/main/java/com/najudoryeong/mineme/common_ui/DialogForDatePickerNoDay.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,70 @@ | ||
package com.najudoryeong.mineme.common_ui | ||
|
||
import android.annotation.SuppressLint | ||
import android.app.Dialog | ||
import android.content.Context | ||
import android.content.res.Resources | ||
import android.graphics.Color | ||
import android.graphics.drawable.ColorDrawable | ||
import android.os.Bundle | ||
import android.view.View | ||
import android.widget.NumberPicker | ||
import com.najudoryeong.mineme.common_ui.CalendarUtil.Companion.getDateNoDay | ||
import com.najudoryeong.mineme.common_ui.databinding.DialogForDatepickerBinding | ||
import java.util.* | ||
|
||
class DialogForDatePickerNoDay( | ||
context: Context, | ||
private val initDate: Date, | ||
private val onClickPositiveButton: (String) -> Unit | ||
) : Dialog(context) { | ||
private lateinit var binding: DialogForDatepickerBinding | ||
private var calendar: Calendar = Calendar.getInstance() | ||
|
||
init { | ||
calendar.time = initDate | ||
} | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
binding = DialogForDatepickerBinding.inflate(layoutInflater).apply { | ||
datePicker.init(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),1,null) | ||
|
||
val daySpinnerId = Resources.getSystem().getIdentifier("day", "id", "android") | ||
val daySpinner = datePicker.findViewById<NumberPicker>(daySpinnerId) | ||
daySpinner.visibility = View.GONE | ||
positiveButton.setOnClickListener { | ||
onClickPositiveButton.invoke(datePicker.getDateNoDay()) | ||
dismiss() | ||
} | ||
negativeButton.setOnClickListener { | ||
dismiss() | ||
} | ||
} | ||
setContentView(binding.root) | ||
|
||
window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) | ||
} | ||
|
||
class Builder(private val context: Context) { | ||
private lateinit var initDate: Date | ||
private var onClickPositiveButton : (String) -> Unit = {} | ||
|
||
|
||
fun setInitDate(initDate: Date) = apply { | ||
this.initDate = initDate | ||
} | ||
|
||
fun setOnClickPositiveButton(onClickPositiveButton: (String) -> Unit) = apply { | ||
this.onClickPositiveButton = onClickPositiveButton | ||
} | ||
|
||
|
||
fun build() = DialogForDatePicker( | ||
context, | ||
initDate, | ||
onClickPositiveButton | ||
) | ||
} | ||
} |
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
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
29 changes: 0 additions & 29 deletions
29
common/src/main/java/com/najudoryeong/mineme/common/util/GalleryObject.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
Oops, something went wrong.