Skip to content

Commit

Permalink
Remove ConductorImpl.java
Browse files Browse the repository at this point in the history
  • Loading branch information
phantomVK committed Apr 13, 2024
1 parent 412fb3f commit d3f602a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ buildscript {
// in the individual module build.gradle files
}
rootProject.ext {
versionCode = 902
versionName = "0.9.2"
versionCode = 903
versionName = "0.9.3"
}
}

Expand Down
13 changes: 0 additions & 13 deletions slideback/src/main/java/com/phantomvk/slideback/ConductorImpl.java

This file was deleted.

15 changes: 10 additions & 5 deletions slideback/src/main/java/com/phantomvk/slideback/SlideManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;

import androidx.annotation.ColorInt;
Expand All @@ -13,11 +14,11 @@

import com.phantomvk.slideback.listener.SlideStateAdapter;
import com.phantomvk.slideback.listener.SlideStateListener;
import com.phantomvk.slideback.utility.TranslucentHelper;

public class SlideManager {

private static final ColorDrawable DRAWABLE_TRANSPARENT = new ColorDrawable(Color.TRANSPARENT);
private static final Conductor CONDUCTOR = new ConductorImpl();

/**
* The target activity to control.
Expand All @@ -41,7 +42,7 @@ public class SlideManager {
*/
public SlideManager(@NonNull Activity activity) {
this(activity,
activity instanceof Conductor ? (Conductor) activity : CONDUCTOR,
activity instanceof Conductor ? (Conductor) activity : null,
new SlideStateAdapter(activity));
}

Expand All @@ -62,7 +63,7 @@ public SlideManager(@NonNull Activity activity, @NonNull Conductor conductor) {
* @param listener must not be null. For more detail, see {@link SlideStateListener}
*/
public SlideManager(@NonNull Activity activity, @NonNull SlideStateListener listener) {
this(activity, activity instanceof Conductor ? (Conductor) activity : CONDUCTOR, listener);
this(activity, activity instanceof Conductor ? (Conductor) activity : null, listener);
}

/**
Expand All @@ -73,7 +74,7 @@ public SlideManager(@NonNull Activity activity, @NonNull SlideStateListener list
* @param listener must not be null. For more detail, see {@link SlideStateListener}
*/
public SlideManager(@NonNull Activity activity,
@NonNull Conductor conductor,
@Nullable Conductor conductor,
@NonNull SlideStateListener listener) {

this.conductor = conductor;
Expand Down Expand Up @@ -178,7 +179,11 @@ public boolean isTranslucent() {
}

public boolean isSlideDisable() {
return conductor != null && conductor.slideBackDisable();
if (conductor == null) {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT || !TranslucentHelper.isEnabled();
}

return conductor.slideBackDisable();
}

/**
Expand Down

0 comments on commit d3f602a

Please sign in to comment.