-
-
Notifications
You must be signed in to change notification settings - Fork 135
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 #294 from Chooloo/dev
Dev
- Loading branch information
Showing
451 changed files
with
2,649 additions
and
3,148 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 |
---|---|---|
@@ -1,28 +1,19 @@ | ||
package com.chooloo.www.koler | ||
|
||
import android.app.Application | ||
import android.content.res.Resources | ||
import androidx.appcompat.app.AppCompatDelegate | ||
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM | ||
import com.chooloo.www.koler.di.component.ComponentRootImpl | ||
import com.chooloo.www.koler.data.call.CallNotification | ||
import com.chooloo.www.koler.di.contextcomponent.ContextComponentImpl | ||
|
||
open class KolerApp : Application() { | ||
|
||
val componentRoot by lazy { | ||
ComponentRootImpl(this) | ||
} | ||
val component by lazy { ContextComponentImpl(this) } | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
KolerApp.resources = resources | ||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_FOLLOW_SYSTEM) | ||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { | ||
CallNotification(this).createNotificationChannel() | ||
} | ||
} | ||
|
||
companion object { | ||
var resources: Resources? = null | ||
} | ||
} |
20 changes: 13 additions & 7 deletions
20
app/src/main/java/com/chooloo/www/koler/adapter/ContactsAdapter.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,22 +1,28 @@ | ||
package com.chooloo.www.koler.adapter | ||
|
||
import android.net.Uri | ||
import com.chooloo.www.koler.data.account.Contact | ||
import com.chooloo.www.koler.di.boundcomponent.BoundComponentRoot | ||
import com.chooloo.www.koler.data.account.ContactAccount | ||
import com.chooloo.www.koler.di.activitycomponent.ActivityComponent | ||
import com.chooloo.www.koler.ui.list.ListData | ||
import com.chooloo.www.koler.ui.widgets.listitem.ListItem | ||
import com.chooloo.www.koler.util.initials | ||
|
||
class ContactsAdapter(boundComponent: BoundComponentRoot) : | ||
ListAdapter<Contact>(boundComponent) { | ||
override fun onBindListItem(listItem: ListItem, item: Contact) { | ||
open class ContactsAdapter(activityComponent: ActivityComponent) : | ||
ListAdapter<ContactAccount>(activityComponent) { | ||
|
||
override fun onBindListItem(listItem: ListItem, item: ContactAccount) { | ||
listItem.apply { | ||
titleText = item.name | ||
boundComponent.phoneAccountsInteractor.getContactAccounts(item.id) { account -> | ||
captionText = account?.firstOrNull()?.number | ||
isCompact = component.preferences.isCompact | ||
component.phones.getContactAccounts(item.id) { accounts -> | ||
captionText = accounts?.firstOrNull()?.number | ||
} | ||
|
||
setImageInitials(item.name?.initials()) | ||
setImageUri(if (item.photoUri != null) Uri.parse(item.photoUri) else null) | ||
} | ||
} | ||
|
||
override fun convertDataToListData(data: List<ContactAccount>) = | ||
ListData.fromContacts(data, true) | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/chooloo/www/koler/adapter/ContactsSuggestionsAdapter.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,17 @@ | ||
package com.chooloo.www.koler.adapter | ||
|
||
import com.chooloo.www.koler.data.account.ContactAccount | ||
import com.chooloo.www.koler.di.activitycomponent.ActivityComponent | ||
import com.chooloo.www.koler.ui.list.ListData | ||
import com.chooloo.www.koler.ui.widgets.listitem.ListItem | ||
|
||
class ContactsSuggestionsAdapter(activityComponent: ActivityComponent) : | ||
ContactsAdapter(activityComponent) { | ||
|
||
override fun onBindListItem(listItem: ListItem, item: ContactAccount) { | ||
super.onBindListItem(listItem, item) | ||
listItem.isCompact = true | ||
} | ||
|
||
override fun convertDataToListData(data: List<ContactAccount>) = ListData.fromContacts(data) | ||
} |
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
20 changes: 0 additions & 20 deletions
20
app/src/main/java/com/chooloo/www/koler/adapter/MainPagerAdapter.kt
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/chooloo/www/koler/adapter/MenuAdapter.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,28 @@ | ||
package com.chooloo.www.koler.adapter | ||
|
||
import android.graphics.Color | ||
import android.view.MenuItem | ||
import com.chooloo.www.koler.R | ||
import com.chooloo.www.koler.di.activitycomponent.ActivityComponent | ||
import com.chooloo.www.koler.ui.list.ListData | ||
import com.chooloo.www.koler.ui.widgets.listitem.ListItem | ||
import com.google.android.material.internal.ViewUtils | ||
|
||
class MenuAdapter(component: ActivityComponent) : ListAdapter<MenuItem>(component) { | ||
override fun onBindListItem(listItem: ListItem, item: MenuItem) { | ||
listItem.apply { | ||
setBackgroundColor(Color.TRANSPARENT) | ||
setTitleTextAppearance(R.style.Koler_Text_Subtitle1) | ||
setImageTint(component.colors.getColor(R.color.color_opposite)) | ||
setTitleColor(component.colors.getColor(R.color.color_opposite)) | ||
|
||
paddingTop = 28 | ||
paddingBottom = 28 | ||
imageDrawable = item.icon | ||
titleText = item.title.toString() | ||
imageSize = ViewUtils.dpToPx(context, 30).toInt() | ||
} | ||
} | ||
|
||
override fun convertDataToListData(data: List<MenuItem>) = ListData(data) | ||
} |
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.