Comments (7)
I see this too. Have you figured out why? Ill try to look at it myself.
from progresswheel.
I had to make the calculations programatically for achieving that
from progresswheel.
Want to share your code?
On Tue, Apr 15, 2014 at 11:26 AM, Antonio [email protected] wrote:
I had to make the calculations programatically for achieving that
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/24#issuecomment-40495389
.
from progresswheel.
private void updateProgressWheelLayoutParameters(ProgressWheel progressWheel) {
if (getActivity() == null)
return;
Display display = getActivity().getWindowManager().getDefaultDisplay();
@SuppressWarnings("deprecation")
int width = display.getWidth();
@SuppressWarnings("deprecation")
int height = display.getHeight();
Resources resources = getResources();
int progressWheelSize = (width > height ? height / 2 : width / 2) - (int) resources.getDimension(R.dimen.dial_margins);
progressWheel.setRimWidth((int) resources.getDimension(R.dimen.dial_rim_width));
progressWheel.setBarWidth((int) resources.getDimension(R.dimen.dial_bar_width));
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(progressWheelSize, progressWheelSize);
params.addRule(RelativeLayout.CENTER_IN_PARENT);
params.addRule(RelativeLayout.BELOW, R.id.dialTitleTextView);
int marginTop = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, resources.getDisplayMetrics());
params.setMargins(0, marginTop, 0, 0);
progressWheel.setLayoutParams(params);
}
from progresswheel.
This is not the best solution still
from progresswheel.
I discovered the problem...in setupBounds, the call to this.getLayoutParams().width and this.getLayoutParams().height return -1 when the layout_[width|height] parameter is set to match_parent. This throw the rest of the calculations off. I look to fix this.
from progresswheel.
I just submitted a proper fix as a pull request to this issue.
from progresswheel.
Related Issues (20)
- How to install this ? HOT 2
- Change bar color dynamically HOT 1
- How do I create it programmatically
- Set attribute values programnatically won't change the visual of the progress wheel. HOT 2
- Why I can't use this library on eclipse HOT 1
- GitHub release HOT 2
- License ambiguity HOT 1
- How to set bar to full width (whole radius) ?
- Attribute "radius" has already been defined HOT 2
- How to set maximum value for the progress bar? HOT 1
- Gradle dependency causes AndroidManifest errors HOT 8
- Double application HOT 15
- AndroidStudio suggests different xmlns:ProgressWheel HOT 3
- Text with multiple line doesn't work HOT 4
- Failed to resolve Gradle dependency
- readme's demo is wrong HOT 2
- Add to Home Widget
- barLength conflicts HOT 10
- Cancellable HOT 1
- ERROR: Failed to resolve: ProgressWheel 1.2 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from progresswheel.