We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
主线程更新TagCloudView出现较多jank,可以尝试使用单独的非主线程进行维护进行优化,但是目前的TagClouldView限制了更新线程只能在主线程
解决方案:https://github.com/misakuo/3dTagCloudAndroid/pull/33/commits
如下方法可以自定义一个线程,并在线程中维护TagCloudView
//: MyThread.java @Override public void run() { Looper.prepare(); mHandler = new Handler(Looper.myLooper()); WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, Utils.dx2dp(400), TYPE_APPLICATION, 0, PixelFormat.TRANSPARENT); layoutParams.gravity = Gravity.TOP; layoutParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; mWindowManager.addView(mFrameLayout = new FrameLayout(mContext), layoutParams ); mFrameLayout.setVisibility(View.GONE); onViewCreated(mFrameLayout); Looper.loop(); } private void onViewCreated(FrameLayout frameLayout) { frameLayout.setVisibility(View.VISIBLE); if (frameLayout.getChildCount() == 0){ LayoutInflater.from(mContext.getApplicationContext()) .inflate(R.layout.layout_planet, frameLayout); } frameLayout.setVisibility(View.VISIBLE); initCloudView(frameLayout); } private void initCloudView(FrameLayout frameLayout) { if (frameLayout.getParent() == null ) return; TagCloudView tagCloudView = frameLayout.findViewById(R.id.tag_cloud); try { Field handler = tagCloudView.getClass().getDeclaredField("handler"); handler.setAccessible(true); handler.set(tagCloudView, new Handler(Looper.myLooper())); } catch (Exception e) { e.printStackTrace(); } TagCloudAdapter adapter = new TagCloudAdapter(); tagCloudView.setAdapter(adapter); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
主线程更新TagCloudView出现较多jank,可以尝试使用单独的非主线程进行维护进行优化,但是目前的TagClouldView限制了更新线程只能在主线程
解决方案:https://github.com/misakuo/3dTagCloudAndroid/pull/33/commits
如下方法可以自定义一个线程,并在线程中维护TagCloudView
The text was updated successfully, but these errors were encountered: