GithubHelp home page GithubHelp logo

gaugeview's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gaugeview's Issues

Exception. Invalid radius value!

Get error with
app:outerShadowWidth="0.5"

mOuterShadowRect.width() / 2.0f
in:
paint.setShader(new RadialGradient(... , ... , here! , ...

public Paint getDefaultOuterShadowPaint() {
    final Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    paint.setStyle(Paint.Style.FILL);
    paint.setShader(new RadialGradient(CENTER, CENTER, mOuterShadowRect.width() / 2.0f, OUTER_SHADOW_COLORS, OUTER_SHADOW_POS,
            TileMode.MIRROR));
    return paint;
}

How can I change the start and the end value?

I'm trying to make Signal meter with dBm value. How can I change the start and the end value. It shoule start with -94 dBm (very bad signal) and end at 0 dBm (excellent signal strength).

All scale is showing as 0

I am running the your code in LG Nexus(Loolipop) and all the scales is showing as zero(0) instead of 0,10,20,30,40,50,60,70,80,90,100. Please help me in resolving this.Thanks in advance

How to add this library to my project in android studio?

Hi
I want to develop an application with this functionality. So I found GaugeView on github, I really like this project. But because I'm just starting out with github, so I do not know how to apply some of the features of this project to my application. I would be very appreciate if you could tell me the way to apply it to my application!

XML Error when creating Gauges

I get the a XML error when i try to run the app. Here is a copy of my log cat:

06-09 14:46:04.019: E/dalvikvm(2568): Could not find class 'org.codeandmagic.android.gauge.GaugeView', referenced from method MainActivity.onCreate
06-09 14:46:04.019: W/dalvikvm(2568): VFY: unable to resolve check-cast 1091 (org/codeandmagic/android/gauge/GaugeView;) in MainActivity;
06-09 14:46:04.034: W/dalvikvm(2568): VFY: unable to resolve virtual method 6304: Lorg/codeandmagic/android/gauge/GaugeView;.setTargetValue (F)V
06-09 14:46:04.769: W/dalvikvm(2568): threadid=1: thread exiting with uncaught exception (group=0x418282d0)
06-09 14:46:04.819: E/AndroidRuntime(2568): FATAL EXCEPTION: main
06-09 14:46:04.819: E/AndroidRuntime(2568): java.lang.RuntimeException: Unable to start activity ComponentInfo{MainActivity}: android.view.InflateException: Binary XML file line #32: Error inflating class org.codeandmagic.android.gauge.GaugeView
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2355)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2391)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.access$600(ActivityThread.java:151)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1335)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.os.Handler.dispatchMessage(Handler.java:99)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.os.Looper.loop(Looper.java:155)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.main(ActivityThread.java:5493)
06-09 14:46:04.819: E/AndroidRuntime(2568): at java.lang.reflect.Method.invokeNative(Native Method)
06-09 14:46:04.819: E/AndroidRuntime(2568): at java.lang.reflect.Method.invoke(Method.java:511)
06-09 14:46:04.819: E/AndroidRuntime(2568): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
06-09 14:46:04.819: E/AndroidRuntime(2568): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
06-09 14:46:04.819: E/AndroidRuntime(2568): at dalvik.system.NativeStart.main(Native Method)
06-09 14:46:04.819: E/AndroidRuntime(2568): Caused by: android.view.InflateException: Binary XML file line #32: Error inflating class org.codeandmagic.android.gauge.GaugeView
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
06-09 14:46:04.819: E/AndroidRuntime(2568): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:365)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.Activity.setContentView(Activity.java:1912)
06-09 14:46:04.819: E/AndroidRuntime(2568): at com.Tim.Koers.minitoolbox.MainActivity.onCreate(MainActivity.java:21)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.Activity.performCreate(Activity.java:5066)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
06-09 14:46:04.819: E/AndroidRuntime(2568): ... 11 more
06-09 14:46:04.819: E/AndroidRuntime(2568): Caused by: java.lang.ClassNotFoundException: org.codeandmagic.android.gauge.GaugeView
06-09 14:46:04.819: E/AndroidRuntime(2568): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-09 14:46:04.819: E/AndroidRuntime(2568): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-09 14:46:04.819: E/AndroidRuntime(2568): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.createView(LayoutInflater.java:552)
06-09 14:46:04.819: E/AndroidRuntime(2568): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
06-09 14:46:04.819: E/AndroidRuntime(2568): ... 21 more
06-09 14:46:08.019: D/Process(2568): killProcess, pid=2568
06-09 14:46:08.034: D/Process(2568): dalvik.system.VMStack.getThreadStackTrace(Native Method)
06-09 14:46:08.034: D/Process(2568): java.lang.Thread.getStackTrace(Thread.java:599)
06-09 14:46:08.034: D/Process(2568): android.os.Process.killProcess(Process.java:944)
06-09 14:46:08.034: D/Process(2568): com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:108)
06-09 14:46:08.034: D/Process(2568): java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
06-09 14:46:08.034: D/Process(2568): java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
06-09 14:46:08.034: D/Process(2568): dalvik.system.NativeStart.main(Native Method)

Thanks!
Tim

XML error when adding the view


