Compare commits
5 Commits
2e6bf877fe
...
SNFLaunche
| Author | SHA1 | Date | |
|---|---|---|---|
| ad72e265c1 | |||
| 2f7539febb | |||
| c7600b014a | |||
| c7f0f1ef7b | |||
| 724d4cff36 |
@@ -27,6 +27,7 @@
|
||||
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.GET_TASKS"/>
|
||||
<uses-permission
|
||||
android:name="android.permission.INSTALL_PACKAGES"/>
|
||||
<uses-permission android:name="permission.REQUEST_DELETE_PACKAGES" />
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.view.View;
|
||||
import com.android.device.MediaStateChangeObserver;
|
||||
import com.android.eventbaus.MessageEvent;
|
||||
import com.android.util.LogUtils;
|
||||
import com.android.util.SharedPreferencesUtil;
|
||||
import com.ik.mboxlauncher.R;
|
||||
import com.ik.mboxlauncher.ui.base.FragmentActivity;
|
||||
import com.ik.mboxlauncher.ui.fragment.AppsFragment;
|
||||
@@ -73,6 +74,11 @@ public class CategoryActivity extends FragmentActivity {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFragmentsDisableRefreshDataFlag() {
|
||||
FragmentManager.getInstance().pressBackUpdateAllFragmentDisableRefreshDataFlag();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void popBackStackFragment() {
|
||||
|
||||
@@ -94,9 +100,24 @@ public class CategoryActivity extends FragmentActivity {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
onResumeResetDisableFreshDataFlag();
|
||||
}
|
||||
|
||||
private void onResumeResetDisableFreshDataFlag() {
|
||||
if(SharedPreferencesUtil.getSharePrefrencesBoolean(this,SharedPreferencesUtil.CONFIG_RESET_DISABLE_FRESHDATA_FLAG)){
|
||||
SharedPreferencesUtil.setSharePrefrencesBoolean(this,SharedPreferencesUtil.CONFIG_RESET_DISABLE_FRESHDATA_FLAG,false);
|
||||
FragmentManager.getInstance().pressBackUpdateAllFragmentDisableRefreshDataFlag();
|
||||
if(currentFragment!=null){
|
||||
currentFragment.onResumeFragment(new MessageEvent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// public void setPopWindow(int top, int bottom){
|
||||
// public void setPopWindow(int top, int bottom){
|
||||
// View view = this.getWindow().getDecorView();
|
||||
// view.layout(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
// view.setDrawingCacheEnabled(true);
|
||||
@@ -122,6 +143,7 @@ public class CategoryActivity extends FragmentActivity {
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
FragmentManager.getInstance().destory();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@@ -135,9 +157,16 @@ public class CategoryActivity extends FragmentActivity {
|
||||
if(currentFragment.onKeyDown(keyCode,event)){
|
||||
return true;
|
||||
}else {
|
||||
//currentFragment.resetDisableRefreshDataFlag();
|
||||
FragmentManager.getInstance().pressBackUpdateAllFragmentDisableRefreshDataFlag();
|
||||
return super.onKeyDown(keyCode,event);
|
||||
}
|
||||
}
|
||||
if(keyCode==KeyEvent.KEYCODE_HOME){
|
||||
LogUtils.loge("onKeyDown===>KEYCODE_HOME");
|
||||
currentFragment.onDetach();
|
||||
FragmentManager.getInstance().pressBackUpdateAllFragmentDisableRefreshDataFlag();
|
||||
}
|
||||
return super.onKeyDown(keyCode,event);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ik.mboxlauncher.ui;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.util.LogUtils;
|
||||
import com.ik.mboxlauncher.ui.base.BaseFragment;
|
||||
import com.ik.mboxlauncher.ui.base.NotifyInterface;
|
||||
import com.ik.mboxlauncher.ui.fragment.AppsFragment;
|
||||
@@ -55,9 +56,10 @@ public class FragmentManager {
|
||||
|
||||
public static void init(Context context, NotifyInterface notifyInterface){
|
||||
if(mInstance==null){
|
||||
LogUtils.loge("FragmentManager init null");
|
||||
mInstance = new FragmentManager(context,notifyInterface);
|
||||
}
|
||||
|
||||
LogUtils.loge("FragmentManager init end");
|
||||
}
|
||||
|
||||
public static FragmentManager getInstance(){
|
||||
@@ -82,6 +84,25 @@ public class FragmentManager {
|
||||
return null;
|
||||
}
|
||||
public void destory(){
|
||||
// 清空所有 Fragment 引用
|
||||
if(mAppsFragment != null) {
|
||||
mAppsFragment = null;
|
||||
}
|
||||
if(mLocalFragment != null) {
|
||||
mLocalFragment = null;
|
||||
}
|
||||
if(mMainFragment != null) {
|
||||
mMainFragment = null;
|
||||
}
|
||||
if(mMusicFragment != null) {
|
||||
mMusicFragment = null;
|
||||
}
|
||||
if(mRecommendFragment != null) {
|
||||
mRecommendFragment = null;
|
||||
}
|
||||
if(mVideoFragment != null) {
|
||||
mVideoFragment = null;
|
||||
}
|
||||
mInstance = null;
|
||||
}
|
||||
|
||||
@@ -91,4 +112,34 @@ public class FragmentManager {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
//按返回键 home键 等必须恢复 刷新数据处理
|
||||
public void pressBackUpdateAllFragmentDisableRefreshDataFlag(){
|
||||
if(mAppsFragment!=null){
|
||||
mAppsFragment.resetDisableRefreshDataFlag();
|
||||
}else {
|
||||
LogUtils.loge("mAppsFragment==null");
|
||||
}
|
||||
if(mLocalFragment!=null){
|
||||
mLocalFragment.resetDisableRefreshDataFlag();
|
||||
}else {
|
||||
LogUtils.loge("mLocalFragment==null");
|
||||
}
|
||||
if(mVideoFragment!=null){
|
||||
mVideoFragment.resetDisableRefreshDataFlag();
|
||||
}else {
|
||||
LogUtils.loge("mVideoFragment==null");
|
||||
}
|
||||
if(mMusicFragment!=null){
|
||||
mMusicFragment.resetDisableRefreshDataFlag();
|
||||
}else {
|
||||
LogUtils.loge("mMusicFragment==null");
|
||||
}
|
||||
if(mRecommendFragment!=null){
|
||||
mRecommendFragment.resetDisableRefreshDataFlag();
|
||||
}else {
|
||||
LogUtils.loge("mRecommendFragment==null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -293,6 +293,10 @@ public class Launcher extends FragmentActivity implements SplashView.SplashAdLi
|
||||
|
||||
ADSWindowManager.init(this);
|
||||
bindAdsWindowMultiView();
|
||||
//内存不足时释放单列所有Fragment 打开设置按Home出现单个Fragment异常
|
||||
if(FragmentManager.getInstance()!=null){
|
||||
FragmentManager.getInstance().destory();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -711,6 +715,7 @@ public boolean onGenericMotionEvent(MotionEvent event) {
|
||||
displayStatus();
|
||||
}else if(MessageEvent.ACTION_UPADATE_APPS_SOURCE.equals(event.action)){
|
||||
if(currentFragment!=null&¤tFragment instanceof AppsFragment){
|
||||
LogUtils.loge("Launcher onMessageEvent===>"+event.action);
|
||||
currentFragment.onResumeFragment(event);
|
||||
}
|
||||
|
||||
@@ -718,6 +723,11 @@ public boolean onGenericMotionEvent(MotionEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFragmentsDisableRefreshDataFlag() {
|
||||
|
||||
}
|
||||
|
||||
private void displayStatus() {
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
@@ -880,7 +890,7 @@ public boolean onGenericMotionEvent(MotionEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
translateAnimation.setDuration(380);
|
||||
translateAnimation.setDuration(300);
|
||||
translateAnimation.setFillAfter(true);
|
||||
content_view.startAnimation(translateAnimation);
|
||||
|
||||
@@ -897,11 +907,12 @@ public boolean onGenericMotionEvent(MotionEvent event) {
|
||||
cuttentModel = MODEL_NORMAL;
|
||||
LogUtils.loge("coustom_view.getHeight():"+coustom_view.getLayoutParams().height);
|
||||
TranslateAnimation translateAnimation = new TranslateAnimation(0.0f, 0.0f,(float)(0 - coustom_view.getLayoutParams().height - gv_shortcut.getHeight()),0.0f);
|
||||
translateAnimation.setDuration(380);
|
||||
translateAnimation.setDuration(300);
|
||||
translateAnimation.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
coustom_view.setTranslationZ(0);
|
||||
grid_coustom_apps.disScrollFocus();
|
||||
loadShortAppList();
|
||||
coustom_view.clearFocus();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.ik.mboxlauncher.ui;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
@@ -18,6 +20,7 @@ import com.android.nebulasdk.AppManager;
|
||||
import com.android.util.EventBusType;
|
||||
import com.android.util.LogManager;
|
||||
import com.android.util.LogUtils;
|
||||
import com.android.util.SharedPreferencesUtil;
|
||||
import com.ik.mboxlauncher.SystemService;
|
||||
|
||||
import java.util.List;
|
||||
@@ -102,10 +105,39 @@ public class StartupBroadcast extends BroadcastReceiver {
|
||||
break;
|
||||
}
|
||||
EventBusUtils.postMsg(messageEvent);
|
||||
|
||||
if(!isTopAppPackage(context)){
|
||||
LogUtils.loge("three app activity on top of layer");
|
||||
boolean sharePrefrencesBoolean = SharedPreferencesUtil.getSharePrefrencesBoolean(context, SharedPreferencesUtil.CONFIG_RESET_DISABLE_FRESHDATA_FLAG);
|
||||
if(!sharePrefrencesBoolean){
|
||||
SharedPreferencesUtil.setSharePrefrencesBoolean(context,SharedPreferencesUtil.CONFIG_RESET_DISABLE_FRESHDATA_FLAG,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取顶层应用的包名
|
||||
* @param context 上下文
|
||||
* @return 顶层应用包名,如果获取失败返回 null
|
||||
*/
|
||||
public static boolean isTopAppPackage(Context context) {
|
||||
try {
|
||||
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
if (activityManager != null) {
|
||||
List<ActivityManager.RunningTaskInfo> runningTasks = activityManager.getRunningTasks(1);
|
||||
if (runningTasks != null && !runningTasks.isEmpty()) {
|
||||
ActivityManager.RunningTaskInfo taskInfo = runningTasks.get(0);
|
||||
ComponentName topActivity = taskInfo.topActivity;
|
||||
LogUtils.loge("topActivity packagename: " + topActivity.getPackageName());
|
||||
return topActivity.getPackageName().equalsIgnoreCase(context.getPackageName());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtils.loge("Error getting top app package name: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定包名应用的Launcher Activity信息
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.android.eventbaus.MessageEvent;
|
||||
import com.android.util.LogUtils;
|
||||
|
||||
/** A fragment which slides when it is entering/exiting. */
|
||||
public abstract class BaseFragment extends Fragment {
|
||||
@@ -38,6 +39,8 @@ public abstract class BaseFragment extends Fragment {
|
||||
protected static final int MODEL_NORMAL = 0x00;
|
||||
protected static final int MODEL_CUSTOM = 0x01;
|
||||
protected int cuttentModel=MODEL_NORMAL;
|
||||
private View view;
|
||||
|
||||
public NotifyInterface getNotifyInterface() {
|
||||
return notifyInterface;
|
||||
}
|
||||
@@ -110,7 +113,12 @@ public abstract class BaseFragment extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(
|
||||
LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(getLayoutResourceId(), container, false);
|
||||
if(view==null){
|
||||
view = inflater.inflate(getLayoutResourceId(), container, false);
|
||||
LogUtils.loge("onCreateView()==>view=null"+getClass().getSimpleName());
|
||||
}else {
|
||||
LogUtils.loge("onCreateView()==>view!=null"+getClass().getSimpleName());
|
||||
}
|
||||
initView( view);
|
||||
handler.post(inidataRunnable);
|
||||
return view;
|
||||
@@ -152,7 +160,7 @@ public abstract class BaseFragment extends Fragment {
|
||||
protected abstract void initView(View view);
|
||||
protected abstract void initData();
|
||||
|
||||
|
||||
public abstract void resetDisableRefreshDataFlag();
|
||||
@Override
|
||||
public void setEnterTransition(Transition transition) {
|
||||
super.setEnterTransition(transition);
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.app.FragmentTransaction;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.android.eventbaus.MessageEvent;
|
||||
import com.android.util.LogUtils;
|
||||
|
||||
|
||||
/**
|
||||
@@ -42,16 +43,19 @@ public abstract class FragmentActivity extends BaseActivity implements NotifyInt
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(getlayoutId());
|
||||
if (savedInstanceState == null) {
|
||||
LogUtils.loge("savedInstanceState===>null");
|
||||
showInitialFragment();
|
||||
} else {
|
||||
mShowInitialFragment = false;
|
||||
LogUtils.loge("savedInstanceState===>not null");
|
||||
}
|
||||
mFragmentManager = getFragmentManager();
|
||||
initView();
|
||||
initData();
|
||||
// Show initial fragment only when the saved state is not restored, because the last
|
||||
// fragment is restored if savesInstanceState is not null.
|
||||
if (savedInstanceState == null) {
|
||||
showInitialFragment();
|
||||
} else {
|
||||
mShowInitialFragment = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -95,10 +99,11 @@ public abstract class FragmentActivity extends BaseActivity implements NotifyInt
|
||||
protected FragmentTransaction showFragment(Fragment fragment, boolean addToBackStack) {
|
||||
currentFragment = (BaseFragment) fragment;
|
||||
currentFragment.setNotifyInterface(this);
|
||||
LogUtils.loge("showFragment===>mFragmentManager1");
|
||||
if (mFragmentManager == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
LogUtils.loge("showFragment===>mFragmentManager2");
|
||||
FragmentTransaction ft = mFragmentManager.beginTransaction();
|
||||
// ft.setCustomAnimations(
|
||||
// R.anim.slide_left_in,
|
||||
@@ -128,6 +133,7 @@ public abstract class FragmentActivity extends BaseActivity implements NotifyInt
|
||||
}
|
||||
if (!fragment.isAdded()) {
|
||||
ft.replace(getFramlayoutId(), fragment, tag).commit();
|
||||
LogUtils.loge("showFragment===>replace");
|
||||
} else {
|
||||
ft.show(fragment).commit();
|
||||
}
|
||||
@@ -139,7 +145,9 @@ public abstract class FragmentActivity extends BaseActivity implements NotifyInt
|
||||
@Override
|
||||
public void onMessageEvent(MessageEvent event) {
|
||||
super.onMessageEvent(event);
|
||||
// if(MessageEvent.ACTION_UPADATE_DATA_SOURCE.equals(event.action)){
|
||||
if(MessageEvent.ACTION_UPADATE_APPS_SOURCE.equals(event.action)){
|
||||
setFragmentsDisableRefreshDataFlag();
|
||||
}
|
||||
// 更新UI
|
||||
if(currentFragment!=null){
|
||||
currentFragment.onResumeFragment(event);
|
||||
@@ -147,7 +155,7 @@ public abstract class FragmentActivity extends BaseActivity implements NotifyInt
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public abstract void setFragmentsDisableRefreshDataFlag();
|
||||
protected boolean isShowDisplay() {
|
||||
int count = mFragmentManager.getBackStackEntryCount();
|
||||
if (count > 0) {
|
||||
|
||||
@@ -153,7 +153,10 @@ public abstract class CategoryFragment extends BaseFragment implements AppnetCal
|
||||
mCategoryAppPresenter.loadAppByCategory(category);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void resetDisableRefreshDataFlag() {
|
||||
disableFreshData=false;
|
||||
}
|
||||
|
||||
protected abstract void toNextPage();
|
||||
|
||||
|
||||
@@ -135,9 +135,10 @@ public class MainFragment extends BaseFragment implements ShortAppInfoAdapter.On
|
||||
ADSWindowManager.getInstance().startVideo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetDisableRefreshDataFlag() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("UnsafeOptInUsageError")
|
||||
|
||||
@@ -161,6 +161,7 @@ public class RecommendFragment extends CategoryFragment {
|
||||
@Override
|
||||
public void onResumeFragment(MessageEvent event) {
|
||||
super.onResumeFragment(event);
|
||||
disableFreshData=false;
|
||||
loadAppInfoByCategory(AppManager.CATEGORY_RECOMMEND);//重新加载数据
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ public class VideoFragment extends CategoryFragment {
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
LogUtils.loge("VideoFragment===>initData()");
|
||||
loadAppInfoByCategory(AppManager.CATEGORY_VIDEO);
|
||||
}
|
||||
|
||||
@@ -160,6 +161,7 @@ public class VideoFragment extends CategoryFragment {
|
||||
@Override
|
||||
public void onResumeFragment(MessageEvent event) {
|
||||
super.onResumeFragment(event);
|
||||
LogUtils.loge("VideoFragment===>onResumeFragment()");
|
||||
disableFreshData=false;
|
||||
loadAppInfoByCategory(AppManager.CATEGORY_VIDEO);//重新加载数据
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.res.TypedArray;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.FocusFinder;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -227,7 +228,7 @@ public class CustomRecyclerViewer extends RecyclerView {
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
|
||||
// int keyCode = event.getKeyCode();
|
||||
int keyCode = event.getKeyCode();
|
||||
// if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_UP) {
|
||||
// long current = System.currentTimeMillis();
|
||||
// boolean res;
|
||||
@@ -240,32 +241,40 @@ public class CustomRecyclerViewer extends RecyclerView {
|
||||
// return res;
|
||||
// }
|
||||
//
|
||||
if(keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_UP) {
|
||||
|
||||
// View focusedView = getFocusedChild(); // 获取当前获得焦点的view
|
||||
// View nextFocusView;
|
||||
// try {
|
||||
// if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
|
||||
// // 通过findNextFocus获取下一个需要得到焦点的view
|
||||
// nextFocusView = FocusFinder.getInstance().findNextFocus(this, focusedView, View.FOCUS_DOWN);
|
||||
// } else {
|
||||
// // 通过findNextFocus获取下一个需要得到焦点的view
|
||||
// nextFocusView = FocusFinder.getInstance().findNextFocus(this, focusedView, View.FOCUS_UP);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// LogUtils.loge("nextFocusView===>"+nextFocusView);
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// nextFocusView = null;
|
||||
// }
|
||||
//
|
||||
// // 如果获取失败(也就是说需要交给系统来处理焦点, 消耗掉事件,不让系统处理, 并让先前获取焦点的view获取焦点)
|
||||
// if (nextFocusView == null) {
|
||||
// focusedView.requestFocus();
|
||||
// return true;
|
||||
//
|
||||
// }
|
||||
|
||||
View focusedView = getFocusedChild(); // 获取当前获得焦点的view
|
||||
View nextFocusView;
|
||||
try {
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
|
||||
// 通过findNextFocus获取下一个需要得到焦点的view
|
||||
nextFocusView = FocusFinder.getInstance().findNextFocus(this, focusedView, View.FOCUS_DOWN);
|
||||
} else {
|
||||
// 通过findNextFocus获取下一个需要得到焦点的view
|
||||
nextFocusView = FocusFinder.getInstance().findNextFocus(this, focusedView, View.FOCUS_UP);
|
||||
}
|
||||
|
||||
|
||||
LogUtils.loge("nextFocusView===>" + nextFocusView);
|
||||
|
||||
} catch (Exception e) {
|
||||
nextFocusView = null;
|
||||
}
|
||||
|
||||
// 如果获取失败(也就是说需要交给系统来处理焦点, 消耗掉事件,不让系统处理, 并让先前获取焦点的view获取焦点)
|
||||
if (nextFocusView == null) {
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) {
|
||||
focusedView.requestFocus(View.FOCUS_DOWN);
|
||||
}
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_UP) {
|
||||
focusedView.requestFocus(View.FOCUS_UP);
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
// }
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -129,6 +129,10 @@ public class TvRecyclerView extends RecyclerView {
|
||||
LogUtils.loge("TvRecyclerView gainFocus="+gainFocus);
|
||||
}
|
||||
}
|
||||
//防止失去焦点还是会继续滚动再度获取焦点
|
||||
public void disScrollFocus(){
|
||||
hasResetFocus=false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFocus() {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SharedPreferencesUtil {
|
||||
|
||||
public static final String CONFIG_LOCAL_BOOKMARK_APP="config_local_bookmark_app";//本地配置 收藏夹
|
||||
public static final String CONFIG_NET_DEFEND_BOOKMARK_APP="config_net_defend_bookmark_app";//网络隔离 收藏夹
|
||||
|
||||
public static final String CONFIG_RESET_DISABLE_FRESHDATA_FLAG="config_reset_disable_freshdata_flag";//重置设备禁止刷新数据为true可刷新
|
||||
public static String getSharePrefrencesString(Context context,String key){
|
||||
SharedPreferences sharedPreferences=context.getSharedPreferences(SHARE_NAME,0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user