Back button menu icon scaling according to DP, this partially fixes issue #85
Fixed a touch issue in edit mode Some cleanup...
This commit is contained in:
parent
1b8322aa92
commit
050f30a274
|
@ -40,7 +40,8 @@ public class EditVJoyActivity extends Activity {
|
||||||
|
|
||||||
void createPopup() {
|
void createPopup() {
|
||||||
popUp = new PopupWindow(this);
|
popUp = new PopupWindow(this);
|
||||||
params = new LayoutParams(80, 80);
|
int p = GL2JNIActivity.getPixelsFromDp(60, this);
|
||||||
|
params = new LayoutParams(p, p);
|
||||||
|
|
||||||
LinearLayout hlay = new LinearLayout(this);
|
LinearLayout hlay = new LinearLayout(this);
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import com.reicast.emulator.GL2JNIView.EmuThread;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -46,6 +47,10 @@ public class GL2JNIActivity extends Activity {
|
||||||
|
|
||||||
int map[][];
|
int map[][];
|
||||||
|
|
||||||
|
public static int getPixelsFromDp(float dps, Context context) {
|
||||||
|
return (int) (dps * context.getResources().getDisplayMetrics().density + 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
View addbut(int x, OnClickListener ocl) {
|
View addbut(int x, OnClickListener ocl) {
|
||||||
ImageButton but = new ImageButton(this);
|
ImageButton but = new ImageButton(this);
|
||||||
|
|
||||||
|
@ -63,8 +68,8 @@ public class GL2JNIActivity extends Activity {
|
||||||
// LinearLayout layout = new LinearLayout(this);
|
// LinearLayout layout = new LinearLayout(this);
|
||||||
|
|
||||||
// tv = new TextView(this);
|
// tv = new TextView(this);
|
||||||
|
int p = getPixelsFromDp(60, this);
|
||||||
params = new LayoutParams(80, 80);
|
params = new LayoutParams(p, p);
|
||||||
|
|
||||||
// layout.setOrientation(LinearLayout.VERTICAL);
|
// layout.setOrientation(LinearLayout.VERTICAL);
|
||||||
// tv.setText("Hi this is a sample text for popup window");
|
// tv.setText("Hi this is a sample text for popup window");
|
||||||
|
|
|
@ -461,7 +461,7 @@ class GL2JNIView extends GLSurfaceView
|
||||||
if(vjoy[j][4]==-3)
|
if(vjoy[j][4]==-3)
|
||||||
{
|
{
|
||||||
if (editVjoyMode) {
|
if (editVjoyMode) {
|
||||||
selectedVjoyElement = 5;Log.w("selcted", "anal"); // Analog
|
selectedVjoyElement = 5; // Analog
|
||||||
resetEditMode();
|
resetEditMode();
|
||||||
} else {
|
} else {
|
||||||
vjoy[j+1][0]=x-vjoy[j+1][2]/2;
|
vjoy[j+1][0]=x-vjoy[j+1][2]/2;
|
||||||
|
@ -534,15 +534,16 @@ class GL2JNIView extends GLSurfaceView
|
||||||
{
|
{
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
case MotionEvent.ACTION_CANCEL:
|
case MotionEvent.ACTION_CANCEL:
|
||||||
|
selectedVjoyElement = -1;
|
||||||
reset_analog();
|
reset_analog();
|
||||||
anal_id=-1;
|
anal_id=-1;
|
||||||
rv=0xFFFF;
|
rv=0xFFFF;
|
||||||
rt[0]=0;
|
rt[0]=0;
|
||||||
lt[0]=0;
|
lt[0]=0;
|
||||||
lt_id=-1;
|
lt_id=-1;
|
||||||
rt_id=-1;
|
rt_id=-1;
|
||||||
for(int j=0;j<vjoy.length;j++)
|
for(int j=0;j<vjoy.length;j++)
|
||||||
vjoy[j][5]=0;
|
vjoy[j][5]=0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionEvent.ACTION_POINTER_UP:
|
case MotionEvent.ACTION_POINTER_UP:
|
||||||
|
|
Loading…
Reference in New Issue