Skip to content

Commit

Permalink
Added possibility to change the style of lock pattern screen (1/2)
Browse files Browse the repository at this point in the history
Patch set #1: Added hdpi resources.
Patch set #2: Added ldpi & mdpi resources.
Patch set #3: Corrected whitespaces.
Patch set #4: Separate option in Settings.

Change-Id: I5138885cf71cb39fd95f4c501ab1a69b01bfad27
  • Loading branch information
djMesias authored and nadlabak committed Jun 8, 2012
1 parent 2cb4320 commit dfbfd81
Show file tree
Hide file tree
Showing 47 changed files with 41 additions and 5 deletions.
6 changes: 6 additions & 0 deletions core/java/android/provider/Settings.java
Expand Up @@ -2641,6 +2641,12 @@ public static void setShowGTalkServiceStatus(ContentResolver cr, boolean flag) {
*/
public static final String RINGLOCK_STYLE_PREF = "ringlock_style_pref";

/**
* Sets the pattern style
* @hide
*/
public static final String PATTERN_STYLE_PREF = "pattern_style_pref";

/**
* Pulse the Trackball with Screen On. The value is boolean (1 or 0).
* @hide
Expand Down
40 changes: 35 additions & 5 deletions core/java/com/android/internal/widget/LockPatternView.java
Expand Up @@ -35,6 +35,8 @@
import android.os.Parcelable;
import android.os.SystemClock;
import android.os.Vibrator;
import android.provider.CmSystem.RinglockStyle;
import android.provider.Settings;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
Expand Down Expand Up @@ -274,11 +276,39 @@ public LockPatternView(Context context, AttributeSet attrs) {
mPathPaint.setStrokeCap(Paint.Cap.ROUND);

// lot's of bitmaps!
mBitmapBtnDefault = getBitmapFor(R.drawable.btn_code_lock_default);
mBitmapBtnTouched = getBitmapFor(R.drawable.btn_code_lock_touched);
mBitmapCircleDefault = getBitmapFor(R.drawable.indicator_code_lock_point_area_default);
mBitmapCircleGreen = getBitmapFor(R.drawable.indicator_code_lock_point_area_green);
mBitmapCircleRed = getBitmapFor(R.drawable.indicator_code_lock_point_area_red);
int ringlockStyle = Settings.System.getInt(getContext().getContentResolver(),
Settings.System.PATTERN_STYLE_PREF, RinglockStyle.getIdByStyle(RinglockStyle.Bubble));

switch (RinglockStyle.getStyleById(ringlockStyle)) {
case Revamped:
mBitmapBtnDefault = getBitmapFor(R.drawable.btn_code_lock_default_rev);
mBitmapBtnTouched = getBitmapFor(R.drawable.btn_code_lock_touched_rev);
mBitmapCircleDefault = getBitmapFor(R.drawable.indicator_code_lock_point_area_default_rev);
mBitmapCircleGreen = getBitmapFor(R.drawable.indicator_code_lock_point_area_green_rev);
mBitmapCircleRed = getBitmapFor(R.drawable.indicator_code_lock_point_area_red_rev);
break;
case Holo:
mBitmapBtnDefault = getBitmapFor(R.drawable.btn_code_lock_default_holo);
mBitmapBtnTouched = getBitmapFor(R.drawable.btn_code_lock_touched_holo);
mBitmapCircleDefault = getBitmapFor(R.drawable.indicator_code_lock_point_area_default_holo);
mBitmapCircleGreen = getBitmapFor(R.drawable.indicator_code_lock_point_area_green_holo);
mBitmapCircleRed = getBitmapFor(R.drawable.indicator_code_lock_point_area_red_holo);
break;
case Blade:
mBitmapBtnDefault = getBitmapFor(R.drawable.btn_code_lock_default_blade);
mBitmapBtnTouched = getBitmapFor(R.drawable.btn_code_lock_touched_blade);
mBitmapCircleDefault = getBitmapFor(R.drawable.indicator_code_lock_point_area_default_blade);
mBitmapCircleGreen = getBitmapFor(R.drawable.indicator_code_lock_point_area_green_blade);
mBitmapCircleRed = getBitmapFor(R.drawable.indicator_code_lock_point_area_red_blade);
break;
default:
mBitmapBtnDefault = getBitmapFor(R.drawable.btn_code_lock_default);
mBitmapBtnTouched = getBitmapFor(R.drawable.btn_code_lock_touched);
mBitmapCircleDefault = getBitmapFor(R.drawable.indicator_code_lock_point_area_default);
mBitmapCircleGreen = getBitmapFor(R.drawable.indicator_code_lock_point_area_green);
mBitmapCircleRed = getBitmapFor(R.drawable.indicator_code_lock_point_area_red);
break;
}

mBitmapArrowGreenUp = getBitmapFor(R.drawable.indicator_code_lock_drag_direction_green_up);
mBitmapArrowRedUp = getBitmapFor(R.drawable.indicator_code_lock_drag_direction_red_up);
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dfbfd81

Please sign in to comment.