andy671 / dachshund-tab-layout Goto Github PK
View Code? Open in Web Editor NEWExtended Android Tab Layout with animated indicators that have continuous feedback.
License: MIT License
Extended Android Tab Layout with animated indicators that have continuous feedback.
License: MIT License
two tabs in my tablayout,
how should I makes the both tab's width containing the half width of screen width?
what about tree tabs ?
I am using ViewPager2. How to use it with ViewPager2. Does it have provision for it?
Is it possible to use this inside Recycler view to get the same effect. I want to have the effect for my vertical recycler view to get this kind of effect.
https://i.stack.imgur.com/Dx38z.gif
https://raw.githubusercontent.com/ogaclejapan/SmartTabLayout/master/art/demo4.gif
I'm using the new class provided by the design library : TabLayout. And I want in specific cases that the one I'm using can't change tab anymore.
I manage to disable swipe on its viewpager but I can't figure out how to disable the change of page by clicking on tabs.
Thank's in advance.
**In The Normal Tablayout with below code i can disable it **
LinearLayout tabStrip = ((LinearLayout)mTabLayout.getChildAt(0)); for(int i = 0; i < tabStrip.getChildCount(); i++) { tabStrip.getChildAt(i).setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return true; } }); }
But in This Library How Can I Do It ?
hello andy671
I use it with an error
what is the solution
error:
Process: com.example.ganger.dmzjapp, PID: 24343
java.lang.NoSuchMethodError: No super method setupWithViewPager(Landroid/support/v4/view/ViewPager;Z)V in class Landroid/support/design/widget/TabLayout; or its super classes (declaration of 'android.support.design.widget.TabLayout' appears in /data/data/com.example.ganger.dmzjapp/files/instant-run/dex/slice-com.android.support-design-23.3.0_885fe9c4b8444b33318faa2144462abf1840cd46-classes.dex)
at com.kekstudio.dachshundtablayout.DachshundTabLayout.setupWithViewPager(DachshundTabLayout.java:122)
at com.kekstudio.dachshundtablayout.DachshundTabLayout.setupWithViewPager(DachshundTabLayout.java:117)
at com.example.ganger.dmzjapp.MainActivity.onCreate(MainActivity.java:158)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
code:
pageAdapter=new MyPageAdapter(getSupportFragmentManager(),titles,fs);
viewPager.setAdapter(pageAdapter);
dachshundTabLayout= (DachshundTabLayout) findViewById(R.id.tab_layout);
dachshundTabLayout.setupWithViewPager(viewPager);
It's better to add the ability to make the dot width wrap content of the tab title.
The tab in Fragment is not work
Hi, I didnt found help about to set edge radius of LineMoveIndicator to ZERO!
i want it as a keen rectangle!
where to use setEdgeRadius(int edgeRadius) ?
To reproduce:
Expected:
App uses LineMoveIndicator once it runs
Actual:
App uses the default DachshundIndicator
Problem, the way I understand it:
setupAnimatedIndicator should not overule an AnimatedIndicator set through setAnimatedIndicator.
When animatedIndicator is set programatically by calling setAnimatedIndicator in the Android Activity's onCreate, onStart or onResume methods the setupAnimatedIndicator is still called afterwards and the programatically set indicator with either default or whatever was set through xml.
A potential quick fix could be to add a CUSTOM flag for the animatedIndicatorType that could be both set from xml and would be automatically used once setAnimatedIndicator has been called.
How can i use this without pager.i tried to add tabs using addTab method and later tried using addOntabselected Listener but its showing an error.I am using below code to do so. Is there any other way of doing the same thing or is there something wrong with my code ?
DachshundTabLayout navigationTabStrip = (DachshundTabLayout) view.findViewById(R.id.tablayout);
navigationTabStrip.addTab(new TabLayout.Tab().setText("Pug"),1,true);
navigationTabStrip.addTab(new TabLayout.Tab().setText("Bulldog"),2);
navigationTabStrip.addTab(new TabLayout.Tab().setText("Beagle"),3);
with a addontabselectedlistener
navigationTabStrip.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
Toast.makeText(getContext(), tab.getText(), Toast.LENGTH_SHORT).show();
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
its showing an error
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setContentDescription(java.lang.CharSequence)' on a null object reference
at com.google.android.material.tabs.TabLayout$Tab.setText(TabLayout.java:1846)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.