[MOD][GUIDE] Panasonic Eluga style lockscreen (Trace the arc to unlock) - Android Themes

This is just another ICS lockscreen mod. Panasonic Eluga style.
And originally posted on Nexus S theme forum.. :
[MOD] Panasonic Eluga style lockscreen (Trace the arc to unlock)
Preview :
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
-----------------------------------------------------------------------------
* Caution : All values and resources(PNGs) are for HDPI=WVGA devices *
How to :
1) Apply patch(diff) with resources.
2) Compile.
3) Done
*How to use patch : http://jungels.net/articles/diff-patch-ten-minutes.html
* diff : Download
Code:
diff -rupN ./a/core/java/com/android/internal/widget/WaveView.java ./b/core/java/com/android/internal/widget/WaveView.java
--- ./a/core/java/com/android/internal/widget/WaveView.java 2012-04-05 00:32:15.291482000 +0900
+++ ./b/core/java/com/android/internal/widget/WaveView.java 2012-04-19 17:23:22.719207000 +0900
@@ -43,7 +43,7 @@ import com.android.internal.R;
public class WaveView extends View implements ValueAnimator.AnimatorUpdateListener {
private static final String TAG = "WaveView";
private static final boolean DBG = false;
- private static final int WAVE_COUNT = 20; // default wave count
+ private static final int WAVE_COUNT = 1; // default wave count
private static final long VIBRATE_SHORT = 20; // msec
private static final long VIBRATE_LONG = 20; // msec
@@ -62,7 +62,7 @@ public class WaveView extends View imple
private static final long FINAL_DELAY = 200; // delay for unlock success animation
private static final long SHORT_DELAY = 100; // for starting one animation after another.
private static final long WAVE_DURATION = 2000; // amount of time for way to expand/decay
- private static final long RESET_TIMEOUT = 3000; // elapsed time of inactivity before we reset
+ private static final long RESET_TIMEOUT = 200; // elapsed time of inactivity before we reset
private static final long DELAY_INCREMENT = 15; // increment per wave while tracking motion
private static final long DELAY_INCREMENT2 = 12; // increment per wave while not tracking
private static final long WAVE_DELAY = WAVE_DURATION / WAVE_COUNT; // initial propagation delay
@@ -84,8 +84,8 @@ public class WaveView extends View imple
private ArrayList<DrawableHolder> mDrawables = new ArrayList<DrawableHolder>(3);
private ArrayList<DrawableHolder> mLightWaves = new ArrayList<DrawableHolder>(WAVE_COUNT);
private boolean mFingerDown = false;
- private float mRingRadius = 182.0f; // Radius of bitmap ring. Used to snap halo to it
- private int mSnapRadius = 136; // minimum threshold for drag unlock
+ private float mRingRadius = 320.0f; // Radius of bitmap ring. Used to snap halo to it
+ private int mSnapRadius = 180; // minimum threshold for drag unlock
private int mWaveCount = WAVE_COUNT; // number of waves
private long mWaveTimerDelay = WAVE_DELAY;
private int mCurrentWave = 0;
@@ -166,16 +166,16 @@ public class WaveView extends View imple
mUnlockRing = new DrawableHolder(createDrawable(R.drawable.unlock_ring));
mUnlockRing.setX(mLockCenterX);
mUnlockRing.setY(mLockCenterY);
- mUnlockRing.setScaleX(0.1f);
- mUnlockRing.setScaleY(0.1f);
+ mUnlockRing.setScaleX(1.0f);
+ mUnlockRing.setScaleY(1.0f);
mUnlockRing.setAlpha(0.0f);
mDrawables.add(mUnlockRing);
mUnlockDefault = new DrawableHolder(createDrawable(R.drawable.unlock_default));
mUnlockDefault.setX(mLockCenterX);
mUnlockDefault.setY(mLockCenterY);
- mUnlockDefault.setScaleX(0.1f);
- mUnlockDefault.setScaleY(0.1f);
+ mUnlockDefault.setScaleX(1.0f);
+ mUnlockDefault.setScaleY(1.0f);
mUnlockDefault.setAlpha(0.0f);
mDrawables.add(mUnlockDefault);
@@ -215,41 +215,23 @@ public class WaveView extends View imple
mLightWaves.get(i).startAnimations(this);
}
- mUnlockRing.addAnimTo(DURATION, 0, "x", mLockCenterX, true);
- mUnlockRing.addAnimTo(DURATION, 0, "y", mLockCenterY, true);
- mUnlockRing.addAnimTo(DURATION, 0, "scaleX", 0.1f, true);
- mUnlockRing.addAnimTo(DURATION, 0, "scaleY", 0.1f, true);
- mUnlockRing.addAnimTo(DURATION, 0, "alpha", 0.0f, true);
-
- mUnlockDefault.removeAnimationFor("x");
- mUnlockDefault.removeAnimationFor("y");
- mUnlockDefault.removeAnimationFor("scaleX");
- mUnlockDefault.removeAnimationFor("scaleY");
- mUnlockDefault.removeAnimationFor("alpha");
+ mUnlockRing.setX(mLockCenterX);
+ mUnlockRing.setY(mLockCenterY);
+ mUnlockRing.setScaleX(1.0f);
+ mUnlockRing.setScaleY(1.0f);
+ mUnlockRing.setAlpha(1.0f);
+
mUnlockDefault.setX(mLockCenterX);
mUnlockDefault.setY(mLockCenterY);
- mUnlockDefault.setScaleX(0.1f);
- mUnlockDefault.setScaleY(0.1f);
+ mUnlockDefault.setScaleX(1.0f);
+ mUnlockDefault.setScaleY(1.0f);
mUnlockDefault.setAlpha(0.0f);
- mUnlockDefault.addAnimTo(DURATION, SHORT_DELAY, "scaleX", 1.0f, true);
- mUnlockDefault.addAnimTo(DURATION, SHORT_DELAY, "scaleY", 1.0f, true);
- mUnlockDefault.addAnimTo(DURATION, SHORT_DELAY, "alpha", 1.0f, true);
-
- mUnlockHalo.removeAnimationFor("x");
- mUnlockHalo.removeAnimationFor("y");
- mUnlockHalo.removeAnimationFor("scaleX");
- mUnlockHalo.removeAnimationFor("scaleY");
- mUnlockHalo.removeAnimationFor("alpha");
+
mUnlockHalo.setX(mLockCenterX);
mUnlockHalo.setY(mLockCenterY);
- mUnlockHalo.setScaleX(0.1f);
- mUnlockHalo.setScaleY(0.1f);
- mUnlockHalo.setAlpha(0.0f);
- mUnlockHalo.addAnimTo(DURATION, SHORT_DELAY, "x", mLockCenterX, true);
- mUnlockHalo.addAnimTo(DURATION, SHORT_DELAY, "y", mLockCenterY, true);
- mUnlockHalo.addAnimTo(DURATION, SHORT_DELAY, "scaleX", 1.0f, true);
- mUnlockHalo.addAnimTo(DURATION, SHORT_DELAY, "scaleY", 1.0f, true);
- mUnlockHalo.addAnimTo(DURATION, SHORT_DELAY, "alpha", 1.0f, true);
+ mUnlockHalo.setScaleX(1.0f);
+ mUnlockHalo.setScaleY(1.0f);
+ mUnlockHalo.setAlpha(1.0f);
removeCallbacks(mLockTimerActions);
@@ -263,24 +245,12 @@ public class WaveView extends View imple
case STATE_START_ATTEMPT:
if (DBG) Log.v(TAG, "State START_ATTEMPT");
- mUnlockDefault.removeAnimationFor("x");
- mUnlockDefault.removeAnimationFor("y");
- mUnlockDefault.removeAnimationFor("scaleX");
- mUnlockDefault.removeAnimationFor("scaleY");
- mUnlockDefault.removeAnimationFor("alpha");
- mUnlockDefault.setX(mLockCenterX + 182);
- mUnlockDefault.setY(mLockCenterY);
- mUnlockDefault.setScaleX(0.1f);
- mUnlockDefault.setScaleY(0.1f);
- mUnlockDefault.setAlpha(0.0f);
- mUnlockDefault.addAnimTo(DURATION, SHORT_DELAY, "scaleX", 1.0f, false);
- mUnlockDefault.addAnimTo(DURATION, SHORT_DELAY, "scaleY", 1.0f, false);
- mUnlockDefault.addAnimTo(DURATION, SHORT_DELAY, "alpha", 1.0f, false);
-
- mUnlockRing.addAnimTo(DURATION, 0, "scaleX", 1.0f, true);
- mUnlockRing.addAnimTo(DURATION, 0, "scaleY", 1.0f, true);
- mUnlockRing.addAnimTo(DURATION, 0, "alpha", 1.0f, true);
+ mUnlockRing.setX(mLockCenterX);
+ mUnlockRing.setY(mLockCenterY);
+ mUnlockRing.setScaleX(1.0f);
+ mUnlockRing.setScaleY(1.0f);
+ mUnlockRing.setAlpha(1.0f);
mLockState = STATE_ATTEMPTING;
break;
@@ -290,11 +260,8 @@ public class WaveView extends View imple
if (dragDistance > mSnapRadius) {
mFinishWaves = true; // don't start any more waves.
if (fingerDown) {
- mUnlockHalo.addAnimTo(0, 0, "x", ringX, true);
- mUnlockHalo.addAnimTo(0, 0, "y", ringY, true);
- mUnlockHalo.addAnimTo(0, 0, "scaleX", 1.0f, true);
- mUnlockHalo.addAnimTo(0, 0, "scaleY", 1.0f, true);
- mUnlockHalo.addAnimTo(0, 0, "alpha", 1.0f, true);
+ mUnlockDefault.setAlpha(1.0f);
+ mUnlockRing.setAlpha(0.0f);
} else {
if (DBG) Log.v(TAG, "up detected, moving to STATE_UNLOCK_ATTEMPT");
mLockState = STATE_UNLOCK_ATTEMPT;
@@ -307,11 +274,8 @@ public class WaveView extends View imple
// mWaveTimerDelay = WAVE_DELAY;
postDelayed(mAddWaveAction, mWaveTimerDelay);
}
- mUnlockHalo.addAnimTo(0, 0, "x", mouseX, true);
- mUnlockHalo.addAnimTo(0, 0, "y", mouseY, true);
- mUnlockHalo.addAnimTo(0, 0, "scaleX", 1.0f, true);
- mUnlockHalo.addAnimTo(0, 0, "scaleY", 1.0f, true);
- mUnlockHalo.addAnimTo(0, 0, "alpha", 1.0f, true);
+ mUnlockDefault.setAlpha(0.0f);
+ mUnlockRing.setAlpha(1.0f);
}
break;
@@ -331,42 +295,6 @@ public class WaveView extends View imple
mLightWaves.get(i).startAnimations(this);
}
- mUnlockRing.addAnimTo(FINAL_DURATION, 0, "x", ringX, false);
- mUnlockRing.addAnimTo(FINAL_DURATION, 0, "y", ringY, false);
- mUnlockRing.addAnimTo(FINAL_DURATION, 0, "scaleX", 0.1f, false);
- mUnlockRing.addAnimTo(FINAL_DURATION, 0, "scaleY", 0.1f, false);
- mUnlockRing.addAnimTo(FINAL_DURATION, 0, "alpha", 0.0f, false);
-
- mUnlockRing.addAnimTo(FINAL_DURATION, FINAL_DELAY, "alpha", 0.0f, false);
-
- mUnlockDefault.removeAnimationFor("x");
- mUnlockDefault.removeAnimationFor("y");
- mUnlockDefault.removeAnimationFor("scaleX");
- mUnlockDefault.removeAnimationFor("scaleY");
- mUnlockDefault.removeAnimationFor("alpha");
- mUnlockDefault.setX(ringX);
- mUnlockDefault.setY(ringY);
- mUnlockDefault.setScaleX(0.1f);
- mUnlockDefault.setScaleY(0.1f);
- mUnlockDefault.setAlpha(0.0f);
-
- mUnlockDefault.addAnimTo(FINAL_DURATION, 0, "x", ringX, true);
- mUnlockDefault.addAnimTo(FINAL_DURATION, 0, "y", ringY, true);
- mUnlockDefault.addAnimTo(FINAL_DURATION, 0, "scaleX", 1.0f, true);
- mUnlockDefault.addAnimTo(FINAL_DURATION, 0, "scaleY", 1.0f, true);
- mUnlockDefault.addAnimTo(FINAL_DURATION, 0, "alpha", 1.0f, true);
-
- mUnlockDefault.addAnimTo(FINAL_DURATION, FINAL_DELAY, "scaleX", 3.0f, false);
- mUnlockDefault.addAnimTo(FINAL_DURATION, FINAL_DELAY, "scaleY", 3.0f, false);
- mUnlockDefault.addAnimTo(FINAL_DURATION, FINAL_DELAY, "alpha", 0.0f, false);
-
- mUnlockHalo.addAnimTo(FINAL_DURATION, 0, "x", ringX, false);
- mUnlockHalo.addAnimTo(FINAL_DURATION, 0, "y", ringY, false);
-
- mUnlockHalo.addAnimTo(FINAL_DURATION, FINAL_DELAY, "scaleX", 3.0f, false);
- mUnlockHalo.addAnimTo(FINAL_DURATION, FINAL_DELAY, "scaleY", 3.0f, false);
- mUnlockHalo.addAnimTo(FINAL_DURATION, FINAL_DELAY, "alpha", 0.0f, false);
-
removeCallbacks(mLockTimerActions);
postDelayed(mLockTimerActions, RESET_TIMEOUT);
Binary files ./a/core/res/res/drawable-hdpi/unlock_default.png and ./b/core/res/res/drawable-hdpi/unlock_default.png differ
Binary files ./a/core/res/res/drawable-hdpi/unlock_halo.png and ./b/core/res/res/drawable-hdpi/unlock_halo.png differ
Binary files ./a/core/res/res/drawable-hdpi/unlock_ring.png and ./b/core/res/res/drawable-hdpi/unlock_ring.png differ
Binary files ./a/core/res/res/drawable-hdpi/unlock_wave.png and ./b/core/res/res/drawable-hdpi/unlock_wave.png differ
diff -rupN ./a/core/res/res/layout/keyguard_screen_tab_unlock.xml ./b/core/res/res/layout/keyguard_screen_tab_unlock.xml
--- ./a/core/res/res/layout/keyguard_screen_tab_unlock.xml 2012-04-05 00:32:17.031482000 +0900
+++ ./b/core/res/res/layout/keyguard_screen_tab_unlock.xml 2012-04-19 19:13:39.669207000 +0900
@@ -28,16 +28,29 @@
android:layout_height="match_parent"
android:gravity="center_horizontal">
+ <TextView
+ android:id="@+id/carrier"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_marginTop="12dip"
+ android:layout_marginRight="12dip"
+ android:gravity="right"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textSize="16dip"
+ android:textStyle="bold"
+ />
+
<com.android.internal.widget.DigitalClock android:id="@+id/time"
android:layout_marginTop="@dimen/keyguard_lockscreen_status_line_clockfont_top_margin"
- android:layout_marginBottom="12dip"
- android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin"
- android:layout_gravity="right">
+ android:layout_marginBottom="12dip">
<!-- Because we can't have multi-tone fonts, we render two TextViews, one on
top of the other. Hence the redundant layout... -->
<TextView android:id="@+id/timeDisplayBackground"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="none"
@@ -45,10 +58,11 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginBottom="6dip"
android:textColor="@color/lockscreen_clock_background"
+ android:gravity="center_horizontal"
/>
<TextView android:id="@+id/timeDisplayForeground"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="none"
@@ -58,52 +72,57 @@
android:textColor="@color/lockscreen_clock_foreground"
android:layout_alignLeft="@id/timeDisplayBackground"
android:layout_alignTop="@id/timeDisplayBackground"
+ android:gravity="center_horizontal"
/>
</com.android.internal.widget.DigitalClock>
<LinearLayout
android:orientation="horizontal"
- android:layout_gravity="right"
- android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin">
+ android:layout_width="match_parent">
<TextView
android:id="@+id/date"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
+ android:textStyle="bold"
+ android:gravity="center_horizontal"
/>
<TextView
android:id="@+id/alarm_status"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
+ android:textStyle="bold"
android:drawablePadding="4dip"
+ android:gravity="center_horizontal"
/>
</LinearLayout>
<TextView
android:id="@+id/status1"
- android:layout_gravity="right"
- android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
+ android:textStyle="bold"
android:drawablePadding="4dip"
+ android:layout_marginBottom="16dip"
+ android:gravity="center_horizontal"
/>
- <Space android:layout_gravity="fill" />
-
<!-- emergency call button shown when sim is PUKd and tab_selector is hidden -->
<Button
android:id="@+id/emergencyCallButton"
@@ -111,7 +130,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="4dip"
android:layout_marginRight="16dip"
- android:layout_gravity="right"
+ android:layout_gravity="center_horizontal"
android:drawableLeft="@*android:drawable/lockscreen_emergency_button"
style="?android:attr/buttonBarButtonStyle"
android:drawablePadding="4dip"
@@ -121,42 +140,13 @@
<RelativeLayout
android:layout_width="match_parent"
- android:layout_height="302dip">
+ android:layout_height="320dip"
+ android:layout_gravity="center_horizontal">
- <com.android.internal.widget.multiwaveview.MultiWaveView
+ <com.android.internal.widget.WaveView
android:id="@+id/unlock_widget"
- android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_alignParentBottom="true"
-
- android:targetDrawables="@array/lockscreen_targets_with_camera"
- android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera"
- android:directionDescriptions="@array/lockscreen_direction_descriptions"
- android:handleDrawable="@drawable/ic_lockscreen_handle"
- android:waveDrawable="@drawable/ic_lockscreen_outerring"
- android:outerRadius="@dimen/multiwaveview_target_placement_radius"
- android:snapMargin="@dimen/multiwaveview_snap_margin"
- android:hitRadius="@dimen/multiwaveview_hit_radius"
- android:rightChevronDrawable="@drawable/ic_lockscreen_chevron_right"
- android:horizontalOffset="0dip"
- android:verticalOffset="60dip"
- android:feedbackCount="3"
- android:vibrationDuration="20"
- />
-
- <TextView
- android:id="@+id/carrier"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_marginBottom="12dip"
- android:gravity="center_horizontal"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
- android:textColor="?android:attr/textColorSecondary"
/>
</RelativeLayout>
@@ -166,13 +156,13 @@
android:layout_width="match_parent"
style="?android:attr/buttonBarStyle"
android:gravity="center"
- android:weightSum="2">
+ android:weightSum="0">
<Button android:id="@+id/emergencyCallButton"
android:layout_gravity="center_horizontal"
android:layout_width="0dip"
android:layout_height="wrap_content"
- android:layout_weight="1"
+ android:layout_weight="0"
style="?android:attr/buttonBarButtonStyle"
android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
android:text="@*android:string/lockscreen_emergency_call"
diff -rupN ./a/core/res/res/values/dimens.xml ./b/core/res/res/values/dimens.xml
--- ./a/core/res/res/values/dimens.xml 2012-04-05 00:32:17.671482000 +0900
+++ ./b/core/res/res/values/dimens.xml 2012-04-19 18:27:08.859215000 +0900
@@ -164,7 +164,7 @@
<dimen name="keyguard_lockscreen_status_line_font_right_margin">42dip</dimen>
<!-- Size of top margin on Clock font to edge on unlock LockScreen -->
- <dimen name="keyguard_lockscreen_status_line_clockfont_top_margin">22dip</dimen>
+ <dimen name="keyguard_lockscreen_status_line_clockfont_top_margin">34dip</dimen>
<!-- Size of top margin on Clock font to edge on unlock LockScreen -->
<dimen name="keyguard_lockscreen_status_line_clockfont_bottom_margin">12dip</dimen>
* resources : Download
-----------------------------------------------------------------------------
Thanks to stephenjungels.com for guide to diff and patch..
-----------------------------------------------------------------------------

