Skip to content

Commit

Permalink
Update gradle version
Browse files Browse the repository at this point in the history
  • Loading branch information
virresh committed Aug 14, 2021
1 parent 0790b94 commit 72d2aaa
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ All kinds of contributions are welcome. Two ways of contributing:

# Credits
Thanks to EVA Facial Mouse for open sourcing their code. I've taken lots of ideas from their codebase. You can check them out at https://github.com/cmauri/eva_facial_mouse
Thanks to @sweenwolf for making this app work on remotes with less buttons, and for the app icons and fully transparent cursor images
Thanks to @sweenwolf for making this app work on remotes with less buttons, and for the app icons and fully transparent cursor images
Thanks to TechDoctorUK for making a demo video
Thanks to @hotcereal_twitter for providing more cursor images. [Link](https://gitter.im/virresh/community?at=6102e7b0d8381a2a839bbcfd).

# Disclaimer
Please note that this project in no way, shape or form is sponsored by anybody. It's a fully independent project with generous folks contributing to it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,33 @@ public class IconStyleSpinnerAdapter extends ArrayAdapter<String> {
private final List<String> objects;
private Context context;
public static Map<String, Integer> textToResourceIdMap = new HashMap<String, Integer>();
public static Map<String, Integer> textToOffsetX = new HashMap<String, Integer>();
public static Map<String, Integer> textToOffsetY = new HashMap<String, Integer>();

static {
textToResourceIdMap.put("Default", R.drawable.pointer);
textToOffsetX.put("Default", 0);
textToOffsetY.put("Default", 0);

textToResourceIdMap.put("Light", R.drawable.pointer_light);
textToOffsetX.put("Light", 0);
textToOffsetY.put("Light", 0);

textToResourceIdMap.put("Dark", R.drawable.pointer_mac);
textToOffsetX.put("Dark", 8);
textToOffsetY.put("Dark", 6);

textToResourceIdMap.put("Orb", R.drawable.light_orb);
textToOffsetX.put("Orb", 54);
textToOffsetY.put("Orb", 52);

textToResourceIdMap.put("Orb Dark", R.drawable.dark_orb);
textToOffsetX.put("Orb Dark", 54);
textToOffsetY.put("Orb Dark", 52);

textToResourceIdMap.put("Hand", R.drawable.finger_mac);
textToOffsetX.put("Hand", 56);
textToOffsetY.put("Hand", 10);
}

public IconStyleSpinnerAdapter(@NonNull Context context, int resource, int textViewId, @NonNull List<String> objects) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class MouseCursorView extends View {
private int pointerDrawableReference;
private int pointerSizeReference;

private int pointerOffsetX;
private int pointerOffsetY;

public MouseCursorView(Context context) {
super(context);
setWillNotDraw(false);
Expand All @@ -45,7 +48,10 @@ private void setBitmap(Context context) {

public void updateFromPreferences() {
Context ctx = getContext();
pointerDrawableReference = IconStyleSpinnerAdapter.textToResourceIdMap.getOrDefault(Helper.getMouseIconPref(ctx), R.drawable.pointer);
String iconStr = Helper.getMouseIconPref(ctx);
pointerDrawableReference = IconStyleSpinnerAdapter.textToResourceIdMap.getOrDefault(iconStr, R.drawable.pointer);
pointerOffsetX = IconStyleSpinnerAdapter.textToOffsetX.getOrDefault(iconStr, 0);
pointerOffsetY = IconStyleSpinnerAdapter.textToOffsetY.getOrDefault(iconStr, 0);
pointerSizeReference = Helper.getMouseSizePref(ctx) + 1;
setBitmap(getContext());
}
Expand All @@ -54,7 +60,7 @@ public void updateFromPreferences() {
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
mPaintBox.setAlpha(DEFAULT_ALPHA);
canvas.drawBitmap(mPointerBitmap, mPointerLocation.x, mPointerLocation.y, mPaintBox);
canvas.drawBitmap(mPointerBitmap, mPointerLocation.x - 50 * pointerSizeReference * pointerOffsetX / 209, mPointerLocation.y - 50 * pointerSizeReference * pointerOffsetY / 209, mPaintBox);
}

public void updatePosition(PointF p) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:7.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip

0 comments on commit 72d2aaa

Please sign in to comment.