Made settings work
This commit is contained in:
parent
9db5933bf1
commit
553f87e1a8
15 changed files with 12 additions and 54 deletions
|
@ -7,7 +7,7 @@
|
|||
tools:context="com.antonioleiva.materialeverywhere.SettingsActivity" >
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/abp__toolbar"
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
|
@ -24,7 +24,7 @@
|
|||
android:layout_height="match_parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/abp__shadowView"
|
||||
android:id="@+id/shadowView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/abp__shadow_height"
|
||||
android:src="@drawable/preference_activity_action_bar_shadow"
|
||||
|
|
|
@ -16,8 +16,6 @@ public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
|
|||
private Toolbar _toolbar;
|
||||
private View _shadowView;
|
||||
|
||||
protected abstract int getPreferencesXmlId();
|
||||
|
||||
public Toolbar getToolbar() {
|
||||
return _toolbar;
|
||||
}
|
||||
|
@ -27,14 +25,13 @@ public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
|
|||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.preference_activity);
|
||||
_toolbar = (Toolbar) findViewById(R.id.abp__toolbar);
|
||||
_toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
|
||||
_shadowView = findViewById(R.id.abp__shadowView);
|
||||
_shadowView = findViewById(R.id.shadowView);
|
||||
final ViewGroup parent = (ViewGroup) _shadowView.getParent();
|
||||
parent.removeView(_shadowView);
|
||||
_shadowView = null;
|
||||
}
|
||||
addPreferencesFromResource(getPreferencesXmlId());
|
||||
_toolbar.setClickable(true);
|
||||
_toolbar.setNavigationIcon(getResIdFromAttribute(this, R.attr.homeAsUpIndicator));
|
||||
_toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||
|
@ -58,7 +55,7 @@ public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
|
|||
ViewCompat.setElevation(_toolbar, enable ? 4 : 0);
|
||||
} else {
|
||||
if (_shadowView == null)
|
||||
_shadowView = findViewById(R.id.abp__shadowView);
|
||||
_shadowView = findViewById(R.id.shadowView);
|
||||
_shadowView.setVisibility(enable ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,8 +134,8 @@ public class MapActivity extends AccessibleActivity {
|
|||
app = getMyApplication();
|
||||
settings = app.getSettings();
|
||||
app.applyTheme(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
super.onCreate(savedInstanceState);
|
||||
// Full screen is not used here
|
||||
//getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
setContentView(R.layout.main);
|
||||
|
|
|
@ -27,10 +27,6 @@ public class SettingsActivity extends SettingsBaseActivity {
|
|||
private Preference routing;
|
||||
private Preference about;
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
@ -300,20 +300,16 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
((OsmandApplication) getApplication()).applyTheme(this);
|
||||
//getToolbar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||
//getToolbar().setDisplayHomeAsUpEnabled(true);
|
||||
getToolbar().setTitle(R.string.settings_activity);
|
||||
|
||||
// R.drawable.tab_settings_screen_icon
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getToolbar().setTitle(R.string.settings_activity);
|
||||
settings = getMyApplication().getSettings();
|
||||
|
||||
if (profileSettings) {
|
||||
|
|
|
@ -62,10 +62,6 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
|||
private ListPreference drivingRegionPreference;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
@ -92,6 +92,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
private void createUI() {
|
||||
addPreferencesFromResource(R.xml.navigation_settings);
|
||||
PreferenceScreen screen = getPreferenceScreen();
|
||||
|
|
|
@ -33,10 +33,6 @@ public class SettingsAudioVideoActivity extends SettingsBaseActivity {
|
|||
|
||||
private static final Log log = PlatformUtil.getLog(AudioVideoNotesPlugin.class);
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
|
|
@ -26,11 +26,6 @@ import android.view.View;
|
|||
public class SettingsDevelopmentActivity extends SettingsBaseActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -71,9 +71,9 @@ public class DownloadActivity extends BaseDownloadActivity {
|
|||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
getMyApplication().applyTheme(this);
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
super.onCreate(savedInstanceState);
|
||||
updateDownloads();
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
setProgressBarIndeterminateVisibility(false);
|
||||
|
||||
setContentView(R.layout.tab_content);
|
||||
|
|
|
@ -36,11 +36,6 @@ public class SettingsMonitoringActivity extends SettingsBaseActivity {
|
|||
super(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||
|
|
|
@ -15,11 +15,6 @@ import android.text.InputType;
|
|||
public class SettingsOsmEditingActivity extends SettingsBaseActivity {
|
||||
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -35,11 +35,6 @@ public class SettingsOsMoActivity extends SettingsBaseActivity {
|
|||
public static final int[] MINUTES = new int[] {2, 3, 5};
|
||||
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -24,10 +24,6 @@ public class SettingsRasterMapsActivity extends SettingsBaseActivity {
|
|||
public static final String MORE_VALUE = "MORE_VALUE";
|
||||
public static final String DEFINE_EDIT = "DEFINE_EDIT";
|
||||
|
||||
@Override
|
||||
protected int getPreferencesXmlId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
|
Loading…
Reference in a new issue