only show remove banner for twitter account

This commit is contained in:
Mariotaku Lee 2017-04-23 00:51:34 +08:00
parent 717e93f38c
commit a224e666c9
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
1 changed files with 8 additions and 7 deletions

View File

@ -79,10 +79,10 @@ class UserProfileEditorFragment : BaseFragment(), OnSizeChangedListener,
private var getUserInfoCalled: Boolean = false
override fun onClick(view: View) {
val user = user
val user = user ?: return
val account = account ?: return
val task = currentTask
if (user == null || task != null && !task.isFinished)
return
if (task != null && !task.isFinished) return
when (view.id) {
R.id.editProfileImage -> {
val intent = ThemedMediaPickerActivity.withThemed(activity)
@ -93,13 +93,14 @@ class UserProfileEditorFragment : BaseFragment(), OnSizeChangedListener,
startActivityForResult(intent, REQUEST_UPLOAD_PROFILE_IMAGE)
}
R.id.editProfileBanner -> {
val intent = ThemedMediaPickerActivity.withThemed(activity)
val builder = ThemedMediaPickerActivity.withThemed(activity)
.aspectRatio(3, 1)
.maximumSize(1500, 500)
.containsVideo(false)
.addEntry(getString(R.string.remove), "remove_banner", RESULT_REMOVE_BANNER)
.build()
startActivityForResult(intent, REQUEST_UPLOAD_PROFILE_BANNER_IMAGE)
if (account.type == AccountType.TWITTER) {
builder.addEntry(getString(R.string.remove), "remove_banner", RESULT_REMOVE_BANNER)
}
startActivityForResult(builder.build(), REQUEST_UPLOAD_PROFILE_BANNER_IMAGE)
}
R.id.editProfileBackground -> {
val intent = ThemedMediaPickerActivity.withThemed(activity)