-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from danielgomezrico/master
v1.0.1
- Loading branch information
Showing
23 changed files
with
341 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.makingiants.android.banjotuner"> | ||
package="com.makingiants.android.banjotuner"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@drawable/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme"> | ||
<meta-data | ||
android:name="com.google.android.gms.version" | ||
android:value="@integer/google_play_services_version" /> | ||
<application | ||
android:allowBackup="true" | ||
android:icon="@drawable/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme"> | ||
<meta-data | ||
android:name="com.google.android.gms.version" | ||
android:value="@integer/google_play_services_version"/> | ||
|
||
<activity | ||
android:name="com.google.android.gms.ads.AdActivity" | ||
android:theme="@android:style/Theme.Translucent" | ||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /> | ||
<activity | ||
android:name="com.google.android.gms.ads.AdActivity" | ||
android:theme="@android:style/Theme.Translucent" | ||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/> | ||
|
||
<activity | ||
android:name=".EarActivity" | ||
android:label="@string/app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<activity | ||
android:name=".EarActivity" | ||
android:label="@string/app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
app/src/main/java/com/makingiants/android/banjotuner/TouchDrawLayout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package com.makingiants.android.banjotuner; | ||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.graphics.Bitmap; | ||
import android.graphics.BitmapFactory; | ||
import android.graphics.Canvas; | ||
import android.util.AttributeSet; | ||
import android.util.DisplayMetrics; | ||
import android.util.Log; | ||
import android.widget.RelativeLayout; | ||
|
||
/** | ||
* Helps to draw a bitmap on footprintX,footprintY positions when shouldPaintTouchBitmap | ||
* variable is set to true | ||
* <p/> | ||
* Created by danielgomez22 on 2/7/15. | ||
*/ | ||
public class TouchDrawLayout extends RelativeLayout { | ||
|
||
private boolean shouldPaintTouchBitmap = false; | ||
private Bitmap rightFeetBitmap, leftFeetBitmap; | ||
private float footprintX, footprintY = 100; | ||
private float middleScreenVertical; | ||
|
||
//<editor-fold desc="Constructors"> | ||
|
||
public TouchDrawLayout(Context context) { | ||
super(context); | ||
init(); | ||
} | ||
|
||
public TouchDrawLayout(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
init(); | ||
} | ||
|
||
public TouchDrawLayout(Context context, AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
init(); | ||
} | ||
|
||
private void init() { | ||
inflate(getContext(), R.layout.empty_relative_layout, this); | ||
rightFeetBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ear_ic_right); | ||
leftFeetBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ear_ic_left); | ||
|
||
DisplayMetrics dm = new DisplayMetrics(); | ||
((Activity) getContext()).getWindowManager().getDefaultDisplay().getMetrics(dm); | ||
middleScreenVertical = dm.widthPixels / 2; | ||
} | ||
|
||
//</editor-fold> | ||
|
||
//<editor-fold desc="Activity Overrides"> | ||
|
||
@Override | ||
protected void dispatchDraw(Canvas canvas) { | ||
super.dispatchDraw(canvas); | ||
|
||
if (shouldPaintTouchBitmap) { | ||
|
||
Log.d("ASD", footprintX + " " + middleScreenVertical); | ||
if (footprintX < middleScreenVertical) { | ||
canvas.drawBitmap(leftFeetBitmap, footprintX, footprintY, null); | ||
} else { | ||
canvas.drawBitmap(rightFeetBitmap, footprintX, footprintY, null); | ||
} | ||
} | ||
|
||
} | ||
|
||
//</editor-fold> | ||
|
||
public void setTouch(float x, float y) { | ||
this.footprintX = x - (leftFeetBitmap.getWidth() / 2); | ||
this.footprintY = y - (leftFeetBitmap.getHeight() / 2); | ||
invalidate(); | ||
} | ||
|
||
public boolean isShouldPaintTouchBitmap() { | ||
return shouldPaintTouchBitmap; | ||
} | ||
|
||
public void setShouldPaintTouchBitmap(boolean shouldPaintTouchBitmap) { | ||
this.shouldPaintTouchBitmap = shouldPaintTouchBitmap; | ||
invalidate(); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.