diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index f1aa1c6..ffd8656 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -24,10 +24,10 @@ android:layout_height="wrap_content" android:layout_marginTop="100dp" android:background="@drawable/bg_btn_red" + android:gravity="center" android:orientation="horizontal" android:paddingLeft="16dp" android:paddingRight="16dp" - android:gravity="center" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/slider_view"> diff --git a/pluto/build.gradle b/pluto/build.gradle index d5047a6..de7c76a 100644 --- a/pluto/build.gradle +++ b/pluto/build.gradle @@ -16,7 +16,7 @@ ext { gitUrl = 'https://github.com/OpenSooq/Pluto.git' githubRepository= 'OpenSooq/Pluto' - libraryVersion = '1.3' + libraryVersion = '1.4' developerId = 'OpenSooq' developerName = 'OpenSooq' @@ -64,3 +64,6 @@ dependencies { } apply from: 'https://raw.githubusercontent.com/nisrulz/JCenter/master/installv1.gradle' apply from: 'https://gist.githubusercontent.com/tamtom/f54a538637178e4818bbc72f24a73e2d/raw/af6f8b6782475230cfff852ae11669c936e739a2/bintrayv1.gradle' +tasks.withType(Javadoc).all { + enabled = false +} \ No newline at end of file diff --git a/pluto/src/main/java/com/opensooq/pluto/PlutoLifeCycleObserver.kt b/pluto/src/main/java/com/opensooq/pluto/PlutoLifeCycleObserver.kt index 18f4f97..208594f 100644 --- a/pluto/src/main/java/com/opensooq/pluto/PlutoLifeCycleObserver.kt +++ b/pluto/src/main/java/com/opensooq/pluto/PlutoLifeCycleObserver.kt @@ -10,31 +10,31 @@ import android.arch.lifecycle.OnLifecycleEvent internal class PlutoLifeCycleObserver : LifecycleObserver { private var actionHandler: ViewActionHandler? = null private lateinit var lifecycle: Lifecycle - fun registerActionHandler(handler: ViewActionHandler) { + internal fun registerActionHandler(handler: ViewActionHandler) { this.actionHandler = handler } - fun registerLifecycle(lifecycle: Lifecycle) { + internal fun registerLifecycle(lifecycle: Lifecycle) { this.lifecycle = lifecycle this.lifecycle.addObserver(this) } @OnLifecycleEvent(Lifecycle.Event.ON_RESUME) - fun onResume() { + internal fun onResume() { this.actionHandler?.onResumed() } @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) - fun stop() { + internal fun stop() { this.actionHandler?.onDestroy() } @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE) - fun onDestroy() { + internal fun onDestroy() { this.actionHandler?.onPause() } - fun unregister() { + internal fun unregister() { this.actionHandler = null lifecycle.removeObserver(this) } diff --git a/pluto/src/main/java/com/opensooq/pluto/PlutoView.kt b/pluto/src/main/java/com/opensooq/pluto/PlutoView.kt index a64e3aa..b86bd40 100644 --- a/pluto/src/main/java/com/opensooq/pluto/PlutoView.kt +++ b/pluto/src/main/java/com/opensooq/pluto/PlutoView.kt @@ -18,6 +18,7 @@ import com.opensooq.pluto.listeners.OnSnapPositionChangeListener import com.opensooq.pluto.listeners.SnapOnScrollListener import java.lang.ref.WeakReference import java.util.* +import kotlin.Experimental.Level /** * Created by Omar Altamimi on 28,April,2019 @@ -382,23 +383,21 @@ class PlutoView @JvmOverloads constructor(context: Context, } } + @DontUse override fun onResumed() { - println("LifeCycle : onResumed()") if (wasCycling) { - println("LifeCycle : recovering()") recoverCycle() } } + @DontUse override fun onPause() { - - println("LifeCycle : onPause()") pauseAutoCycle() } + @DontUse override fun onDestroy() { - println("LifeCycle : onDestroy()") destroyPluto() } @@ -407,4 +406,8 @@ class PlutoView @JvmOverloads constructor(context: Context, private const val DELAY_TIME = 3000L private const val DEFAULT_DURATION = 4000L } + + @Experimental(level = Level.ERROR) + private annotation class DontUse + }