-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed details page in old Android style and moved to bottom sheet w…
…ith jetpack compose.
- Loading branch information
Showing
32 changed files
with
350 additions
and
440 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in C:\SDK/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle.kts. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
-keepattributes EnclosingMethod | ||
-keepattributes SourceFile,LineNumberTable | ||
-keepattributes *Annotation*,Signature |
14 changes: 11 additions & 3 deletions
14
app/src/main/java/com/pouyaheydari/calendar/MainActivity.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 |
---|---|---|
@@ -1,16 +1,24 @@ | ||
package com.pouyaheydari.calendar | ||
|
||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import com.pouyaheydari.calendar.ui.CalendarScreen | ||
import com.pouyaheydari.calendar.ui.theme.PersianCalendarTheme | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
/** | ||
* The single activity of the application | ||
*/ | ||
@AndroidEntryPoint | ||
open class MainActivity : AppCompatActivity() { | ||
open class MainActivity : ComponentActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
setContent { | ||
PersianCalendarTheme { | ||
CalendarScreen() | ||
} | ||
} | ||
} | ||
} |
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,3 @@ | ||
package com.pouyaheydari.calendar.domain | ||
|
||
data class Event(val day: Int, val description: String) |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/pouyaheydari/calendar/domain/GetEventsByDayUseCase.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,23 @@ | ||
package com.pouyaheydari.calendar.domain | ||
|
||
import com.pouyaheydari.calendar.core.pojo.Day | ||
import com.pouyaheydari.calendar.core.utils.ResourceUtils | ||
import javax.inject.Inject | ||
|
||
class GetEventsByDayUseCase @Inject constructor(private val resourceUtils: ResourceUtils) { | ||
operator fun invoke(day: Day): List<Event> { | ||
val persianTemp = day.shamsiMonth.monthNumber * 100 + day.shamsiDay | ||
val gregorianTemp = day.gregorianMonth.monthNumber * 100 + day.gregorianDay | ||
val persianEvents = resourceUtils.eventP[persianTemp].orEmpty() | ||
val gregorianEvents = resourceUtils.eventG[gregorianTemp].orEmpty() | ||
|
||
return buildList { | ||
persianEvents.forEach { | ||
add(Event(day = day.shamsiDay, description = it)) | ||
} | ||
gregorianEvents.forEach { | ||
add(Event(day = day.gregorianDay, description = it)) | ||
} | ||
} | ||
} | ||
} |
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
5 changes: 4 additions & 1 deletion
5
app/src/main/java/com/pouyaheydari/calendar/ui/CalendarUserIntents.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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package com.pouyaheydari.calendar.ui | ||
|
||
import com.pouyaheydari.calendar.core.pojo.Day | ||
|
||
sealed interface CalendarUserIntents { | ||
data object OnNextMonthClicked : CalendarUserIntents | ||
data object OnPreviousMonthClicked : CalendarUserIntents | ||
data object OnDayClicked : CalendarUserIntents | ||
data class OnDayClicked(val day: Day) : CalendarUserIntents | ||
data object OnBottomSheetDismissed : CalendarUserIntents | ||
} |
Oops, something went wrong.