Good morning!
I'm having trouble finding some LinearLayout property to control transparency.
My situation is as follows I have a LinearLayout with a background image, and I also have HomeScrollViewObserver for all the XML in the onScrollChanged method of the HomeScrollViewObserver I need to apply a transparency effect or smooth the background image exchange.
Below is a snippet of code, this code is only exchanging the background image.
<LinearLayout
android:id="@+id/ll_icons_path"
android:layout_width="fill_parent"
android:layout_height="900dp"
android:background="@drawable/home_icons_path"
android:orientation="vertical">
//Método que controla a rolagem da tela na vertical(y) e horizontal(x)
@Override
public void onScrollChanged(HomeScrollViewObserver scrollView, int x, int y, int oldx, int oldy) {
//Coloca a imagem de fundo padrão (fundo branco) somente é alterado quando o valor y for menor ou igual a 5
if (y <= 100) {
ll_icons_path.setBackgroundResource(R.drawable.home_icons_path);
} else {
//Verifica se o valor de y é maior ou igual a 6 e muda imagem de fundo(fundo transparente)
if (y >= 101){
ll_icons_path.setBackgroundResource(R.drawable.home_icons_path_semfundo);
}
}
}