rename "TrackAppearanceViewHolder" -> "AppearanceViewHolder"

This commit is contained in:
nazar-kutz 2021-03-19 16:35:16 +02:00
parent aa95f686f4
commit 4f5f995509
3 changed files with 17 additions and 17 deletions

View file

@ -8,13 +8,13 @@ import androidx.recyclerview.widget.RecyclerView;
import net.osmand.plus.R;
public class TrackAppearanceViewHolder extends RecyclerView.ViewHolder {
public class AppearanceViewHolder extends RecyclerView.ViewHolder {
final TextView title;
final ImageView icon;
final ImageView button;
public final TextView title;
public final ImageView icon;
public final ImageView button;
TrackAppearanceViewHolder(View itemView) {
public AppearanceViewHolder(View itemView) {
super(itemView);
title = itemView.findViewById(R.id.groupName);
icon = itemView.findViewById(R.id.groupIcon);

View file

@ -135,7 +135,7 @@ public class TrackColoringCard extends BaseCard {
updateHeader();
}
private class TrackColoringAdapter extends RecyclerView.Adapter<TrackAppearanceViewHolder> {
private class TrackColoringAdapter extends RecyclerView.Adapter<AppearanceViewHolder> {
private List<TrackAppearanceItem> items;
@ -145,16 +145,16 @@ public class TrackColoringCard extends BaseCard {
@NonNull
@Override
public TrackAppearanceViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
public AppearanceViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater themedInflater = UiUtilities.getInflater(parent.getContext(), nightMode);
View view = themedInflater.inflate(R.layout.point_editor_group_select_item, parent, false);
view.getLayoutParams().width = app.getResources().getDimensionPixelSize(R.dimen.gpx_group_button_width);
view.getLayoutParams().height = app.getResources().getDimensionPixelSize(R.dimen.gpx_group_button_height);
return new TrackAppearanceViewHolder(view);
return new AppearanceViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final TrackAppearanceViewHolder holder, int position) {
public void onBindViewHolder(@NonNull final AppearanceViewHolder holder, int position) {
final TrackAppearanceItem item = items.get(position);
if (item.isActive() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@ -186,7 +186,7 @@ public class TrackColoringCard extends BaseCard {
});
}
private void updateButtonBg(TrackAppearanceViewHolder holder, TrackAppearanceItem item) {
private void updateButtonBg(AppearanceViewHolder holder, TrackAppearanceItem item) {
GradientDrawable rectContourDrawable = (GradientDrawable) AppCompatResources.getDrawable(app, R.drawable.bg_select_group_button_outline);
if (rectContourDrawable != null) {
Context ctx = holder.itemView.getContext();
@ -217,7 +217,7 @@ public class TrackColoringCard extends BaseCard {
}
}
private void updateTextAndIconColor(TrackAppearanceViewHolder holder, TrackAppearanceItem item) {
private void updateTextAndIconColor(AppearanceViewHolder holder, TrackAppearanceItem item) {
Context ctx = holder.itemView.getContext();
boolean isSelected = item.getAttrName().equals(getSelectedAppearanceItem().getAttrName());
int iconColorId;

View file

@ -184,7 +184,7 @@ public class TrackWidthCard extends BaseCard {
}
}
private class GpxWidthAdapter extends RecyclerView.Adapter<TrackAppearanceViewHolder> {
private class GpxWidthAdapter extends RecyclerView.Adapter<AppearanceViewHolder> {
private List<AppearanceListItem> items;
@ -194,13 +194,13 @@ public class TrackWidthCard extends BaseCard {
@NonNull
@Override
public TrackAppearanceViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
public AppearanceViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater themedInflater = UiUtilities.getInflater(parent.getContext(), nightMode);
View view = themedInflater.inflate(R.layout.point_editor_group_select_item, parent, false);
view.getLayoutParams().width = app.getResources().getDimensionPixelSize(R.dimen.gpx_group_button_width);
view.getLayoutParams().height = app.getResources().getDimensionPixelSize(R.dimen.gpx_group_button_height);
TrackAppearanceViewHolder holder = new TrackAppearanceViewHolder(view);
AppearanceViewHolder holder = new AppearanceViewHolder(view);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
AndroidUtils.setBackground(app, holder.button, nightMode, R.drawable.ripple_solid_light_6dp,
R.drawable.ripple_solid_dark_6dp);
@ -209,7 +209,7 @@ public class TrackWidthCard extends BaseCard {
}
@Override
public void onBindViewHolder(@NonNull final TrackAppearanceViewHolder holder, int position) {
public void onBindViewHolder(@NonNull final AppearanceViewHolder holder, int position) {
AppearanceListItem item = items.get(position);
holder.title.setText(item.getLocalizedValue());
@ -238,7 +238,7 @@ public class TrackWidthCard extends BaseCard {
});
}
private void updateWidthIcon(TrackAppearanceViewHolder holder, AppearanceListItem item) {
private void updateWidthIcon(AppearanceViewHolder holder, AppearanceListItem item) {
int color = trackDrawInfo.getColor();
int iconId;
@ -251,7 +251,7 @@ public class TrackWidthCard extends BaseCard {
holder.icon.setImageDrawable(app.getUIUtilities().getPaintedIcon(iconId, color));
}
private void updateButtonBg(TrackAppearanceViewHolder holder, AppearanceListItem item) {
private void updateButtonBg(AppearanceViewHolder holder, AppearanceListItem item) {
GradientDrawable rectContourDrawable = (GradientDrawable) AppCompatResources.getDrawable(app, R.drawable.bg_select_group_button_outline);
if (rectContourDrawable != null) {
if (getSelectedItem() != null && getSelectedItem().equals(item)) {