Skip to content

Commit ecb5367

Browse files
committed
weaken access to some methods
1 parent 84e91e2 commit ecb5367

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
android:layout_height="wrap_content"
2525
android:layout_marginTop="100dp"
2626
android:background="@drawable/bg_btn_red"
27+
android:gravity="center"
2728
android:orientation="horizontal"
2829
android:paddingLeft="16dp"
2930
android:paddingRight="16dp"
30-
android:gravity="center"
3131
app:layout_constraintEnd_toEndOf="parent"
3232
app:layout_constraintStart_toStartOf="parent"
3333
app:layout_constraintTop_toBottomOf="@id/slider_view">

pluto/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ext {
1616
gitUrl = 'https://github.com/OpenSooq/Pluto.git'
1717
githubRepository= 'OpenSooq/Pluto'
1818

19-
libraryVersion = '1.3'
19+
libraryVersion = '1.4'
2020

2121
developerId = 'OpenSooq'
2222
developerName = 'OpenSooq'
@@ -64,3 +64,6 @@ dependencies {
6464
}
6565
apply from: 'https://raw.githubusercontent.com/nisrulz/JCenter/master/installv1.gradle'
6666
apply from: 'https://gist.githubusercontent.com/tamtom/f54a538637178e4818bbc72f24a73e2d/raw/af6f8b6782475230cfff852ae11669c936e739a2/bintrayv1.gradle'
67+
tasks.withType(Javadoc).all {
68+
enabled = false
69+
}

pluto/src/main/java/com/opensooq/pluto/PlutoLifeCycleObserver.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ import android.arch.lifecycle.OnLifecycleEvent
1010
internal class PlutoLifeCycleObserver : LifecycleObserver {
1111
private var actionHandler: ViewActionHandler? = null
1212
private lateinit var lifecycle: Lifecycle
13-
fun registerActionHandler(handler: ViewActionHandler) {
13+
internal fun registerActionHandler(handler: ViewActionHandler) {
1414
this.actionHandler = handler
1515
}
1616

17-
fun registerLifecycle(lifecycle: Lifecycle) {
17+
internal fun registerLifecycle(lifecycle: Lifecycle) {
1818
this.lifecycle = lifecycle
1919
this.lifecycle.addObserver(this)
2020
}
2121

2222
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
23-
fun onResume() {
23+
internal fun onResume() {
2424
this.actionHandler?.onResumed()
2525
}
2626

2727
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
28-
fun stop() {
28+
internal fun stop() {
2929
this.actionHandler?.onDestroy()
3030
}
3131

3232
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
33-
fun onDestroy() {
33+
internal fun onDestroy() {
3434
this.actionHandler?.onPause()
3535
}
3636

37-
fun unregister() {
37+
internal fun unregister() {
3838
this.actionHandler = null
3939
lifecycle.removeObserver(this)
4040
}

pluto/src/main/java/com/opensooq/pluto/PlutoView.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import com.opensooq.pluto.listeners.OnSnapPositionChangeListener
1818
import com.opensooq.pluto.listeners.SnapOnScrollListener
1919
import java.lang.ref.WeakReference
2020
import java.util.*
21+
import kotlin.Experimental.Level
2122

2223
/**
2324
* Created by Omar Altamimi on 28,April,2019
@@ -382,23 +383,21 @@ class PlutoView @JvmOverloads constructor(context: Context,
382383
}
383384
}
384385

386+
@DontUse
385387
override fun onResumed() {
386-
println("LifeCycle : onResumed()")
387388
if (wasCycling) {
388-
println("LifeCycle : recovering()")
389389
recoverCycle()
390390
}
391391

392392
}
393393

394+
@DontUse
394395
override fun onPause() {
395-
396-
println("LifeCycle : onPause()")
397396
pauseAutoCycle()
398397
}
399398

399+
@DontUse
400400
override fun onDestroy() {
401-
println("LifeCycle : onDestroy()")
402401
destroyPluto()
403402
}
404403

@@ -407,4 +406,8 @@ class PlutoView @JvmOverloads constructor(context: Context,
407406
private const val DELAY_TIME = 3000L
408407
private const val DEFAULT_DURATION = 4000L
409408
}
409+
410+
@Experimental(level = Level.ERROR)
411+
private annotation class DontUse
412+
410413
}

0 commit comments

Comments
 (0)