android


ProgressBar (Spinner) is filling the whole screen


As the title says, I can't get the progress bar to shrink at all. Currently it continues to fill the whole screen. I assume it has something to do with me using it in a viewstub? Anyway, here is my code.
This is my main layout. I'm using viewstub and will only inflate it when the framelayout is changing fragments
<android.support.v4.widget.DrawerLayout
....
<FrameLayout
....
/>
<ViewStub android:id="#+id/loadSpinner"
android:inflatedId="#+id/subView"
android:layout="#layout/progress_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
....
</android.support.v4.widget.DrawerLayout>
Here is the ProgressBar (progress_spinner.xml) which will be loaded into the viewstub
<ProgressBar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/progressSpinner"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="gone"
android:indeterminateDrawable="#drawable/custom_spinner">
</ProgressBar>
This is my custom_spinner.xml, which I was hoping would set the size of the spinner
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="1"
android:toDegrees="360" >
<shape
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="8"
android:useLevel="false" >
<size
android:height="48dp"
android:width="48dp" />
<gradient
android:centerColor="#color/color_preloader_center"
android:centerY="0.50"
android:endColor="#color/color_preloader_end"
android:startColor="#color/color_preloader_start"
android:type="sweep"
android:useLevel="false" />
</shape>
This is what I get, it always fills the whole screen
As mike suggeste do it like
<android.support.v4.widget.DrawerLayout
....
<FrameLayout
....
/>
<FrameLayout>
<ViewStub android:id="#+id/loadSpinner"
android:inflatedId="#+id/subView"
android:layout="#layout/progress_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</FrameLayout>
....
</android.support.v4.widget.DrawerLayout>

Related Links

refresh list veiw in activity 2 when going through acitivity 1
Make login form unreaching by pressing back
GPS activation on Android
Get the file capabilities of a file in Linux Android
MediaPlayer difference between reset and release
how to call Intent.ACTION_CLOSE_SYSTEM_DIALOGS on application level
Center view in android after changing its width properties
Displaying in ListView with CustomArrayAdapter
Is “adb root” the same as “adb shell” followed by “su”?
BB10: Tackle input in background
android render a trail of the user's finger
iframe on Android browser issue
Set color of Listview items in a specific repeating pattern
Open source android app wont run via Eclipse
Saving a drawing with the MediaStore.Images.Media.insertImage
Android - How to set two ImageViews side by side and one of them scrollable in XML Layout file

Categories

HOME
facebook-oauth
checkstyle
linkedin
webdriver
zend-framework
sh
jsf-2.2
bitbucket-api
emscripten
x264
vsm
pattern-matching
g++
heap
text-mining
activecollab
google-form
mathprog
video-editing
solrcloud
asciidoctor-pdf
squashfs
pimcore
object-storage
windows-server-2003
beautifier
licensing
android-maps
linked-data
cppreference
uitapgesturerecognizer
vex
eviews
weather
classcastexception
installshield-le
searchkit
sim-toolkit
tasm
magento-1.9.3
odoo-website
strftime
httr
phpdbg
vaadin-elements
getchar
ovf
configurationmanager
geotiff
azure-cli
subnet
opengl-4
offline.js
vcloud-director-rest-api
centrifuge
tinkerpop3
burrows-wheeler-transform
windows-azure-queues
wso2developerstudio
synonym
dimension
jclouds
cycle2
tfs-workitem
avisynth
microsoft-reporting
ess
zscript
sql-server-data-tools
bcache
dbaccess
iiop
appserver
draw2d-js
menubar
synapse
amslidemenu
qscrollarea
ecslidingviewcontroller
windows-embedded-standard
dtmf
asdf
swfobject
fragmenttransaction
jquery-blockui
correlated-subquery
subproject
josql
apache-whirr
mapping-by-code
stress
google-maps-mobile
tournament
timthumb
cac
vs-android
lxr
web-application-project
mathematical-notation
cuda.net
wysiwym
perl5.12
firefox-3

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App