Hide daily folders option and fix pref info padding

This commit is contained in:
Vitaliy 2020-02-03 15:13:33 +02:00
parent 2b9c871e7d
commit f0348e6b4e
10 changed files with 25 additions and 13 deletions

View file

@ -35,6 +35,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="2"
android:textColor="?attr/app_bar_primary_item_color"
android:textSize="@dimen/dialog_header_text_size"
@ -46,6 +47,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:letterSpacing="@dimen/description_letter_spacing"
android:maxLines="2"
android:textColor="?attr/pstsInactiveTextColor"
android:textSize="@dimen/default_desc_text_size"

View file

@ -21,7 +21,6 @@
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:letterSpacing="@dimen/description_letter_spacing"
android:paddingLeft="@dimen/content_padding"
android:paddingTop="@dimen/content_padding_small"

View file

@ -41,6 +41,7 @@
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />

View file

@ -39,6 +39,7 @@
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="2"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"

View file

@ -6,7 +6,7 @@
<Preference
android:key="osm_editing_info"
android:layout="@layout/preference_with_descr"
android:layout="@layout/preference_info"
android:persistent="false"
android:selectable="false"
android:title="@string/plugin_global_prefs_info"

View file

@ -1759,7 +1759,7 @@ public class OsmandSettings {
public static final Integer REC_DIRECTORY = 0;
public static final Integer MONTHLY_DIRECTORY = 1;
public static final Integer DAILY_DIRECTORY = 2;
// public static final Integer DAILY_DIRECTORY = 2;
public final CommonPreference<Boolean> DISABLE_RECORDING_ONCE_APP_KILLED = new BooleanPreference("disable_recording_once_app_killed", false).makeProfile();

View file

@ -216,9 +216,9 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
Integer track_storage_directory = ctx.getSettings().TRACK_STORAGE_DIRECTORY.get();
if (track_storage_directory != OsmandSettings.REC_DIRECTORY) {
SimpleDateFormat dateDirFormat = new SimpleDateFormat("yyyy-MM");
if (track_storage_directory == OsmandSettings.DAILY_DIRECTORY) {
dateDirFormat = new SimpleDateFormat("yyyy-MM-dd");
}
// if (track_storage_directory == OsmandSettings.DAILY_DIRECTORY) {
// dateDirFormat = new SimpleDateFormat("yyyy-MM-dd");
// }
String dateDirName = dateDirFormat.format(new Date(pt.time));
File dateDir = new File(dir, dateDirName);
dateDir.mkdirs();

View file

@ -29,7 +29,6 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.LinkedHashMap;
import static net.osmand.plus.OsmandSettings.DAILY_DIRECTORY;
import static net.osmand.plus.OsmandSettings.MONTHLY_DIRECTORY;
import static net.osmand.plus.OsmandSettings.REC_DIRECTORY;
import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES;
@ -195,11 +194,11 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment implements
}
private void setupTrackStorageDirectoryPref() {
Integer[] entryValues = new Integer[] {REC_DIRECTORY, MONTHLY_DIRECTORY, DAILY_DIRECTORY};
Integer[] entryValues = new Integer[] {REC_DIRECTORY, MONTHLY_DIRECTORY};
String[] entries = new String[entryValues.length];
entries[0] = getString(R.string.store_tracks_in_rec_directory);
entries[1] = getString(R.string.store_tracks_in_monthly_directories);
entries[2] = getString(R.string.store_tracks_in_daily_directories);
// entries[2] = getString(R.string.store_tracks_in_daily_directories);
ListPreferenceEx trackStorageDirectory = (ListPreferenceEx) findPreference(settings.TRACK_STORAGE_DIRECTORY.getId());
trackStorageDirectory.setEntries(entries);

View file

@ -37,7 +37,6 @@ import net.osmand.plus.activities.SettingsBaseActivity;
import java.util.Map;
import static net.osmand.plus.OsmandSettings.DAILY_DIRECTORY;
import static net.osmand.plus.OsmandSettings.MONTHLY_DIRECTORY;
import static net.osmand.plus.OsmandSettings.REC_DIRECTORY;
@ -156,11 +155,11 @@ public class SettingsMonitoringActivity extends SettingsBaseActivity {
cat.addPreference(createCheckBoxPreference(settings.SAVE_HEADING_TO_GPX, R.string.save_heading,
R.string.save_heading_descr));
Integer[] intValues = new Integer[]{REC_DIRECTORY, MONTHLY_DIRECTORY, DAILY_DIRECTORY};
Integer[] intValues = new Integer[]{REC_DIRECTORY, MONTHLY_DIRECTORY};
names = new String[intValues.length];
names[0] = getString(R.string.store_tracks_in_rec_directory);
names[1] = getString(R.string.store_tracks_in_monthly_directories);
names[2] = getString(R.string.store_tracks_in_daily_directories);
// names[2] = getString(R.string.store_tracks_in_daily_directories);
cat.addPreference(createListPreference(settings.TRACK_STORAGE_DIRECTORY, names, intValues,
R.string.track_storage_directory, R.string.track_storage_directory_descrp));
}

View file

@ -5,6 +5,7 @@ import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.support.v4.app.FragmentManager;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceViewHolder;
import android.text.SpannableString;
import android.view.LayoutInflater;
import android.view.View;
@ -22,12 +23,13 @@ import net.osmand.plus.widgets.style.CustomTypefaceSpan;
public class OsmEditingFragment extends BaseSettingsFragment implements OnPreferenceChanged {
private static final String OSM_EDITING_INFO = "osm_editing_info";
private static final String OPEN_OSM_EDITS = "open_osm_edits";
private static final String OSM_LOGIN_DATA = "osm_login_data";
@Override
protected void setupPreferences() {
Preference osmEditingInfo = findPreference("osm_editing_info");
Preference osmEditingInfo = findPreference(OSM_EDITING_INFO);
osmEditingInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark));
setupNameAndPasswordPref();
@ -45,6 +47,15 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer
AndroidUiHelper.updateVisibility(toolbarSubtitle, true);
}
@Override
protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {
super.onBindPreferenceViewHolder(preference, holder);
if (OSM_EDITING_INFO.equals(preference.getKey())) {
TextView titleView = (TextView) holder.findViewById(android.R.id.title);
titleView.setTextSize(16);
}
}
private void setupNameAndPasswordPref() {
Preference nameAndPasswordPref = findPreference(OSM_LOGIN_DATA);
nameAndPasswordPref.setSummary(settings.USER_NAME.get());