Я хочу программно центрировать мои индикаторы выполнения в коде.Вот мой код:
LinearLayout streamLayout = new LinearLayout(this);
streamLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
streamLayout.setOrientation(LinearLayout.VERTICAL);
streamLayout.setGravity(Gravity.CENTER);
LinearLayout newsLayout = new LinearLayout(this);
streamLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
streamLayout.setOrientation(LinearLayout.VERTICAL);
streamLayout.setGravity(Gravity.CENTER);
mSwipeView.addView(streamLayout);
mSwipeView.addView(newsLayout);
mSwipeView.addView(new LinearLayout(this));
((LinearLayout) mSwipeView.getChildContainer().getChildAt(0)).addView(streamListView);
((LinearLayout) mSwipeView.getChildContainer().getChildAt(0)).addView(streamProgressBar);
((LinearLayout) mSwipeView.getChildContainer().getChildAt(1)).addView(newsListView);
((LinearLayout) mSwipeView.getChildContainer().getChildAt(1)).addView(newsProgressBar);
((LinearLayout) mSwipeView.getChildContainer().getChildAt(2)).addView(chartImageView);
Как я могу получить индикатор выполнения по центру по вертикали и по горизонтали в моем макете?