Skip to content

Commit

Permalink
Merge pull request #531 from Chooloo/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
roeiedri authored Jun 20, 2023
2 parents 9f4f7a0 + e2e43d1 commit 518b3c0
Show file tree
Hide file tree
Showing 32 changed files with 647 additions and 899 deletions.
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,28 @@
Koler
</h1>

<a href="https://hosted.weblate.org/engage/koler/">
<img src="https://hosted.weblate.org/widgets/koler/-/svg-badge.svg" alt="Translation startus" />
</a>

<p align="center">
It's a dialer but it's simple and it looks pretty good honestly
A dialer, but it's simple and looks pretty good honestly!
</p>

Koler is an open source MVVM android app.
Designed with the user in mind.
Copylefted libre MVVM Android app. \
Designed with the user in mind. \
Believe us we want to make it good, we use it ourselves.

## ☕ Support
We, money, dont have.
We, money, don't have.
We, money, need.
You, money, give.
</br>
You can donate with PayPal.
[![Donate with PayPal](https://raw.githubusercontent.com/stefan-niedermann/paypal-donate-button/master/paypal-donate-button.png)](https://paypal.me/theroeiedri?locale.x=en_US)

Or you can just buy the app from the playstore.
You'll get constant updates without the need to get all the way here and download the release all by yourself and install the release all by yourself and then you realize you have a different package name so you contact me but I really don't have time for this so I update it on google play and then you realize your installer doesn't work and then you realize your whole life is like this, miserable and not working but then you see a point of light in the distance so you run towards and and it's the "Buy" button in the Koler's page on google play, it'l make your life easier.
Or you can just buy the app from the Play store.
You'll get constant updates without the need to get all the way here and download the release all by yourself and install the release all by yourself and then you realize you have a different package name so you contact me, but I really don't have time for this so I update it on Google Play and then you realize your installer doesn't work and then you realize your whole life is like this, miserable and not working but then you see a point of light in the distance so you run towards and and it's the "Buy" button in the Koler's page on Google Play, and your life is much improved.

## ⭐ Find this repository useful?
Support it by joining [Stargazers](https://github.com/Chooloo/koler/stargazers) for this repository.
Expand All @@ -37,16 +41,22 @@ If you enjoy the app, wish to contribute or simply wish to be with like-minded p
</a>
</p>

## Translations

<a href="https://hosted.weblate.org/engage/koler/">
<img src="https://hosted.weblate.org/widgets/koler/-/multi-auto.svg" alt="Translation status" />
</a>

## 👍 Support Availability
We are aware the app needs more support and updates, due to feature requests and minor bugs
We are currently not fully available for supporting the app due to a lack of support (The app is free to use)
We'll do our best to slowly push updates and add the requested feature
If you want to help us and support us so we can put more attention to the app, please consider supporting us (Bottom of the page)
Feel free to contact us for every little thing
We are aware the app needs more support and updates, due to feature requests and minor bugs.
We are currently not fully available for supporting the app due to a lack of support (seeing as the app is gratis).
We'll do our best to slowly push updates and add the requested features.
If you want to help us and support us so we can put more of our attention towards the app, please consider supporting us (at the bottom of the page).
Feel free to contact us for every little thing.

## ⚙️ Install
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" alt="Get it on Google Play" height="80">](https://play.google.com/store/apps/details?id=com.chooloo.www.koler)
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Git it on F-Droid" height="80">](https://f-droid.org/app/com.chooloo.www.koler)
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" alt="Get it on Google Play" height="80">](https://play.google.com/store/apps/details?id=com.chooloo.www.koler)
[<img src="https://github.com/machiav3lli/oandbackupx/blob/034b226cea5c1b30eb4f6a6f313e4dadcbb0ece4/badge_github.png" alt="Get it on GitHub" height="80">](https://github.com/Chooloo/koler/releases)

## License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface RecentsInteractor : BaseInteractor<RecentsInteractor.Listener> {
interface Listener

fun deleteRecent(recentId: Long)
fun deleteAllRecents()
fun getRecents(): Flow<List<RecentAccount>>
fun getRecent(recentId: Long): Flow<RecentAccount?>
fun getCallTypeImage(@RecentAccount.CallType callType: Int): Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ class RecentsInteractorImpl @Inject constructor(
)
}

@RequiresPermission(WRITE_CALL_LOG)
override fun deleteAllRecents() {
context.contentResolver.delete(
CallLog.Calls.CONTENT_URI,
null,
null
)
}

override fun getRecent(recentId: Long) = recentsRepository.getRecent(recentId)

override fun getRecents() = recentsRepository.getRecents()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import com.chooloo.www.chooloolib.databinding.BottomDialogBinding
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import javax.inject.Inject

open class BottomFragment<FragmentType : BaseFragment<BaseViewState>>(
private val fragment: FragmentType
open class BottomFragment(
private val fragment: BaseFragment<BaseViewState>? = null
) : BottomSheetDialogFragment(), BaseView<BaseViewState> {
override val viewState: BaseViewState by viewModels()

Expand Down Expand Up @@ -42,7 +42,7 @@ open class BottomFragment<FragmentType : BaseFragment<BaseViewState>>(
}

override fun onSetup() {
fragment.setOnFinishListener {
fragment?.setOnFinishListener {
this@BottomFragment.dismiss()
}

Expand All @@ -59,7 +59,7 @@ open class BottomFragment<FragmentType : BaseFragment<BaseViewState>>(
}

childFragmentManager.commit {
replace(binding.bottomDialogFragmentPlaceholder.id, fragment)
fragment?.let { replace(binding.bottomDialogFragmentPlaceholder.id, it) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ abstract class ListFragment<ItemType, VS : ListViewState<ItemType>> : Permission
isScrollerVisible.observe(this@ListFragment) {
binding.itemsScrollView.fastScroller.isVisible = it
}

onIsObserve(args.getBoolean(ARG_OBSERVE, true))
}

adapter.apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ import androidx.lifecycle.viewModelScope
import com.chooloo.www.chooloolib.interactor.permission.PermissionsInteractor
import com.chooloo.www.chooloolib.ui.permissioned.PermissionedViewState
import com.chooloo.www.chooloolib.util.DataLiveEvent
import com.chooloo.www.chooloolib.util.LiveEvent
import com.chooloo.www.chooloolib.util.MutableDataLiveEvent
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch

abstract class ListViewState<ItemType>(
permissions: PermissionsInteractor
) : PermissionedViewState(permissions) {
private var _isObserve: Boolean = true
private var _itemsCollectJob: Job? = null
private var _itemsFlow: Flow<List<ItemType>>? = null

Expand Down Expand Up @@ -51,9 +50,11 @@ abstract class ListViewState<ItemType>(

protected fun updateItemsFlow() {
_itemsCollectJob?.cancel()
_itemsCollectJob = viewModelScope.launch {
_itemsFlow = getItemsFlow(filter.value)
_itemsFlow?.collect(this@ListViewState::onItemsChanged)
if (_isObserve) {
_itemsCollectJob = viewModelScope.launch {
_itemsFlow = getItemsFlow(filter.value)
_itemsFlow?.collect(this@ListViewState::onItemsChanged)
}
}
}

Expand All @@ -76,6 +77,10 @@ abstract class ListViewState<ItemType>(
_itemLongClickedEvent.call(item)
}

open fun onIsObserve(isObserve: Boolean) {
_isObserve = isObserve
}

open fun onItemLeftClick(item: ItemType) {}
open fun onItemRightClick(item: ItemType) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.chooloo.www.chooloolib.data.repository.phones.PhonesRepository
import com.chooloo.www.chooloolib.interactor.permission.PermissionsInteractor
import com.chooloo.www.chooloolib.ui.list.ListViewState
import com.chooloo.www.chooloolib.util.DataLiveEvent
import com.chooloo.www.chooloolib.util.LiveEvent
import com.chooloo.www.chooloolib.util.MutableDataLiveEvent
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.Flow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ open class RecentsFragment @Inject constructor() : ListFragment<RecentAccount, R
viewState.showRecentEvent.observe(this@RecentsFragment) { ev ->
ev.ifNew?.let {
if (it.groupCount > 1) {
prompts.showFragment(fragmentFactory.getRecentsHistoryFragment().apply {
arguments = arguments ?: Bundle()
requireArguments().putBoolean(ARG_OBSERVE, false)
})
prompts.showFragment(
fragmentFactory.getRecentsHistoryFragment().apply {
arguments = arguments ?: Bundle()
requireArguments().putBoolean(ARG_OBSERVE, false)
})
recentsHistoryViewState.onItemsChanged(it.groupAccounts)
} else {
prompts.showFragment(fragmentFactory.getRecentFragment(it.id))
Expand Down
Loading

0 comments on commit 518b3c0

Please sign in to comment.