hi, i have 3 XML layout file (in res) with several buttons . i use xml layouts in view pager into main activity in my app ... now i want change buttons background when my condition is true , how do it ?
this my button in XML layout :
- <ir.rahgoshafan.alphabetpuzzle.customs.PuzzleButton
- android:id="@+id/btn_green455"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="0.33"
- android:onClick="BTN_CLICK"
- android:background="@drawable/button_red"
- android:contentDescription="@string/app_name"
- android:text="?????? ?????"
- android:textColor="#fff"
- android:textSize="20sp"
- android:textStyle="bold" />
and view pager in main activity :
- private void init() {
- ViewPager VIEW_PAGER = (ViewPager) findViewById(R.id.tour_view_pager);
- DOTS_LAYOUT = (LinearLayout) findViewById(R.id.tour_layout_dots);
- LAYOUTS = new int[]{R.layout.items_one, R.layout.items_two, R.layout.items_three};
- addBottomDots(0);
- TourViewPagerAdapter ViewPagerAdapter = new TourViewPagerAdapter();
- VIEW_PAGER.setAdapter(ViewPagerAdapter);
- VIEW_PAGER.addOnPageChangeListener(viewPagerPageChangeListener);
- }