Skip to content

Commit da55c4f

Browse files
committed
Remove LoadingBadgeFragment shifting when FPS counter is displayed
Many crashes are recorded due to early `ResourceManager` call at `onLoadView`. Don't really want to spend any more time to fix this, just let them overlap - it's temporary anyway.
1 parent eb13060 commit da55c4f

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

res/layout/loading_badge_fragment.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
tools:background="#FFF">
99

1010
<LinearLayout
11-
android:id="@+id/container"
1211
android:layout_width="wrap_content"
1312
android:layout_height="wrap_content"
1413
android:layout_margin="16dp"

src/com/osudroid/ui/v1/LoadingBadgeFragment.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
package com.osudroid.ui.v1
22

33
import android.view.View
4-
import android.widget.LinearLayout
5-
import android.widget.RelativeLayout
64
import android.widget.TextView
7-
import androidx.core.view.updateLayoutParams
85
import com.edlplan.ui.fragment.BaseFragment
96
import com.google.android.material.progressindicator.CircularProgressIndicator
10-
import com.reco1l.toolkt.android.dp
11-
import kotlin.math.roundToInt
12-
import ru.nsu.ccfit.zuev.osu.Config
13-
import ru.nsu.ccfit.zuev.osu.ResourceManager
147
import ru.nsu.ccfit.zuev.osuplus.R
158

169
class LoadingBadgeFragment : BaseFragment() {
@@ -64,22 +57,6 @@ class LoadingBadgeFragment : BaseFragment() {
6457
}
6558

6659
override fun onLoadView() {
67-
findViewById<LinearLayout>(R.id.container)!!.updateLayoutParams<RelativeLayout.LayoutParams> {
68-
var fpsHeight = 0
69-
70-
if (Config.isShowFPS()) {
71-
val font = ResourceManager.getInstance().getFont("smallFont")
72-
73-
if (font != null) {
74-
val scale = resources.displayMetrics.widthPixels.toFloat() / Config.getRES_WIDTH()
75-
76-
fpsHeight = ((font.lineHeight + 4f) * scale).roundToInt()
77-
}
78-
}
79-
80-
bottomMargin = 16f.dp.roundToInt() + fpsHeight
81-
}
82-
8360
progressView = findViewById(R.id.progress)!!
8461
messageView = findViewById(R.id.message)!!
8562
textView = findViewById(R.id.text)!!

0 commit comments

Comments
 (0)