Skip to content

Instantly share code, notes, and snippets.

@wightwulf1944
Created May 4, 2019 08:59
Show Gist options
  • Save wightwulf1944/e975ad518ba28287e25f66a9bd92d335 to your computer and use it in GitHub Desktop.
Save wightwulf1944/e975ad518ba28287e25f66a9bd92d335 to your computer and use it in GitHub Desktop.
package me.devsaki.hentoid;
import android.os.Bundle;
public final class CoordinateActivityBundle {
private static final String KEY_X = "key_x";
private static final String KEY_Y = "key_y";
private CoordinateActivityBundle() {
throw new UnsupportedOperationException();
}
public static final class Builder {
private final Bundle bundle = new Bundle();
public void setX(int x) {
bundle.putInt(KEY_X, x);
}
public void setY(int y) {
bundle.putInt(KEY_Y, y);
}
public Bundle getBundle() {
return bundle;
}
}
public static final class Parser {
private final Bundle bundle;
public Parser(Bundle bundle) {
this.bundle = bundle;
}
public int getX() {
return bundle.getInt(KEY_X);
}
public int getY() {
return bundle.getInt(KEY_Y);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment