├── Ref ├── infer-out ├── .start ├── results.db-wal ├── results.db ├── results.db-shm ├── logs └── toplevel.log ├── app ├── .gitignore ├── hold1.keystore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_tabs.png │ │ │ │ ├── tabs_web.png │ │ │ │ ├── ic_adapter.png │ │ │ │ ├── ic_colors.png │ │ │ │ ├── ic_contact.png │ │ │ │ ├── ic_divider.png │ │ │ │ ├── ic_divider1.png │ │ │ │ ├── ic_divider2.png │ │ │ │ ├── ic_divider3.png │ │ │ │ ├── tab_image.png │ │ │ │ ├── tabs_custom.png │ │ │ │ ├── tabs_text.png │ │ │ │ ├── divider_diag.png │ │ │ │ ├── ic_indicator.png │ │ │ │ ├── tabs_custom_anim.png │ │ │ │ └── ic_add_shopping_cart_black_24dp.png │ │ │ ├── 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 │ │ │ ├── drawable │ │ │ │ ├── solid_color.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── demo_fragment.xml │ │ │ │ ├── contact_fragment.xml │ │ │ │ ├── tab_item.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_viewpager_2.xml │ │ │ │ ├── activity_navigation.xml │ │ │ │ ├── activity_start.xml │ │ │ │ ├── colors_fragment.xml │ │ │ │ ├── divider_fragment.xml │ │ │ │ ├── adapters_fragment.xml │ │ │ │ └── tabs_fragment.xml │ │ │ ├── menu │ │ │ │ └── menu.xml │ │ │ ├── navigation │ │ │ │ └── nav_graph.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── hold1 │ │ │ │ └── pagertabsdemo │ │ │ │ ├── fragments │ │ │ │ ├── FragmentPresenter.kt │ │ │ │ ├── DemoFragment.kt │ │ │ │ ├── ContactFragment.kt │ │ │ │ ├── AdaptersFragment.kt │ │ │ │ ├── ColorsFragment.kt │ │ │ │ ├── DividerFragment.kt │ │ │ │ └── TabsFragment.kt │ │ │ │ ├── TabbedActivity.kt │ │ │ │ ├── StartActivity.kt │ │ │ │ ├── TabItemView.kt │ │ │ │ ├── Util.kt │ │ │ │ ├── JetpackNavigationActivity.kt │ │ │ │ ├── ViewPagerActivity.kt │ │ │ │ └── ViewPager2Activity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── hold1 │ │ │ └── pagertabsdemo │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── hold1 │ │ └── pagertabsdemo │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── pagertabsindicator ├── .gitignore ├── src │ └── main │ │ ├── res │ │ └── values │ │ │ ├── strings.xml │ │ │ ├── colors.xml │ │ │ ├── config.xml │ │ │ └── attrs.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── hold1 │ │ └── pagertabsindicator │ │ ├── TabInfo.kt │ │ ├── TabViewProvider.kt │ │ ├── TabView.kt │ │ ├── Util.java │ │ ├── adapters │ │ ├── ViewPagerTabsAdapter.kt │ │ ├── ViewPager2TabsAdapter.kt │ │ └── TabsAdapter.kt │ │ └── PagerTabsIndicator.kt ├── proguard-rules.pro └── build.gradle ├── .idea ├── .gitignore ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── compiler.xml ├── vcs.xml ├── modules.xml ├── gradle.xml ├── misc.xml ├── jarRepositories.xml └── navEditor.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── gradle.properties ├── gradlew.bat ├── Readme.md ├── scripts └── gradle-publishing.gradle ├── gradlew └── LICENSE /Ref: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /infer-out/.start: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /infer-out/results.db-wal: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pagertabsindicator/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /app/hold1.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/hold1.keystore -------------------------------------------------------------------------------- /infer-out/results.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/infer-out/results.db -------------------------------------------------------------------------------- /infer-out/results.db-shm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/infer-out/results.db-shm -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | PagerTabsIndicator 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /pagertabsindicator/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | PagerTabsIndicator 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_tabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_tabs.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/tabs_web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/tabs_web.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_adapter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_adapter.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_colors.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_contact.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_divider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_divider.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_divider1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_divider1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_divider2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_divider2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_divider3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_divider3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/tab_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/tab_image.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/tabs_custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/tabs_custom.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/tabs_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/tabs_text.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/divider_diag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/divider_diag.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_indicator.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/tabs_custom_anim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/tabs_custom_anim.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /pagertabsindicator/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_add_shopping_cart_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Crysis21/PagerTabIndicator/HEAD/app/src/main/res/drawable-xxhdpi/ic_add_shopping_cart_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 64dp 4 | 56dp 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /pagertabsindicator/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ff7b16 4 | #a1a1a1 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/solid_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #737373 4 | #9b9b9b 5 | #ffa940 6 | 7 | -------------------------------------------------------------------------------- /pagertabsindicator/src/main/java/com/hold1/pagertabsindicator/TabInfo.kt: -------------------------------------------------------------------------------- 1 | package com.hold1.pagertabsindicator 2 | 3 | open class TabInfo( 4 | val destinationId: Int, 5 | val name: String?, 6 | val imageUrl: String?, 7 | val imageResource: Int? 8 | ) 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Nov 24 23:14:42 EET 2020 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-7.0.2-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/hold1/pagertabsdemo/fragments/FragmentPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.hold1.pagertabsdemo.fragments 2 | 3 | /** 4 | * Created by Cristian Holdunu on 16/11/2017. 5 | */ 6 | interface FragmentPresenter { 7 | val tabName: String? 8 | val tabImage: Int 9 | val tabImageUrl: String? 10 | } -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/demo_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 3 | repositories { 4 | google() 5 | mavenCentral() 6 | maven { url = 'https://dl.bintray.com/yuancloud/maven/' } 7 | maven { url 'https://jitpack.io' } 8 | } 9 | } 10 | include ':app', ':pagertabsindicator' 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/hold1/pagertabsdemo/TabbedActivity.kt: -------------------------------------------------------------------------------- 1 | package com.hold1.pagertabsdemo 2 | 3 | import com.hold1.pagertabsindicator.PagerTabsIndicator 4 | 5 | interface TabbedActivity { 6 | 7 | enum class TabAdapterType { 8 | TEXT, IMAGE, WEB, CUSTOM, CUSTOM_ANIM 9 | } 10 | 11 | val tabsIndicator: PagerTabsIndicator 12 | 13 | fun changeTabAdapter(adapterType: TabAdapterType?) 14 | 15 | fun addDummyTab() 16 | 17 | } -------------------------------------------------------------------------------- /app/src/test/java/com/hold1/pagertabsdemo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.hold1.pagertabsdemo; 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() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /pagertabsindicator/src/main/res/values/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #363636 4 | #595959 5 | 16dp 6 | 8dp 7 | 8dp 8 | 1px 9 | 10dp 10 | 12dp 11 | -------------------------------------------------------------------------------- /pagertabsindicator/src/main/java/com/hold1/pagertabsindicator/TabViewProvider.kt: -------------------------------------------------------------------------------- 1 | package com.hold1.pagertabsindicator 2 | 3 | import android.net.Uri 4 | import android.view.View 5 | 6 | sealed interface TabViewProvider { 7 | 8 | interface ImageResource: TabViewProvider { 9 | fun getTabIconUri(position: Int): Uri? 10 | fun getTabIconResId(position: Int): Int 11 | } 12 | 13 | interface ViewResource: TabViewProvider { 14 | fun getTabView(position: Int): View 15 | } 16 | 17 | interface TextResource: TabViewProvider { 18 | fun getTabTitle(position: Int): String 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 11 | 14 | 17 | 20 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /pagertabsindicator/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/main/java/com/hold1/pagertabsdemo/fragments/DemoFragment.kt: -------------------------------------------------------------------------------- 1 | package com.hold1.pagertabsdemo.fragments 2 | 3 | import android.os.Bundle 4 | import android.view.LayoutInflater 5 | import android.view.View 6 | import android.view.ViewGroup 7 | import androidx.fragment.app.Fragment 8 | import com.hold1.pagertabsdemo.R 9 | 10 | /** 11 | * Created by Cristian Holdunu on 08/11/2017. 12 | */ 13 | class DemoFragment : Fragment(), FragmentPresenter { 14 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { 15 | return inflater.inflate(R.layout.demo_fragment, null) 16 | } 17 | 18 | override val tabName: String 19 | get() = "Dummy" 20 | override val tabImage: Int 21 | get() = R.drawable.ic_add_shopping_cart_black_24dp 22 | override val tabImageUrl: String? 23 | get() = null 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hold1/pagertabsdemo/StartActivity.kt: -------------------------------------------------------------------------------- 1 | package com.hold1.pagertabsdemo 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import androidx.appcompat.app.AppCompatActivity 6 | import com.hold1.pagertabsdemo.databinding.ActivityStartBinding 7 | 8 | class StartActivity: AppCompatActivity() { 9 | 10 | lateinit var binding: ActivityStartBinding 11 | 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | binding = ActivityStartBinding.inflate(layoutInflater) 15 | setContentView(binding.root) 16 | 17 | binding.viewPager1.setOnClickListener { 18 | startActivity(Intent(this, ViewPagerActivity::class.java)) 19 | } 20 | 21 | binding.viewPager2.setOnClickListener { 22 | startActivity(Intent(this, ViewPager2Activity::class.java)) 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/hold1/pagertabsdemo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.hold1.pagertabsdemo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.hold1.pagertabsindicator", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/contact_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |