Search in sources :

Example 6 with OsmAndAppCustomization

use of net.osmand.plus.OsmAndAppCustomization in project Osmand by osmandapp.

the class TrackActivity method onBackPressed.

@Override
public void onBackPressed() {
    if (openTracksList) {
        OsmAndAppCustomization appCustomization = getMyApplication().getAppCustomization();
        final Intent favorites = new Intent(this, appCustomization.getFavoritesActivity());
        getMyApplication().getSettings().FAVORITES_TAB.set(FavoritesActivity.GPX_TAB);
        favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(favorites);
    }
    super.onBackPressed();
}
Also used : OsmAndAppCustomization(net.osmand.plus.OsmAndAppCustomization) Intent(android.content.Intent)

Example 7 with OsmAndAppCustomization

use of net.osmand.plus.OsmAndAppCustomization in project Osmand by osmandapp.

the class SettingsOsmEditingActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    ((OsmandApplication) getApplication()).applyTheme(this);
    super.onCreate(savedInstanceState);
    getToolbar().setTitle(R.string.osm_settings);
    @SuppressWarnings("deprecation") PreferenceScreen grp = getPreferenceScreen();
    DialogPreference loginDialogPreference = new OsmLoginDataDialogPreference(this, null);
    grp.addPreference(loginDialogPreference);
    CheckBoxPreference poiEdit = createCheckBoxPreference(settings.OFFLINE_EDITION, R.string.offline_edition, R.string.offline_edition_descr);
    grp.addPreference(poiEdit);
    Preference pref = new Preference(this);
    pref.setTitle(R.string.local_openstreetmap_settings);
    pref.setSummary(R.string.local_openstreetmap_settings_descr);
    pref.setKey("local_openstreetmap_points");
    pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference preference) {
            OsmAndAppCustomization appCustomization = getMyApplication().getAppCustomization();
            final Intent favorites = new Intent(SettingsOsmEditingActivity.this, appCustomization.getFavoritesActivity());
            favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            getMyApplication().getSettings().FAVORITES_TAB.set(R.string.osm_edits);
            startActivity(favorites);
            return true;
        }
    });
    grp.addPreference(pref);
}
Also used : OnPreferenceClickListener(android.preference.Preference.OnPreferenceClickListener) OsmandApplication(net.osmand.plus.OsmandApplication) PreferenceScreen(android.preference.PreferenceScreen) DialogPreference(android.preference.DialogPreference) CheckBoxPreference(android.preference.CheckBoxPreference) CheckBoxPreference(android.preference.CheckBoxPreference) DialogPreference(android.preference.DialogPreference) Preference(android.preference.Preference) OsmAndAppCustomization(net.osmand.plus.OsmAndAppCustomization) Intent(android.content.Intent)

Aggregations

Intent (android.content.Intent)7 OsmAndAppCustomization (net.osmand.plus.OsmAndAppCustomization)7 View (android.view.View)3 Activity (android.app.Activity)2 LinearLayout (android.widget.LinearLayout)2 TextView (android.widget.TextView)2 LatLon (net.osmand.data.LatLon)2 PointDescription (net.osmand.data.PointDescription)2 MapActivity (net.osmand.plus.activities.MapActivity)2 TextViewEx (net.osmand.plus.widgets.TextViewEx)2 CheckBoxPreference (android.preference.CheckBoxPreference)1 DialogPreference (android.preference.DialogPreference)1 Preference (android.preference.Preference)1 OnPreferenceClickListener (android.preference.Preference.OnPreferenceClickListener)1 PreferenceScreen (android.preference.PreferenceScreen)1 ImageView (android.widget.ImageView)1 FavouritePoint (net.osmand.data.FavouritePoint)1 WptPt (net.osmand.plus.GPXUtilities.WptPt)1 OsmandApplication (net.osmand.plus.OsmandApplication)1 FavoritesActivity (net.osmand.plus.myplaces.FavoritesActivity)1