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
@Override | |
public boolean onOptionsItemSelected(MenuItem item) { | |
// Pass the event to ActionBarDrawerToggle, if it returns | |
// true, then it has handled the app icon touch event | |
if ((item != null) && (item.getItemId() == 16908332) && (mDrawerToggle.isDrawerIndicatorEnabled())) { | |
if (this.mDrawerLayout.isDrawerVisible(Gravity.LEFT)) | |
this.mDrawerLayout.closeDrawer(Gravity.LEFT); | |
else { | |
this.mDrawerLayout.openDrawer(Gravity.LEFT); | |
} |
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.support.v4.widget.DrawerLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/drawer_layout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<!-- The main content view --> | |
<FrameLayout | |
android:id="@+id/content_frame" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> |
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
package com.moltak.usingdrawerwithsherlockandscrollview; | |
import android.content.Context; | |
import android.support.v4.widget.DrawerLayout; | |
import android.util.AttributeSet; | |
import android.view.Gravity; | |
import android.view.MotionEvent; | |
public class MODrawerLayout extends DrawerLayout { | |
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
# code updated 2014.05.16 | |
from os import listdir | |
from os.path import isfile, join | |
import os | |
import shutil | |
from PIL import Image | |
import string | |
xxhdpi = './drawable-xxhdpi/' | |
xhdpi = './drawable-xhdpi/' |
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
from os import listdir | |
import sys | |
import os | |
import string | |
xml_prefix = '<?xml version="1.0" encoding="utf-8"?>\n' \ | |
+ '<selector xmlns:android="http://schemas.android.com/apk/res/android">\n' \ | |
+ '<item android:drawable="@drawable/' | |
pressed_postfix = '" android:state_pressed="true"></item>\n' | |
normal_prefix = '<item android:drawable="@drawable/' |
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 String sendFileToServer(String filename, String targetUrl) { | |
String response = "error"; | |
Log.e("Image filename", filename); | |
Log.e("url", targetUrl); | |
HttpURLConnection connection = null; | |
DataOutputStream outputStream = null; | |
// DataInputStream inputStream = null; | |
String pathToOurFile = filename; | |
String urlServer = targetUrl; |
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
package com.gradle.app; | |
import android.content.res.Resources; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.widget.TextView; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.robolectric.Robolectric; |
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.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT' | |
classpath 'com.android.tools.build:gradle:0.6.+' |
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
package com.gradle.app; | |
import android.content.res.Resources; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentActivity; | |
import android.widget.TextView; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.robolectric.Robolectric; |
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
package com.gradle.app; | |
import org.junit.runners.model.InitializationError; | |
import org.robolectric.AndroidManifest; | |
import org.robolectric.RobolectricTestRunner; | |
import org.robolectric.annotation.Config; | |
import org.robolectric.res.Fs; | |
public class RobolectricGradleTestRunner extends RobolectricTestRunner { | |
public RobolectricGradleTestRunner(Class<?> testClass) throws InitializationError { |
OlderNewer