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() {
|
||||
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);
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.reicast.emulator.GL2JNIView.EmuThread;
|
|||
import android.content.SharedPreferences;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.net.Uri;
|
||||
|
@ -46,6 +47,10 @@ public class GL2JNIActivity extends Activity {
|
|||
|
||||
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) {
|
||||
ImageButton but = new ImageButton(this);
|
||||
|
||||
|
@ -63,8 +68,8 @@ public class GL2JNIActivity extends Activity {
|
|||
// LinearLayout layout = new LinearLayout(this);
|
||||
|
||||
// tv = new TextView(this);
|
||||
|
||||
params = new LayoutParams(80, 80);
|
||||
int p = getPixelsFromDp(60, this);
|
||||
params = new LayoutParams(p, p);
|
||||
|
||||
// layout.setOrientation(LinearLayout.VERTICAL);
|
||||
// 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 (editVjoyMode) {
|
||||
selectedVjoyElement = 5;Log.w("selcted", "anal"); // Analog
|
||||
selectedVjoyElement = 5; // Analog
|
||||
resetEditMode();
|
||||
} else {
|
||||
vjoy[j+1][0]=x-vjoy[j+1][2]/2;
|
||||
|
@ -534,6 +534,7 @@ class GL2JNIView extends GLSurfaceView
|
|||
{
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
selectedVjoyElement = -1;
|
||||
reset_analog();
|
||||
anal_id=-1;
|
||||
rv=0xFFFF;
|
||||
|
|
Loading…
Reference in New Issue