Closed ghost closed 5 years ago
According to me the camera tab cannot be hidden through xposed there is some method level code involved. The hide tabs feature works by skipping some method calls and changing the return values. This cannot be done for camera tab. If you are interested in more technical explanation comment below I'll explain.
I would appreciate it if you would explain it to me. I'm modify your code to try hide it, but I didn't get good results
There are two methods hooked to hide status tab. 1) The viewpager adapter has a method which return the number of tabs to inflate, In my implementation we want 3 tabs instead of 4 ( we want to hide tab at index 2 and inflate tab 3 at its place ). so we hook the method and return 3 from beforeHook
2) Another method used here basically tells which fragment to inflate so when argument to that method is 2 we want to set it to 3 so that 3rd tab will be rendered. So in before hook param.args[0] is modified.
if we apply the same logic for camera i.e set tabs count to 2 and change arg to 1 when it is originally 0 , whatsapp force closes. That means there is some other code that depends on tab 0. If its a method ( which I couldnt find ) we can skip that method call if it doesnt affect other functionality. If it is some part of the code, I'm afraid we cannot use xposed here.
I think i get it. Is there any way to remove it in "drawable"?
Thank you very much for response
can you specify what to you mean by "drawable". If we somehow get the reference to that camera tab. We can set the visibility to gone but user can still switch to that tab. For that we can hook method which is called when tab is changed ( not sure about name and if it exists ) and set changed tab to current tab in beforeHookedMethod. I gave you a hint. See if it is possible, create pull request. I'll merge.
I understand, I'll try hide it. If I have some news I post here. Thank you, Regards ;)
@nosijf982 any updates on that?
No, I had tried a few months ago but without any result, at this moment i'm busy with classes and I don't have time.Sorry
Good luck ;)
Yeah no problem. Just wanted to know. All the best
Now that I read this, I will shed some light on the matter (without the results you expect).
The camera tab is not created in the same way as the "Text Only" tabs, it creates an image and text dynamically in another method. The text tabs, create them in a totally different method, which is accessible and you can modify the variables. The method of the camera tab uses local variables, which can not be modified with Xposed, since you can only modify public variables. Therefore, it is impossible to modify or delete this tab with Xposed.
as per the above comment closing this for now.
Hi @suraj0208, I appreciate your job a lot, I have small request if is possible. I would like a option to remove the camera tab in the main screen. Regards ;)