Skip to content

Commit

Permalink
迁移到MavenCentral
Browse files Browse the repository at this point in the history
  • Loading branch information
tyzlmjj committed May 8, 2021
1 parent 2ef3c36 commit fae3861
Show file tree
Hide file tree
Showing 16 changed files with 98 additions and 165 deletions.
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx

*.apk
*.aab
*.gpg
Binary file removed .idea/caches/build_file_checksums.ser
Binary file not shown.
18 changes: 1 addition & 17 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

55 changes: 0 additions & 55 deletions .idea/navEditor.xml

This file was deleted.

1 change: 1 addition & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 14 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# PagerBottomTabStrip [ ![Download](https://api.bintray.com/packages/tyzlmjj/maven/pager-bottom-tab-strip/images/download.svg) ](https://bintray.com/tyzlmjj/maven/pager-bottom-tab-strip/view)
PagerBottomTabStrip
=====

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.majiajie/pager-bottom-tab-strip/badge.svg)](https://maven-badges.herokuapp.com/maven-central/me.majiajie/pager-bottom-tab-strip)
|[使用指南][1]|[DEMO.apk][2]

Android 页面底部和侧边的导航栏。

Expand All @@ -10,7 +14,6 @@ Android 页面底部和侧边的导航栏。
- 支持与[Navigation Architecture Component](https://developer.android.com/topic/libraries/architecture/navigation/)配合使用
- 支持[AndroidX](https://developer.android.com/jetpack/androidx/)

[[使用指南](https://github.com/tyzlmjj/PagerBottomTabStrip/wiki/%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97) ] [[DEMO.apk](https://github.com/tyzlmjj/PagerBottomTabStrip/releases/download/2.3.0X/Demo.apk)]

## 实现效果图

Expand All @@ -31,14 +34,14 @@ Android 页面底部和侧边的导航栏。

## 引入库

for [AndroidX](https://developer.android.com/jetpack/androidx/)
```
implementation 'me.majiajie:pager-bottom-tab-strip:2.3.0X'
```
```gradle
repositories {
mavenCentral()
}
for original Android [Support Library](https://developer.android.com/topic/libraries/support-library/)
```
implementation 'me.majiajie:pager-bottom-tab-strip:2.3.0'
dependencies {
implementation 'me.majiajie:pager-bottom-tab-strip:2.4.0'
}
```

## 联系我
Expand All @@ -49,21 +52,5 @@ implementation 'me.majiajie:pager-bottom-tab-strip:2.3.0'

这个库有BUG?请点这里 [Github Issues](https://github.com/tyzlmjj/PagerBottomTabStrip/issues)

## LICENSE

PagerBottomTabStrip is released under the [Apache 2.0 license](/LICENSE).
```
Copyright 2016 MJJ
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.
```
[1]: https://github.com/tyzlmjj/PagerBottomTabStrip/wiki
[2]: https://github.com/tyzlmjj/PagerBottomTabStrip/releases/download/2.4.0/Demo.apk
15 changes: 9 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ android {

dependencies {

implementation project(':pager-bottom-tab-strip')
// implementation "me.majiajie:pager-bottom-tab-strip:${versionName}"
def nav_version = "2.3.5"

// implementation project(':pager-bottom-tab-strip')
implementation "me.majiajie:pager-bottom-tab-strip:${versionName}"

// V7
implementation "androidx.appcompat:appcompat:$supportLibraryVersion"
implementation "androidx.appcompat:appcompat:1.2.0"
// design
implementation "com.google.android.material:material:$supportLibraryVersion"
implementation "com.google.android.material:material:1.2.1"

// navigation
implementation "android.arch.navigation:navigation-fragment:$nav_version"
implementation "android.arch.navigation:navigation-ui:$nav_version"
implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.majiajie.pagerbottomtabstriptest.utils;



import androidx.annotation.NonNull;
import androidx.navigation.NavController;
import androidx.navigation.NavDestination;
import androidx.navigation.NavOptions;
import me.majiajie.pagerbottomtabstrip.NavigationController;
import me.majiajie.pagerbottomtabstrip.listener.OnTabItemSelectedListener;
Expand All @@ -28,18 +28,14 @@ public void onSelected(int index, int old) {
public void onRepeat(int index) {}
});

navController.addOnNavigatedListener(new NavController.OnNavigatedListener() {
@Override
public void onNavigated(@NonNull NavController controller,
@NonNull NavDestination destination) {
int destinationId = destination.getId();
for (int i = 0; i < pageIds.length; i++) {
if (destinationId == pageIds[i]){
if (navigationController.getSelected() != i){
navigationController.setSelect(i,false);
}
break;
navController.addOnDestinationChangedListener((controller, destination, arguments) -> {
int destinationId = destination.getId();
for (int i = 0; i < pageIds.length; i++) {
if (destinationId == pageIds[i]){
if (navigationController.getSelected() != i){
navigationController.setSelect(i,false);
}
break;
}
}
});
Expand Down
24 changes: 12 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:4.2.0'
}
}

plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

allprojects {
repositories {
jcenter()
mavenCentral()
google()
}

Expand All @@ -25,17 +28,14 @@ task clean(type: Delete) {

ext{
// 编译版本
compileSdkVersion = 28
compileSdkVersion = 30
minSdkVersion = 14
targetSdkVersion = 28
targetSdkVersion = 30

// 版本号
versionCode = 16
versionName = "2.3.0X"
versionCode = 17
versionName = "2.4.0"

// 依赖库版本
supportLibraryVersion = '1.0.0'
}

// Navigation
nav_version = "1.0.0-alpha06"
}
apply from: 'https://raw.githubusercontent.com/tyzlmjj/Gradle/master/MavenCentral/publish-root.gradle'
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
14 changes: 3 additions & 11 deletions pager-bottom-tab-strip/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
// plugins {
// id "com.jfrog.bintray" version "1.8.4"
// id "com.github.dcendents.android-maven" version "2.1"
// }

apply plugin: 'com.android.library'

android {
Expand All @@ -28,11 +23,8 @@ android {
}

dependencies {
implementation "androidx.legacy:legacy-support-v4:${supportLibraryVersion}"
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
}


//apply from: 'upload_to_bintray.gradle'



apply from: 'upload_to_maven_central.gradle'
Loading

0 comments on commit fae3861

Please sign in to comment.