blob: af321a5a307e3769191d6a75c0a30cdfc7bd05a1 (
plain)
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
48
|
package org.fox.ttrss;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.MenuItem;
import androidx.appcompat.widget.Toolbar;
public class PreferencesActivity extends CommonActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
// we use that before parent onCreate so let's init locally
m_prefs = PreferenceManager
.getDefaultSharedPreferences(getApplicationContext());
setAppTheme(m_prefs);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_preferences);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().hide();
if (savedInstanceState == null) {
android.app.FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.preferences_container, new PreferencesFragment());
ft.commit();
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
|