after reading many ICS+ users requests, they want 4.2 lock screen clock.. here it is
Things Needed:
* smali & baksmali
* Text Editor
* Your device framework.jar
Step 1 : in lockscreen digital clock, there are actually 2 clock views overlapping one another...
java source :
and
so we just have to use both views to get what we wanted, to do so follow steps,
decompile framework.jar goto : com\android\internal\widget\ , open DigitalClock.smali with a text editor..
search for :
you will see these lines :
Step 2: below this,
add these lines :
so now we just used second clock view which is add to android at API level 11 (Honeycomb).. but not used after ICS...
Step 3 : last step, by default as i said second clock view visibility is turned off
java source :
to do so delete this line :
Step 4 : download font in attachments push them to system\fonts\
Step 5 : Save all changes and compile flash/push/do whateva
for those who want to know what is happening study modified AOSP DigitalClock source in attachment (unmodified),
Things Needed:
* smali & baksmali
* Text Editor
* Your device framework.jar
Step 1 : in lockscreen digital clock, there are actually 2 clock views overlapping one another...
java source :
Code:
CharSequence newTime = DateFormat.format(mFormat, mCalendar);
mTimeDisplayBackground.setText(newTime);
mTimeDisplayForeground.setText(newTime);
mAmPm.setIsMorning(mCalendar.get(Calendar.AM_PM) == 0);
Code:
private static final String SYSTEM_FONT_TIME_BACKGROUND = SYSTEM + "AndroidClock.ttf";
private static final String SYSTEM_FONT_TIME_FOREGROUND = SYSTEM + "AndroidClock_Highlight.ttf";
so we just have to use both views to get what we wanted, to do so follow steps,
decompile framework.jar goto : com\android\internal\widget\ , open DigitalClock.smali with a text editor..
search for :
Code:
Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
you will see these lines :
Code:
iget-object v2, p0, Lcom/android/internal/widget/DigitalClock;->mTimeDisplayBackground:Landroid/widget/TextView;
invoke-virtual {v2, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
iget-object v2, p0, Lcom/android/internal/widget/DigitalClock;->mTimeDisplayForeground:Landroid/widget/TextView;
invoke-virtual {v2, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
Step 2: below this,
Code:
iget-object v2, p0, Lcom/android/internal/widget/DigitalClock;->mTimeDisplayBackground:Landroid/widget/TextView;
invoke-virtual {v2, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
Code:
new-instance v2, Ljava/text/SimpleDateFormat;
const-string v3, "h"
sget-object v4, Ljava/util/Locale;->ENGLISH:Ljava/util/Locale;
invoke-direct {v2, v3, v4}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;Ljava/util/Locale;)V
iget-object v3, p0, Lcom/android/internal/widget/DigitalClock;->mCalendar:Ljava/util/Calendar;
invoke-virtual {v3}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
so now we just used second clock view which is add to android at API level 11 (Honeycomb).. but not used after ICS...
Step 3 : last step, by default as i said second clock view visibility is turned off
java source :
Code:
mTimeDisplayBackground = (TextView) findViewById(R.id.timeDisplayBackground);
mTimeDisplayBackground.setTypeface(sBackgroundFont);
mTimeDisplayBackground.setVisibility(View.[COLOR="Red"]INVISIBLE[/COLOR]);
to do so delete this line :
Code:
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V
Step 4 : download font in attachments push them to system\fonts\
Step 5 : Save all changes and compile flash/push/do whateva
for those who want to know what is happening study modified AOSP DigitalClock source in attachment (unmodified),
Attachments
Last edited: