Skip to content

Commit

Permalink
1、Update to 1.0.3
Browse files Browse the repository at this point in the history
2、fix(fragmentation_core): YoKeyword#1139
3、fix(fragmentation_swipeback):YoKeyword#1159
4、update demo_wechat ,add login and splash fragments
5、CI use github actions
  • Loading branch information
JantHsueh committed Jan 17, 2020
1 parent 0394930 commit ecebb2c
Show file tree
Hide file tree
Showing 30 changed files with 381 additions and 127 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: RELEASE_CI

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# 打包apk
- name: Build with Gradle
run: chmod +x gradlew &&./gradlew assembleRelease


# 上传apk 到action,在右上角查看
- name: Upload APK
uses: actions/upload-artifact@v1
with:
name: app
path: app/build/outputs/apk/release/fragmentation.apk

# apk 签名
- name: Sign Apk
id: sign
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release/
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ steps.sign.outputs.signedReleaseFile }}
asset_name: fragmentation.apk
asset_content_type: application/zip
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
Support Androidx!

## Pre
[master](https://github.com/YoKeyword/Fragmentation/blob/master/CHANGELOG.md)
[master](https://github.com/JantHsueh/Fragmentation/blob/master/CHANGELOG.md)
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Fragmentation-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5937)
[![Build Status](https://travis-ci.org/YoKeyword/Fragmentation.svg?branch=master)](https://travis-ci.org/YoKeyword/Fragmentation)
[![Download](https://api.bintray.com/packages/yokeyword/maven/Fragmentation/images/download.svg) ](https://bintray.com/yokeyword/maven/Fragmentation/_latestVersion)
[![Build Status](https://github.com/JantHsueh/Fragmentation/workflows/RELEASE_CI/badge.svg?branch=androidx)](https://github.com/JantHsueh/Fragmentation/workflows/RELEASE_CI/badge.svg?branch=androidxn)
[![Download](https://api.bintray.com/packages/jantxue/maven/Fragmentationx/images/download.svg) ](https://bintray.com/jantxue/maven/Fragmentationx/_latestVersion)
[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://www.apache.org/licenses/LICENSE-2.0)

# PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED
****
### [中文版 README.md](https://github.com/YoKeyword/Fragmentation/blob/master/README_CN.md)
### [中文版 README.md](https://github.com/JantHsueh/Fragmentation/blob/androidx/README_CN.md)

# FragmentationX

Expand All @@ -18,7 +17,7 @@ It is designed for "Single Activity + Multi-Fragments" and "Multi-FragmentActivi
## Demo
The first demo shows the basic usage of the library. The second one shows the way to implement an app which is similar to Instagram. Complicated nested fragments' usage demo are also showed.

## [Download APK](https://www.pgyer.com/fragmentation)
## [Download APK](https://github.com/JantHsueh/Fragmentation/releases)

<img src="/gif/demo1.gif" width="280px"/> <img src="/gif/demo2.gif" width="280px"/>
 <img src="/gif/demo3.gif" width="280px"/>
Expand All @@ -37,34 +36,34 @@ The first demo shows the basic usage of the library. The second one shows the wa

**6. Easily manage Fragment transition animations**

**7. To simplify the communication between Fragment([EventBusActivityScope module](https://github.com/YoKeyword/Fragmentation/blob/master/eventbus_activity_scope/README.md))**
**7. To simplify the communication between Fragment([EventBusActivityScope module](https://github.com/JantHsueh/Fragmentation/blob/master/eventbus_activity_scope/README.md))**

**8. Support SwipeBack to pop(Fragmentation_SwipeBack module [README](https://github.com/YoKeyword/Fragmentation/blob/master/fragmentation_swipeback/README.md))**
**8. Support SwipeBack to pop(Fragmentation_SwipeBack module [README](https://github.com/JantHsueh/Fragmentation/blob/master/fragmentation_swipeback/README.md))**

<img src="/gif/stack.png" width="150px"/> <img src="/gif/log.png" width="300px"/>       <img src="/gif/SwipeBack.png" width="150px"/>

## How do I use Fragmentation?
### Note: This is the use of androidx, if you are using the android.support, [click here `branch:master`](https://github.com/YoKeyword/Fragmentation/blob/master/README.md)
### Note: This is the use of androidx, if you are using the android.support, [click here `branch:master`](https://github.com/JantHsueh/Fragmentation/blob/master/README.md)
**1、build.gradle**
````gradle
// This is the use of androidx, if you are using the android.support: fragmentationx -> fragmentation
implementation 'me.yokeyword:fragmentationx:1.0.2'
implementation 'me.xuexuan:fragmentationx:1.0.3'
// If you don't want to extends SupportActivity/Fragment and would like to customize your own support, just rely on fragmentation-core
// implementation 'me.yokeyword:fragmentationx-core:1.0.2'
// implementation 'me.xuexuan:fragmentationx-core:1.0.3'
// To get SwipeBack feature, rely on both fragmentation & fragmentation-swipeback
implementation 'me.yokeyword:fragmentationx:1.0.2'
implementation 'me.xuexuan:fragmentationx:1.0.3'
// Swipeback is based on fragmentation. Refer to SwipeBackActivity/Fragment for your Customized SupportActivity/Fragment
implementation 'me.yokeyword:fragmentationx-swipeback:1.0.2'
implementation 'me.xuexuan:fragmentationx-swipeback:1.0.3'
// To simplify the communication between Fragments.
implementation 'me.yokeyword:eventbus-activity-scope:1.1.0'
// Your EventBus's version
implementation 'org.greenrobot:eventbus:{version}'
````

**2. Activity `extends` SupportActivity or `implements` ISupportActivity:(refer to [MySupportActivity](https://github.com/YoKeyword/Fragmentation/blob/master/demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportActivity.java))**
**2. Activity `extends` SupportActivity or `implements` ISupportActivity:(refer to [MySupportActivity](https://github.com/JantHsueh/Fragmentation/blob/master/demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportActivity.java))**
````java
// since v1.0.0, forced extends of SupportActivity is not required, you can use interface + delegate to implement your own SupportActivity
public class MainActivity extends SupportActivity {
Expand All @@ -87,7 +86,7 @@ public class MainActivity extends SupportActivity {
}
````

**3. Fragment `extends` SupportFragment or `implements` ISupportFragment:(refer to [MySupportFragment](https://github.com/YoKeyword/Fragmentation/blob/master/demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportFragment.java)):**
**3. Fragment `extends` SupportFragment or `implements` ISupportFragment:(refer to [MySupportFragment](https://github.com/JantHsueh/Fragmentation/blob/master/demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportFragment.java)):**
````java
// since v1.0.0, forced extends of SupportActivity is not required, you can use interface + delegate to implement your own SupportActivity
public class HomeFragment extends SupportFragment {
Expand All @@ -100,7 +99,7 @@ public class HomeFragment extends SupportFragment {
}
````

## [WIKI](https://github.com/YoKeyword/Fragmentation/wiki) , [CHANGELOG](https://github.com/YoKeyword/Fragmentation/blob/master/CHANGELOG.md)
## [WIKI](https://github.com/JantHsueh/Fragmentation/wiki) , [CHANGELOG](https://github.com/JantHsueh/Fragmentation/blob/master/CHANGELOG.md)

## LICENSE
````
Expand Down
29 changes: 13 additions & 16 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Fragmentation-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5937)
[![Build Status](https://travis-ci.org/YoKeyword/Fragmentation.svg?branch=master)](https://travis-ci.org/YoKeyword/Fragmentation)
[![Download](https://api.bintray.com/packages/yokeyword/maven/Fragmentationx/images/download.svg) ](https://bintray.com/yokeyword/maven/Fragmentationx/_latestVersion)
[![Build Status](https://github.com/JantHsueh/Fragmentation/workflows/RELEASE_CI/badge.svg?branch=androidx)](https://github.com/JantHsueh/Fragmentation/workflows/RELEASE_CI/badge.svg?branch=androidxn)
[![Download](https://api.bintray.com/packages/jantxue/maven/Fragmentationx/images/download.svg) ](https://bintray.com/jantxue/maven/Fragmentationx/_latestVersion)
[![Hex.pm](https://img.shields.io/hexpm/l/plug.svg)](https://www.apache.org/licenses/LICENSE-2.0)

# 注意:该项目不再维护


# FragmentationX
A powerful library that manage Fragment for Android!
Expand All @@ -24,8 +22,7 @@ A powerful library that manage Fragment for Android!
# Demo演示:
均为单Activity + 多Fragment,第一个为简单流式demo,第二个为仿微信交互的demo(全页面支持滑动退出),第三个为仿知乎交互的复杂嵌套demo

## [下载APK](https://www.pgyer.com/fragmentation)

## [下载APK](https://github.com/JantHsueh/Fragmentation/releases)

<img src="/gif/demo1.gif" width="280px"/> <img src="/gif/demo2.gif" width="280px"/>
 <img src="/gif/demo3.gif" width="280px"/>
Expand All @@ -44,35 +41,35 @@ A powerful library that manage Fragment for Android!

6、**提供 Fragment转场动画 系列解决方案,动态改变动画**

7、**提供Activity作用域的EventBus辅助类,Fragment通信更简单、独立(需要使用[EventBusActivityScope库](https://github.com/YoKeyword/Fragmentation/blob/master/eventbus_activity_scope/README.md))**
7、**提供Activity作用域的EventBus辅助类,Fragment通信更简单、独立(需要使用[EventBusActivityScope库](https://github.com/JantHsueh/Fragmentation/blob/master/eventbus_activity_scope/README.md))**

8、**支持SwipeBack滑动边缘退出(需要使用[Fragmentation_SwipeBack库](https://github.com/YoKeyword/Fragmentation/blob/master/fragmentation_swipeback/README.md))**
8、**支持SwipeBack滑动边缘退出(需要使用[Fragmentation_SwipeBack库](https://github.com/JantHsueh/Fragmentation/blob/master/fragmentation_swipeback/README.md))**

<img src="/gif/stack.png" width="150px"/> <img src="/gif/log.png" width="300px"/>     <img src="/gif/SwipeBack.png" width="150px"/>

# 如何使用
### 注意:以下为androidx的使用方式,如果使用的是android.support包,[点击这里`master`分支](https://github.com/YoKeyword/Fragmentation/blob/master/README_CN.md)
### 注意:以下为androidx的使用方式,如果使用的是android.support包,[点击这里`master`分支](https://github.com/JantHsueh/Fragmentation/blob/master/README_CN.md)
**1. 项目下app的build.gradle中依赖:**

````gradle
// 以下为androidx的使用方式,如果使用的是android.support包,fragmentationx -> fragmentation 即可
implementation 'me.yokeyword:fragmentationx:1.0.2'
implementation 'me.xuexuan:fragmentationx:1.0.3'
// 如果不想继承SupportActivity/Fragment,自己定制Support,可仅依赖:
// implementation 'me.yokeyword:fragmentationx-core:1.0.2'
// implementation 'me.xuexuan:fragmentationx-core:1.0.3'
// 如果想使用SwipeBack 滑动边缘退出Fragment/Activity功能,完整的添加规则如下:
implementation 'me.yokeyword:fragmentationx:1.0.2'
implementation 'me.xuexuan:fragmentationx:1.0.3'
// swipeback基于fragmentation, 如果是自定制SupportActivity/Fragment,则参照SwipeBackActivity/Fragment实现即可
implementation 'me.yokeyword:fragmentationx-swipeback:1.0.2'
implementation 'me.xuexuan:fragmentationx-swipeback:1.0.3'
// Activity作用域的EventBus,通信更安全
implementation 'me.yokeyword:eventbus-activity-scope:1.1.0'
// Your EventBus's version
implementation 'org.greenrobot:eventbus:{version}'
````

**2. Activity `extends` SupportActivity或者 `implements` ISupportActivity:(实现方式可参考[MySupportActivity](https://github.com/YoKeyword/Fragmentation/blob/master/demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportActivity.java))**
**2. Activity `extends` SupportActivity或者 `implements` ISupportActivity:(实现方式可参考[MySupportActivity](https://github.com/JantHsueh/Fragmentation/blob/master/demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportActivity.java))**
````java
// v1.0.0开始,不强制继承SupportActivity,可使用接口+委托形式来实现自己的SupportActivity
public class MainActivity extends SupportActivity {
Expand All @@ -95,7 +92,7 @@ public class MainActivity extends SupportActivity {
}
````

**3. Fragment `extends` SupportFragment或者 `implements` ISupportFragment:(实现方式可参考[MySupportFragment](https://github.com/YoKeyword/Fragmentation/blob/master/demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportFragment.java)):**
**3. Fragment `extends` SupportFragment或者 `implements` ISupportFragment:(实现方式可参考[MySupportFragment](https://github.com/JantHsueh/Fragmentation/blob/master/demo/src/main/java/me/yokeyword/sample/demo_flow/base/MySupportFragment.java)):**
````java
// v1.0.0开始,不强制继承SupportFragment,可使用接口+委托形式来实现自己的SupportFragment
public class HomeFragment extends SupportFragment {
Expand All @@ -108,7 +105,7 @@ public class HomeFragment extends SupportFragment {
}
````

## [进一步使用、ChangeLog,查看wiki](https://github.com/YoKeyword/Fragmentation/wiki)
## [进一步使用、ChangeLog,查看wiki](https://github.com/JantHsueh/Fragmentation/wiki)

## LICENSE
````
Expand Down
12 changes: 10 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.android.tools.build:gradle:3.5.2'
// classpath 'com.novoda:bintray-release:0.9.2'
}
}

Expand All @@ -28,4 +28,12 @@ ext {
targetSdkVersion = compileSdkVersion

appCompatVersion = "1.1.0-alpha01"

// userOrg = "jantxue"
// groupId = "me.xuexuan"
// publishVersion = "1.0.3"
// desc = "A powerful library that manage Fragment for Android"
// website = "https://github.com/JantHsueh/Fragmentation"
// licences = ['Apache-2.0']

}
14 changes: 1 addition & 13 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,16 @@ android {
compileSdkVersion rootProject.compileSdkVersion

defaultConfig {
applicationId "me.yokeyword.sample"
applicationId "me.xuexuan.fragmentation"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 1
versionName gitLatestTag()
}

signingConfigs {
releaseConfig {
storeFile file("./fragmentation.jks")
storePassword System.getenv("KEYSTORE_PASS")
keyAlias System.getenv("ALIAS_NAME")
keyPassword System.getenv("ALIAS_PASS")
}
}

buildTypes {
release {
minifyEnabled false

signingConfig signingConfigs.releaseConfig

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand Down
Binary file removed demo/fragmentation.jks.enc
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
package me.yokeyword.sample.demo_wechat;

import android.os.Bundle;

import androidx.annotation.Nullable;

import me.yokeyword.fragmentation.SupportActivity;
import me.yokeyword.fragmentation.anim.DefaultHorizontalAnimator;
import me.yokeyword.fragmentation.anim.FragmentAnimator;
import me.yokeyword.sample.R;
import me.yokeyword.sample.demo_wechat.ui.fragment.LoginFragment;
import me.yokeyword.sample.demo_wechat.ui.fragment.MainFragment;
import me.yokeyword.sample.demo_wechat.ui.fragment.SplashFragment;

/**
* 仿微信交互方式Demo
* Created by YoKeyword on 16/6/30.
* Modify by xuexuan on 2020年1月16日16:37:10
* 修改后,加入SplashFragment、LoginFragment。这样的跳转关系和内存重启后的判断很关键,如果处理不当,容易出现崩溃
*
*/
public class MainActivity extends SupportActivity {

Expand All @@ -20,8 +26,11 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.wechat_activity_main);

if (findFragment(MainFragment.class) == null) {
loadRootFragment(R.id.fl_container, MainFragment.newInstance());
//这里需要如下判断,否则可能出现这个错误https://xuexuan.blog.csdn.net/article/details/103733622
if (findFragment(MainFragment.class) == null
&& findFragment(LoginFragment.class) == null
&& findFragment(SplashFragment.class) == null) {
loadRootFragment(R.id.fl_container, SplashFragment.newInstance());
}
}

Expand Down
Loading

0 comments on commit ecebb2c

Please sign in to comment.