the guide to use patch is only for linux user ? Is it right ? How to apply it on windows ?

Your Mod for ICS LockScreen works only on Nexus S?
Can i apply it on my Motorola Defy with CM9, by your patch?

remix96 said:
Your Mod for ICS LockScreen works only on Nexus S?
Can i apply it on my Motorola Defy with CM9, by your patch?
Click to expand...
Click to collapse
Once again thanks evilisto for the mods ^_^
Yes you can this should work on any ics rom but obviously with aokp and other roms with a different framework it might require some different changes(correct me if am wrong evilisto)...... I am currently using the Optimus 4x lockscreen which I used a patch for on my defy also ...... Btw you know you need the source code to use this........

Kayant said:
Once again thanks evilisto for the mods ^_^
Yes you can this should work on any ics rom but obviously with aokp and other roms with different a framework it might require some different changes(correct me if am wrong evilisto)...... I am currently using the Optimus 4x lockscreen which I used a patch for on my defy also ...... Btw you know you need the source code to use this........
Click to expand...
Click to collapse
Oh! You use this lockscreen mods on Defy!?!?!?
Can you tell me how to specifically apply that mods on Defy?
And what you intend for "know the source code"... why i need to know that for this mod?
P.S. You can PM me, if you want

Kayant said:
Once again thanks evilisto for the mods ^_^
Yes you can this should work on any ics rom but obviously with aokp and other roms with different a framework it might require some different changes(correct me if am wrong evilisto)...... I am currently using the Optimus 4x lockscreen which I used a patch for on my defy also ...... Btw you know you need the source code to use this........
Click to expand...
Click to collapse
You are right. Basically this patch will work well on other devices but it will not work on AOKP or AOKP-based other custom roms. (need some modifications)

resources updated
I re-drew arc image. Now it is more similar to original..

Can anyone with an xperia arc patch their files and post them here please? I really want this mod, but i am unable to patch my files since i am not on linux

Can any one help get this work on a Galaxy S2

question
where does the resources files put into?

chenleicpp said:
where does the resources files put into?
Click to expand...
Click to collapse
Once you apply the patch to your source files then you add the files(resource) to your source as well then compile your rom or if you have compiled once already use the mmm command to compile the part that got changed - http://wiki.cyanogenmod.com/wiki/Howto:_Speed_up_building#Using_mmm_to_rebuild_only_valid_parts

help
tt tooks this error and i think i dont have WaveView before?
[email protected]:/work/cm9source/frameworks$ patch -p1 < base/Trace_the_Arc_LS.patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN ./a/core/java/com/android/internal/widget/WaveView.java ./b/core/java/com/android/internal/widget/WaveView.java
|--- ./a/core/java/com/android/internal/widget/WaveView.java 2012-04-05 00:32:15.291482000 +0900
|+++ ./b/core/java/com/android/internal/widget/WaveView.java 2012-04-19 17:23:22.719207000 +0900
--------------------------

