├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── LICENSE
├── README.md
├── Screenshots
└── animation.gif
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── cuberto
│ │ └── flashytabbarsampleapp
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── cuberto
│ │ │ └── flashytabbarsampleapp
│ │ │ ├── MainActivity.java
│ │ │ ├── SplashActivity.java
│ │ │ └── TabFragment.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── cuberto_logo.png
│ │ ├── ic_events.png
│ │ ├── ic_highlights.png
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_search.png
│ │ └── ic_settings.png
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── activity_splash.xml
│ │ └── fragment_one.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── cuberto
│ └── flashytabbarsampleapp
│ └── ExampleUnitTest.java
├── build.gradle
├── flashytabbarandroid
├── .gitignore
├── build.gradle
├── consumer-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── cuberto
│ │ └── flashytabbarandroid
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── cuberto
│ │ │ └── flashytabbarandroid
│ │ │ └── TabFlashyAnimator.java
│ └── res
│ │ ├── anim
│ │ ├── hide.xml
│ │ └── show.xml
│ │ ├── drawable
│ │ ├── badge_bg.xml
│ │ ├── ic_dot.xml
│ │ └── image_foreground.xml
│ │ ├── layout
│ │ └── custom_tab.xml
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── com
│ └── cuberto
│ └── flashytabbarandroid
│ └── ExampleUnitTest.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── versioning.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 |
4 | /local.properties
5 | /github.properties
6 |
7 | /.idea/caches
8 | /.idea/libraries
9 | /.idea/modules.xml
10 | /.idea/workspace.xml
11 | /.idea/navEditor.xml
12 | /.idea/assetWizardSettings.xml
13 | .idea/tasks.xml
14 | .idea/gradle.xml
15 | .idea/dictionaries
16 |
17 | .DS_Store
18 | /build
19 | /captures
20 | .externalNativeBuild
21 | .cxx
22 |
23 | # Built application files
24 | *.apk
25 | *.ap_
26 |
27 | # Files for the ART/Dalvik VM
28 | *.dex
29 |
30 | # Java class files
31 | *.class
32 |
33 | # Generated files
34 | bin/
35 | gen/
36 | out/
37 |
38 | # Gradle files
39 | .gradle/
40 | build/
41 |
42 | # Proguard folder generated by Eclipse
43 | proguard/
44 |
45 | # Log Files
46 | *.log
47 |
48 | # Android Studio Navigation editor temp files
49 | .navigation/
50 |
51 | # Android Studio captures folder
52 | captures/
53 |
54 | # Keystore files
55 | # Uncomment the following line if you do not want to check your keystore files in.
56 | #*.jks
57 |
58 | # External native build folder generated in Android Studio 2.2 and later
59 | .externalNativeBuild
60 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Cuberto
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FlashyTabBar
2 |
3 | [](https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/master/LICENSE)
4 |
5 | 
6 |
7 | ## Requirements
8 |
9 | - Android 4.4+
10 |
11 | ## Example
12 |
13 | To run the example project, clone the repo, and run `MainActivity`
14 |
15 | ## Installation
16 | Add materialdesign library to your project
17 |
18 | ```
19 | dependencies {
20 | //your project depencies here
21 | implementation "com.google.android.material:material:1.0.0"
22 | }
23 | ```
24 |
25 | ### As library
26 |
27 | #### GitHub Packages
28 |
29 | Step 1 : Generate a Personal Access Token for GitHub
30 | - Inside you GitHub account:
31 | - Settings -> Developer Settings -> Personal Access Tokens -> Generate new token
32 | - Make sure you select the following scopes (“ read:packages”) and Generate a token
33 | - After Generating make sure to copy your new personal access token. You cannot see it again! The only option is to generate a new key.
34 |
35 | Step 2: Store your GitHub — Personal Access Token details
36 | - Create a github.properties file within your root Android project
37 | - In case of a public repository make sure you add this file to .gitignore for keep the token private
38 | - Add properties gpr.usr=GITHUB_USERID and gpr.key=PERSONAL_ACCESS_TOKEN
39 | - Replace GITHUB_USERID with personal / organisation Github User ID and PERSONAL_ACCESS_TOKEN with the token generated in #Step 1
40 |
41 | Step 3 : Update build.gradle inside the application module
42 | - Add the following code to build.gradle inside the app module that will be using the library
43 | ```
44 | def githubProperties = new Properties()
45 | githubProperties.load(new FileInputStream(rootProject.file("github.properties")))
46 | repositories {
47 | maven {
48 | name = "GitHubPackages"
49 |
50 | url = uri("https://maven.pkg.github.com/Cuberto/flashy-tabbar-android")
51 | credentials {
52 | /** Create github.properties in root project folder file with
53 | ** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN
54 | ** Or set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/
55 | username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
56 | password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
57 | }
58 | }
59 | }
60 | ```
61 | - inside dependencies of the build.gradle of app module, use the following code
62 | ```
63 | dependencies {
64 | //consume library
65 | implementation 'com.cuberto.flashytabbarandroid:flashytabbarandroid:1.0.0'
66 | ....
67 | }
68 | ```
69 | Sync project and now you can use flashytabbar library
70 |
71 | #### Android Archive Library
72 |
73 | [Download](https://github.com/Cuberto/flashy-tabbar-android/packages/93596) flashytabbarandroid-1.0.0.aar from assets, add it to your app module `libs` package and add this to your dependencies
74 | ```
75 | dependencies {
76 | //your project depencies here
77 | implementation fileTree(dir: 'libs', include: ['*.aar'])
78 | }
79 |
80 | ```
81 | Sync project and now you can use flashytabbar library
82 |
83 | ### Manual
84 |
85 | Add `TabFlashyAnimator` and content of res package to your project
86 |
87 | ## Usage
88 |
89 | Add TabLayout to your xml with tabGravity="fill", tabIndicatorHeight="0dp" and tabMode="fixed"
90 |
91 | ```
92 |
105 |
106 | ```
107 |
108 | Create adapter in your Activity, add some fragments and set ViewPager adapter
109 | ```
110 | private List mFragmentList = new ArrayList<>();
111 | private TabFlashyAnimator tabFlashyAnimator;
112 | private String[] titles = new String[]{"Events", "Highlights", "Search", "Settings"};
113 |
114 | @Override
115 | protected void onCreate(Bundle savedInstanceState) {
116 | super.onCreate(savedInstanceState);
117 | setContentView(R.layout.activity_main);
118 | mFragmentList.add(new TabFragment(titles[0]));
119 | mFragmentList.add(new TabFragment(titles[1]));
120 | mFragmentList.add(new TabFragment(titles[2]));
121 | mFragmentList.add(new TabFragment(titles[3]));
122 | ViewPager viewPager = findViewById(R.id.view_pager);
123 | FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(getSupportFragmentManager()) {
124 | @Override
125 | public Fragment getItem(int position) {
126 | return mFragmentList.get(position);
127 | }
128 |
129 | @Override
130 | public int getCount() {
131 | return mFragmentList.size();
132 | }
133 | };
134 | viewPager.setAdapter(adapter);
135 |
136 | ```
137 |
138 | Setup your TabLayout with ViewPager
139 | ```
140 | TabLayout tabLayout = findViewById(R.id.tabLayout);
141 | tabLayout.setupWithViewPager(viewPager);
142 | ```
143 |
144 | Create TabFlashyAnimator and tabItem as title and image id for each fragment. You can also set text color and size for tab item.
145 | ```
146 | tabFlashyAnimator = new TabFlashyAnimator(tabLayout);
147 | tabFlashyAnimator.addTabItem(titles[0], R.drawable.ic_events);
148 | tabFlashyAnimator.addTabItem(titles[1], R.drawable.ic_highlights);
149 | tabFlashyAnimator.addTabItem(titles[2], R.drawable.ic_search);
150 | tabFlashyAnimator.addTabItem(titles[3], R.drawable.ic_settings, R.color.colorAccent, getResources().getDimension(R.dimen.big_text));
151 | ```
152 | Call highlightTab() for 0 position and add tabFlashyAnimator as OnPageChangeListener to ViewPager
153 | ```
154 | tabFlashyAnimator.highLightTab(0);
155 | viewPager.addOnPageChangeListener(tabFlashyAnimator);
156 | ```
157 |
158 | Do this to set badge for tab item:
159 | ```
160 | tabFlashyAnimator.setBadge(1, 2);
161 | ```
162 |
163 |
164 | Call tabFlashyAnimator onStart() and onStop() in appropriate activity methods
165 | ```
166 | @Override
167 | protected void onStart() {
168 | super.onStart();
169 | tabFlashyAnimator.onStart((TabLayout) findViewById(R.id.tabLayout));
170 | }
171 |
172 | @Override
173 | protected void onStop() {
174 | super.onStop();
175 | tabFlashyAnimator.onStop();
176 | }
177 | ```
178 |
179 | ## iOS
180 |
181 | Similar library [FlashyTabBar](https://github.com/Cuberto/flashy-tabbar) by [Cuberto](https://github.com/Cuberto)
182 |
183 | ## Author
184 |
185 | Cuberto Design, info@cuberto.com
186 |
187 | ## License
188 |
189 | FlashyTabbar is available under the MIT license. See the LICENSE file for more info.
190 |
--------------------------------------------------------------------------------
/Screenshots/animation.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/Screenshots/animation.gif
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "29.0.2"
6 | defaultConfig {
7 | applicationId "com.cuberto.flashytabbarsampleapp"
8 | minSdkVersion 19
9 | targetSdkVersion 29
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(dir: 'libs', include: ['*.jar'])
24 | implementation 'androidx.appcompat:appcompat:1.1.0'
25 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
26 | testImplementation 'junit:junit:4.12'
27 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
28 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
29 | implementation "com.google.android.material:material:1.0.0"
30 |
31 | implementation project(":flashytabbarandroid")
32 | }
33 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/cuberto/flashytabbarsampleapp/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.cuberto.flashytabbarsampleapp;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.cuberto.flashytabbarsampleapp", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cuberto/flashytabbarsampleapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.cuberto.flashytabbarsampleapp;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.fragment.app.Fragment;
5 | import androidx.fragment.app.FragmentStatePagerAdapter;
6 | import androidx.viewpager.widget.ViewPager;
7 |
8 | import android.os.Bundle;
9 | import android.os.Handler;
10 |
11 | import com.cuberto.flashytabbarandroid.TabFlashyAnimator;
12 | import com.google.android.material.tabs.TabLayout;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | public class MainActivity extends AppCompatActivity {
18 |
19 | private List mFragmentList = new ArrayList<>();
20 | private TabFlashyAnimator tabFlashyAnimator;
21 | private String[] titles = new String[]{"Events", "Highlights", "Search", "Settings"};
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_main);
27 | mFragmentList.add(new TabFragment(titles[0]));
28 | mFragmentList.add(new TabFragment(titles[1]));
29 | mFragmentList.add(new TabFragment(titles[2]));
30 | mFragmentList.add(new TabFragment(titles[3]));
31 | ViewPager viewPager = findViewById(R.id.view_pager);
32 | FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(getSupportFragmentManager()) {
33 | @Override
34 | public Fragment getItem(int position) {
35 | return mFragmentList.get(position);
36 | }
37 |
38 | @Override
39 | public int getCount() {
40 | return mFragmentList.size();
41 | }
42 | };
43 | viewPager.setAdapter(adapter);
44 | TabLayout tabLayout = findViewById(R.id.tabLayout);
45 | tabLayout.setupWithViewPager(viewPager);
46 | tabFlashyAnimator = new TabFlashyAnimator(tabLayout);
47 | tabFlashyAnimator.addTabItem(titles[0], R.drawable.ic_events);
48 | tabFlashyAnimator.addTabItem(titles[1], R.drawable.ic_highlights);
49 | tabFlashyAnimator.addTabItem(titles[2], R.drawable.ic_search);
50 | tabFlashyAnimator.addTabItem(titles[3], R.drawable.ic_settings, R.color.colorAccent, getResources().getDimension(R.dimen.big_text));
51 | tabFlashyAnimator.highLightTab(0);
52 | viewPager.addOnPageChangeListener(tabFlashyAnimator);
53 | Handler handler = new Handler();
54 | handler.postDelayed(new Runnable() {
55 | @Override
56 | public void run() {
57 | tabFlashyAnimator.setBadge(1, 2);
58 | }
59 | }, 1000);
60 | handler.postDelayed(new Runnable() {
61 | @Override
62 | public void run() {
63 | tabFlashyAnimator.setBadge(20, 2);
64 | }
65 | }, 2000);
66 | handler.postDelayed(new Runnable() {
67 | @Override
68 | public void run() {
69 | tabFlashyAnimator.setBadge(200, 2);
70 | }
71 | }, 3000);
72 | }
73 |
74 | @Override
75 | protected void onStart() {
76 | super.onStart();
77 | tabFlashyAnimator.onStart((TabLayout) findViewById(R.id.tabLayout));
78 | }
79 |
80 | @Override
81 | protected void onStop() {
82 | super.onStop();
83 | tabFlashyAnimator.onStop();
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cuberto/flashytabbarsampleapp/SplashActivity.java:
--------------------------------------------------------------------------------
1 | package com.cuberto.flashytabbarsampleapp;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.os.Handler;
6 |
7 | import androidx.appcompat.app.AppCompatActivity;
8 |
9 | public class SplashActivity extends AppCompatActivity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_splash);
15 | final Intent intent = new Intent(SplashActivity.this, MainActivity.class);
16 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
17 | new Handler().postDelayed(new Runnable() {
18 | @Override
19 | public void run() {
20 | startActivity(intent);
21 | }
22 | }, 500);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cuberto/flashytabbarsampleapp/TabFragment.java:
--------------------------------------------------------------------------------
1 | package com.cuberto.flashytabbarsampleapp;
2 |
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.annotation.Nullable;
11 | import androidx.fragment.app.Fragment;
12 |
13 | public class TabFragment extends Fragment {
14 |
15 | private String title;
16 |
17 | public TabFragment(String title) {
18 | this.title = title;
19 | }
20 |
21 | @Override
22 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
23 | setRetainInstance(true);
24 | return inflater.inflate(R.layout.fragment_one, container, false);
25 | }
26 |
27 | @Override
28 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
29 | super.onViewCreated(view, savedInstanceState);
30 | TextView textView = getView().findViewById(R.id.tab_title);
31 | textView.setText(title);
32 | }
33 |
34 | @Override
35 | public void onSaveInstanceState(@NonNull Bundle outState) {
36 | super.onSaveInstanceState(outState);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/cuberto_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/drawable/cuberto_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_events.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/drawable/ic_events.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_highlights.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/drawable/ic_highlights.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/drawable/ic_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/drawable/ic_settings.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_one.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 | #FFFFFF
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 18dp
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FlashyTabbarSampleApp
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/cuberto/flashytabbarsampleapp/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.cuberto.flashytabbarsampleapp;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 |
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.5.1'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 |
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/flashytabbarandroid/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/flashytabbarandroid/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'maven-publish'
3 |
4 | android {
5 | compileSdkVersion 29
6 | buildToolsVersion "29.0.2"
7 |
8 |
9 | defaultConfig {
10 | minSdkVersion 19
11 | targetSdkVersion 29
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16 | consumerProguardFiles 'consumer-rules.pro'
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | implementation fileTree(dir: 'libs', include: ['*.jar'])
30 |
31 | implementation 'androidx.appcompat:appcompat:1.1.0'
32 | testImplementation 'junit:junit:4.12'
33 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
34 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
35 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
36 | implementation "com.google.android.material:material:1.0.0"
37 | }
38 |
39 | def githubProperties = new Properties()
40 | githubProperties.load(new FileInputStream(rootProject.file("github.properties"))) //Set env variable GPR_USER & GPR_API_KEY if not adding a properties file
41 |
42 | def getVersionName = { ->
43 | return "1.0.0" // Replace with version Name
44 | }
45 |
46 | def getArtificatId = { ->
47 | return "flashytabbarandroid" // Replace with library name ID
48 | }
49 |
50 | publishing {
51 | publications {
52 | bar(MavenPublication) {
53 | groupId 'com.cuberto.flashytabbarandroid' // Replace with group ID
54 | artifactId getArtificatId()
55 | version getVersionName()
56 | artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar")
57 | }
58 | }
59 |
60 | repositories {
61 | maven {
62 | name = "GitHubPackages"
63 | /** Configure path of your package repository on Github
64 | ** Replace GITHUB_USERID with your/organisation Github userID
65 | ** and REPOSITORY with the repository name on GitHub
66 | */
67 | url = uri("https://maven.pkg.github.com/Cuberto/flashy-tabbar-android")
68 | credentials {
69 | /** Create github.properties in root project folder file with
70 | ** gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN
71 | ** Set env variable GPR_USER & GPR_API_KEY if not adding a properties file**/
72 |
73 | username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER")
74 | password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY")
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/flashytabbarandroid/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/flashytabbarandroid/consumer-rules.pro
--------------------------------------------------------------------------------
/flashytabbarandroid/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/androidTest/java/com/cuberto/flashytabbarandroid/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.cuberto.flashytabbarandroid;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.cuberto.flashytabbarandroid.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/java/com/cuberto/flashytabbarandroid/TabFlashyAnimator.java:
--------------------------------------------------------------------------------
1 | package com.cuberto.flashytabbarandroid;
2 |
3 | import android.graphics.Color;
4 | import android.util.TypedValue;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.animation.AnimationUtils;
8 | import android.widget.ImageView;
9 | import android.widget.LinearLayout;
10 | import android.widget.TextView;
11 |
12 | import androidx.annotation.ColorRes;
13 | import androidx.constraintlayout.widget.ConstraintLayout;
14 | import androidx.constraintlayout.widget.ConstraintSet;
15 | import androidx.core.content.ContextCompat;
16 | import androidx.transition.ChangeBounds;
17 | import androidx.transition.TransitionManager;
18 | import androidx.transition.TransitionSet;
19 | import androidx.viewpager.widget.ViewPager;
20 |
21 | import com.google.android.material.tabs.TabLayout;
22 |
23 | import java.util.ArrayList;
24 | import java.util.List;
25 |
26 | public class TabFlashyAnimator extends ViewPager.SimpleOnPageChangeListener {
27 | private final List mFragmentTitleList = new ArrayList<>();
28 | private final List mFragmentIconList = new ArrayList<>();
29 | private final List mFragmentColorList = new ArrayList<>();
30 | private final List mFragmentSizeList = new ArrayList<>();
31 | private TabLayout tabLayout;
32 | private int previousPosition = -1;
33 |
34 | public TabFlashyAnimator(TabLayout tabLayout) {
35 | this.tabLayout = tabLayout;
36 | }
37 |
38 | public void addTabItem(String title, int tabIcon) {
39 | addTabItem(title, tabIcon, null, null);
40 | }
41 |
42 | public void addTabItem(String title, int tabIcon, int color) {
43 | addTabItem(title, tabIcon, color, null);
44 | }
45 |
46 | public void addTabItem(String title, int tabIcon, float size) {
47 | addTabItem(title, tabIcon, null, size);
48 | }
49 |
50 | public void addTabItem(String title, Integer tabIcon, Integer color, Float size) {
51 | mFragmentTitleList.add(title);
52 | mFragmentIconList.add(tabIcon);
53 | mFragmentColorList.add(color);
54 | mFragmentSizeList.add(size);
55 | }
56 |
57 | private void getTabView(int position, TabLayout.Tab tab, boolean isSelected) {
58 | View view = tab.getCustomView() == null ? LayoutInflater.from(tabLayout.getContext()).inflate(R.layout.custom_tab, null) : tab.getCustomView();
59 | if (tab.getCustomView() == null) {
60 | tab.setCustomView(view);
61 | }
62 | ImageView tabImageView = view.findViewById(R.id.tab_image);
63 | tabImageView.setImageResource(mFragmentIconList.get(position));
64 | ConstraintLayout layout = view.findViewById(R.id.root);
65 | ConstraintSet set = new ConstraintSet();
66 | ImageView foreground = view.findViewById(R.id.image_foreground);
67 | ImageView textForeground = view.findViewById(R.id.text_foreground);
68 | ImageView dot = view.findViewById(R.id.dot);
69 | TextView title = view.findViewById(R.id.tab_title);
70 | title.setText(mFragmentTitleList.get(position));
71 | title.setTextColor(mFragmentColorList.get(position) == null ? Color.argb(255, 40, 45, 130) : getColor(mFragmentColorList.get(position)));
72 | if(mFragmentSizeList.get(position) != null) {
73 | title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mFragmentSizeList.get(position));
74 | }
75 | set.clone(layout);
76 | set.connect(textForeground.getId(), ConstraintSet.TOP, isSelected ? title.getId() : tabImageView.getId(), ConstraintSet.BOTTOM);
77 | if(isSelected) {
78 | set.clear(tabImageView.getId(), ConstraintSet.BOTTOM);
79 | set.connect(title.getId(), ConstraintSet.TOP, ConstraintSet.PARENT_ID, ConstraintSet.TOP);
80 | set.connect(title.getId(), ConstraintSet.BOTTOM, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM);
81 | dot.startAnimation(AnimationUtils.loadAnimation(tabLayout.getContext(), R.anim.show));
82 | } else {
83 | set.connect(tabImageView.getId(), ConstraintSet.BOTTOM, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM);
84 | set.clear(title.getId(), ConstraintSet.BOTTOM);
85 | set.connect(title.getId(), ConstraintSet.TOP, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM);
86 | if(position == previousPosition || previousPosition == -1) {
87 | dot.startAnimation(AnimationUtils.loadAnimation(tabLayout.getContext(), R.anim.hide));
88 | }
89 | }
90 | set.clear(foreground.getId(), isSelected ? ConstraintSet.TOP : ConstraintSet.BOTTOM);
91 | set.connect(foreground.getId(), isSelected ? ConstraintSet.BOTTOM : ConstraintSet.TOP, tabImageView.getId(), ConstraintSet.BOTTOM);
92 | set.applyTo(layout);
93 | tabImageView.setColorFilter(Color.argb(255, 40, 45, 130));
94 | }
95 |
96 | public void highLightTab(int position) {
97 | if (tabLayout != null) {
98 | TransitionManager.beginDelayedTransition(tabLayout, getTransitionSet());
99 | for (int i = 0; i < tabLayout.getTabCount(); i++) {
100 | TabLayout.Tab tab = tabLayout.getTabAt(i);
101 | assert tab != null;
102 | getTabView(i, tab, i == position);
103 | LinearLayout layout = ((LinearLayout) ((LinearLayout) tabLayout.getChildAt(0)).getChildAt(i));
104 | layout.setBackground(null);
105 | layout.setPaddingRelative(0, 0, 0, 0);
106 | }
107 | previousPosition = position;
108 | }
109 | }
110 |
111 | private TransitionSet getTransitionSet() {
112 | TransitionSet set = new TransitionSet();
113 | set.addTransition(new ChangeBounds().setDuration(250));
114 | set.setOrdering(TransitionSet.ORDERING_TOGETHER);
115 | return set;
116 | }
117 |
118 | public void onStart(TabLayout tabLayout) {
119 | this.tabLayout = tabLayout;
120 | }
121 |
122 | public void onStop() {
123 | this.tabLayout = null;
124 | }
125 |
126 | @Override
127 | public void onPageSelected(int position) {
128 | highLightTab(position);
129 | }
130 |
131 | public int getColor(@ColorRes int colorRes) {
132 | return ContextCompat.getColor(tabLayout.getContext(), colorRes);
133 | }
134 |
135 | public void setBadge(int count, int position) {
136 | TabLayout.Tab tab = tabLayout.getTabAt(position);
137 | assert tab != null;
138 | TextView badge = tab.getCustomView().findViewById(R.id.badge);
139 | badge.setVisibility(count == 0 ? View.GONE : View.VISIBLE);
140 | badge.setText(String.valueOf(count));
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/res/anim/hide.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
14 |
15 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/res/anim/show.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
14 |
15 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/res/drawable/badge_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/res/drawable/ic_dot.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/res/drawable/image_foreground.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
11 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/res/layout/custom_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
27 |
28 |
41 |
42 |
50 |
51 |
59 |
60 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | flashytabbarandroid
3 |
4 |
--------------------------------------------------------------------------------
/flashytabbarandroid/src/test/java/com/cuberto/flashytabbarandroid/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.cuberto.flashytabbarandroid;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cuberto/flashy-tabbar-android/2357393008da11c768184c0e5aa527beb56126c2/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Dec 25 13:15:55 MSK 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':flashytabbarandroid'
2 | rootProject.name='FlashyTabbarSampleApp'
3 |
--------------------------------------------------------------------------------
/versioning.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 |
3 | versionMajor = 1
4 | versionMinor = 0
5 | versionPatch = 0
6 | versionBuild = 0
7 |
8 | buildVersionCode = {
9 | (versionMajor * 1000000) + (versionMinor * 10000) + (versionPatch * 100) + versionBuild
10 | }
11 |
12 | buildVersionName = {
13 | "${versionMajor}.${versionMinor}.${versionPatch}"
14 | }
15 |
16 |
17 | buildVersionNameDebug = {
18 | "${versionMajor}.${versionMinor}.${versionPatch}.${versionBuild}"
19 | }
20 | }
--------------------------------------------------------------------------------