|
31 | 31 |
|
32 | 32 | import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton; |
33 | 33 | import com.google.android.material.floatingactionbutton.FloatingActionButton; |
34 | | -import com.nextcloud.android.sso.exceptions.NextcloudFilesAppAccountNotFoundException; |
35 | | -import com.nextcloud.android.sso.exceptions.NoCurrentAccountSelectedException; |
36 | 34 | import com.nextcloud.android.sso.helper.SingleAccountHelper; |
37 | 35 | import com.owncloud.android.lib.common.utils.Log_OC; |
38 | 36 |
|
39 | 37 | import it.niedermann.owncloud.notes.R; |
40 | 38 | import it.niedermann.owncloud.notes.branding.BrandingUtil; |
41 | 39 | import it.niedermann.owncloud.notes.databinding.FragmentNotePreviewBinding; |
42 | 40 | import it.niedermann.owncloud.notes.persistence.entity.Note; |
43 | | -import it.niedermann.owncloud.notes.shared.model.ISyncCallback; |
44 | 41 | import it.niedermann.owncloud.notes.shared.util.SSOUtil; |
45 | 42 | import kotlin.Unit; |
46 | | -import kotlin.jvm.functions.Function0; |
47 | 43 |
|
48 | 44 | public class NotePreviewFragment extends SearchableBaseNoteFragment implements OnRefreshListener { |
49 | 45 |
|
@@ -233,7 +229,17 @@ public void applyBrand(int color) { |
233 | 229 | super.applyBrand(color); |
234 | 230 |
|
235 | 231 | final var util = BrandingUtil.of(color, requireContext()); |
236 | | - binding.singleNoteContent.setSearchColor(color); |
| 232 | + |
| 233 | + lifecycleScopeIOJob(() -> { |
| 234 | + try { |
| 235 | + final var ssoAccount = SingleAccountHelper.getCurrentSingleSignOnAccount(getContext()); |
| 236 | + binding.singleNoteContent.setCurrentSingleSignOnAccount(ssoAccount, color); |
| 237 | + } catch (Exception e) { |
| 238 | + Log_OC.e(TAG, "applyBrand exception: " + e); |
| 239 | + } |
| 240 | + return Unit.INSTANCE; |
| 241 | + }); |
| 242 | + |
237 | 243 | binding.singleNoteContent.setHighlightColor(util.notes.getTextHighlightBackgroundColor(requireContext(), color, colorPrimary, colorAccent)); |
238 | 244 | } |
239 | 245 |
|
|
0 commit comments