Do not show "Change device config" button at all, if startup button timeout is 0

This commit is contained in:
pelya
2012-09-17 15:57:43 +03:00
parent 17ea07d39d
commit 58ea082bd5
2 changed files with 21 additions and 18 deletions

View File

@@ -97,23 +97,26 @@ public class MainActivity extends Activity
_layout2 = new LinearLayout(this); _layout2 = new LinearLayout(this);
_layout2.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); _layout2.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
_btn = new Button(this); if( Globals.StartupMenuButtonTimeout > 0 )
_btn.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
_btn.setText(getResources().getString(R.string.device_change_cfg));
class onClickListener implements View.OnClickListener
{ {
public MainActivity p; _btn = new Button(this);
onClickListener( MainActivity _p ) { p = _p; } _btn.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
public void onClick(View v) _btn.setText(getResources().getString(R.string.device_change_cfg));
{ class onClickListener implements View.OnClickListener
setUpStatusLabel(); {
System.out.println("libSDL: User clicked change phone config button"); public MainActivity p;
Settings.showConfig(p, false); onClickListener( MainActivity _p ) { p = _p; }
} public void onClick(View v)
}; {
_btn.setOnClickListener(new onClickListener(this)); setUpStatusLabel();
System.out.println("libSDL: User clicked change phone config button");
Settings.showConfig(p, false);
}
};
_btn.setOnClickListener(new onClickListener(this));
_layout2.addView(_btn); _layout2.addView(_btn);
}
_layout.addView(_layout2); _layout.addView(_layout2);

View File

@@ -602,8 +602,8 @@ int main(int argc, char* argv[])
r.x = SCREEN_W/2 + screenjoy[0] * SCREEN_H / 65536; r.x = SCREEN_W/2 + screenjoy[0] * SCREEN_H / 65536;
r.y = SCREEN_H/2 + screenjoy[1] * SCREEN_H / 65536; r.y = SCREEN_H/2 + screenjoy[1] * SCREEN_H / 65536;
//__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Screen joystick: %d %d screen %d %d", screenjoy[0], screenjoy[1], r.x, r.y); //__android_log_print(ANDROID_LOG_INFO, "Ballfield", "Screen joystick: %d %d screen %d %d", screenjoy[0], screenjoy[1], r.x, r.y);
r.w = 6; r.w = 10;
r.h = 6; r.h = 10;
r.x -= r.w/2; r.x -= r.w/2;
r.y -= r.h/2; r.y -= r.h/2;
SDL_FillRect(screen, &r, 0x000000); SDL_FillRect(screen, &r, 0x000000);