Search in sources :

Example 1 with LongParcelable

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();
}
Also used : RenamingDelegatingContext(android.test.RenamingDelegatingContext) LongParcelable(com.jigdraw.draw.model.LongParcelable) Intent(android.content.Intent)

Example 2 with LongParcelable

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);
}
Also used : LongParcelable(com.jigdraw.draw.model.LongParcelable) JigsawActivity(com.jigdraw.draw.activity.JigsawActivity) Intent(android.content.Intent)

Example 3 with LongParcelable

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());
}
Also used : Bundle(android.os.Bundle) LongParcelable(com.jigdraw.draw.model.LongParcelable) JigsawLoader(com.jigdraw.draw.tasks.JigsawLoader) JigsawGridView(com.jigdraw.draw.views.JigsawGridView)

Aggregations

LongParcelable (com.jigdraw.draw.model.LongParcelable)3 Intent (android.content.Intent)2 Bundle (android.os.Bundle)1 RenamingDelegatingContext (android.test.RenamingDelegatingContext)1 JigsawActivity (com.jigdraw.draw.activity.JigsawActivity)1 JigsawLoader (com.jigdraw.draw.tasks.JigsawLoader)1 JigsawGridView (com.jigdraw.draw.views.JigsawGridView)1