This file contains hidden or 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
public class DemoFoodListAdapter extends BaseAdapter implements PinnedSectionListAdapter{ | |
// i am following this library @aamir & @sweetwisher | |
// https://github.com/beworker/pinned-section-listview | |
private final Context mContext; | |
ArrayList<Food> foodList; | |
DisplayImageOptions options; | |
ImageLoader imageLoader = ImageLoader.getInstance(); |
This file contains hidden or 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
compile project('libraries:sliding_menu_library') | |
public void initializeSlidingMenu() { | |
menu = new SlidingMenu(this); | |
menu.setMode(SlidingMenu.LEFT); | |
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); | |
menu.setBehindOffset(200); | |
menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); | |
menu.setMenu(R.layout.activity_sliding_menu); |
This file contains hidden or 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
public void imageSlider() { | |
final Handler mHandler = new Handler(); | |
// Create runnable for posting | |
final Runnable mUpdateResults = new Runnable() { | |
public void run() { | |
AnimateandSlideShow(); |
This file contains hidden or 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
private GoogleApiClient mGoogleApiClient; | |
private LocationRequest mLocationRequest; | |
protected Location mLastLocation; | |
protected synchronized void buildGoogleApiClient() { | |
// set which Service API you used | |
mGoogleApiClient = new GoogleApiClient.Builder(this) | |
.addConnectionCallbacks(this) |
This file contains hidden or 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
buildscript { | |
repositories { | |
mavenCentral() | |
maven { | |
url 'https://oss.sonatype.org/content/repositories/snapshots/' | |
} | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.9.+' | |
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT' |
This file contains hidden or 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
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.ResolveInfo; | |
import android.content.res.AssetFileDescriptor; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Matrix; | |
import android.media.ExifInterface; |
This file contains hidden or 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
byte[] convertBitMapToByteArray(Bitmap bmp) { | |
ByteArrayOutputStream stream = new ByteArrayOutputStream(); | |
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); | |
byte[] byteArray = stream.toByteArray(); | |
return byteArray; | |
} |
This file contains hidden or 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
<TextView | |
android:id="@+id/textView_News_HeadLine" | |
style="@style/black_extra_large_heading_text" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_alignParentLeft="true" | |
android:layout_marginLeft="8dp" | |
android:ellipsize="marquee" | |
android:marqueeRepeatLimit="-1" | |
android:singleLine="true" |
This file contains hidden or 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
android:launchMode="singleInstance" | |
# add this to your activity |
This file contains hidden or 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
ActionBar mActionBar = getSupportActionBar(); | |
// checking either this is home actiivty or not for | |
// ActionBar.DISPLAY_HOME_AS_UP | |
if (this.getClass().getSimpleName() | |
.equalsIgnoreCase(RestaurentListActivity.class.getSimpleName())) { | |
mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE | |
| ActionBar.DISPLAY_SHOW_CUSTOM | |
| ActionBar.DISPLAY_SHOW_HOME); | |
} else { |
OlderNewer