Created
May 4, 2019 08:59
-
-
Save wightwulf1944/e975ad518ba28287e25f66a9bd92d335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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