use of com.jigdraw.draw.model.LongParcelable in project android-jigsaw-puzzle by julesbond007.
the class JigsawActivityTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
RenamingDelegatingContext context = new RenamingDelegatingContext(this.getInstrumentation().getTargetContext().getApplicationContext(), "test_");
setActivityIntent(new Intent(context, JigsawActivity.class).putExtra("originalId", new LongParcelable(1L)));
activity = getActivity();
}
use of com.jigdraw.draw.model.LongParcelable in project android-jigsaw-puzzle by julesbond007.
the class JigsawGenerator method startJigsaw.
private void startJigsaw(long id) {
Intent intent = new Intent(context, JigsawActivity.class).putExtra(JigsawActivity.ORIGINAL_IMG_ID, new LongParcelable(id));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
use of com.jigdraw.draw.model.LongParcelable in project android-jigsaw-puzzle by julesbond007.
the class JigsawActivity method initViews.
/**
* Initialize the jigsaw grid view
*/
private void initViews() {
Log.d(TAG, "initializing jigsaw grid view");
final JigsawGridView gridView = findViewById(R.id.jigsaw_grid);
JigsawLoader task = new JigsawLoader(getApplicationContext(), gridView);
Bundle bundle = getIntent().getExtras();
if (bundle != null) {
LongParcelable parcelable = bundle.getParcelable(ORIGINAL_IMG_ID);
if (parcelable != null) {
task.execute(parcelable.getData());
}
}
gridView.setOnItemLongClickListener(onItemLongClickListener(gridView));
gridView.setOnDropListener(onDropListener(gridView));
gridView.setOnDragListener(onDragListener());
}
Aggregations