Skip to content

Commit e678bce

Browse files
fix: cleanup code removing unused variables and parameters
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 parent fedb5bc commit e678bce

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ProfileActivity : BaseActivity() {
122122
val restoredEdit = savedInstanceState?.getBoolean(KEY_EDIT_MODE) ?: false
123123
profileUiState = profileUiState.copy(isEditMode = restoredEdit)
124124

125-
adapter = UserInfoAdapter(null, viewThemeUtils, this) {
125+
adapter = UserInfoAdapter(null) {
126126
// Called by updateScope() / setData() — keep Compose state in sync.
127127
profileUiState = profileUiState.copy(
128128
items = adapter.displayList.orEmpty().toList(),
@@ -227,8 +227,6 @@ class ProfileActivity : BaseActivity() {
227227
})
228228
}
229229

230-
// ─── Edit / save toggle ────────────────────────────────────────────────────
231-
232230
private fun handleEditSave() {
233231
val currentlyEditing = profileUiState.isEditMode
234232
if (currentlyEditing) {
@@ -487,8 +485,6 @@ class ProfileActivity : BaseActivity() {
487485
return result
488486
}
489487

490-
// ─── Save ─────────────────────────────────────────────────────────────────
491-
492488
private fun save() {
493489
val credentials = ApiUtils.getCredentials(currentUser!!.username, currentUser!!.token)
494490

@@ -604,9 +600,6 @@ class ProfileActivity : BaseActivity() {
604600
file!!.name,
605601
file.asRequestBody(IMAGE_JPG.toMediaTypeOrNull())
606602
)
607-
val builder = MultipartBody.Builder()
608-
.setType(MultipartBody.FORM)
609-
.addFormDataPart("files[]", file.name, file.asRequestBody(IMAGE_PREFIX_GENERIC.toMediaTypeOrNull()))
610603

611604
ncApi.uploadAvatar(
612605
ApiUtils.getCredentials(currentUser!!.username, currentUser!!.token),
@@ -664,8 +657,6 @@ class ProfileActivity : BaseActivity() {
664657
})
665658
}
666659

667-
// ─── Permission result ────────────────────────────────────────────────────
668-
669660
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
670661
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
671662
if (requestCode == REQUEST_PERMISSION_CAMERA) {
@@ -689,8 +680,6 @@ class ProfileActivity : BaseActivity() {
689680
}
690681
}
691682

692-
// ─── Inner classes ────────────────────────────────────────────────────────
693-
694683
class UserInfoDetailsItem(
695684
@field:DrawableRes @param:DrawableRes
696685
var icon: Int,
@@ -706,8 +695,6 @@ class ProfileActivity : BaseActivity() {
706695
*/
707696
class UserInfoAdapter(
708697
displayList: List<UserInfoDetailsItem>?,
709-
private val viewThemeUtils: ViewThemeUtils,
710-
private val profileActivity: ProfileActivity,
711698
/** Invoked after [setData] or [updateScope] so the caller can sync Compose state. */
712699
private val onChanged: () -> Unit = {}
713700
) : androidx.recyclerview.widget.RecyclerView.Adapter<UserInfoAdapter.ViewHolder>() {
@@ -752,8 +739,6 @@ class ProfileActivity : BaseActivity() {
752739
override fun getItemCount(): Int = displayList?.size ?: 0
753740
}
754741

755-
// ─── Field enum ───────────────────────────────────────────────────────────
756-
757742
enum class Field(val fieldName: String, val scopeName: String) {
758743
EMAIL("email", "emailScope"),
759744
DISPLAYNAME("displayname", "displaynameScope"),

0 commit comments

Comments
 (0)