chenleicpp said:
tt tooks this error and i think i dont have WaveView before?
[email protected]:/work/cm9source/frameworks$ patch -p1 < base/Trace_the_Arc_LS.patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN ./a/core/java/com/android/internal/widget/WaveView.java ./b/core/java/com/android/internal/widget/WaveView.java
|--- ./a/core/java/com/android/internal/widget/WaveView.java 2012-04-05 00:32:15.291482000 +0900
|+++ ./b/core/java/com/android/internal/widget/WaveView.java 2012-04-19 17:23:22.719207000 +0900
--------------------------
Click to expand...
Click to collapse
Do you have the rom source code because that's why you're getting an error as it can't find which files to patch..

yes
Kayant said:
Do you have the rom source code because that's why you're getting an error as it can't find which files to patch..
Click to expand...
Click to collapse
yes,maybe it is the point,because in my frameworks/base/core/java/android/widget folder,there is no waveview.java, so i need compelete code to include this theme.
---------- Post added at 11:10 AM ---------- Previous post was at 11:01 AM ----------
also i want to say that my sourcecode is cm9,and how to use it in cm9

for lg p500
i want ths lockscreen , how do i gt that??

Related

diffing kj4 - kj6 kernels

as kj6 is supposed to bring some bug fixes, I thought I'd check the kernel source.
there's not a huge amount of difference, but some looks interesting, hopefully of use to anyone wanting to building it.
Code:
--- drivers/input/touchscreen/mxt540e.c 2011-10-20 02:58:48.000000000
+++ drivers/input/touchscreen/mxt540e.c 2011-10-25 17:58:10.000000000
@@ -907,16 +907,16 @@
}
if (object_type == PROCG_NOISESUPPRESSION_T48) {
if (msg[4] == 5) { /* Median filter error */
printk("[TSP] Median filter Error\n");
get_object_info(data, PROCG_NOISESUPPRESSION_T48, &size, &obj_address);
- value = data->calcfg_batt_e;
+ value = 0;
error = write_mem(data, obj_address+2, 1, &value);
- msleep(5);
- value |= 0x20;
+ msleep(15);
+ value = data->calcfg_batt_e;
error |= write_mem(data, obj_address+2, 1, &value);
if(error) printk(KERN_ERR "[TSP] failed to reenable CHRGON\n");
}
}
if (object_type == TOUCH_MULTITOUCHSCREEN_T9) {
Code:
--- drivers/input/keyboard/cypress/cypress-touchkey.c 2011-10-20 02:58:48.000000000
+++ drivers/input/keyboard/cypress/cypress-touchkey.c 2011-10-25 17:58:10.000000000
@@ -1909,18 +1909,20 @@
int ret = 0;
#ifdef TEST_JIG_MODE
unsigned char get_touch = 0x40;
#endif
+#ifndef CONFIG_MACH_Q1_REV02
if (gpio_request(_3_TOUCH_SDA_28V, "_3_TOUCH_SDA_28V"))
WARN(1, "Fail to request gpio (_3_TOUCH_SDA_28V)\n");
if (gpio_request(_3_TOUCH_SCL_28V, "_3_TOUCH_SCL_28V"))
WARN(1, "Fail to request gpio (_3_TOUCH_SCL_28V)\n");
if (gpio_request(_3_GPIO_TOUCH_EN, "_3_GPIO_TOUCH_EN"))
WARN(1, "Fail to request gpio (_3_GPIO_TOUCH_EN)\n");
+#endif
if (gpio_request(_3_GPIO_TOUCH_INT, "_3_GPIO_TOUCH_INT"))
WARN(1, "Fail to request gpio (_3_GPIO_TOUCH_INT)\n");
/*20110222 N1_firmware_sync*/
sec_touchkey = device_create(sec_class, NULL, 0, NULL, "sec_touchkey");
@@ -2212,18 +2214,20 @@
misc_deregister(&touchkey_update_device);
if (touchkey_wq) {
destroy_workqueue(touchkey_wq);
}
+#ifndef CONFIG_MACH_Q1_REV02
gpio_free(_3_TOUCH_SDA_28V);
gpio_free(_3_TOUCH_SCL_28V);
gpio_free(_3_GPIO_TOUCH_EN);
+#endif
gpio_free(_3_GPIO_TOUCH_INT);
}
late_initcall(touchkey_init);
module_exit(touchkey_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("@@@");
MODULE_DESCRIPTION("melfas touch keypad");
Code:
--- drivers/leds/leds-max8997.c 2011-10-20 02:58:48.000000000
+++ drivers/leds/leds-max8997.c 2011-10-25 17:58:10.000000000
@@ -242,19 +242,30 @@
regulator_led_disable(led);
regulator_put(led->vcc);
kfree(led);
return 0;
}
+static void regulator_led_shutdown(struct platform_device *pdev)
+{
+ struct regulator_led *led = platform_get_drvdata(pdev);
+
+ if (regulator_is_enabled(led->vcc)) {
+ regulator_led_disable(led);
+ }
+ return;
+}
+
static struct platform_driver regulator_led_driver = {
.driver = {
.name = "leds-max8997",
.owner = THIS_MODULE,
},
.probe = regulator_led_probe,
.remove = __devexit_p(regulator_led_remove),
+ .shutdown = regulator_led_shutdown,
};
static int __init regulator_led_init(void)
{
return platform_driver_register(&regulator_led_driver);
}
Code:
--- drivers/media/video/samsung/mali/common/mali_kernel_mem_os.c 2011-10-20 02:58:48.000000000
+++ drivers/media/video/samsung/mali/common/mali_kernel_mem_os.c 2011-10-25 17:58:10.000000000
@@ -251,12 +251,13 @@
{
if ( allocation_order > 0 ) {
--allocation_order;
} else {
/* return OOM */
_mali_osk_lock_signal(info->mutex, _MALI_OSK_LOCKMODE_RW);
+ MALI_PRINT(("Failed to allocate consistent memory in all sizes.\n"));
return MALI_MEM_ALLOC_NONE;
}
}
/* try to allocate 2^(allocation_order) pages, if that fails, try
* allocation_order-1 to allocation_order 0 (inclusive) */
@@ -270,18 +271,21 @@
--allocation_order;
}
if ( NULL == virt )
{
MALI_DEBUG_PRINT(1, ("Failed to allocate consistent memory. Is CONSISTENT_DMA_SIZE set too low?\n"));
+ MALI_PRINT(("Failed to allocate consistent memory. Is CONSISTENT_DMA_SIZE set too low?\n"));
/* return OOM */
_mali_osk_lock_signal(info->mutex, _MALI_OSK_LOCKMODE_RW);
return MALI_MEM_ALLOC_NONE;
}
MALI_DEBUG_PRINT(5, ("os_allocator_allocate_page_table_block: Allocation of order %i succeeded\n",
+ allocation_order));
+ MALI_PRINT(("os_allocator_allocate_page_table_block: Allocation of order %i succeeded\n",
allocation_order));
/* we now know the size of the allocation since we know for what
* allocation_order the allocation succeeded */
size = _MALI_OSK_CPU_PAGE_SIZE << allocation_order;
Code:
--- drivers/media/video/m5mo.c 2011-10-20 02:58:48.000000000
+++ drivers/media/video/m5mo.c 2011-10-25 17:58:10.000000000
@@ -1707,13 +1707,13 @@
}
#endif
static int m5mo_set_touch_auto_focus(struct v4l2_subdev *sd, int val)
{
struct m5mo_state *state = to_state(sd);
- int err = -EINVAL;
+ int err;
cam_info("%s\n", val ? "start" : "stop");
state->focus.touch = val;
if (val) {
err = m5mo_set_af_mode(sd, FOCUS_MODE_TOUCH);
@@ -1727,13 +1727,13 @@
err = m5mo_writew(sd, M5MO_CATEGORY_LENS,
M5MO_LENS_AF_TOUCH_POSY, state->focus.pos_y);
CHECK_ERR(err);
}
cam_trace("X\n");
- return err;
+ return 0;
}
static int m5mo_set_zoom(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
{
struct m5mo_state *state = to_state(sd);
struct v4l2_queryctrl qc = {0,};
Code:
--- drivers/power/smb328_charger.c 2011-10-20 02:58:49.000000000
+++ drivers/power/smb328_charger.c 2011-10-25 17:58:10.000000000
@@ -820,18 +820,26 @@
{
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
struct smb328_chip *chip;
int ret = 0;
int gpio = 0;
u8 data;
+ int i;
- if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
- return -EIO;
+ i = 10;
+ while (1) {
+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
+ goto I2CERROR;
- if (smb328_i2c_read(client, 0x36, &data)<0) /* check HW */
- return -EIO;
+ if (smb328_i2c_read(client, 0x36, &data)>=0) /* check HW */
+ break;
+
+I2CERROR:
+ if (!i--) return -EIO;
+ msleep(300);
+ }
dev_info(&client->dev, "%s : SMB328 Charger Driver Loading\n", __func__);
chip = kzalloc(sizeof(struct smb328_chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
Code:
--- drivers/video/samsung/s3cfb_s6e8aa0.c 2011-10-20 02:58:50.000000000
+++ drivers/video/samsung/s3cfb_s6e8aa0.c 2011-10-25 17:58:10.000000000
@@ -1009,19 +1009,27 @@
return 0;
}
int s6e8ax0_read_mtp(struct lcd_info *lcd, u8 *mtp_data)
{
int ret;
+ u8 retry_cnt = 3;
s6e8ax0_write(lcd, enable_mtp_register, ARRAY_SIZE(enable_mtp_register));
+
+read_retry:
ret = s6e8ax0_read(lcd, LDI_MTP_ADDR, LDI_MTP_LENGTH, mtp_data);
if (!ret) {
- printk("ERROR:MTP read failed\n");
- return 0;
+ if (retry_cnt) {
+ printk("[WARN:LCD] : %s : retry cnt : %d\n", __func__, retry_cnt);
+ retry_cnt--;
+ goto read_retry;
+ } else
+ printk("ERROR:MTP read failed\n");
}
+
s6e8ax0_write(lcd, disable_mtp_register, ARRAY_SIZE(disable_mtp_register));
return ret;
}
#endif
static ssize_t lcdtype_show(struct device *dev, struct
@@ -1228,12 +1236,13 @@
struct s5p_platform_dsim *pd = (struct s5p_platform_dsim *)pdev->dev.platform_data;
#endif
#ifdef SMART_DIMMING
u8 mtp_data[LDI_MTP_LENGTH] = {0,};
u32 i;
u8 id_buf[3] = {0,};
+ u8 retry_cnt = 3;
#endif
lcd = kzalloc(sizeof(struct lcd_info), GFP_KERNEL);
if (!lcd) {
pr_err("failed to allocate for lcd\n");
ret = -ENOMEM;
@@ -1330,17 +1339,24 @@
dev_info(&lcd->ld->dev, "s6e8aa0 lcd panel driver has been probed.\n");
#ifdef SMART_DIMMING
mutex_init(&lcd->bl_lock);
- //read mpt
+read_retry:
ret = s6e8ax0_read(lcd, PANEL_ID_COMMAND, 3, id_buf);
if (!ret) {
- printk("[LCD:ERROR] : %s read id failed\n", __func__);
- //return -1;
+ if (retry_cnt) {
+ printk("[WARN:LCD] : %s : retry cnt : %d\n", __func__, retry_cnt);
+ retry_cnt--;
+ goto read_retry;
+ } else {
+ printk("[ERROR:LCD] : %s : Read ID Failed\n", __func__);
+ /*To protect ELVSS Wrong Operation*/
+ id_buf[2] = 0x33;
+ }
}
printk("Read ID : %x, %x, %x\n", id_buf[0], id_buf[1], id_buf[2]);
if (id_buf[2] == 0x33) {
lcd->support_elvss = 0;
@@ -1361,22 +1377,23 @@
init_table_info(&lcd->smart);
ret = s6e8ax0_read_mtp(lcd, mtp_data);
if (!ret) {
printk("[LCD:ERROR] : %s read mtp failed\n", __func__);
- //return -1;
+ lcd->connected = 0;
+ dev_info(&lcd->ld->dev, "panel is not connected well\n");
+ /*return -1;*/
}
calc_voltage_table(&lcd->smart, mtp_data);
s6e8ax0_adb_brightness_update(lcd, lcd->bd->props.brightness, 1);
#endif
- if (id_buf[0] == 0xa2) {
- lcd->connected = 1;
+ if (lcd->connected) {
INIT_DELAYED_WORK(&hs_clk_re_try, hs_clk_re_try_work);
lcd->irq = gpio_to_irq(GPIO_OLED_DET);
s3c_gpio_cfgpin(GPIO_OLED_DET, S3C_GPIO_SFN(0xf));
s3c_gpio_setpull(GPIO_OLED_DET, S3C_GPIO_PULL_NONE);
@@ -1384,15 +1401,12 @@
if (request_irq(lcd->irq, oled_det_int, IRQF_TRIGGER_FALLING, "vgh_toggle", 0)) {
pr_err("failed to reqeust irq. %d\n", lcd->irq);
ret = -EINVAL;
goto out_free_backlight;
}
- } else {
- lcd->connected = 0;
- dev_info(&lcd->ld->dev, "panel is not connected\n");
}
return 0;
out_free_backlight:
lcd_device_unregister(lcd->ld);
Code:
--- drivers/video/samsung/s5p-dsim.c 2011-10-20 02:58:50.000000000
+++ drivers/video/samsung/s5p-dsim.c 2011-10-25 17:58:10.000000000
@@ -115,13 +115,13 @@
#define MIPI_CMD_GENERIC_RD_2 0x24
#define MIPI_CMD_DSI_RD_0 0x06
#define MIPI_CMD_DSI_SET_PKT_SZ 0x37
-#define MIPI_RX_TIMEOUT HZ
+#define MIPI_RX_TIMEOUT msecs_to_jiffies(250)
#define DSMI_RX_FIFO_READ_DONE 0x30800002
#define DSIM_MAX_RX_FIFO 20
#define S5P_DSIM_INT_SFR_FIFO_EMPTY 29
#define S5P_DSIM_INT_BTA 25
#define S5P_DSIM_INT_MSK_FRAME_DONE 24
@@ -358,13 +358,13 @@
}
rxhd = readl(reg_base + S5P_DSIM_RXFIFO);
printk("rxhd : %x\n", rxhd);
if ((u8)(rxhd & 0xff) != response) {
printk(KERN_ERR "[DSIM:ERROR]:%s wrong response rxhd : %x, response:%x\n"
- ,__func__, rxhd, response);
+ , __func__, rxhd, response);
goto clear_rx_fifo;
}
// for short packet
if (count <= 2) {
for (i = 0; i < count; i++)
buf[i] = (rxhd >> (8+(i*8))) & 0xff;
@@ -379,21 +379,21 @@
goto clear_rx_fifo;
}
for (i = 0; i < rxsize>>2; i++) {
temp = readl(reg_base + S5P_DSIM_RXFIFO);
printk("pkt : %08x\n", temp);
- for(j=0; j < 4; j++) {
+ for (j = 0; j < 4; j++) {
buf[(i*4)+j] = (u8)(temp>>(j*8))&0xff;
//printk("Value : %02x\n",(temp>>(j*8))&0xff);
}
}
if (rxsize % 4) {
temp = readl(reg_base + S5P_DSIM_RXFIFO);
printk("pkt-l : %08x\n", temp);
- for(j=0; j < rxsize%4; j++) {
+ for (j = 0; j < rxsize%4; j++) {
buf[(i*4)+j] = (u8)(temp>>(j*8))&0xff;
//printk("Value : %02x\n",(temp>>(j*8))&0xff);
}
}
}
@@ -1089,30 +1089,30 @@
writel(int_stat, dsim.reg_base + S5P_DSIM_INTMSK);
}
int s5p_dsim_fifo_clear(void)
{
- int dsim_count=0,ret;
+ int dsim_count = 0, ret;
writel(SwRstRelease, dsim.reg_base + S5P_DSIM_INTSRC);
-
+
writel(DSIM_FUNCRST, dsim.reg_base + S5P_DSIM_SWRST);
- do{
- if(++dsim_count>90000){
- printk("dsim fifo clear fail re_try dsim resume\n");
- ret=0;
+ do {
+ if (++dsim_count > 90000) {
+ printk("dsim fifo clear fail re_try dsim resume\n");
+ ret = 0;
break;
- }
-
- if(readl(dsim.reg_base + S5P_DSIM_INTSRC) & SwRstRelease){
- s5p_dsim_interrupt_mask_set();
- ret=1;
+ }
+
+ if (readl(dsim.reg_base + S5P_DSIM_INTSRC) & SwRstRelease) {
+ s5p_dsim_interrupt_mask_set();
+ ret = 1;
break;
}
- }while(1);
+ } while (1);
return ret;
}
#ifdef CONFIG_HAS_EARLYSUSPEND
void s5p_dsim_early_suspend(void)
@@ -1140,24 +1140,24 @@
if (dsim.mipi_drv->suspend)
dsim.mipi_drv->suspend(dsim.dev, state);
if (dsim.mipi_ddi_pd->lcd_power_on)
dsim.mipi_ddi_pd->lcd_power_on(dsim.dev, 0);
-
+
s5p_dsim_enable_hs_clock(dsim.reg_base, 0);
s5p_dsim_set_clock(dsim.reg_base, dsim.dsim_info->e_byte_clk, 0);
-
+
writel(0xffff, dsim.reg_base + S5P_DSIM_CLKCTRL);
writel(0x0, dsim.reg_base + S5P_DSIM_PLLCTRL);
writel(0x0, dsim.reg_base + S5P_DSIM_PLLTMR);
writel(0x0, dsim.reg_base + S5P_DSIM_PHYACCHR);
- writel(0x0, dsim.reg_base + S5P_DSIM_PHYACCHR1);
+ writel(0x0, dsim.reg_base + S5P_DSIM_PHYACCHR1);
writel(0x1, dsim.reg_base + S5P_DSIM_SWRST);
-
+
clk_disable(dsim.clock);
#if 0
if (dsim.pd->mipi_power)
dsim.pd->mipi_power(0);
else
Code:
--- drivers/video/samsung/s6e8aa0_param.h 2011-10-20 02:58:50.000000000
+++ drivers/video/samsung/s6e8aa0_param.h 2011-10-25 17:58:10.000000000
@@ -66,13 +66,14 @@
static const unsigned char SEQ_APPLY_LEVEL_2_KEY[] = {
0xFC,
0x5A, 0x5A
};
static const unsigned char SEQ_SLEEP_OUT[] = {
- 0x11
+ 0x11,
+ 0x00,0x00
};
static const unsigned char SEQ_PANEL_CONDITION_SET[] = {
0xF8,
0x25, 0x34, 0x00, 0x00, 0x00, 0x95, 0x00, 0x3C, 0x7D, 0x08,
0x27, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00,
@@ -83,13 +84,14 @@
static const unsigned char SEQ_DISPLAY_CONDITION_SET[] = {
0xF2,
0x80, 0x03, 0x0D
};
static const unsigned char SEQ_GAMMA_UPDATE[] = {
- 0xF7, 0x03
+ 0xF7, 0x03,
+ 0x00
};
static const unsigned char SEQ_ETC_SOURCE_CONTROL[] = {
0xF6,
0x00, 0x02, 0x00
};
@@ -116,30 +118,35 @@
0x14, 0x40, 0x0C, 0xCB, 0xCE,
0x6E, 0xC4, 0x0F, 0x40, 0x41,
0xD9, 0x00, 0x00, 0x00
};
static const unsigned char SEQ_DISPLAY_ON[] = {
- 0x29
+ 0x29,
+ 0x00,0x00
};
static const unsigned char SEQ_DISPLAY_OFF[] = {
- 0x28
+ 0x28,
+ 0x00,0x00
};
static const unsigned char SEQ_STANDBY_ON[] = {
- 0x01
+ 0x01,
+ 0x00,0x00
};
static const unsigned char SEQ_ACL_ON[] = {
0xC0, 0x01,
+ 0x00
};
static const unsigned char SEQ_ACL_OFF[] = {
0xC0, 0x00,
+ 0x00
};
static const unsigned char SEQ_ACL_CUTOFF_20[] = {
0xC1,
0x47, 0x53, 0x13, 0x53, 0x00,
0x00, 0x03, 0x1F, 0x00, 0x00,
and they changed to codesourcery for toolchain
+CROSS_COMPILE ?= /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-
Not a massive amount of differences, the screen driver changes looks most interesting to me.
fards said:
and they changed to codesourcery for toolchain
+CROSS_COMPILE ?= /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-
Not a massive amount of differences, the screen driver changes looks most interesting to me.
Click to expand...
Click to collapse
Is there a new kernel source?
Sent from my GT-I9100
yes, kj6 is up,
the diffs are between kj4 and that kj6
to show the file differences (there's also some docs changes but they aren't really needed)
fards said:
yes, kj6 is up,
the diffs are between kj4 and that kj6
to show the file differences (there's also some docs changes but they aren't really needed)
Click to expand...
Click to collapse
Where did you get the kernel source?
https://opensource.samsung.com/index.jsp
search for N7000
I presume the kkx build will be there under the other device code.
fards said:
https://opensource.samsung.com/index.jsp
search for N7000
I presume the kkx build will be there under the other device code.
Click to expand...
Click to collapse
LOL you have the Hong Kong version source code xD
netchip said:
LOL you have the Hong Kong version source code xD
Click to expand...
Click to collapse
kj6 as I said...
to compare against kj4 as 6 is supposed to bring bugfixes..
fards said:
Not a massive amount of differences, the screen driver changes looks most interesting to me.
Click to expand...
Click to collapse
Maybe that diff solves my screen issue.
Just to explain, sometimes my screen does not wake up even if the phone is still running (long pressing the on/off button makes the phone vibrate which means that it is still working) and when I hard reboot it (8 seconds long on/off button press), it restarts and in the battery usage I can see that the phone has been awake for a long time instead of having been idle (when it happens, it is generally during the night).
As I am facing it globally (with both European stock and Hong Kong ROMs), I hope this kernel change corrects it.
The_Steph said:
Maybe that diff solves my screen issue.
Just to explain, sometimes my screen does not wake up even if the phone is still running (long pressing the on/off button makes the phone vibrate which means that it is still working) and when I hard reboot it (8 seconds long on/off button press), it restarts and in the battery usage I can see that the phone has been awake for a long time instead of having been idle (when it happens, it is generally during the night).
As I am facing it globally (with both European stock and Hong Kong ROMs), I hope this kernel change corrects it.
Click to expand...
Click to collapse
I've seen the same thing a couple of times. Still haven't tested the KJ6 kernel to see the effect of those patches yet.
Actually thats spurred me onto testing the KJ6.. Initialtesting suggests Screen powers back up Much quicker from standby
KJ6, where did you get it?
Edit: I have Baseband version N7000XXKJ6 but Kernel N7000ZSKK1. Is is this version you are talking about?
The_Steph said:
KJ6, where did you get it?
Edit: I have Baseband version N7000XXKJ6 but Kernel N7000ZSKK1. Is is this version you are talking about?
Click to expand...
Click to collapse
no there's threads with the kj6 kernel, including the CF root thread.
I've just built kernel with the patches, working well so far.
Basically, what you did is you installed KJ6 kernel, rooted it and install the kernel you built?
If yes, do you mind, allowing me to download the kernel you built in order to use it?

[MOD][GUIDE][v2.0] Sense 4.0 style Multitasking on Stock ICS [Added Reflection]

-----------------------------------------------------------------------------
v1.1 to v2.0
- added thumbnail reflection thanks to D4rKn3sSyS and Neil Davies
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
v1.0 to v1.1
- removed all resources (png files) : for other screen size devices..
- minor layout fixes.
- added landscape layout.
-----------------------------------------------------------------------------
This mod is originally posted on Nexus S theme forum :
[MOD] Sense 4.0 style Multitasking on Stock ICS
Preview :
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This mod is related to SystemUI.apk and framework-res.apk, so making universal version for all devices and all roms is impossible. So here I post my source code for other users..
-----------------------------------------------------------------------------
* Caution : All values are (basically) for HDPI=WVGA devices *
How to :
1) Apply patch(diff).
2) Compile.
3) Done
* diff v2.0 : Download
Code:
diff -rupN ./a/core/res/res/values/dimens.xml ./b/core/res/res/values/dimens.xml
--- ./a/core/res/res/values/dimens.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/core/res/res/values/dimens.xml 2012-04-27 00:22:57.951903000 +0900
@@ -19,9 +19,9 @@
-->
<resources>
<!-- The width that is used when creating thumbnails of applications. -->
- <dimen name="thumbnail_width">120dp</dimen>
+ <dimen name="thumbnail_width">168dp</dimen>
<!-- The height that is used when creating thumbnails of applications. -->
- <dimen name="thumbnail_height">120dp</dimen>
+ <dimen name="thumbnail_height">267dp</dimen>
<!-- The standard size (both width and height) of an application icon that
will be displayed in the app launcher and elsewhere. -->
<dimen name="app_icon_size">48dip</dimen>
diff -rupN ./a/packages/SystemUI/res/drawable/status_bar_recents_background.xml ./b/packages/SystemUI/res/drawable/status_bar_recents_background.xml
--- ./a/packages/SystemUI/res/drawable/status_bar_recents_background.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/drawable/status_bar_recents_background.xml 2012-04-26 19:18:32.766622000 +0900
@@ -16,10 +16,11 @@
* limitations under the License.
*/
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
+<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<gradient name="status_bar_recents_background"
- android:startColor="#e6000000"
- android:endColor="#c0000000"
- android:angle="@integer/status_bar_recents_bg_gradient_degrees"
+ android:type="radial"
+ android:startColor="#ff4a4a4a"
+ android:endColor="#ff080808"
+ android:gradientRadius="400"
/>
</shape>
diff -rupN ./a/packages/SystemUI/res/layout/status_bar_no_recent_apps.xml ./b/packages/SystemUI/res/layout/status_bar_no_recent_apps.xml
--- ./a/packages/SystemUI/res/layout/status_bar_no_recent_apps.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/layout/status_bar_no_recent_apps.xml 2012-04-26 19:54:23.777459000 +0900
@@ -32,5 +32,6 @@
android:text="@string/status_bar_no_recent_apps"
android:gravity="center_horizontal"
android:layout_gravity="center"
+ android:visibility="gone"
/>
</FrameLayout>
diff -rupN ./a/packages/SystemUI/res/layout-land/status_bar_recent_item.xml ./b/packages/SystemUI/res/layout-land/status_bar_recent_item.xml
--- ./a/packages/SystemUI/res/layout-land/status_bar_recent_item.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/layout-land/status_bar_recent_item.xml 2012-05-07 04:53:08.705255000 +0900
@@ -22,55 +22,53 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="wrap_content"
- android:paddingLeft="@dimen/status_bar_recents_item_padding"
- android:paddingRight="@dimen/status_bar_recents_item_padding">
+ android:paddingRight="@dimen/status_bar_recents_item_padding"
+ android:paddingLeft="@dimen/status_bar_recents_item_padding">
<RelativeLayout android:id="@+id/recent_item"
android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:paddingTop="@*android:dimen/status_bar_height">
+ android:paddingTop="@*android:dimen/status_bar_height"
+ android:layout_centerInParent="true">
<FrameLayout android:id="@+id/app_thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:layout_marginTop="@dimen/status_bar_recents_thumbnail_top_margin"
- android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
- android:background="@drawable/recents_thumbnail_bg"
- android:foreground="@drawable/recents_thumbnail_fg"
+ android:layout_centerInParent="true"
+ android:background="#00000000"
+ android:foreground="#00000000"
android:visibility="invisible">
<ImageView android:id="@+id/app_thumbnail_image"
- android:layout_width="@dimen/status_bar_recents_thumbnail_width"
- android:layout_height="@dimen/status_bar_recents_thumbnail_height"
+ android:layout_width="120.0dip"
+ android:layout_height="320.0dip"
+ android:scaleType="centerInside"
/>
</FrameLayout>
<ImageView android:id="@+id/app_icon"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/status_bar_recents_app_icon_top_margin"
- android:layout_marginLeft="@dimen/status_bar_recents_app_icon_left_margin"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:maxWidth="@dimen/status_bar_recents_app_icon_max_width"
- android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
+ android:gravity="center_horizontal"
+ android:layout_marginTop="232.0dip"
+ android:maxWidth="35dp"
+ android:maxHeight="35dp"
android:scaleType="centerInside"
android:adjustViewBounds="true"
/>
<TextView android:id="@+id/app_label"
- android:layout_width="@dimen/status_bar_recents_app_label_width"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textSize="@dimen/status_bar_recents_app_label_text_size"
- android:fadingEdge="horizontal"
- android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
+ android:gravity="center_horizontal"
+ android:textSize="12dip"
+ android:fadingEdge="none"
+ android:fadingEdgeLength="0.0dip"
android:scrollHorizontally="true"
- android:layout_alignLeft="@id/app_thumbnail"
- android:layout_below="@id/app_thumbnail"
- android:layout_marginTop="@dimen/status_bar_recents_text_description_padding"
- android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
+ android:layout_below="@id/app_icon"
+ android:layout_alignParentBottom="true"
+ android:paddingTop="0.0dip"
+ android:layout_marginTop="0.0dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textColor="@color/status_bar_recents_app_label_color"
@@ -80,12 +78,13 @@
android:layout_width="@dimen/status_bar_recents_app_label_width"
android:layout_height="wrap_content"
android:textSize="@dimen/status_bar_recents_app_description_text_size"
- android:fadingEdge="horizontal"
- android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
+ android:fadingEdge="none"
+ android:fadingEdgeLength="0dip"
android:scrollHorizontally="true"
- android:layout_alignLeft="@id/app_thumbnail"
+ android:layout_alignParentBottom="true"
+ android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
android:layout_below="@id/app_label"
- android:layout_marginTop="@dimen/status_bar_recents_text_description_padding"
+ android:layout_marginTop="3.0dip"
android:singleLine="true"
android:ellipsize="marquee"
/>
diff -rupN ./a/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml ./b/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml
--- ./a/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/layout-land/status_bar_recent_panel.xml 2012-04-27 14:05:59.391168000 +0900
@@ -29,27 +29,33 @@
android:background="@drawable/status_bar_recents_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_alignParentBottom="true"
- android:clipToPadding="false"
- android:clipChildren="false">
-
- <com.android.systemui.recent.RecentsHorizontalScrollView android:id="@+id/recents_container"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_marginRight="@dimen/status_bar_recents_right_glow_margin"
- android:divider="@null"
- android:stackFromBottom="true"
- android:fadingEdge="horizontal"
- android:scrollbars="none"
- android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
- android:layout_gravity="bottom|left"
- android:orientation="horizontal"
- android:clipToPadding="false"
- android:clipChildren="false">
+ android:layout_centerVertical="true">
+
+ <ImageView
+ android:gravity="center"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginTop="0.0dip"
+ android:src="@drawable/status_bar_recents_background"
+ />
+
+ <com.android.systemui.recent.RecentsHorizontalScrollView
+ android:id="@+id/recents_container"
+ android:layout_gravity="bottom|left|center"
+ android:scrollbars="none"
+ android:fadingEdge="none"
+ android:fadingEdgeLength="0.0dip"
+ android:clipChildren="false"
+ android:clipToPadding="false"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="0.0dip"
+ android:stackFromBottom="true"
+ android:divider="@null">
<LinearLayout android:id="@+id/recents_linear_layout"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
android:orientation="horizontal"
android:clipToPadding="false"
android:clipChildren="false">
@@ -57,6 +63,16 @@
</com.android.systemui.recent.RecentsHorizontalScrollView>
+ <TextView
+ android:textSize="18.0dip"
+ android:textColor="#ffe5e5e5"
+ android:gravity="center_horizontal"
+ android:layout_marginTop="10.0dip"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/recent_apps_title"
+ />
+
</FrameLayout>
<include layout="@layout/status_bar_no_recent_apps"
diff -rupN ./a/packages/SystemUI/res/layout-port/status_bar_recent_item.xml ./b/packages/SystemUI/res/layout-port/status_bar_recent_item.xml
--- ./a/packages/SystemUI/res/layout-port/status_bar_recent_item.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/layout-port/status_bar_recent_item.xml 2012-05-07 04:31:12.435246000 +0900
@@ -20,69 +20,62 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:paddingTop="@dimen/status_bar_recents_item_padding"
- android:paddingBottom="@dimen/status_bar_recents_item_padding">
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:paddingRight="@dimen/status_bar_recents_item_padding"
+ android:paddingLeft="@dimen/status_bar_recents_item_padding">
<RelativeLayout android:id="@+id/recent_item"
- android:layout_gravity="center_horizontal"
+ android:layout_gravity="center_vertical"
android:layout_height="wrap_content"
- android:layout_width="wrap_content">
+ android:layout_width="wrap_content"
+ android:paddingTop="@*android:dimen/status_bar_height"
+ android:layout_centerInParent="true">
- <TextView android:id="@+id/app_label"
- android:layout_width="@dimen/status_bar_recents_app_label_width"
- android:layout_height="wrap_content"
- android:textSize="@dimen/status_bar_recents_app_label_text_size"
- android:fadingEdge="horizontal"
- android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
- android:scrollHorizontally="true"
- android:layout_alignParentLeft="true"
- android:layout_alignTop="@id/app_icon"
- android:paddingTop="2dp"
- android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:textColor="@color/status_bar_recents_app_label_color"
- />
<FrameLayout android:id="@+id/app_thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_toRightOf="@id/app_label"
- android:layout_marginLeft="@dimen/status_bar_recents_thumbnail_left_margin"
- android:background="@drawable/recents_thumbnail_bg"
- android:foreground="@drawable/recents_thumbnail_fg"
+ android:layout_centerInParent="true"
+ android:background="#00000000"
+ android:foreground="#00000000"
android:visibility="invisible">
<ImageView android:id="@+id/app_thumbnail_image"
- android:layout_width="@dimen/status_bar_recents_thumbnail_width"
- android:layout_height="@dimen/status_bar_recents_thumbnail_height"
+ android:paddingTop="60dip"
+ android:layout_marginTop="30.0dip"
+ android:layout_width="212.0dip"
+ android:layout_height="455.0dip"
+ android:scaleType="centerInside"
/>
</FrameLayout>
- <View android:id="@+id/recents_callout_line"
- android:layout_width="@dimen/status_bar_recents_app_label_width"
- android:layout_height="1dip"
- android:layout_alignParentLeft="true"
- android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
- android:layout_toLeftOf="@id/app_thumbnail"
- android:layout_below="@id/app_label"
- android:layout_marginRight="3dip"
- android:layout_marginTop="3dip"
- android:background="@drawable/recents_callout_line"
- />
<ImageView android:id="@+id/app_icon"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_toRightOf="@id/app_label"
- android:layout_marginLeft="@dimen/status_bar_recents_app_icon_left_margin"
- android:layout_marginTop="@dimen/status_bar_recents_app_icon_top_margin"
+ android:gravity="center_horizontal"
+ android:layout_marginTop="405.0dip"
android:maxWidth="@dimen/status_bar_recents_app_icon_max_width"
android:maxHeight="@dimen/status_bar_recents_app_icon_max_height"
android:scaleType="centerInside"
android:adjustViewBounds="true"
/>
+ <TextView android:id="@+id/app_label"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
+ android:textSize="@dimen/status_bar_recents_app_label_text_size"
+ android:fadingEdge="none"
+ android:fadingEdgeLength="0.0dip"
+ android:scrollHorizontally="true"
+ android:layout_below="@id/app_icon"
+ android:layout_alignParentBottom="true"
+ android:paddingTop="0.0dip"
+ android:layout_marginTop="3.0dip"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:textColor="@color/status_bar_recents_app_label_color"
+ />
+
<TextView android:id="@+id/app_description"
android:layout_width="@dimen/status_bar_recents_app_label_width"
android:layout_height="wrap_content"
@@ -90,10 +83,10 @@
android:fadingEdge="horizontal"
android:fadingEdgeLength="@dimen/status_bar_recents_fading_edge_length"
android:scrollHorizontally="true"
- android:layout_alignParentLeft="true"
+ android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin"
- android:layout_below="@id/recents_callout_line"
- android:layout_marginTop="3dip"
+ android:layout_below="@id/app_label"
+ android:layout_marginTop="40.0dip"
android:singleLine="true"
android:ellipsize="marquee"
/>
diff -rupN ./a/packages/SystemUI/res/layout-port/status_bar_recent_panel.xml ./b/packages/SystemUI/res/layout-port/status_bar_recent_panel.xml
--- ./a/packages/SystemUI/res/layout-port/status_bar_recent_panel.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/layout-port/status_bar_recent_panel.xml 2012-04-27 14:11:39.881175000 +0900
@@ -29,31 +29,49 @@
android:background="@drawable/status_bar_recents_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_alignParentBottom="true">
+ android:layout_centerVertical="true">
- <com.android.systemui.recent.RecentsVerticalScrollView
- android:id="@+id/recents_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginRight="0dp"
- android:divider="@null"
- android:stackFromBottom="true"
- android:fadingEdge="vertical"
- android:scrollbars="none"
- android:fadingEdgeLength="@*android:dimen/status_bar_height"
- android:layout_gravity="bottom|left"
- android:clipToPadding="false"
- android:clipChildren="false">
+ <ImageView
+ android:gravity="center"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginTop="0.0dip"
+ android:src="@drawable/status_bar_recents_background"
+ />
+
+ <com.android.systemui.recent.RecentsHorizontalScrollView
+ android:id="@+id/recents_container"
+ android:layout_gravity="bottom|left|center"
+ android:scrollbars="none"
+ android:fadingEdge="none"
+ android:fadingEdgeLength="0.0dip"
+ android:clipChildren="false"
+ android:clipToPadding="false"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="0.0dip"
+ android:stackFromBottom="true"
+ android:divider="@null">
<LinearLayout android:id="@+id/recents_linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
+ android:orientation="horizontal"
android:clipToPadding="false"
android:clipChildren="false">
</LinearLayout>
- </com.android.systemui.recent.RecentsVerticalScrollView>
+ </com.android.systemui.recent.RecentsHorizontalScrollView>
+
+ <TextView
+ android:textSize="20.0dip"
+ android:textColor="#ffe5e5e5"
+ android:gravity="center_horizontal"
+ android:layout_marginTop="45.0dip"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/recent_apps_title"
+ />
</FrameLayout>
diff -rupN ./a/packages/SystemUI/res/values/colors.xml ./b/packages/SystemUI/res/values/colors.xml
--- ./a/packages/SystemUI/res/values/colors.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/values/colors.xml 2012-04-26 19:46:08.367467000 +0900
@@ -22,8 +22,8 @@
<drawable name="notification_item_background_color_pressed">#ff257390</drawable>
<drawable name="ticker_background_color">#ff1d1d1d</drawable>
<drawable name="status_bar_background">#ff000000</drawable>
- <drawable name="status_bar_recents_background_solid">#b3000000</drawable>
- <drawable name="status_bar_recents_app_thumbnail_background">#88000000</drawable>
+ <drawable name="status_bar_recents_background_solid">#00000000</drawable>
+ <drawable name="status_bar_recents_app_thumbnail_background">#00000000</drawable>
<color name="status_bar_recents_app_label_color">#ffffffff</color>
<drawable name="status_bar_notification_row_background_color">#ff090909</drawable>
<drawable name="notification_header_bg">#FF000000</drawable>
diff -rupN ./a/packages/SystemUI/res/values/config.xml ./b/packages/SystemUI/res/values/config.xml
--- ./a/packages/SystemUI/res/values/config.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/values/config.xml 2012-04-26 20:20:19.237457000 +0900
@@ -27,7 +27,7 @@
<!-- Whether recents thumbnails should stretch in both x and y to fill their
ImageView -->
- <bool name="config_recents_thumbnail_image_fits_to_xy">false</bool>
+ <bool name="config_recents_thumbnail_image_fits_to_xy">true</bool>
<!-- Control whether status bar should distinguish HSPA data icon form UMTS
data icon on devices -->
diff -rupN ./a/packages/SystemUI/res/values/dimens.xml ./b/packages/SystemUI/res/values/dimens.xml
--- ./a/packages/SystemUI/res/values/dimens.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/values/dimens.xml 2012-04-26 20:31:54.317462000 +0900
@@ -21,9 +21,9 @@
<!-- Recent Applications parameters -->
<!-- Upper width limit for application icon -->
- <dimen name="status_bar_recents_app_icon_max_width">48dp</dimen>
+ <dimen name="status_bar_recents_app_icon_max_width">42dp</dimen>
<!-- Upper height limit for application icon -->
- <dimen name="status_bar_recents_app_icon_max_height">48dp</dimen>
+ <dimen name="status_bar_recents_app_icon_max_height">42dp</dimen>
<!-- Size of application thumbnail -->
<dimen name="status_bar_recents_thumbnail_width">164dp</dimen>
diff -rupN ./a/packages/SystemUI/res/values/strings.xml ./b/packages/SystemUI/res/values/strings.xml
--- ./a/packages/SystemUI/res/values/strings.xml 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/res/values/strings.xml 2012-04-30 10:53:24.049658000 +0900
@@ -377,4 +377,8 @@
<!-- Content description of the clear button in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
<string name="accessibility_clear_all">Clear all notifications.</string>
+
+ <!-- for Sense 4.0 style multitasking mod -->
+ <string name="recent_apps_title">Recent apps</string>
+
</resources>
diff -rupN ./a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java ./b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
--- ./a/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java 2012-04-25 11:31:16.000000000 +0900
+++ ./b/packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java 2012-05-07 04:30:21.215261000 +0900
@@ -24,9 +24,17 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
+import android.graphics.drawable.BitmapDrawable;
import android.graphics.Matrix;
import android.graphics.Shader.TileMode;
-import android.graphics.drawable.BitmapDrawable;
+import android.graphics.Color;
+import android.graphics.Canvas;
+import android.graphics.LinearGradient;
+import android.graphics.Paint;
+import android.graphics.PorterDuffXfermode;
+import android.graphics.Bitmap.Config;
+import android.graphics.PorterDuff.Mode;
+import android.graphics.Shader.TileMode;
import android.net.Uri;
import android.provider.Settings;
import android.util.AttributeSet;
@@ -402,7 +410,32 @@ public class RecentsPanelView extends Re
// Should remove the default image in the frame
// that this now covers, to improve scrolling speed.
// That can't be done until the anim is complete though.
- h.thumbnailViewImage.setImageBitmap(thumbnail);
+ final int reflectionGap = 4;
+ int width = thumbnail.getWidth();
+ int height = thumbnail.getHeight();
+
+ Matrix matrix = new Matrix();
+ matrix.preScale(1, -1);
+
+ Bitmap reflectionImage = Bitmap.createBitmap(thumbnail, 0, height * 2 / 3, width, height/3, matrix, false);
+ Bitmap bitmapWithReflection = Bitmap.createBitmap(width, (height + height/3), Config.ARGB_8888);
+
+ Canvas canvas = new Canvas(bitmapWithReflection);
+ canvas.drawBitmap(thumbnail, 0, 0, null);
+ Paint defaultPaint = new Paint();
+ canvas.drawRect(0, height, width, height + reflectionGap, defaultPaint);
+ canvas.drawBitmap(reflectionImage, 0, height + reflectionGap, null);
+
+ Paint paint = new Paint();
+ LinearGradient shader = new LinearGradient(0, thumbnail.getHeight(), 0,
+ bitmapWithReflection.getHeight() + reflectionGap, 0x70ffffff, 0x00ffffff,
+ TileMode.CLAMP);
+ paint.setShader(shader);
+ paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));
+ canvas.drawRect(0, height, width,
+ bitmapWithReflection.getHeight() + reflectionGap, paint);
+
+ h.thumbnailViewImage.setImageBitmap(bitmapWithReflection);
// scale the image to fill the full width of the ImageView. do this only if
// we haven't set a bitmap before, or if the bitmap size has changed
@@ -410,7 +443,7 @@ public class RecentsPanelView extends Re
h.thumbnailViewImageBitmap.getWidth() != thumbnail.getWidth() ||
h.thumbnailViewImageBitmap.getHeight() != thumbnail.getHeight()) {
if (mFitThumbnailToXY) {
- h.thumbnailViewImage.setScaleType(ScaleType.FIT_XY);
+ h.thumbnailViewImage.setRotationY(25.0f);
} else {
Matrix scaleMatrix = new Matrix();
float scale = mThumbnailWidth / (float) thumbnail.getWidth();
-----------------------------------------------------------------------------
Thanks to brucekey in rootzwiki
(this mod is based on his WEBAOKP mod.)
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
and Thanks to D4rKn3sSyS and Neil Davies
for image reflection source code.
-----------------------------------------------------------------------------
ok but where is the guide, what should we do with these files
Amazing!!will try soon
Sent from my GT-S5830 using xda premium
The download link is broken :|
jun980219 said:
The download link is broken :|
Click to expand...
Click to collapse
OMG Sorry.. All links are fixed now.
TweetyPeety said:
ok but where is the guide, what should we do with these files
Click to expand...
Click to collapse
Apply patch and compile..
Thanks! Its Working great
I made it for Galaxy Sl (http://forum.xda-developers.com/showthread.php?t=1590430)
Keep up the good work!
Sent from my GT-I9000 using XDA
Can't install on CM9 :/
Looks really good though!
This is really cool, already modded for samsung galaxy s2 .
EDIT: Your zip only bricks input method on sgs2, I had to build from sources duh! , anyway its working as it should now
fuss132 said:
Thanks! Its Working great
I made it for Galaxy Sl (http://forum.xda-developers.com/showthread.php?t=1590430)
Keep up the good work!
Sent from my GT-I9000 using XDA
Click to expand...
Click to collapse
Is there any lag on Galaxy S?
Thanks!
evilisto said:
Apply patch and compile..
Click to expand...
Click to collapse
And for those who can only decompile and recompile apks? Any hope for a HOW-TO guide like the WP7 and Chrome mod? I know am pushing it and sorry but your mods are incredible mate
you are the man! genius themer!
Sent from my Galaxy Nexus
been trying but so far can't figure how to push those files
vicino said:
been trying but so far can't figure how to push those files
Click to expand...
Click to collapse
Apply patch(diff) with resources and compile...
by using apktool?
vicino said:
by using apktool?
Click to expand...
Click to collapse
wondering the same thing...what is a diff? how do you use it?
Do I get a cookie?
http://goo.gl/IAaCs
can someone please explain how to do this?
i have quite literally no idea...
kjaved373 said:
http://goo.gl/IAaCs
Click to expand...
Click to collapse
Are you????!!! That's for windows and in case you haven't noticed...this is android.
evilisto, any help with terminal command?
I'm putting:
Code:
patch -p0 -i Sense-4.0-Multitasking.patch
And that returns a hunk error. Any help would be great as I have limited experience with linux (running ubuntu 11)
I think it should be clearly stated in the op that this doesn't work with apktool. You need to compile it from sources.
ezcats said:
Are you????!!! That's for windows and in case you haven't noticed...this is android.
Click to expand...
Click to collapse
In case you haven't noticed... you need to work on your reading comprehension

[MOD][DEV] Motorola style Transparent NavBar [JOP40D]

-----------------------------------------------------------------------------
Updated to v1.1
- add Tablet UI support : Preview
- very minor fixes
-----------------------------------------------------------------------------
This mod is originally posted in Galaxy Nexus theme forum :
[MOD] Moto Style - Transparent Navbar and Modified Launcher
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
-----------------------------------------------------------------------------
* diff for JOP40D : download
Code:
diff -rupN ./a/frameworks/base/packages/SystemUI/res/layout/navigation_bar.xml ./b/frameworks/base/packages/SystemUI/res/layout/navigation_bar.xml
--- ./a/frameworks/base/packages/SystemUI/res/layout/navigation_bar.xml 2012-11-15 06:56:46.284574000 +0900
+++ ./b/frameworks/base/packages/SystemUI/res/layout/navigation_bar.xml 2012-11-26 02:22:33.688340970 +0900
@@ -23,7 +23,7 @@
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
android:layout_height="match_parent"
android:layout_width="match_parent"
- android:background="#FF000000"
+ android:background="#88000000"
>
<FrameLayout android:id="@+id/rot0"
diff -rupN ./a/frameworks/base/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml ./b/frameworks/base/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml
--- ./a/frameworks/base/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml 2012-11-15 06:56:51.254573000 +0900
+++ ./b/frameworks/base/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml 2012-11-26 02:22:45.329174028 +0900
@@ -22,7 +22,7 @@
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
android:layout_height="match_parent"
android:layout_width="match_parent"
- android:background="#FF000000"
+ android:background="#88000000"
>
<FrameLayout android:id="@+id/rot0"
diff -rupN ./a/frameworks/base/packages/SystemUI/res/values/colors.xml ./b/frameworks/base/packages/SystemUI/res/values/colors.xml
--- ./a/frameworks/base/packages/SystemUI/res/values/colors.xml 2012-11-15 06:56:15.354577000 +0900
+++ ./b/frameworks/base/packages/SystemUI/res/values/colors.xml 2012-11-26 02:23:37.219186755 +0900
@@ -19,7 +19,7 @@
<resources>
<drawable name="notification_number_text_color">#ffffffff</drawable>
<drawable name="ticker_background_color">#ff1d1d1d</drawable>
- <drawable name="status_bar_background">#ff000000</drawable>
+ <drawable name="status_bar_background">#88000000</drawable>
<color name="notification_panel_solid_background">#ff000000</color>
<drawable name="status_bar_recents_app_thumbnail_background">#88000000</drawable>
<color name="status_bar_recents_app_label_color">#ffffffff</color>
@@ -31,8 +31,8 @@
<drawable name="notification_header_bg">#FF000000</drawable>
<!-- ==================== system bar only ==================== -->
- <drawable name="system_bar_background">#ff000000</drawable>
+ <drawable name="system_bar_background">#88000000</drawable>
<!-- the darkening filter applied to notifications -->
- <drawable name="notification_icon_area_smoke">#aa000000</drawable>
+ <drawable name="notification_icon_area_smoke">#88000000</drawable>
<color name="notification_panel_scrim_color">#B0000000</color>
</resources>
diff -rupN ./a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java ./b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
--- ./a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java 2012-11-15 06:56:11.314567000 +0900
+++ ./b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java 2012-12-04 03:48:39.654073231 +0900
@@ -410,7 +410,7 @@ public class PhoneStatusBar extends Base
}
// figure out which pixel-format to use for the status bar.
- mPixelFormat = PixelFormat.OPAQUE;
+ mPixelFormat = PixelFormat.TRANSLUCENT;
mSystemIconArea = (LinearLayout) mStatusBarView.findViewById(R.id.system_icon_area);
mStatusIcons = (LinearLayout)mStatusBarView.findViewById(R.id.statusIcons);
@@ -800,7 +800,7 @@ public class PhoneStatusBar extends Base
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
| WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
- PixelFormat.OPAQUE);
+ PixelFormat.TRANSLUCENT);
// this will allow the navbar to run in an overlay on devices that support this
if (ActivityManager.isHighEndGfx()) {
lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
diff -rupN ./a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java ./b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
--- ./a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java 2012-11-15 06:56:20.634573000 +0900
+++ ./b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java 2012-12-04 03:49:10.074070472 +0900
@@ -223,7 +223,7 @@ public class TabletStatusBar extends Bas
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING
| WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
- PixelFormat.OPAQUE);
+ PixelFormat.TRANSLUCENT);
// We explicitly leave FLAG_HARDWARE_ACCELERATED out of the flags. The status bar occupies
// very little screen real-estate and is updated fairly frequently. By using CPU rendering
diff -rupN ./a/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java ./b/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
--- ./a/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java 2012-11-15 06:56:30.065396000 +0900
+++ ./b/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java 2012-11-26 02:17:11.528336640 +0900
@@ -2547,8 +2547,6 @@ public class PhoneWindowManager implemen
systemRect.top = mSystemTop;
systemRect.right = mSystemRight;
systemRect.bottom = mSystemBottom;
- if (mStatusBar != null) return mStatusBar.getSurfaceLayer();
- if (mNavigationBar != null) return mNavigationBar.getSurfaceLayer();
return 0;
}
diff -rupN ./a/packages/apps/Launcher2/res/layout-port/launcher.xml ./b/packages/apps/Launcher2/res/layout-port/launcher.xml
--- ./a/packages/apps/Launcher2/res/layout-port/launcher.xml 2012-11-15 06:56:33.644567000 +0900
+++ ./b/packages/apps/Launcher2/res/layout-port/launcher.xml 2012-11-26 02:13:44.479173944 +0900
@@ -19,7 +19,7 @@
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:id="@+id/drag_layer"
- android:background="@drawable/workspace_bg"
+ android:background="#00000000"
android:layout_width="match_parent"
android:layout_height="match_parent">
diff -rupN ./a/packages/apps/Launcher2/res/values/dimens.xml ./b/packages/apps/Launcher2/res/values/dimens.xml
--- ./a/packages/apps/Launcher2/res/values/dimens.xml 2012-11-15 06:56:36.904569000 +0900
+++ ./b/packages/apps/Launcher2/res/values/dimens.xml 2012-11-26 02:14:58.399175719 +0900
@@ -43,8 +43,8 @@
<dimen name="workspace_divider_padding_right">3dp</dimen>
<dimen name="workspace_divider_padding_top">0dp</dimen>
<dimen name="workspace_divider_padding_bottom">0dp</dimen>
- <dimen name="hotseat_cell_width">64dp</dimen>
- <dimen name="hotseat_cell_height">64dp</dimen>
+ <dimen name="hotseat_cell_width">72dp</dimen>
+ <dimen name="hotseat_cell_height">88dp</dimen>
<dimen name="hotseat_width_gap">-1dp</dimen>
<dimen name="hotseat_height_gap">-1dp</dimen>
<dimen name="workspace_overscroll_drawable_padding">0dp</dimen>
diff -rupN ./a/packages/apps/Launcher2/src/com/android/launcher2/CellLayout.java ./b/packages/apps/Launcher2/src/com/android/launcher2/CellLayout.java
--- ./a/packages/apps/Launcher2/src/com/android/launcher2/CellLayout.java 2012-11-26 02:13:14.109170000 +0900
+++ ./b/packages/apps/Launcher2/src/com/android/launcher2/CellLayout.java 2012-11-26 00:46:51.878340000 +0900
@@ -609,11 +609,7 @@ public class CellLayout extends ViewGrou
BubbleTextView bubbleChild = (BubbleTextView) child;
Resources res = getResources();
- if (mIsHotseat) {
- bubbleChild.setTextColor(res.getColor(android.R.color.transparent));
- } else {
- bubbleChild.setTextColor(res.getColor(R.color.workspace_icon_text_color));
- }
+ bubbleChild.setTextColor(res.getColor(R.color.workspace_icon_text_color));
}
child.setScaleX(getChildrenScale());
diff -rupN ./a/packages/apps/Launcher2/src/com/android/launcher2/Workspace.java ./b/packages/apps/Launcher2/src/com/android/launcher2/Workspace.java
--- ./a/packages/apps/Launcher2/src/com/android/launcher2/Workspace.java 2012-11-26 02:13:06.868336000 +0900
+++ ./b/packages/apps/Launcher2/src/com/android/launcher2/Workspace.java 2012-11-26 00:50:40.238351000 +0900
@@ -43,6 +43,7 @@ import android.os.Build;
import android.os.IBinder;
import android.os.Parcelable;
import android.util.AttributeSet;
+import android.util.DisplayMetrics;
import android.util.Log;
import android.util.SparseArray;
import android.view.Display;
@@ -522,7 +523,7 @@ public class Workspace extends SmoothPag
// Hide folder title in the hotseat
if (child instanceof FolderIcon) {
- ((FolderIcon) child).setTextVisible(false);
+ ((FolderIcon) child).setTextVisible(true);
}
if (screen < 0) {
@@ -837,12 +838,10 @@ public class Workspace extends SmoothPag
}
protected void setWallpaperDimension() {
- Point minDims = new Point();
- Point maxDims = new Point();
- mLauncher.getWindowManager().getDefaultDisplay().getCurrentSizeRange(minDims, maxDims);
-
- final int maxDim = Math.max(maxDims.x, maxDims.y);
- final int minDim = Math.min(minDims.x, minDims.y);
+ DisplayMetrics displayMetrics = new DisplayMetrics();
+ mLauncher.getWindowManager().getDefaultDisplay().getRealMetrics(displayMetrics);
+ final int maxDim = Math.max(displayMetrics.widthPixels, displayMetrics.heightPixels);
+ final int minDim = Math.min(displayMetrics.widthPixels, displayMetrics.heightPixels);
// We need to ensure that there is enough extra space in the wallpaper for the intended
// parallax effects
@@ -971,9 +970,9 @@ public class Workspace extends SmoothPag
class WallpaperOffsetInterpolator {
float mFinalHorizontalWallpaperOffset = 0.0f;
- float mFinalVerticalWallpaperOffset = 0.5f;
+ float mFinalVerticalWallpaperOffset = 0.0f;
float mHorizontalWallpaperOffset = 0.0f;
- float mVerticalWallpaperOffset = 0.5f;
+ float mVerticalWallpaperOffset = 0.0f;
long mLastWallpaperOffsetUpdateTime;
boolean mIsMovingFast;
boolean mOverrideHorizontalCatchupConstant;
* resources : download
-----------------------------------------------------------------------------
I'm a fan of moto's new interface. Good job bro.
welcome back man! i'ts been awhile
transparent Navbar! nice :good:
i think this would be great with my Moto theme lol
Galaxy Nexus AOSP JRO03C ok:good:
Only on the desktop is transparent to other interface or black
Not compatible cm, aokp?, Will stop at the boot screen
you did a great job!
Im sorry for the stupid question but what do i do with this please ?.......yes im a noob :crying:
tibi09 said:
Only on the desktop is transparent to other interface or black
Not compatible cm, aokp?, Will stop at the boot screen
Click to expand...
Click to collapse
Yes, this mod makes navbar and statusbar to semi-transparent on stock launcher's workspace(home screen) only.
If navbar is transparent when using other apps, that will cause many ui problems.. (navbar will overlap some ui elements)
And this patch is for AOSP only, because I'm using stock rom..
But I think making same mod for cm9 or aokp is not much different from this. (but you have to apply patch manually)
Sean_Seany said:
Im sorry for the stupid question but what do i do with this please ?.......yes im a noob :crying:
Click to expand...
Click to collapse
This patch is for someone who know how to compile android on linux. (not difficult at all because there are so many great guides about it )
Apply this patch and compile rom or each files(SystemUI.apk, android.policy.jar and Launcher2.apk). then you can get this mod for your device (or rom).
is this possible on windows?
aooga said:
is this possible on windows?
Click to expand...
Click to collapse
i think yes,but very elaborated without all the change...OP sad the modify at framework,but not these on policy.jar and systemUI..instaed with the inux method,with diff and patch tools you can easily do the mod.i'm linux user from 2 months,but i'm not able to do that.i'm trying right now,i want to do that on codename for gnex,i'll let you say if i have good response on this work!
Updated!
Now transparent navbar is compatible with tablet & phablet(Nexus 7) UI.
And I added 2 more patches for CM10 and Paranoid Android rom.
aooga said:
is this possible on windows?
Click to expand...
Click to collapse
Yes possible but you have to edit each smali and xml files manually.. and sorry I can't be much help about this because I don't have any knowledge about smali..
Looks absolutely fantastic! Will you submit this to cyanogenmod? That would eliminate the need to patch for every nightly
Sent from my GT-I9100 using xda app-developers app
well that sucks...wish there was a really detailed tutorial on how to use these on ubuntu.
EDIT: If i were to give you the systemui.apk, framework-res.apk, and android-policy.jar, could you pleeeeease apply the patch for them?
The all legends of ICS Mods, welcome back. This is totally awesome. Compiled through my aokp workspace and it works fine with aokp. Should make a toggle for this.
after a little search,i got the diff and patch
copy patch file to your source path
run terminal and cd /your/source/path
patch -p2 < PATCHFILENAME
how to use this?
Sent from my GT-P1000 using Tapatalk 2
I am using Codenameandroid so which on should i download?
asvantypography said:
how to use this?
Sent from my GT-P1000 using Tapatalk 2
Click to expand...
Click to collapse
You'll need to patch it using a Java app called 'NetBeans', if you're on linux, you can just compile it together with your aosp sources. (if you have one.)
But where do I put the png's? Applied patch in ~/android/system and all went fine, but I'm not sure where I should put the new navigation bar buttons. And how do I compile single apk's?
New to compiling, used to zip before... :angel:
its very easy to do in Windows, just lost 10 minutes. :good:

app doesn't lanch; java.lang.NullPointerException

Hello,
i am trying to launch my app on a samsung galaxy s3, but the activity doesn't launch
can someone help me?
error:
06-14 08:36:58.720 24601-24601/plopmenzinc.nsapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: plopmenzinc.nsapp, PID: 24601
java.lang.RuntimeException: Unable to start activity ComponentInfo{plopmenzinc.nsapp/plopmenzinc.nsapp.Start}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2436)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495)
at android.app.ActivityThread.access$900(ActivityThread.java:170)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5635)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at plopmenzinc.nsapp.Start.onCreate(Start.java:37)
at android.app.Activity.performCreate(Activity.java:5580)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2400)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495)*
at android.app.ActivityThread.access$900(ActivityThread.java:170)*
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304)*
at android.os.Handler.dispatchMessage(Handler.java:102)*
at android.os.Looper.loop(Looper.java:146)*
at android.app.ActivityThread.main(ActivityThread.java:5635)*
at java.lang.reflect.Method.invokeNative(Native Method)*
at java.lang.reflect.Method.invoke(Method.java:515)*
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)*
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)*
at dalvik.system.NativeStart.main(Native Method)*
start.java:
package plopmenzinc.nsapp;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.nfc.NfcAdapter;
import android.os.CountDownTimer;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageSwitcher;
import android.widget.TextView;
import android.widget.Toast;
public class Start extends AppCompatActivity {
int number = 0;
private ImageSwitcher sw;
public static final String MIME_TEXT_PLAIN = "text/plain";
public static final String TAG = "NfcDemo";
private TextView mTextView;
private NfcAdapter mNfcAdapter;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start);
mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
sw.setImageResource(R.drawable.reclame);
if (mNfcAdapter == null) {
// Stop here, we definitely need NFC
Toast.makeText(this, "U kunt deze functie helaas niet gebruiken, omdat uw toestel geen NFC heeft.", Toast.LENGTH_LONG).show();
finish();
return;
}
if (!mNfcAdapter.isEnabled()) {
mTextView.setText("Om deze functie te gebruiken moet u NFC aanzetten.");
}
handleIntent(getIntent());
}
@override
protected void onResume() {
super.onResume();
/**
* It's important, that the activity is in the foreground (resumed). Otherwise
* an IllegalStateException is thrown.
*/
setupForegroundDispatch(this, mNfcAdapter);
}
@override
protected void onPause() {
/**
* Call this before onPause, otherwise an IllegalArgumentException is thrown as well.
*/
stopForegroundDispatch(this, mNfcAdapter);
super.onPause();
}
@override
protected void onNewIntent(Intent intent) {
/**
* This method gets called, when a new Intent gets associated with the current activity instance.
* Instead of creating a new activity, onNewIntent will be called. For more information have a look
* at the documentation.
*
* In our case this method gets called, when the user attaches a Tag to the device.
*/
handleIntent(intent);
}
private void handleIntent(Intent intent) {
TextView var = (TextView) findViewById(R.id.score);
number++;
String disp = Integer.toString(number);
var.setText(disp);
final TextView CountDown = (TextView) findViewById(R.id.textView3);
new CountDownTimer(300000, 1000) {
public void onTick(long millisUntilFinished) {
CountDown.setText(millisUntilFinished / 1000 + " sec");
}
public void onFinish() {
CountDown.setText("0 sec");
}
}.start();
}
/**
* @param activity The corresponding {@link Activity} requesting the foreground dispatch.
* @param adapter The {@link NfcAdapter} used for the foreground dispatch.
*/
public void setupForegroundDispatch(final Activity activity, NfcAdapter adapter) {
final Intent intent = new Intent(activity.getApplicationContext(), activity.getClass());
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
final PendingIntent pendingIntent = PendingIntent.getActivity(activity.getApplicationContext(), 0, intent, 0);
IntentFilter[] filters = new IntentFilter[1];
String[][] techList = new String[][]{};
// Notice that this is the same filter as in our manifest.
filters[0] = new IntentFilter();
filters[0].addAction(NfcAdapter.ACTION_NDEF_DISCOVERED);
filters[0].addCategory(Intent.CATEGORY_DEFAULT);
try {
filters[0].addDataType(MIME_TEXT_PLAIN);
} catch (IntentFilter.MalformedMimeTypeException e) {
throw new RuntimeException("Check your mime type.");
}
adapter.enableForegroundDispatch(activity, pendingIntent, filters, techList);
}
public void stopForegroundDispatch(final Activity activity, NfcAdapter adapter) {
adapter.disableForegroundDispatch(activity);
}
public void image_next(){
sw.setImageResource(R.drawable.reclame);
}
public void image_prev(){
sw.setImageResource(R.drawable.reclame2);
}
}
activity:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="(link)"
xmlns:tools="(link)"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
androidrientation="vertical"
androidaddingBottom="@dimen/activity_vertical_margin"
androidaddingLeft="@dimen/activity_horizontal_margin"
androidaddingRight="@dimen/activity_horizontal_margin"
androidaddingTop="@dimen/activity_vertical_margin"
tools:context="plopmenzinc.nsapp.Start"
android:saveEnabled="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Uw aantal punten:"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="50dp"
android:singleLine="true"
android:textColor="#FF2646B0"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/disp"
android:id="@+id/score"
android:layout_alignBottom="@+id/textView"
android:layout_toRightOf="@+id/textView"
android:layout_toEndOf="@+id/textView"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tijd tot U weer kunt scannen:"
android:id="@+id/textView2"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="34dp"
android:singleLine="true"
android:textColor="#FF2646B0"
android:textSize="22sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0 sec"
android:id="@+id/textView3"
android:singleLine="true"
android:textSize="22sp"
android:layout_alignTop="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:layout_toEndOf="@+id/textView2" />
<ImageSwitcher
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageSwitcher"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="275dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="prev"
android:id="@+id/button"
android:layout_alignTop="@+id/button2"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="54dp"
android:layout_marginStart="54dp"
androidnClick="image_prev" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="next"
android:id="@+id/button2"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/textView3"
android:layout_alignEnd="@+id/textView3"
androidnClick="image_next" />
</RelativeLayout>
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="(link)"
package="plopmenzinc.nsapp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Start">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.NFC" />
<uses-feature
android:name="android.hardware.nfc"
android:required="true" />
<activity
android:name="net.vrallev.android.nfc.demo.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
</activity>
</manifest>
need to get this finished before thursday, so please help me
Well, thus far I see that you are making references to parts of the Layout View but I am not seeing where you are declaring your TextView / ImageView inside your XML layout, see below:
Code:
sw.setImageResource(R.drawable.reclame);
mTextView.setText("Om deze functie te gebruiken moet u NFC aanzetten.");
You need to have something like:
mTextView = (TextView)findViewbyId(R.id.TextViewId);
sw = (ImageView)findViewById(R.id.ImageViewId);
Fix those, try again and then return.

