/
BirdLeon
/
ROBLOX2016
Обзор
Документация
Войти
/
BirdLeon
/
ROBLOX2016
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
Android/NativeShell/src/com/roblox/client/ReclickableTabHost.java
38 строк
1 KB
PatoFlamejanteTV
full source code
19 дек 2024, 19:11
19 дек 2024, 19:11
05db15d
Код
Авторство
О чём код?
package com.roblox.client; import android.app.Fragment; import android.content.Context; import android.util.AttributeSet; import android.widget.TabHost; public class ReclickableTabHost extends TabHost { private ActivityNativeMain mMainReference = null; public ReclickableTabHost(Context context) { super(context); } public ReclickableTabHost(Context context, AttributeSet attrs) { super(context, attrs); } // We created this wrapper class so we can capture every click on a tab button. // The default tab host only fires the listener if we click on a different tab // than the currently active one. @Override public void setCurrentTab(int index) { if (index == getCurrentTab()) { Fragment currentFrag = mMainReference.getTabContents().get(index); if(currentFrag instanceof RobloxWebFragment) { ((RobloxWebFragment) currentFrag).loadDefaultUrl(); return; } } super.setCurrentTab(index); } public void setActivityRef(ActivityNativeMain ref) { mMainReference = ref; } }