[Samsung Galaxy S 5 Unified Development] xenreon:
Nice guide :D

Update: I'm getting fcs :/ ......

Here's the codes of my smalis, and the bold ones are what I added

Main smali:

.class public Lcom/tenten/LDateBar;

.super Landroid/widget/TextView;

.source "LDateBar.java"

[B]# annotations

.annotation system Ldalvik/annotation/MemberClasses;

value = {

Lcom/tenten/LDateBar$SettingsObserver;

}

.end annotation[/B]

# direct methods

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

.locals 9

.parameter "context"

.parameter "attributeSet"

.prologue

.line 16

invoke-direct {p0, p1, p2}, Landroid/widget/TextView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

[B]new-instance v7, Lcom/tenten/LDateBar$SettingsObserver;

new-instance v8, Landroid/os/Handler;

invoke-direct {v8}, Landroid/os/Handler;-><init>()V

invoke-direct {v7, p0, v8}, Lcom/tenten/LDateBar$SettingsObserver;-><init>(Lcom/tenten/LDateBar;Landroid/os/Handler;)V

invoke-virtual {v1}, Lcom/tenten/LDateBar$SettingsObserver;->observe()V[/B]

.line 17

new-instance v1, Ljava/text/SimpleDateFormat;

const-string v3, "EEE, MMM d"

invoke-direct {v1, v3}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V

.line 18

.local v1, df:Ljava/text/DateFormat;

invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

move-result-object v3

invoke-virtual {v3}, Ljava/util/Calendar;->getTime()Ljava/util/Date;

move-result-object v3

invoke-virtual {v1, v3}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

move-result-object v0

.line 19

.local v0, date:Ljava/lang/String;

invoke-virtual {p0, v0}, Lcom/tenten/LDateBar;->setText(Ljava/lang/CharSequence;)V

[B]invoke-virtual {p0}, Lcom/tenten/LDateBar;->getContext()Landroid/content/Context;

move-result-object v4

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

move-result-object v4

const-string v5, "date_color"

const v6, -0x000000

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

move-result v4

invoke-virtual {p0, v4}, Lcom/tenten/LDateBar;->setTextColor(I)V[/B]

.line 20

invoke-virtual {p0}, Lcom/tenten/LDateBar;->invalidate()V

.line 22

new-instance v2, Landroid/content/IntentFilter;

invoke-direct {v2}, Landroid/content/IntentFilter;-><init>()V

.line 23

.local v2, intentfilter:Landroid/content/IntentFilter;

const-string v3, "android.intent.action.TIME_TICK"

invoke-virtual {v2, v3}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

.line 24

const-string v3, "android.intent.action.TIME_SET"

invoke-virtual {v2, v3}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

.line 25

const-string v3, "android.intent.action.TIMEZONE_CHANGED"

invoke-virtual {v2, v3}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

.line 26

const-string v3, "android.intent.action.CONFIGURATION_CHANGED"

invoke-virtual {v2, v3}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

.line 27

new-instance v3, Lcom/tenten/LDateBar$1;

invoke-direct {v3, p0}, Lcom/tenten/LDateBar$1;-><init>(Lcom/tenten/LDateBar;)V

invoke-virtual {p1, v3, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

.line 36

return-void

.end method

the settings observer smali:

.class public Lcom/tenten/LDateBar$SettingsObserver;

.super Landroid/database/ContentObserver;

.source "LDateBar.java"

# annotations

.annotation system Ldalvik/annotation/EnclosingClass;

value = Lcom/tenten/LDateBar;

.end annotation

.annotation system Ldalvik/annotation/InnerClass;

accessFlags = 0x4

name = "SettingsObserver"

.end annotation

# instance fields

.field final synthetic this$0:Lcom/tenten/LDateBar;

# direct methods

.method constructor <init>(Lcom/tenten/LDateBar;Landroid/os/Handler;)V

.locals 0

.prologue

.line 268

iput-object p1, p0, Lcom/tenten/LDateBar$SettingsObserver;->this$0:Lcom/tenten/LDateBar;

.line 269

invoke-direct {p0, p2}, Landroid/database/ContentObserver;-><init>(Landroid/os/Handler;)V

.line 270

return-void

.end method

# virtual methods

.method observe()V

.locals 3

.prologue

const/4 v2, 0x0

.line 273

iget-object v1, p0, Lcom/tenten/LDateBar$SettingsObserver;->this$0:Lcom/tenten/LDateBar;

# getter for: Lcom/tenten/LDateBar;->getContext()Landroid/content/Context;

invoke-static {v1}, Lcom/tenten/LDateBar;->access$001(Lcom/tenten/LDateBar;)Landroid/content/Context;

move-result-object v1

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

move-result-object v0

const-string v1, "date_color"

invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v1

invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

const-string v1, "date_color"

invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v1

invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

return-void

.end method

.method public onChange(Z)V

.locals 1

.prologue

.line 291

iget-object v0, p0, Lcom/tenten/LDateBar$SettingsObserver;->this$0:Lcom/tenten/LDateBar;

invoke-virtual {v0}, Lcom/tenten/LDateBar;->onFinishInflate()V

.line 292

return-void

.end method

I'm a total smali noob and trying to make a customizable dateview...... Waiting for someone to briefly tell me the problem and help me fix it...... I used DialpadView$SettingsObserver as my observer smali..... And lastly I'm running JB 4.1 ......