CodeAndMagic / GaugeView

An Android library for drawing gauges on Canvas.
Apache License 2.0
224 stars 156 forks source link

XML error when adding the view #3

Open kazazor opened 11 years ago

kazazor commented 11 years ago

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)