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);
|
||||
}
|
||||
|
||||
|
17
app/src/main/res/drawable/xml_background_dialog_button.xml
Normal file
17
app/src/main/res/drawable/xml_background_dialog_button.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="false">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="@android:color/white"/>
|
||||
<stroke android:width="1dp" android:color="@android:color/black"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="2dp"/>
|
||||
<solid android:color="#e9e9e9"/>
|
||||
<stroke android:width="1dp" android:color="@android:color/black"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="0dp" />
|
||||
<solid
|
||||
android:color="@android:color/white"/>
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="#ff6f00" />
|
||||
</shape>
|
41
app/src/main/res/layout/exit_confirm_dialog.xml
Normal file
41
app/src/main/res/layout/exit_confirm_dialog.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/xml_background_exit_confirm_dialog">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exit_confirm_dialog_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exit_confirm_dialog_question"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<Button
|
||||
android:id="@+id/exit_confirm_dialog_yes_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:layout_marginRight="1dp"
|
||||
style="@style/DialogButton"
|
||||
android:text="@string/exit_confirm_dialog_yes"/>
|
||||
<Button
|
||||
android:id="@+id/exit_confirm_dialog_no_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAlignment="center"
|
||||
style="@style/DialogButton"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exit_confirm_dialog_no"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -3,8 +3,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/levelup_mainlayout"
|
||||
android:background="@drawable/backgrounds_menu_levelup">
|
||||
android:background="@color/background_levelup_message">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -2,7 +2,7 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/backgrounds_menu_shortmenu">
|
||||
android:background="@color/background_short_menu">
|
||||
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
|
@ -3,7 +3,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/backgrounds_menu_levelup">
|
||||
android:background="@color/background_levelup_message">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -12,12 +12,13 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/task_completed_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/task_completed"
|
||||
android:textColor="#ffae00"
|
||||
android:textSize="60sp"
|
||||
android:textSize="45sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="-10dp"/>
|
||||
|
||||
@ -28,7 +29,7 @@
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/placeholder_textview"
|
||||
android:textColor="#ffe100"
|
||||
android:textSize="50sp"
|
||||
android:textSize="35sp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
|
||||
|
@ -17,4 +17,6 @@
|
||||
<color name="countdown3">#f0f41e02</color>
|
||||
<color name="countdown2">#f0f28117</color>
|
||||
<color name="countdown1">#f0d7b106</color>
|
||||
<color name="background_levelup_message">#9d000000</color>
|
||||
<color name="background_short_menu">#5b000000</color>
|
||||
</resources>
|
||||
|
@ -88,6 +88,10 @@
|
||||
<string name="tool_upgrade_force">Force</string>
|
||||
<string name="tool_upgrade_value_max">Max.</string>
|
||||
|
||||
<string name="exit_confirm_dialog_yes">Yes</string>
|
||||
<string name="exit_confirm_dialog_no">No</string>
|
||||
<string name="exit_confirm_dialog_question">Do you really want to exit the game?</string>
|
||||
|
||||
<string name="tutorial_placeholder">This is a multiline placeholder\nfor all the tutorials I made!!!\nAwesome! - Isn\'t it?</string>
|
||||
<string name="tutorial_welcome">Welcome to Endless Roll!\nHave fun!</string>
|
||||
<string name="tutorial_toolbar">This is the toolbar. Here you can select the tool you currently want to use.</string>
|
||||
|
@ -15,6 +15,12 @@
|
||||
<item name="android:shadowRadius">2</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogButton" parent="android:Widget.Holo.Button.Borderless">
|
||||
<item name="android:background">@drawable/xml_background_dialog_button</item>
|
||||
<item name="android:textColor">@android:color/black</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
</style>
|
||||
|
||||
<style name="TutorialTextView">
|
||||
<item name="android:background">@drawable/xml_background_tutorialtextview</item>
|
||||
<item name="android:textColor">#000000</item>
|
||||
|
Reference in New Issue
Block a user