Added fps/performance checkbox (no functionality yet)
This commit is contained in:
@ -3,6 +3,7 @@ package de.frajul.endlessroll.main.screens;
|
||||
import android.support.annotation.IdRes;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ToggleButton;
|
||||
@ -24,6 +25,8 @@ public class SettingsScreen extends Screen<LinearLayout> implements View.OnClick
|
||||
private TopBar topBar;
|
||||
private ToggleButton musicToggle;
|
||||
private ToggleButton soundToggle;
|
||||
private CheckBox fpsCheckbox;
|
||||
private CheckBox performanceCheckbox;
|
||||
private Button creditsButton;
|
||||
private Button resetButton;
|
||||
|
||||
@ -39,6 +42,10 @@ public class SettingsScreen extends Screen<LinearLayout> implements View.OnClick
|
||||
musicToggle.setOnClickListener(this);
|
||||
soundToggle = (ToggleButton) layout.findViewById(R.id.settings_soundtoggle);
|
||||
soundToggle.setOnClickListener(this);
|
||||
fpsCheckbox = (CheckBox) layout.findViewById(R.id.settings_fps_checkbox);
|
||||
fpsCheckbox.setTypeface(gameActivity.getTypeface());
|
||||
performanceCheckbox = (CheckBox) layout.findViewById(R.id.settings_performance_checkbox);
|
||||
performanceCheckbox.setTypeface(gameActivity.getTypeface());
|
||||
creditsButton = (Button) layout.findViewById(R.id.settings_credits);
|
||||
creditsButton.setOnClickListener(this);
|
||||
resetButton = (Button) layout.findViewById(R.id.settings_reset);
|
||||
@ -63,6 +70,7 @@ public class SettingsScreen extends Screen<LinearLayout> implements View.OnClick
|
||||
|
||||
musicToggle.setChecked(!gameActivity.getSoundManager().isMusicMuted());
|
||||
soundToggle.setChecked(!gameActivity.getSoundManager().isSoundsMuted());
|
||||
//TODO: set fps/performance checkboxes selected
|
||||
resetButton.setEnabled(super.caller != ScreenType.GAME);
|
||||
}
|
||||
|
||||
@ -73,6 +81,7 @@ public class SettingsScreen extends Screen<LinearLayout> implements View.OnClick
|
||||
gameActivity.getDataStorageHandler()
|
||||
.writeMusicMuted(gameActivity.getSoundManager().isMusicMuted());
|
||||
|
||||
//TODO: write fps/performance
|
||||
flipToCaller();
|
||||
}
|
||||
|
||||
|
@ -73,11 +73,13 @@ public class ToolButton {
|
||||
}
|
||||
|
||||
public void update(float frameTime) {
|
||||
boolean showAnimation = true;
|
||||
//TODO: showAnimationBoolean
|
||||
if (progress != 100) {
|
||||
progress += (frameTime) / (toolType
|
||||
.getCurrentUpgradeValue(ToolUpgradeType.COOLDOWN) / 100);
|
||||
progress = Math.min(progress, 100);
|
||||
if (progress == 100)
|
||||
if (progress == 100 && showAnimation)
|
||||
animationView.startAnimation(scaleAnimation);
|
||||
}
|
||||
progressBar.setProgress(100 - (int) progress);
|
||||
|
@ -15,74 +15,113 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/backgrounds_menu_grasslands"
|
||||
android:paddingBottom="20dp"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="20dp">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_music_label"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="20sp"
|
||||
android:text="@string/settings_music"/>
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/settings_musictoggle"
|
||||
android:layout_width="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/xml_selector_music"
|
||||
android:textOff=""
|
||||
android:textOn=""/>
|
||||
<TextView
|
||||
android:id="@+id/settings_music_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="@string/settings_music"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/settings_musictoggle"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/xml_selector_music"
|
||||
android:textOff=""
|
||||
android:textOn=""/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_sounds_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:text="@string/settings_sounds"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/settings_soundtoggle"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/xml_selector_sound"
|
||||
android:textOff=""
|
||||
android:textOn=""/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_sounds_label"
|
||||
<CheckBox
|
||||
android:id="@+id/settings_fps_checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:textSize="20sp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_sounds"/>
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="Show FPS"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/settings_performance_checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Boost performance"
|
||||
android:textSize="20sp"/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/settings_soundtoggle"
|
||||
android:layout_width="40dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_height="40dp"
|
||||
android:background="@drawable/xml_selector_sound"
|
||||
android:textOff=""
|
||||
android:textOn=""/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -8,6 +8,7 @@
|
||||
android:id="@+id/shape_inspector_check_box_image"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:background="@drawable/guis_checkbox_unchecked"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="5dp"/>
|
||||
|
||||
|
Reference in New Issue
Block a user