Kotlinize
This commit is contained in:
1 parent
09b0d4d6c4
commit
1bb73b1147
2 files changed
+13
-25
No files matched your search
@@ -69,13 +69,8 @@ open class ListUrlBuilder(
|
||||
}
|
||||
|
||||
fun setIndex(index: String?, isNext: Boolean = true) {
|
||||
if (isNext) {
|
||||
mNext = index
|
||||
mPrev = null
|
||||
} else {
|
||||
mPrev = index
|
||||
mNext = null
|
||||
}
|
||||
mNext = index?.takeIf { isNext }
|
||||
mPrev = index?.takeUnless { isNext }
|
||||
}
|
||||
|
||||
fun setJumpTo(jumpTo: String?) {
|
||||
@@ -403,7 +398,7 @@ open class ListUrlBuilder(
|
||||
sb.toString()
|
||||
}
|
||||
|
||||
else -> throw java.lang.IllegalStateException("Unexpected value: $mode")
|
||||
else -> throw IllegalStateException("Unexpected value: $mode")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,22 +13,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.hippo.ehviewer.client.data
|
||||
|
||||
package com.hippo.ehviewer.client.data;
|
||||
import android.os.Parcelable
|
||||
import com.hippo.widget.LoadImageView
|
||||
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.hippo.widget.LoadImageView;
|
||||
|
||||
public abstract class PreviewSet implements Parcelable {
|
||||
|
||||
public abstract int size();
|
||||
|
||||
public abstract int getPosition(int index);
|
||||
|
||||
public abstract String getPageUrlAt(int index);
|
||||
|
||||
public abstract GalleryPreview getGalleryPreview(long gid, int index);
|
||||
|
||||
public abstract void load(LoadImageView view, long gid, int index);
|
||||
}
|
||||
abstract class PreviewSet : Parcelable {
|
||||
abstract fun size(): Int
|
||||
abstract fun getPosition(index: Int): Int
|
||||
abstract fun getPageUrlAt(index: Int): String
|
||||
abstract fun getGalleryPreview(gid: Long, index: Int): GalleryPreview
|
||||
abstract fun load(view: LoadImageView, gid: Long, index: Int)
|
||||
}
|
||||
Reference in new issue
Block a user