un-material-tab


Source link: https://github.com/creageek/un-material-tab

un-material-tab library

A customizable alternative of TabLayout from Support Design library which provides almost the same functionality.

Currently working on

  • RoundTabLayout#onTabSelected & RoundTabLayout#onTabReselected callbacks
  • reducing number of GPU view updates
  • new tab animations

If you have any suggestions - feel free to open an issue.

How to add?

I. In your build.gradle file add the following dependency:

dependencies {

  compile 'com.ruslankishai:unmaterialtabs:0.1a' 
}
 

II. Declare RoundTabLayout inside your layout.xml file:

<com.ruslankishai.unmaterialtab.tabs.RoundTabLayout

 android:id="@+id/round_tabs"

 android:layout_width="match_parent"

 android:layout_height="wrap_content"

 android:background="@color/colorPrimary"

 app:accent="@color/colorAccent" />

III. Declare RoundTabLayout with ViewPager in your 'class.java':

ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
  //set adapter to your ViewPager ViewPager.setAdapter(new TabPagerAdapter(getFragmentManager()));
  RoundTabLayout tabLayout = (RoundTabLayout) findViewById(R.id.roundTabLayout);
 tabLayout.setupWithViewPager(viewPager);

IV. Override you getPageTitle method in your ViewPager’s adapter to return tab title.

@Override public CharSequence getPageTitle(int position) {

  switch (position) {

  case 0:

 return "First item";

  ...

}
 
}

How to customize?

I. In your layout.xml file you can set a few attributes to RoundedTabLayout:

  • android:background
    • This attribute works just like usual background attribute (reference to a color).
  • app:accent
    • This attribute allows you to set accent color for tab selection, stroke and text (reference to a color).
  • app:cornerRadius
    • This attribute sets the tab corner radius. Possible values are:
      • circle (default)
      • rounded
      • rectangle
      • value in px from 0 to 50

II. In your class.java you can set some values to customize specific tab:

  • Use RoundTab#setIcon method to change icon. You can get RoundTab object via RoundTabLayout#getTab method which accept tab index as parameter. To enable tab icon, you should also use RoundTab#setHasIcon.
//after initializing RoundTabLayout and ViewPager RoundTab tab = tabLayout.getTab(0);
 Drawable icon = getResources().getDrawable(R.drawable.globe);
 tab.setIcon(icon);
 //enable icon in current tab tab.setHasIcon(true);
  //repeat this code for another tabs
  • To disable tab stroke use RoundTab#setHasStroke method.
//after initializing RoundTabLayout and ViewPager RoundTab tab = tabLayout.getTab(0);
 tab.setHasStroke(true);
 …
  • To change corners radius use RoundTab#setCornerRadius which accept values from 0 to 50 as a parameter.
//after initializing RoundTabLayout and ViewPager RoundTab tab = tabLayout.getTab(0);
 tab.setCornerRadius(35);
 …
  • To change tab text use RoundTab#setText which accept String as a parameter.
//after initializing RoundTabLayout and ViewPager RoundTab tab = tabLayout.getTab(0);
 tab.setText(“Usage example”);
 …

Where is un-material-tab demo app?

The app works just as an example of usage with different options. Will be uploaded to Play Store sooner.

What about contributions?

This is my first public repo and first library so I’m trying to keep this code as much clean and well-commented as I can. Feel free to contribute :)

License

Copyright (C) 2017 Ruslan Kishai  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

Dali is an image blur library for Android. It is easy to use, fast and extensible. Dali contains several modules for either static blurring, live blurring and animations. It uses RenderScript internally (although different implementations can be chosen) and is heavily cached to be fast and keeps small memory footprint. It features a lot of additional image filters and may be easily extended and pretty every configuration can be changed.

Under the Hood is a flexible and powerful Android debug view library. It uses a modular template system that can be easily extended to your needs, although coming with many useful elements built-in.

There is a lot of "default" debug data that can be easily embedded (e.g. current runtime-permission status, app version and device info). There are 2 basic themes (dark and light) which can be customized to your needs.

Sticky header view or suspending view for RecyclerView. RecyclerStickyHeaderView is an Android library that makes it easy to integrate section headers stick to the top in RecyclerView.

Official Google Actions SDK is written in Node.js. But in many situations voice interfaces like Google Home or Google Assistant will extend or replace mobile apps. If you are old fashioned Android engineer and the most of your code is already written in Java, why not reuse it and build voice extension to app on your own? And this is the main reason to build Google Actions Java SDK - enabling as much developers as possible to build their brilliant ideas for Google Assistant and Home.

Currently this is just working proof of concept of Google Actions Java SDK. It means that there is no documentation, fixed interface, (not much) unit tests and many, many others.

Google Actions Java SDK is build based on official Node.js library, but it's not a mirror copy of it. The goal is to make it fully compatible with Conversational Protocol of Assistant Platform.

Applozic Android Video Calling SDK lets you integrate video call, audio call, real time chat and in-app messaging in just few lines of code.

A versatile layout that fades its edges regardless of child view type.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes