Skip to content

Commit

Permalink
改变原项目包结构,并将Library提交jcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiDian_Teprinciple committed Sep 28, 2017
1 parent f8d10e8 commit 16e98e1
Show file tree
Hide file tree
Showing 22 changed files with 130 additions and 46 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# SlideBack

# SlideBack
[SlideBack](https://github.com/leehong2005/SlideBack) 项目实现了类似 `iOS` 左侧滑动返回交互的功能,`Android` 平台做得最早的应该是微信,即使到了现在,有滑动返回功能的App也不是很多,就算有,做得极致的也比较少。

滑动返回功能目前我已经使用在自己的项目中了,也发现了不少问题,现在坑基本都填平了,一直就想放到 GitHub 上面来,迟迟等到今天是因为我认为始终还没达到一个完美的状态。该功能的实现最开始其实也从系统提供的组件中找到了一些灵感,典型的就是 `SlidePannel`,左侧菜单, Google 原生的 Android 应用基本都有这样的交互设计。站在前人的肩膀上,经过一番设计加工,也就有了现在的实现。
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'

classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
24 changes: 0 additions & 24 deletions library/build.gradle

This file was deleted.

4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.megabox.android.slide"
applicationId "com.teprinciple.slideback"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
Expand All @@ -22,5 +22,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.2.1'
compile project(path: ':library')
compile project(path: ':slideback')
}
6 changes: 3 additions & 3 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.megabox.android.slide.sample"
<manifest package="com.teprinciple.slideback"
xmlns:android="http://schemas.android.com/apk/res/android">

<application
Expand All @@ -8,14 +8,14 @@
android:label="@string/app_name"
android:supportsRtl="false"
android:theme="@style/AppTheme">
<activity android:name="com.megabox.android.slide.MainActivity">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="com.megabox.android.slide.ListViewActivity"
<activity android:name=".ListViewActivity"
android:label="ListViewActivity"/>
</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.megabox.android.slide;
package com.teprinciple.slideback;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.megabox.android.slide.sample.R;
import com.teprinciple.slideback.slide.SlideBackActivity;

/**
* @author lihong
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.megabox.android.slide;
package com.teprinciple.slideback;

import android.content.Intent;
import android.graphics.Color;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.megabox.android.slide;
package com.teprinciple.slideback;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.megabox.android.slide.sample.R;

public class MainActivity extends ActionBarActivity {

Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.megabox.android.slide.MainActivity">
tools:context="com.teprinciple.slideback.MainActivity">

<Button
android:id="@+id/btn_click_me"
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':sample', ':library'
include ':sample', ':slideback'
File renamed without changes.
105 changes: 105 additions & 0 deletions slideback/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"

defaultConfig {
minSdkVersion 14
targetSdkVersion 24
versionCode 10
versionName "1.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.2.1'
}




apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
// This is the library version used when deploying the artifact
version = "1.1"

def siteUrl = 'https://github.com/teprinciple/SlideBack' // 项目的主页
def gitUrl = 'https://github.com/teprinciple/SlideBack.git' // Git仓库的url
group = "com.teprinciple" // Maven Group ID for the artifact,一般填你唯一的包名
install {
repositories.mavenInstaller {
// This generates POM.file_paths with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'A Simple library for Android Activity slideback'
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'teprinciple' //填写的一些基本信息
name 'teprinciple'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven" ////跟上面创建的Maven仓库名字保持一致
name = "slideback" //发布到JCenter上的项目名字
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
javadoc { //jav doc采用utf-8编码否则会报“GBK的不可映射字符”错误
options{
encoding "UTF-8"
charSet 'UTF-8'
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest package="com.megabox.android.slide"
<manifest package="com.teprinciple.slideback.slide"
xmlns:android="http://schemas.android.com/apk/res/android">

<application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.megabox.android.slide;
package com.teprinciple.slideback.slide;

import android.app.Application;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package com.megabox.android.slide;
package com.teprinciple.slideback.slide;

import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

/**
* 这个类用来管理 activity 的栈
*
* @author lihong
* @since 2016/10/28
*/
class ActivityInterfaceImpl extends Activity implements ActivityInterface {
class ActivityInterfaceImpl extends AppCompatActivity implements ActivityInterface {

private Application.ActivityLifecycleCallbacks mActivityLifecycleCallbacks;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.megabox.android.slide;
package com.teprinciple.slideback.slide;

import android.app.Activity;
import android.app.Application;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.megabox.android.slide;
package com.teprinciple.slideback.slide;

import android.app.Activity;
import android.util.Log;

import com.teprinciple.slideback.slide.BuildConfig;

import java.util.LinkedList;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.megabox.android.slide;
package com.teprinciple.slideback.slide;

import android.app.Activity;
import android.app.Application;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.megabox.android.slide;
package com.teprinciple.slideback.slide;

import android.content.Context;
import android.content.res.TypedArray;
Expand Down
File renamed without changes.

0 comments on commit 16e98e1

Please sign in to comment.