Skip to content

Commit

Permalink
Item layout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRe1nk0 committed Jul 18, 2023
1 parent c26341b commit 7c93f53
Showing 1 changed file with 20 additions and 0 deletions.
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 @@ -85,6 +87,11 @@ protected void setupPreferences() {
setupHazmatPreferences();
}

@Override
public ApplyQueryType getApplyQueryType() {
return ApplyQueryType.NONE;
}

private void setupHazmatPreferences() {
Context context = requireContext();

Expand Down Expand Up @@ -122,9 +129,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

0 comments on commit 7c93f53

Please sign in to comment.