Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into bukalapak
Browse files Browse the repository at this point in the history
  • Loading branch information
andree-surya committed Sep 26, 2019
2 parents d87f5e8 + 4a4726d commit 38710ac
Show file tree
Hide file tree
Showing 83 changed files with 14,482 additions and 260 deletions.
11 changes: 10 additions & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
readme: README.md
author: Vinh Nguyen
author_url: https://github.com/ninjaprox
github_url: https://github.com/ninjaprox/NVActivityIndicatorView

theme: fullwidth
disable_search: true

module: NVActivityIndicatorView
source_directory: Source
xcodebuild_arguments:
- -scheme
- NVActivityIndicatorView
- NVActivityIndicatorView-iOS
- -project
- NVActivityIndicatorView.xcodeproj
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ env:
- SCHEME=NVActivityIndicatorViewTests
matrix:
include:
- osx_image: xcode10
env: SDK="iphonesimulator12.0" DESTINATION="name=iPhone 6s,OS=12.0"
- osx_image: xcode10.2
env: SDK="iphonesimulator12.2" DESTINATION="name=iPhone 6s,OS=12.2"
script:
- set -o pipefail
- pod install --project-directory=Example
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Change log

## [4.8.0](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/4.8.0)
* Add Swift Package Manager support (#290)

## [4.7.0](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/4.7.0)
* Default nil fadeInAnimation and fadeOutAnimation (#264)
* Swift 5 migration (#274)

## [4.6.1](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/4.6.1)
* Fix #261

## [4.6.0](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/4.6.0)
* New NVActivityIndicatorAnimationBallDoubleBounce animation (#258)
* Unify product name (#260)

## [4.5.1](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/4.5.1)
* Fix #251

## [4.5.0](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/4.5.0)
* Add tvOS target (#248)

## [4.4.1](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/4.4.1)
* Don’t start/stop animating if unnecessary (#239)
* Specify Swift version in Podspec (#245)

## [4.4.0](https://github.com/ninjaprox/NVActivityIndicatorView/releases/tag/4.4.0)
* Fix #211
* Swift 4.2 migration
Expand Down
29 changes: 13 additions & 16 deletions Example/NVActivityIndicatorViewExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@
TargetAttributes = {
1F0326F81F0D28CC00BF3358 = {
CreatedOnToolsVersion = 8.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
1F0327281F0D399E00BF3358 = {
CreatedOnToolsVersion = 8.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
TestTargetID = 1F0326F81F0D28CC00BF3358;
};
Expand All @@ -209,6 +209,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -250,7 +251,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-NVActivityIndicatorViewExample/Pods-NVActivityIndicatorViewExample-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-NVActivityIndicatorViewExample/Pods-NVActivityIndicatorViewExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -259,7 +260,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NVActivityIndicatorViewExample/Pods-NVActivityIndicatorViewExample-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NVActivityIndicatorViewExample/Pods-NVActivityIndicatorViewExample-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
C3A662686B21AB8B414FCDA2 /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -286,7 +287,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-NVActivityIndicatorViewExample-NVActivityIndicatorViewTests/Pods-NVActivityIndicatorViewExample-NVActivityIndicatorViewTests-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-NVActivityIndicatorViewExample-NVActivityIndicatorViewTests/Pods-NVActivityIndicatorViewExample-NVActivityIndicatorViewTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -295,7 +296,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NVActivityIndicatorViewExample-NVActivityIndicatorViewTests/Pods-NVActivityIndicatorViewExample-NVActivityIndicatorViewTests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NVActivityIndicatorViewExample-NVActivityIndicatorViewTests/Pods-NVActivityIndicatorViewExample-NVActivityIndicatorViewTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FC7EC3A272EE15625D0A4145 /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -424,7 +425,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand Down Expand Up @@ -475,7 +476,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -491,8 +492,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.vinhis.NVActivityIndicatorViewExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -507,8 +507,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.vinhis.NVActivityIndicatorViewExample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -526,8 +525,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NVActivityIndicatorViewExample.app/NVActivityIndicatorViewExample";
};
name = Debug;
Expand All @@ -545,8 +543,7 @@
PRODUCT_BUNDLE_IDENTIFIER = me.vinhis.NVActivityIndicatorViewTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NVActivityIndicatorViewExample.app/NVActivityIndicatorViewExample";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1F0326F81F0D28CC00BF3358"
BuildableName = "NVActivityIndicatorViewExample.app"
BlueprintName = "NVActivityIndicatorViewExample"
ReferencedContainer = "container:NVActivityIndicatorViewExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1F0326F81F0D28CC00BF3358"
BuildableName = "NVActivityIndicatorViewExample.app"
BlueprintName = "NVActivityIndicatorViewExample"
ReferencedContainer = "container:NVActivityIndicatorViewExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1F0326F81F0D28CC00BF3358"
BuildableName = "NVActivityIndicatorViewExample.app"
BlueprintName = "NVActivityIndicatorViewExample"
ReferencedContainer = "container:NVActivityIndicatorViewExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1F0326F81F0D28CC00BF3358"
BuildableName = "NVActivityIndicatorViewExample.app"
BlueprintName = "NVActivityIndicatorViewExample"
ReferencedContainer = "container:NVActivityIndicatorViewExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
43 changes: 16 additions & 27 deletions Example/NVActivityIndicatorViewExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ import NVActivityIndicatorView

class ViewController: UIViewController, NVActivityIndicatorViewable {

private let presentingIndicatorTypes = {
return NVActivityIndicatorType.allCases.filter { $0 != .blank }
}()

override func viewDidLoad() {
super.viewDidLoad()

Expand All @@ -41,30 +45,30 @@ class ViewController: UIViewController, NVActivityIndicatorViewable {
let cellWidth = Int(self.view.frame.width / CGFloat(cols))
let cellHeight = Int(self.view.frame.height / CGFloat(rows))

(NVActivityIndicatorType.ballPulse.rawValue ... NVActivityIndicatorType.circleStrokeSpin.rawValue).forEach {
let x = ($0 - 1) % cols * cellWidth
let y = ($0 - 1) / cols * cellHeight
for (index, indicatorType) in presentingIndicatorTypes.enumerated() {
let x = index % cols * cellWidth
let y = index / cols * cellHeight
let frame = CGRect(x: x, y: y, width: cellWidth, height: cellHeight)
let activityIndicatorView = NVActivityIndicatorView(frame: frame,
type: NVActivityIndicatorType(rawValue: $0)!)
type: indicatorType)
let animationTypeLabel = UILabel(frame: frame)

animationTypeLabel.text = String($0)
animationTypeLabel.text = String(index)
animationTypeLabel.sizeToFit()
animationTypeLabel.textColor = UIColor.white
animationTypeLabel.frame.origin.x += 5
animationTypeLabel.frame.origin.y += CGFloat(cellHeight) - animationTypeLabel.frame.size.height

activityIndicatorView.padding = 20
if $0 == NVActivityIndicatorType.orbit.rawValue {
if indicatorType == NVActivityIndicatorType.orbit {
activityIndicatorView.padding = 0
}
self.view.addSubview(activityIndicatorView)
self.view.addSubview(animationTypeLabel)
activityIndicatorView.startAnimating()

let button: UIButton = UIButton(frame: frame)
button.tag = $0
button.tag = index
#if swift(>=4.2)
button.addTarget(self,
action: #selector(buttonTapped(_:)),
Expand All @@ -79,26 +83,11 @@ class ViewController: UIViewController, NVActivityIndicatorViewable {
}

@objc func buttonTapped(_ sender: UIButton) {
NVActivityIndicatorView.DEFAULT_TYPE = .ballPulseSync
NVActivityIndicatorView.DEFAULT_BLOCKER_SIZE = CGSize(width: 40, height: 40)
NVActivityIndicatorView.DEFAULT_BLOCKER_MINIMUM_DISPLAY_TIME = 0
NVActivityIndicatorView.DEFAULT_BLOCKER_DISPLAY_TIME_THRESHOLD = 0
NVActivityIndicatorView.DEFAULT_BLOCKER_MESSAGE_FONT = UIFont.systemFont(ofSize: 12)
NVActivityIndicatorView.DEFAULT_IS_BLOCKING_SCREEN = true
NVActivityIndicatorView.DEFAULT_CLOSEABLE = true
NVActivityIndicatorView.DEFAULT_ONCLOSEBLOCK = nil

let activityData = ActivityData(size: CGSize(width: 96, height: 92),
message: "Harap Tunggu",
messageFont: nil,
type: .blAnimation,
color: .black,
padding: nil,
displayTimeThreshold: 0,
minimumDisplayTime: nil,
isCloseable: false)

NVActivityIndicatorPresenter.sharedInstance.startAnimating(activityData, nil)

This comment has been minimized.

Copy link
@andree-surya

andree-surya Sep 26, 2019

Author

Karena ini hanya example, seharusnya aman untuk di-override pakai punya upstream aja.

let size = CGSize(width: 30, height: 30)
let selectedIndicatorIndex = sender.tag
let indicatorType = presentingIndicatorTypes[selectedIndicatorIndex]

startAnimating(size, message: "Loading...", type: indicatorType, fadeInAnimation: nil)

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 1.5) {
NVActivityIndicatorPresenter.sharedInstance.setMessage("Authenticating...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class NVActivityIndicatorTypeTests: XCTestCase {
}
}

func testAllTypes() {
XCTAssertEqual(NVActivityIndicatorType.allTypes.last, NVActivityIndicatorType.circleStrokeSpin)
func testAllCases() {
XCTAssertEqual(NVActivityIndicatorType.allCases.last, NVActivityIndicatorType.circleStrokeSpin)
}
}
10 changes: 5 additions & 5 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- NVActivityIndicatorView (4.4.0):
- NVActivityIndicatorView/Presenter (= 4.4.0)
- NVActivityIndicatorView/Presenter (4.4.0)
- NVActivityIndicatorView (4.8.0):
- NVActivityIndicatorView/Presenter (= 4.8.0)
- NVActivityIndicatorView/Presenter (4.8.0)

DEPENDENCIES:
- NVActivityIndicatorView (from `../`)
Expand All @@ -11,8 +11,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
NVActivityIndicatorView: 187d2298793f550c2d36b4b405f7b8da0a462ee6
NVActivityIndicatorView: 24b713d5140767dc43097cd9d5ff719ff0660bdc

PODFILE CHECKSUM: e5d164996aa6d71a0eda53503111c16d861ecbc6

COCOAPODS: 1.5.3
COCOAPODS: 1.7.5
Loading

0 comments on commit 38710ac

Please sign in to comment.