-
-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathPreferencesActivity.java
More file actions
47 lines (37 loc) · 1.6 KB
/
PreferencesActivity.java
File metadata and controls
47 lines (37 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Nextcloud Notes - Android Client
*
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package it.niedermann.owncloud.notes.preferences;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import it.niedermann.owncloud.notes.LockedActivity;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.branding.BrandingUtil;
import it.niedermann.owncloud.notes.databinding.ActivityPreferencesBinding;
public class PreferencesActivity extends LockedActivity {
private ActivityPreferencesBinding binding;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
PreferencesViewModel viewModel = new ViewModelProvider(this).get(PreferencesViewModel.class);
viewModel.resultCode$.observe(this, this::setResult);
binding = ActivityPreferencesBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.toolbar);
getSupportFragmentManager().beginTransaction()
.replace(R.id.fragment_container_view, new PreferencesFragment())
.commit();
}
@Override
public void applyBrand(int color) {
final var util = BrandingUtil.of(color, this);
util.platform.themeStatusBar(this);
util.material.themeToolbar(binding.toolbar);
util.platform.colorViewBackground(getWindow().getDecorView());
util.platform.colorViewBackground(binding.getRoot());
}
}