App crashes, onStart() crashing.

Code:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
protected void onStart(){
super.onStart();
String comments[] = {"Dare 1","Dare 2","Dare 3"};
Random rand = new Random();
int number = rand.nextInt(comments.length);
TextView t = (TextView) findViewById(R.id.msg);
t.setText(comments[number]);
}
public void tf(View view){
Intent myIntent = new Intent(this, TruthFemale.class);
startActivity(myIntent);
}
public void df(View view){
Intent myIntent = new Intent(this, DareFemale.class);
startActivity(myIntent);
}
public void tm(View view){
Intent myIntent = new Intent(this, TruthMale.class);
startActivity(myIntent);
}
public void dm(View view){
Intent myIntent = new Intent(this, DareMale.class);
startActivity(myIntent);
}
Code:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome Press Start"
android:layout_marginTop="51dp"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Truth"
android:id="@+id/btnTruthM"
android:layout_below="@+id/textView"
android:layout_alignParentStart="true"
android:layout_marginTop="89dp"
android:onClick="tm"
android:background="#FF2F48EB" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dare"
android:id="@+id/btnDareM"
android:background="#FF2F48EB"
android:onClick="dm"
android:layout_alignTop="@+id/btnTruthM"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Truth"
android:id="@+id/btnTruthF"
android:layout_marginTop="89dp"
android:background="#e52feb"
android:onClick="tf"
android:layout_below="@+id/btnTruthM"
android:layout_alignParentStart="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dare"
android:id="@+id/btnDareF"
android:background="#e52feb"
android:onClick="df"
android:layout_alignTop="@+id/btnTruthF"
android:layout_alignEnd="@+id/btnDareM" />
When i load the app it just crashes...
Found the issue. I didnt name the textview properly and was crashing because of it. Problem resolved...

Categories

Resources