There is a Fragment . There is a RecyclerView attached in the bottom. The bottom line is that the very first element is supposed to take up a little more space than the rest. I increase it in the ViewHolder the adapter itself when drawing as follows:
public class myAdapter { ... @Override public void onBindViewHolder(final ViewHolder holder, final int position) { WeatherForDay weather = mWeathersList.get(position); holder.mDayTextView.setText(weather.getDay()); //todo update iconManager //need icon manager, with input -> String, output ->(R.drawable.icon) int holder.mIconImageView.setImageResource(R.drawable.testicon1); holder.mTempTextView.setText(weather.getTmp()); if (position == 0) { if (isFirstBind) { Log.d(DEBUG_TAG, "is first bind and first position"); holder.setBig(); isFirstBind = false; } } } ... public static class ViewHolder extends RecyclerView.ViewHolder { ... public void setBig() { LinearLayout.LayoutParams param = (LinearLayout.LayoutParams) mRoundLayout.getLayoutParams(); int newHeight = (int) (param.height * 1.2f); int newWidth = (int) (param.height * 1.2f); param.height = newHeight; param.width = newWidth; mRoundLayout.setLayoutParams(param); mRoundLayout.setBackgroundDrawable(createBigShape(newHeight)); } private Drawable createBigShape(int newHW) { GradientDrawable shape = new GradientDrawable(); shape.setShape(GradientDrawable.RECTANGLE); shape.setCornerRadii(new float[]{newHW, newHW, newHW, newHW, newHW, newHW, newHW, newHW}); shape.setColor(mContext.getResources().getColor(R.color.weryDark)); shape.setStroke(1, mContext.getResources().getColor(R.color.weryDark)); return shape; } ... } } How to make elements align not on the top edge, but on the bottom?
PS There is also a problem in that the Nth element is also somehow drawn by the "big" (on one device with a large screen N = 13, on a small screen N = 8)
PS2 Maybe there is some more optimal way to change any element RecyclerView ?
