-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Interlude | ||
|
||
提供Loading动画的DialogFragment.主要目的是用于替代ProgressDialog<br> | ||
动画由[AVLoadingIndicatorView](https://github.com/81813780/AVLoadingIndicatorView)实现 | ||
|
||
|
||
|
||
<img src='art/art01.png'/ width=200px> <img src='art/art02.png'/ width=200px> | ||
|
||
` compile 'com.twisty.interlude:1.0.0' | ||
` | ||
``` | ||
//construct | ||
var interlude: Interlude = Interlude(supportFragmentManager) | ||
//config | ||
with(interlude) { | ||
dim = 0.1F //dialog弹出时背景变暗程度 | ||
indicatorColorResource = android.R.color.darker_gray //progress的颜色 | ||
backGroundColorResource = android.R.color.transparent //dialog的背景色 | ||
indicatorType = IndicatorType.BallPulseIndicator //progress的类型 | ||
isCancelable = true //是否可以取消 | ||
canceledOnTouchOutside = false //点击界外是否取消 | ||
cancelCallback = { | ||
Log.i(localClassName, "Cancel") | ||
} //取消回调 | ||
dismissCallback = { | ||
Log.i(localClassName, "Dismiss") | ||
} //消失回调,cancel也会执行dismiss | ||
} | ||
//show | ||
interlude.show() | ||
//dismiss | ||
interlude.dismiss() | ||
``` | ||
|
||
|
||
`IndicatorType` 对应[AVLoadingIndicatorView](https://github.com/81813780/AVLoadingIndicatorView)的各个`Indicator` | ||
|
||
``` | ||
enum class IndicatorType { | ||
BallPulseIndicator, | ||
BallGridPulseIndicator, | ||
BallClipRotateIndicator, | ||
BallClipRotatePulseIndicator, | ||
SquareSpinIndicator, | ||
BallClipRotateMultipleIndicator, | ||
BallPulseRiseIndicator, | ||
BallRotateIndicator, | ||
CubeTransitionIndicator, | ||
BallZigZagIndicator, | ||
BallZigZagDeflectIndicator, | ||
BallTrianglePathIndicator, | ||
BallScaleIndicator, | ||
LineScaleIndicator, | ||
LineScalePartyIndicator, | ||
BallScaleMultipleIndicator, | ||
BallPulseSyncIndicator, | ||
BallBeatIndicator, | ||
LineScalePulseOutIndicator, | ||
LineScalePulseOutRapidIndicator, | ||
BallScaleRippleIndicator, | ||
BallScaleRippleMultipleIndicator, | ||
BallSpinFadeLoaderIndicator, | ||
LineSpinFadeLoaderIndicator, | ||
TriangleSkewSpinIndicator, | ||
PacmanIndicator, | ||
BallGridBeatIndicator, | ||
SemiCircleSpinIndicator, | ||
} | ||
``` | ||
<img src='art/avi.gif') width=200px> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
apply plugin: 'kotlin-android' | ||
|
||
|
||
android { | ||
compileSdkVersion 25 | ||
buildToolsVersion "25.0.2" | ||
defaultConfig { | ||
applicationId "com.twisty.interlude" | ||
minSdkVersion 14 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" | ||
implementation 'com.android.support:appcompat-v7:25.4.0' | ||
implementation 'com.android.support.constraint:constraint-layout:1.0.2' | ||
implementation "org.jetbrains.anko:anko-commons:0.10.1" | ||
implementation project(':library') | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/twisty/Documents/Android_SDK/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.twisty.interlude" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".example.MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".example.Main2Activity"> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |