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
protected void showFragment( Fragment frag, boolean addToBackStack ) { | |
FragmentTransaction t = getSupportFragmentManager().beginTransaction(); | |
t.replace( R.id.fragment_frame, frag, null ); | |
if ( addToBackStack ) { | |
t.addToBackStack( null ); | |
} | |
t.commit(); | |
} | |
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
<RelativeLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<FrameLayout | |
android:id="@+id/fragment_frame" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:android:layout_alignParentTop="true" |
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
# Python script to slice an image with a grid into equal sized pieces | |
# pip install Pillow | |
# | |
# Usage: | |
# python image_slicy.py IMAGE_PATH OUTPUT_FOLDER COLUMNS ROWS | |
import sys | |
from PIL import Image |