app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedule/FahrplanFragment.java
/**
     * Adds room title views as child views to the given {@code roomTitlesRowLayout}.
     * Previously added child views are removed.
     */
Adds room title views as child views to the given  roomTitlesRowLayout.
Previously added child views are removed.
Adds room title views as child views to the given roomTitlesRowLayout . Previously added child views are removed .
private void addRoomTitleViews(
            @NonNull LinearLayout roomTitlesRowLayout,
            int columnWidth,
            @NonNull List<String> roomNames
    ) {
        roomTitlesRowLayout.removeAllViews();
        int textSize = getResources().getInteger(R.integer.room_title_size);
        LinearLayout.LayoutParams params = new LayoutParams(
                columnWidth, LayoutParams.WRAP_CONTENT, 1);
        params.gravity = Gravity.CENTER;
        int paddingRight = getSessionPadding();
        for (String roomName : roomNames) {
            TextView roomTitle = new TextView(context);
            roomTitle.setLayoutParams(params);
            roomTitle.setMaxLines(1);
            roomTitle.setEllipsize(TextUtils.TruncateAt.END);
            roomTitle.setPadding(0, 0, paddingRight, 0);
            roomTitle.setGravity(Gravity.CENTER);
            roomTitle.setTypeface(light);
            roomTitle.setText(roomName);
            roomTitle.setTextColor(0xffffffff);
            roomTitle.setTextSize(textSize);
            roomTitlesRowLayout.addView(roomTitle);
        }
    }
private void addRoomTitleViews ( @ NonNull LinearLayout roomTitlesRowLayout , int columnWidth , @ NonNull List < String > roomNames ) { roomTitlesRowLayout . removeAllViews ( ) ; int textSize = getResources ( ) . getInteger ( R . integer . room_title_size ) ; LinearLayout . LayoutParams params = new LayoutParams ( columnWidth , LayoutParams . WRAP_CONTENT , 1 ) ; params . gravity = Gravity . CENTER ; int paddingRight = getSessionPadding ( ) ; for ( String roomName : roomNames ) { TextView roomTitle = new TextView ( context ) ; roomTitle . setLayoutParams ( params ) ; roomTitle . setMaxLines ( 1 ) ; roomTitle . setEllipsize ( TextUtils . TruncateAt . END ) ; roomTitle . setPadding ( 0 , 0 , paddingRight , 0 ) ; roomTitle . setGravity ( Gravity . CENTER ) ; roomTitle . setTypeface ( light ) ; roomTitle . setText ( roomName ) ; roomTitle . setTextColor ( 0xffffffff ) ; roomTitle . setTextSize ( textSize ) ; roomTitlesRowLayout . addView ( roomTitle ) ; } }
Adds room title views as child views to the given {@code roomTitlesRowLayout}.
Adds room title views as child views to the given { @code roomTitlesRowLayout } .