Error when we set some of the view attributes:
<org.codeandmagic.android.gauge.GaugeView
android:id="@+id/gauge_view2"
android:layout_below="@id/gauge_view1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="10dp"
gauge:showOuterShadow="true"
gauge:showOuterRim="false"
gauge:showNeedle="false"
gauge:showRanges="false"
gauge:showText="true"

gauge:textUnit="%" />

java.lang.NullPointerException
Exception details are logged in Window > Show View > Error LogThe graphics preview in the layout editor may not be accurate:
Paint.setShadowLayer is not supported. (Ignore for this session)

java.lang.NullPointerException
at android.content.res.BridgeResources.getString(BridgeResources.java:501)
at android.content.Context.getString(Context.java:334)
at org.codeandmagic.android.gauge.GaugeView.readAttrs(GaugeView.java:224)
at org.codeandmagic.android.gauge.GaugeView.(GaugeView.java:170)
at org.codeandmagic.android.gauge.GaugeView.(GaugeView.java:175)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:157)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:373)


Error when we don't set the attributes:
<org.codeandmagic.android.gauge.GaugeView
android:id="@+id/gauge_view1"
android:layout_width="match_parent"

android:layout_height="wrap_content" />

ava.lang.ArrayIndexOutOfBoundsException: 3
at android.graphics.Gradient_Delegate$GradientPaint.precomputeGradientColors(Gradient_Delegate.java:110)
at android.graphics.RadialGradient_Delegate$RadialGradientPaint.createContext(RadialGradient_Delegate.java:128)
at apple.awt.OSXSurfaceData.setupPaint(OSXSurfaceData.java:751)
at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:1038)
at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:1004)
at apple.awt.OSXSurfaceData.doOval(OSXSurfaceData.java:1283)
at apple.awt.CRenderer.fillOval(CRenderer.java:273)
at apple.awt.CRenderer.fillOval(CRenderer.java:261)
at sun.java2d.pipe.ValidatePipe.fillOval(ValidatePipe.java:90)
at sun.java2d.SunGraphics2D.fillOval(SunGraphics2D.java:2398)
at android.graphics.Canvas_Delegate$5.draw(Canvas_Delegate.java:708)
at com.android.layoutlib.bridge.impl.GcSnapshot.drawInLayer(GcSnapshot.java:613)
at com.android.layoutlib.bridge.impl.GcSnapshot.draw(GcSnapshot.java:583)
at android.graphics.Canvas_Delegate.draw(Canvas_Delegate.java:1190)
at android.graphics.Canvas_Delegate.native_drawOval(Canvas_Delegate.java:699)
at android.graphics.Canvas.native_drawOval(Canvas.java:-1)
at android.graphics.Canvas.drawOval(Canvas.java:979)
at org.codeandmagic.android.gauge.GaugeView.drawRim(GaugeView.java:630)
at org.codeandmagic.android.gauge.GaugeView.drawGauge(GaugeView.java:592)
at org.codeandmagic.android.gauge.GaugeView.onSizeChanged(GaugeView.java:576)
at android.view.View.sizeChange(View.java:14400)
at android.view.View.setFrame(View.java:14375)
at android.view.View.layout(View.java:14286)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
at android.view.View.layout(View.java:14289)
at android.view.ViewGroup.layout(ViewGroup.java:4559)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:14289)
at android.view.ViewGroup.layout(ViewGroup.java:4559)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14289)
at android.view.ViewGroup.layout(ViewGroup.java:4559)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14289)
at android.view.ViewGroup.layout(ViewGroup.java:4559)

rangesId and colorsId ignored in private void readRanges(final Resources res, final int rangesId, final int colorsId)

Index: trunk/gaugeview-library/src/org/codeandmagic/android/gauge/GaugeView.java

--- trunk/gaugeview-library/src/org/codeandmagic/android/gauge/GaugeView.java (revision 11)
+++ trunk/gaugeview-library/src/org/codeandmagic/android/gauge/GaugeView.java (working copy)
@@ -235,8 +235,8 @@

private void readRanges(final Resources res, final int rangesId, final int colorsId) {
    if (rangesId > 0 && colorsId > 0) {

-- final String[] ranges = res.getStringArray(R.array.ranges);
-- final String[] colors = res.getStringArray(R.array.rangeColors);
++ final String[] ranges = res.getStringArray(rangesId);
++ final String[] colors = res.getStringArray(colorsId);
if (ranges.length != colors.length) { throw new IllegalArgumentException(
"The ranges and colors arrays must have the same length."); }

GaugeView

Why is this marked in Android Arsenal as new when it is at least 1 to 4 years old? Nevertheless a great view...!

Drawing problem in Android 6

My gauge works find on android 5, but has some drawing problem in android 6. As it's clear in the following photo, there are 3 rectangles in the gauge! one in the center circle of needle, 2nd in the inner blue circle and 3rd goes to the outer circle.

guage

i have a problem with view in xml

Rendering Problems Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. The following classes could not be found:
- org.codeandmagic.android.gauge.GaugeView (Fix Build Path, Edit XML, Create Class)
Tip: Try to build the project. Tip: Try to refresh the layout. Failed to find '?attr/textEditSuggestionItemLayout' in current theme. (15 similar errors not shown) Tip: Try to refresh the layout.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.