tag list refresh error

Vim 插件 modirytaglist 使用介绍
本文介绍了 Vim 编辑器中的 modirytaglist.vim 插件用法,包括如何通过该插件自定义刷新文件折叠功能等。文章提供了具体的函数示例代码,有助于用户更好地理解并应用此插件。

modiry taglist.vim

at the beginning of the file

add

" sunyongjie

function! s:Tlist_Refresh_Folds()

    if g:Tlist_Show_One_File

        return

    endif

    let winnum = bufwinnr(g:TagList_title)

endfunction

" sunyongjie

 

copy and paste maybe not work

 

type those word is a good choice

package com.oplus.engineermode.anti.anticase.lcd; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; import com.oplus.engineermode.R; import com.oplus.engineermode.aging.agingcase.foreground.lcd.LCDAgingDisplaySwitchCallback; import com.oplus.engineermode.aging.agingcase.foreground.lcd.LCDAgingView; import com.oplus.engineermode.aging.constant.LCDAgingImageName; import com.oplus.engineermode.aging.setting.activity.lcd.LcdDisplayScheduleItem; import com.oplus.engineermode.anti.anticase.AntiCaseBase; import com.oplus.engineermode.core.sdk.impl.KeyguardManagerWrapper; import com.oplus.engineermode.core.sdk.utils.Log; import com.oplus.engineermode.core.sdk.utils.SystemUiVisibilityManager; import com.oplus.engineermode.display.sdk.LcdRefreshRateManager; import com.oplus.engineermode.display.sdk.OplusDisplayPanelFeature; import com.oplus.engineermode.display.sdk.constants.DisplayPanelFeatureID; import java.util.ArrayList; import java.util.List; public class LCDAntiCase extends AntiCaseBase { private static final String TAG = LCDAntiCase.class.getSimpleName(); private static final int STEP_SHOW_STATIC_PICTURE = 0; private static final int STEP_SHOW_DYNAMIC_PICTURE = 1; private int staticRateDuration; private int dynamicRateDuration; private static final int MSG_CHECK_NEXT = 10000; private static final int MSG_SWITCH_TO_60HZ = 10001; private static final int MSG_SWITCH_TO_90HZ = 10002; private static final int MSG_SWITCH_TO_120HZ = 10003; private static final int MSG_MOVE_TEXT_POSITION = 10004; private int stage; private FrameLayout rootLayout; private TextView tvShowInfo; private ImageView ivStaticPicture; private LCDAgingView mLCDAgingView; private List<LcdDisplayScheduleItem> mDisplayOptions; private int mMIPIErrCheckTotalCheckTimes; private int mMIPIErrCheckTotalFailTimes; private boolean mIsSupportMIPIErrCheck; private final Handler mHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { super.handleMessage(msg); Log.d(TAG, "msg.what = " + msg.what); switch (msg.what) { case MSG_SWITCH_TO_60HZ: switchSupportRefreshRate(LcdRefreshRateManager.REFRESH_RATE_60HZ); getMIPIErrCheckResult(); break; case MSG_SWITCH_TO_90HZ: switchSupportRefreshRate(LcdRefreshRateManager.REFRESH_RATE_90HZ); getMIPIErrCheckResult(); break; case MSG_SWITCH_TO_120HZ: switchSupportRefreshRate(LcdRefreshRateManager.REFRESH_RATE_120HZ); getMIPIErrCheckResult(); break; case MSG_CHECK_NEXT: if (stage == STEP_SHOW_STATIC_PICTURE) { stage++; startNextStep(); } else { if (mMIPIErrCheckTotalFailTimes == 0) { onAntiPass(); } else if (mMIPIErrCheckTotalFailTimes > 0) { onAntiFail("MIPIErrCheckTotalFailTimes is " + mMIPIErrCheckTotalFailTimes); Log.d(TAG, "mMIPIErrCheckTotalCheckTimes is " + mMIPIErrCheckTotalCheckTimes + ", MIPIErrCheckTotalFailTimes is " + mMIPIErrCheckTotalFailTimes); } finish(); } break; case MSG_MOVE_TEXT_POSITION: if (tvShowInfo != null && rootLayout != null) { FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) tvShowInfo.getLayoutParams(); layoutParams.bottomMargin = (int) (Math.random() * (rootLayout.getMeasuredHeight() - tvShowInfo.getMeasuredHeight())); tvShowInfo.setLayoutParams(layoutParams); } break; } } }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.anti_lcd_case); mIsSupportMIPIErrCheck = isSupportMIPIErrCheck(); staticRateDuration = LCDAntiItemSetting.getInstance().getStaticWallPaperDuration(getAntiItemSetting()) * 1000; dynamicRateDuration = LCDAntiItemSetting.getInstance().getDynamicWallPaperDuration(getAntiItemSetting()) * 1000; Log.d(TAG, "staticRateDuration = " + staticRateDuration); Log.d(TAG, "dynamicRateDuration = " + dynamicRateDuration); rootLayout = findViewById(R.id.rootView); tvShowInfo = findViewById(R.id.tvShowInfo); stage = STEP_SHOW_STATIC_PICTURE; startNextStep(); } @Override protected void onResume() { super.onResume(); Log.d(TAG, "onResume()"); KeyguardManagerWrapper.requestDismissKeyguard(this); SystemUiVisibilityManager.getInstance() .hideSystemUiElement(getWindow().getInsetsController(), getWindow().getDecorView(), getContentResolver()); } @Override protected void onPause() { super.onPause(); SystemUiVisibilityManager.getInstance().resetSystemUiElement(getContentResolver()); } @Override protected void onDestroy() { mHandler.removeCallbacksAndMessages(null); super.onDestroy(); Log.d(TAG, "onDestroy() " + this); if (mLCDAgingView != null) { mLCDAgingView.setDisplaySwitchAutoMode(false); } } private boolean isSupportMIPIErrCheck() { int result = OplusDisplayPanelFeature.getDisplayPanelFeatureValueAsInt(DisplayPanelFeatureID.OMMDP_MIPI_ERR_CHECK.getId()); Log.d(TAG, "isSupportMIPIErrCheck = " + result); return result == 1; } private void getMIPIErrCheckResult() { if (!mIsSupportMIPIErrCheck) { return; } int result = OplusDisplayPanelFeature.setDisplayPanelFeatureValueWithResult(DisplayPanelFeatureID.OMMDP_MIPI_ERR_CHECK.getId(), 0); mMIPIErrCheckTotalCheckTimes++; Log.d(TAG, "getMIPIErrCheckResult: result is " + result); if (result > 0) { mMIPIErrCheckTotalFailTimes++; Log.d(TAG, "MIPIErrCheckTotalFailTimes is " + mMIPIErrCheckTotalFailTimes + ", MIPIErrCheck error is " + result); } else if (result < 0) { mMIPIErrCheckTotalFailTimes++; Log.d(TAG, "MIPIErrCheckTotalFailTimes is " + mMIPIErrCheckTotalFailTimes + ", MIPIErrCheck error is " + result); } } private void startNextStep() { Log.d(TAG, "startNextStep()"); switch (stage) { case STEP_SHOW_STATIC_PICTURE: addStaticView(); break; case STEP_SHOW_DYNAMIC_PICTURE: addDynamicView(); break; } } private void updateInfo() { String stageText = (stage == STEP_SHOW_STATIC_PICTURE ? getString(R.string.static_wallpaper) : getString(R.string.dynamic_wallpaper)) + ":"; String refreshRateText = ""; int rateMode = LcdRefreshRateManager.queryLCMFrequencySetting(this); if (rateMode == LcdRefreshRateManager.REFRESH_RATE_60HZ) { refreshRateText = "60HZ"; } else if (rateMode == LcdRefreshRateManager.REFRESH_RATE_90HZ) { refreshRateText = "90HZ"; } else if (rateMode == LcdRefreshRateManager.REFRESH_RATE_120HZ) { refreshRateText = "120HZ"; } String showInfo = stageText + refreshRateText; if (tvShowInfo != null) { tvShowInfo.setText(showInfo); mHandler.sendEmptyMessage(MSG_MOVE_TEXT_POSITION); } } private void switchSupportRefreshRate(int rate) { Log.d(TAG, "switchSupportRefreshRate:" + rate); int rateDuration; if (stage == STEP_SHOW_STATIC_PICTURE) { rateDuration = staticRateDuration; } else { rateDuration = dynamicRateDuration; } Log.d(TAG, "rateDuration = " + rateDuration); switch (rate) { case LcdRefreshRateManager.REFRESH_RATE_60HZ: if (LcdRefreshRateManager.isDisplayRefreshRate60HZSupport(LCDAntiCase.this)) { Log.d(TAG, "SUPPORT 60HZ"); LcdRefreshRateManager.updateLCMFrequencySetting(LCDAntiCase.this, LcdRefreshRateManager.REFRESH_RATE_60HZ); mHandler.sendEmptyMessageDelayed(MSG_SWITCH_TO_90HZ, rateDuration); } else { Log.d(TAG, "NOT SUPPORT 60HZ"); mHandler.sendEmptyMessage(MSG_SWITCH_TO_90HZ); } break; case LcdRefreshRateManager.REFRESH_RATE_90HZ: if (LcdRefreshRateManager.isDisplayRefreshRate90HZSupport(LCDAntiCase.this)) { Log.d(TAG, "SUPPORT 90HZ"); LcdRefreshRateManager.updateLCMFrequencySetting(LCDAntiCase.this, LcdRefreshRateManager.REFRESH_RATE_90HZ); mHandler.sendEmptyMessageDelayed(MSG_SWITCH_TO_120HZ, rateDuration); } else { Log.d(TAG, "NOT SUPPORT 90HZ"); mHandler.sendEmptyMessage(MSG_SWITCH_TO_120HZ); } break; case LcdRefreshRateManager.REFRESH_RATE_120HZ: if (LcdRefreshRateManager.isDisplayRefreshRate120HZSupport(LCDAntiCase.this)) { Log.d(TAG, "SUPPORT 120HZ"); LcdRefreshRateManager.updateLCMFrequencySetting(LCDAntiCase.this, LcdRefreshRateManager.REFRESH_RATE_120HZ); mHandler.sendEmptyMessageDelayed(MSG_CHECK_NEXT, rateDuration); } else { Log.d(TAG, "NOT SUPPORT 120HZ"); mHandler.sendEmptyMessage(MSG_CHECK_NEXT); } break; } updateInfo(); } private void addStaticView() { Log.d(TAG, "addStaticView()"); if (!LCDAntiItemSetting.getInstance().isStaticWallPaperShow(getAntiItemSetting()) || staticRateDuration <= 0) { Log.d(TAG, "skip static view"); mHandler.sendEmptyMessage(MSG_CHECK_NEXT); return; } if (mLCDAgingView != null) { rootLayout.removeView(mLCDAgingView); } if (ivStaticPicture == null) { ivStaticPicture = new ImageView(this); } ivStaticPicture.setBackgroundResource(R.drawable.fruit); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT); rootLayout.addView(ivStaticPicture, 0, layoutParams); switchSupportRefreshRate(LcdRefreshRateManager.REFRESH_RATE_60HZ); } private void addDynamicView() { Log.d(TAG, "addDynamicView()"); if (!LCDAntiItemSetting.getInstance().isDynamicWallPaperShow(getAntiItemSetting()) || dynamicRateDuration <= 0) { Log.d(TAG, "skip dynamic view"); mHandler.sendEmptyMessage(MSG_CHECK_NEXT); return; } if (ivStaticPicture != null) { rootLayout.removeView(ivStaticPicture); } if (mLCDAgingView == null) { mLCDAgingView = new LCDAgingView(this); } if (mDisplayOptions == null) { mDisplayOptions = new ArrayList<>(); final LCDAgingImageName[] items = LCDAgingImageName.values(); for (final LCDAgingImageName item : items) { if (item == LCDAgingImageName.RED || item == LCDAgingImageName.GREEN || item == LCDAgingImageName.BLUE || item == LCDAgingImageName.BLACK || item == LCDAgingImageName.WHITE || item == LCDAgingImageName.V_GREY_SCALE || item == LCDAgingImageName.L64_GREY) { mDisplayOptions.add(new LcdDisplayScheduleItem(item, true)); } } } mLCDAgingView.setDisplayScheduleItemList(mDisplayOptions); mLCDAgingView.setLCDAgingDisplaySwitchCallback(new LCDAgingDisplaySwitchCallback() { @Override public void onItemSwitchDone(LCDAgingImageName imageName) { Log.d(TAG, "imageName is " + imageName.name()); getMIPIErrCheckResult(); } @Override public void onListSwitchDone(int count) { Log.d(TAG, "onListSwitchDone"); } @Override public void onListSwitchRepeatDone() { Log.d(TAG, "onListSwitchRepeatDone"); } @Override public void onViewAttachedToWindow() { Log.d(TAG, "onViewAttachedToWindow"); } @Override public void onViewDetachedFromWindow() { Log.d(TAG, "onViewDetachedFromWindow"); } }); mLCDAgingView.setDisplaySwitchDelay(1); int repeatTimes = (dynamicRateDuration / (10 * 1000) + 1) * 6; Log.d(TAG, "repeatTimes = " + repeatTimes); mLCDAgingView.setDisplaySwitchRepeatTarget(repeatTimes); mLCDAgingView.setDisplaySwitchAutoMode(true); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams( FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT); rootLayout.addView(mLCDAgingView, 0, layoutParams); mLCDAgingView.triggerDisplaySwitch(); switchSupportRefreshRate(LcdRefreshRateManager.REFRESH_RATE_60HZ); } @Override protected String getAntiItemName() { return LCDAntiItemSetting.getInstance().getAntiItemName(); } } 给这段代码加上中文注释
最新发布
07-08
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值