|
@@ -69,6 +69,7 @@ import com.nextcloud.talk.models.json.userprofile.UserProfileFieldsOverall
|
|
|
import com.nextcloud.talk.models.json.userprofile.UserProfileOverall
|
|
|
import com.nextcloud.talk.remotefilebrowser.activities.RemoteFileBrowserActivity
|
|
|
import com.nextcloud.talk.ui.dialog.ScopeDialog
|
|
|
+import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
|
|
import com.nextcloud.talk.users.UserManager
|
|
|
import com.nextcloud.talk.utils.ApiUtils
|
|
|
import com.nextcloud.talk.utils.DisplayUtils
|
|
@@ -110,6 +111,9 @@ class ProfileController : NewBaseController(R.layout.controller_profile) {
|
|
|
@Inject
|
|
|
lateinit var permissionUtil: PlatformPermissionUtil
|
|
|
|
|
|
+ @Inject
|
|
|
+ lateinit var viewThemeUtils: ViewThemeUtils
|
|
|
+
|
|
|
private var currentUser: User? = null
|
|
|
private var edit = false
|
|
|
private var adapter: UserInfoAdapter? = null
|
|
@@ -196,7 +200,7 @@ class ProfileController : NewBaseController(R.layout.controller_profile) {
|
|
|
|
|
|
override fun onAttach(view: View) {
|
|
|
super.onAttach(view)
|
|
|
- adapter = UserInfoAdapter(null, activity!!.resources.getColor(R.color.colorPrimary), this)
|
|
|
+ adapter = UserInfoAdapter(null, viewThemeUtils.getElementColor(activity!!), this)
|
|
|
binding.userinfoList.adapter = adapter
|
|
|
binding.userinfoList.setItemViewCacheSize(DEFAULT_CACHE_SIZE)
|
|
|
currentUser = userManager.currentUser.blockingGet()
|
|
@@ -260,6 +264,13 @@ class ProfileController : NewBaseController(R.layout.controller_profile) {
|
|
|
// unused atm
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ colorIcons()
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun colorIcons() {
|
|
|
+ viewThemeUtils.colorImageView(binding.avatarChoose)
|
|
|
+ viewThemeUtils.colorImageView(binding.avatarCamera)
|
|
|
}
|
|
|
|
|
|
private fun isAllEmpty(items: Array<String?>): Boolean {
|
|
@@ -301,7 +312,8 @@ class ProfileController : NewBaseController(R.layout.controller_profile) {
|
|
|
binding.emptyList.root.visibility = View.VISIBLE
|
|
|
setErrorMessageForMultiList(
|
|
|
activity!!.getString(R.string.userinfo_no_info_headline),
|
|
|
- activity!!.getString(R.string.userinfo_no_info_text), R.drawable.ic_user
|
|
|
+ activity!!.getString(R.string.userinfo_no_info_text),
|
|
|
+ R.drawable.ic_user
|
|
|
)
|
|
|
} else {
|
|
|
binding.emptyList.root.visibility = View.GONE
|
|
@@ -616,11 +628,13 @@ class ProfileController : NewBaseController(R.layout.controller_profile) {
|
|
|
val builder = MultipartBody.Builder()
|
|
|
builder.setType(MultipartBody.FORM)
|
|
|
builder.addFormDataPart(
|
|
|
- "files[]", file!!.name,
|
|
|
+ "files[]",
|
|
|
+ file!!.name,
|
|
|
file.asRequestBody(IMAGE_PREFIX_GENERIC.toMediaTypeOrNull())
|
|
|
)
|
|
|
val filePart: MultipartBody.Part = MultipartBody.Part.createFormData(
|
|
|
- "files[]", file.name,
|
|
|
+ "files[]",
|
|
|
+ file.name,
|
|
|
file.asRequestBody(IMAGE_JPG.toMediaTypeOrNull())
|
|
|
)
|
|
|
|
|
@@ -643,7 +657,8 @@ class ProfileController : NewBaseController(R.layout.controller_profile) {
|
|
|
|
|
|
override fun onError(e: Throwable) {
|
|
|
Toast.makeText(
|
|
|
- applicationContext, context.getString(R.string.default_error_msg),
|
|
|
+ applicationContext,
|
|
|
+ context.getString(R.string.default_error_msg),
|
|
|
Toast
|
|
|
.LENGTH_LONG
|
|
|
).show()
|
|
@@ -688,7 +703,8 @@ class ProfileController : NewBaseController(R.layout.controller_profile) {
|
|
|
}
|
|
|
|
|
|
class UserInfoDetailsItem(
|
|
|
- @field:DrawableRes @param:DrawableRes var icon: Int,
|
|
|
+ @field:DrawableRes @param:DrawableRes
|
|
|
+ var icon: Int,
|
|
|
var text: String?,
|
|
|
var hint: String,
|
|
|
val field: Field,
|