[Galaxy S II Android Development] remuntada78:
[MENTION=3065070]Goldie[/MENTION].

Hi Goldie take a look at the signal icon in statusbar

[YOUTUBE]pbvLRPCwFHY[/YOUTUBE]

I added random color code for the signal icon and it work, then i'm trying to add in that code the choice that when random color is disabled i can choose the signal color icon with the color picker.

But, how you can see in the video , when the random color is disabled color picker don't change the color

These are the code i added

.method set_signal_color()V
.locals 5

iget-object v1, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mMobile:Landroid/widget/ImageView;

invoke-virtual {v1}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

move-result-object v1

invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

const-string v2, "signal_color"

const v3, -0x1

invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v1

iput v1, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mSignalColor:I

return-void

.end method

.method set_signal_randomcolor()V
.locals 13

iget-object v6, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mMobile:Landroid/widget/ImageView;

invoke-virtual {v6}, Landroid/widget/TextView;->getContext()Landroid/content/Context;

move-result-object v6

invoke-virtual {v6}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v6

const-string v7, "signal_bg_state"

const/4 v8, 0x0

invoke-static {v6, v7, v8}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v6

if-eqz v6, :cond_0

const/16 v5, 0x100

new-instance v1, Ljava/util/Random;

invoke-direct {v1}, Ljava/util/Random;-><init>()V

.local v1, rnd:Ljava/util/Random;
const/16 v2, 0xff

invoke-virtual {v1, v5}, Ljava/util/Random;->nextInt(I)I

move-result v3

invoke-virtual {v1, v5}, Ljava/util/Random;->nextInt(I)I

move-result v4

invoke-virtual {v1, v5}, Ljava/util/Random;->nextInt(I)I

move-result v5

invoke-static {v2, v3, v4, v5}, Landroid/graphics/Color;->argb(IIII)I

move-result v0

iput v0, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mSignalRandomColor:I

:cond_0
iget-object v6, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mMobile:Landroid/widget/ImageView;

iget v7, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mMobileStrengthId:I

invoke-virtual {v6, v7}, Landroid/widget/ImageView;->setImageResource(I)V

invoke-virtual {p0}, Lcom/android/systemui/statusbar/SignalClusterView;->set_signal_color()V

iget v11, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mSignalColor:I

sget-object v12, Landroid/graphics/PorterDuff$Mode;->MULTIPLY:Landroid/graphics/PorterDuff$Mode;

invoke-virtual {v6, v11, v12}, Landroid/widget/ImageView;->setColorFilter(ILandroid/graphics/PorterDuff$Mode;)V

return-void
.end method

.line 208
iget-object v4, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mMobile:Landroid/widget/ImageView;

iget v5, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mMobileStrengthId:I

invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setImageResource(I)V
[COLOR="Red"]
invoke-virtual {p0}, Lcom/android/systemui/statusbar/SignalClusterView;->set_signal_randomcolor()V

iget v11, p0, Lcom/android/systemui/statusbar/SignalClusterView;->mSignalRandomColor:I

sget-object v12, Landroid/graphics/PorterDuff$Mode;->MULTIPLY:Landroid/graphics/PorterDuff$Mode;

invoke-virtual {v4, v11, v12}, Landroid/widget/ImageView;->setColorFilter(ILandroid/graphics/PorterDuff$Mode;)V[/COLOR]

i added also the observer smali

which are my errors?

thanks in advance