Skip to content

Commit

Permalink
Merge pull request #17658 from osmandapp/Hazardous_materials_layout_fix
Browse files Browse the repository at this point in the history
Item layout fix
  • Loading branch information
Chumva authored Jul 18, 2023
2 parents 5cc942f + 2caa486 commit c3dbb4b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.DimenRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
Expand Down Expand Up @@ -122,9 +124,22 @@ protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewH
holder.itemView.setContentDescription(getString(R.string.shared_string_class)
+ " " + hazmatClass + " " + preference.getTitle());
}
View item = holder.itemView.findViewById(R.id.selectable_list_item);
item.setMinimumHeight(getDimen(R.dimen.wpt_list_item_height));

View icon = holder.itemView.findViewById(android.R.id.icon);
ViewGroup.LayoutParams layoutParams = icon.getLayoutParams();
int iconSize = getDimen(R.dimen.big_icon_size);
layoutParams.width = iconSize;
layoutParams.height = iconSize;
icon.setLayoutParams(layoutParams);
}
}

private int getDimen(@DimenRes int id){
return app.getResources().getDimensionPixelSize(id);
}

private void resetToDefault() {
ApplicationMode mode = getSelectedAppMode();
for (RoutingParameter parameter : parameters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public enum SettingsScreenType {
ANT_PLUS_SETTINGS(ExternalDevicesListFragment.class.getName(), false, null, R.xml.antplus_settings, R.layout.global_preference_toolbar),
WEATHER_SETTINGS(WeatherSettingsFragment.class.getName(), true, ApplyQueryType.SNACK_BAR, R.xml.weather_settings, R.layout.profile_preference_toolbar),
EXTERNAL_SETTINGS_WRITE_TO_TRACK_SETTINGS(ExternalSettingsWriteToTrackSettingsFragment.class.getName(), true, ApplyQueryType.BOTTOM_SHEET, R.xml.external_sensors_write_to_track_settings, R.layout.profile_preference_toolbar),
DANGEROUS_GOODS(DangerousGoodsFragment.class.getName(), true, ApplyQueryType.SNACK_BAR, R.xml.dangerous_goods_parameters, R.layout.global_preference_toolbar);
DANGEROUS_GOODS(DangerousGoodsFragment.class.getName(), true, ApplyQueryType.NONE, R.xml.dangerous_goods_parameters, R.layout.global_preference_toolbar);

public final String fragmentName;
public final boolean profileDependent;
Expand Down

0 comments on commit c3dbb4b

Please sign in to comment.