Created really leave-dialog
Fixed bugs
This commit is contained in:
@ -21,7 +21,7 @@ public class ToolUpgrade {
|
||||
|
||||
public float getValueAtLevel(int level, int maxLevel) {
|
||||
float step = (last - first) / ((float) maxLevel - 1);
|
||||
return first + level * step;
|
||||
return first + (level - 1) * step;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,49 @@
|
||||
package de.frajul.endlessroll.views;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import de.frajul.endlessroll.R;
|
||||
import de.frajul.endlessroll.main.GameActivity;
|
||||
|
||||
/**
|
||||
* Created by Julian on 31.10.2017.
|
||||
*/
|
||||
|
||||
public class ExitConfirmDialog extends Dialog implements View.OnClickListener {
|
||||
|
||||
private GameActivity gameActivity;
|
||||
private Button yesButton;
|
||||
private Button noButton;
|
||||
|
||||
public ExitConfirmDialog(GameActivity gameActivity) {
|
||||
super(gameActivity);
|
||||
this.gameActivity = gameActivity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.exit_confirm_dialog);
|
||||
TextView textView = (TextView) findViewById(R.id.exit_confirm_dialog_textview);
|
||||
textView.setTypeface(gameActivity.getTypeface());
|
||||
noButton = (Button) findViewById(R.id.exit_confirm_dialog_no_button);
|
||||
noButton.setTypeface(gameActivity.getTypeface());
|
||||
noButton.setOnClickListener(this);
|
||||
yesButton = (Button) findViewById(R.id.exit_confirm_dialog_yes_button);
|
||||
yesButton.setTypeface(gameActivity.getTypeface());
|
||||
yesButton.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
if (v.equals(yesButton))
|
||||
gameActivity.exitGame();
|
||||
}
|
||||
}
|
@ -46,6 +46,8 @@ public class TaskCompletedMessage implements View.OnClickListener, BountyMessage
|
||||
layout.setVisibility(View.GONE);
|
||||
textView = (TextView) layout.findViewById(R.id.task_completed_text);
|
||||
textView.setTypeface(typeface);
|
||||
TextView title = (TextView) layout.findViewById(R.id.task_completed_title);
|
||||
title.setTypeface(typeface);
|
||||
messagesLayout = (LinearLayout) layout.findViewById(R.id.task_completed_unlock_list);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user