Skip to content

Commit

Permalink
Update MainActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirosakiMio committed Aug 19, 2024
1 parent b957239 commit 19e1595
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
22 changes: 6 additions & 16 deletions FCL/src/main/java/com/tungsten/fcl/activity/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.RelativeLayout
import androidx.appcompat.app.AlertDialog
import androidx.core.view.forEach
import androidx.databinding.DataBindingUtil
import com.tungsten.fcl.R
import com.tungsten.fcl.databinding.ActivityMainBinding
Expand Down Expand Up @@ -77,8 +78,8 @@ class MainActivity : FCLActivity(), OnSelectListener, View.OnClickListener {

bind.background.background = ThemeEngine.getInstance().getTheme().getBackground(this)

Skin.registerDefaultSkinLoader { type: Skin.Type? ->
when (type) {
Skin.registerDefaultSkinLoader {
when (it) {
Skin.Type.ALEX -> return@registerDefaultSkinLoader Skin::class.java.getResourceAsStream(
"/assets/img/alex.png"
)
Expand Down Expand Up @@ -289,20 +290,9 @@ class MainActivity : FCLActivity(), OnSelectListener, View.OnClickListener {
}

fun refreshMenuView(view: FCLMenuView?) {
bind.apply {
val views = arrayOf(
home,
manage,
download,
controller,
multiplayer,
setting
)

for (v in views) {
if (v !== view) {
v.isSelected = false
}
bind.menu.forEach {
if (it is FCLMenuView && it != view) {
it.isSelected = false
}
}
}
Expand Down
1 change: 1 addition & 0 deletions FCL/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
app:layout_constraintStart_toStartOf="parent">

<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/menu"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:paddingTop="10dp"
Expand Down

0 comments on commit 19e1595

Please sign in to comment.