Set location for progressbar in layout

I used the Swipe update layout in my application. This worked, but I want to set the location for the progress bar in the layout layout of the top layer to 100 px. I do not want to use it by default. How i did thanks

+4
source share
2 answers

You can set the offset from above using this setProgressViewOffset (boolean scale, int start, int end)

You can read about it here .

+9
source

In the res / values ​​folder, create an xml file if you haven’t named yet.dml

Then you can have in it:

<resources>
    <dimen name="refresher_offset">your_preferred_offset_in_dp</dimen>
    <dimen name="refresher_offset_end">how_long_in_dp_the_swipe</dimen>
</resources>

SwipeRefreshLayout, , onCreate, Activity onCreateView, :

swipeRefreshLayout.setProgressViewOffset(false, 
  getResources().getDimensionPixelSize(R.dimen.refresher_offset),    
  getResources().getDimensionPixelSize(R.dimen.refresher_offset_end));

dimen , , , .

+2

Source: https://habr.com/ru/post/1616480/


All Articles