Skip to content

Commit 84a5ccd

Browse files
committed
Small patch
1 parent 50dce42 commit 84a5ccd

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

src/app/src/main/java/com/helloyanis/rucoycalculator/ui/train/TrainFragment.kt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class TrainFragment : Fragment() {
5959
val repositoryUrl = "https://api.github.com/repos/helloyanis/rucoy-calculator"
6060
GitHubReleaseChecker(requireContext(), repositoryUrl).execute()
6161

62-
binding.tickratehelp.setOnClickListener{
63-
Toast.makeText(context,"It's how many mobs you can hit with 1 power attack", Toast.LENGTH_LONG).show()
62+
binding.tickhelp.setOnClickListener{
63+
Toast.makeText(context,"It's how many mobs you can hit with 1 power attack!", Toast.LENGTH_LONG).show()
6464
}
6565
val trainstylespinner = binding.root.findViewById<Spinner>(R.id.trainstylespinner)
6666
trainstylespinner.setOnItemSelectedListener(object : AdapterView.OnItemSelectedListener {
@@ -138,7 +138,7 @@ class TrainFragment : Fragment() {
138138
updateoutput()
139139
}
140140
})
141-
val editTextTickrate = binding.root.findViewById<EditText>(R.id.tickrate)
141+
val editTextTickrate = binding.root.findViewById<EditText>(R.id.tick)
142142

143143
// Ajoutez un écouteur de texte à votre EditText
144144
editTextTickrate.addTextChangedListener(object : TextWatcher {
@@ -214,8 +214,8 @@ class TrainFragment : Fragment() {
214214
binding.root.findViewById<EditText>(R.id.stat).visibility=View.VISIBLE
215215
binding.root.findViewById<EditText>(R.id.statgoal).visibility=View.GONE
216216
binding.root.findViewById<EditText>(R.id.weaponatk).visibility=View.VISIBLE
217-
binding.root.findViewById<EditText>(R.id.tickrate).visibility=View.GONE
218-
binding.root.findViewById<Button>(R.id.tickratehelp).visibility=View.GONE
217+
binding.root.findViewById<EditText>(R.id.tick).visibility=View.GONE
218+
binding.root.findViewById<Button>(R.id.tickhelp).visibility=View.GONE
219219
binding.root.findViewById<EditText>(R.id.hours).visibility=View.GONE
220220
if (binding.root.findViewById<EditText>(R.id.baselevel).text.toString()!="" && binding.root.findViewById<EditText>(R.id.stat).text.toString()!="" && binding.root.findViewById<EditText>(R.id.weaponatk).text.toString()!="") {
221221
train()
@@ -227,8 +227,8 @@ class TrainFragment : Fragment() {
227227
binding.root.findViewById<EditText>(R.id.stat).visibility=View.VISIBLE
228228
binding.root.findViewById<EditText>(R.id.statgoal).visibility=View.GONE
229229
binding.root.findViewById<EditText>(R.id.weaponatk).visibility=View.VISIBLE
230-
binding.root.findViewById<EditText>(R.id.tickrate).visibility=View.VISIBLE
231-
binding.root.findViewById<Button>(R.id.tickratehelp).visibility=View.VISIBLE
230+
binding.root.findViewById<EditText>(R.id.tick).visibility=View.VISIBLE
231+
binding.root.findViewById<Button>(R.id.tickhelp).visibility=View.VISIBLE
232232
binding.root.findViewById<EditText>(R.id.hours).visibility=View.GONE
233233
if (binding.root.findViewById<EditText>(R.id.baselevel).text.toString()!="" && binding.root.findViewById<EditText>(R.id.stat).text.toString()!="" && binding.root.findViewById<EditText>(R.id.weaponatk).text.toString()!="") {
234234
ptrain()
@@ -240,8 +240,8 @@ class TrainFragment : Fragment() {
240240
binding.root.findViewById<EditText>(R.id.stat).visibility=View.VISIBLE
241241
binding.root.findViewById<EditText>(R.id.statgoal).visibility=View.VISIBLE
242242
binding.root.findViewById<EditText>(R.id.weaponatk).visibility=View.GONE
243-
binding.root.findViewById<EditText>(R.id.tickrate).visibility=View.GONE
244-
binding.root.findViewById<Button>(R.id.tickratehelp).visibility=View.GONE
243+
binding.root.findViewById<EditText>(R.id.tick).visibility=View.GONE
244+
binding.root.findViewById<Button>(R.id.tickhelp).visibility=View.GONE
245245
binding.root.findViewById<EditText>(R.id.hours).visibility=View.VISIBLE
246246
if(binding.root.findViewById<EditText>(R.id.stat).text.toString()!="") {
247247
offline()
@@ -433,7 +433,11 @@ class TrainFragment : Fragment() {
433433
val weaponatk = binding.root.findViewById<EditText>(R.id.weaponatk).text.toString().toDouble()
434434
val base = binding.root.findViewById<EditText>(R.id.baselevel).text.toString().toDouble()
435435
val classtype = binding.root.findViewById<Spinner>(R.id.classspinner).selectedItemPosition
436-
val tick = 4.toDouble() //Change this later
436+
var tick = 4.toDouble()
437+
if(binding.root.findViewById<EditText>(R.id.tick).text.toString()!=""){
438+
tick = binding.root.findViewById<EditText>(R.id.tick).text.toString().toDouble() //Change this later
439+
}
440+
437441
val max_raw_damage: Double
438442
val min_raw_damage: Double
439443

src/app/src/main/res/layout/train.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
app:layout_constraintTop_toBottomOf="@+id/statgoal" />
104104

105105
<EditText
106-
android:id="@+id/tickrate"
106+
android:id="@+id/tick"
107107
android:layout_width="0dp"
108108
android:layout_height="wrap_content"
109109
android:ems="10"
@@ -144,18 +144,18 @@
144144
android:entries="@array/train_methods_array"
145145
android:spinnerMode="dialog"
146146
app:layout_constraintStart_toStartOf="parent"
147-
app:layout_constraintTop_toBottomOf="@+id/tickrate" />
147+
app:layout_constraintTop_toBottomOf="@+id/tick" />
148148

149149
<Button
150-
android:id="@+id/tickratehelp"
150+
android:id="@+id/tickhelp"
151151
android:layout_width="0dp"
152152
android:layout_height="wrap_content"
153153
android:text="@string/tickrate_help"
154154
android:visibility="gone"
155-
app:layout_constraintBottom_toBottomOf="@+id/tickrate"
155+
app:layout_constraintBottom_toBottomOf="@+id/tick"
156156
app:layout_constraintEnd_toEndOf="parent"
157-
app:layout_constraintStart_toEndOf="@+id/tickrate"
158-
app:layout_constraintTop_toTopOf="@+id/tickrate" />
157+
app:layout_constraintStart_toEndOf="@+id/tick"
158+
app:layout_constraintTop_toTopOf="@+id/tick" />
159159

160160
</androidx.constraintlayout.widget.ConstraintLayout>
161161
</ScrollView>

src/app/src/main/res/values/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<string name="weapon_atk">Weapon attack</string>
1010
<string name="stat_goal">Stat goal</string>
1111
<string name="hours">Hours</string>
12-
<string name="tickrate">Tickrate</string>
13-
<string name="tickrate_help">What is tickrate?</string>
12+
<string name="tickrate">Tick (default is 4)</string>
13+
<string name="tickrate_help">What is tick?</string>
1414
<string name="prtain_switch">Power training</string>
1515
<string-array name="classes_array">
1616
<item>Melee</item>

0 commit comments

Comments
 (0)