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
#!/bin/bash | |
# Script adb+ | |
# Usage | |
# You can run any command adb provides on all your currently connected devices | |
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command> | |
adb devices | while read line | |
do | |
if [ ! "$line" = "" ] && [ `echo $line | awk '{print $2}'` = "device" ] | |
then | |
device=`echo $line | awk '{print $1}'` |
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
webView.setWebViewClient(new WebViewClient() { | |
@Override | |
public boolean shouldOverrideUrlLoading(WebView view, String url) { | |
String cookieStr = CookieManager.getInstance().getCookie(url); // android.webkit.CookieManager | |
storeCookies(url, cookieStr); | |
return super.shouldOverrideUrlLoading(view, url); | |
} | |
// Convert cookie string into a list of cookies. Persist cookies in a java.net.CookieStore |
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
@Singleton | |
@Provides | |
CustomRequestInterceptor provideRequestInterceptor(final Application application, SharedPreferencesCookieStore cookieStore) { | |
return new CustomRequestInterceptor(application, cookieStore); | |
} | |
@Singleton | |
@Provides | |
RestAdapter provideRestAdapter(Client client, DynamicEndpoint endpoint, | |
Converter converter, |
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
<!-- Setting the parentActivityName can help the TaskStackBuilder build out the back stack | |
if methods like .addNextIntentWithParentStack(Intent intent) are used --> | |
<activity | |
android:name=".ui.home.HomeActivity" | |
android:launchMode="singleTop" | |
android:label="@string/app_name"/> | |
<activity | |
android:name=".ui.upload.UploadActivity" | |
android:parentActivityName=".ui.home.HomeActivity" |
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
recyclerView.setHasFixedSize(true); | |
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); | |
recyclerView.setAdapter(adapter); | |
SimpleCallback simpleCallback = new SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) { | |
@Override | |
public boolean onMove(RecyclerView recyclerView, ViewHolder viewHolder, ViewHolder viewHolder1) { | |
return false; | |
} |
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
// When the EditText is touched, disable touches on it's ScrollView's parents. | |
// Once the user lifts up their finger, enable touches on on the ScrollView's parents once again. | |
@OnTouch(R.id.edit_text) | |
boolean handleNoteFieldTouch(View v, MotionEvent event) { | |
v.getParent().getParent().requestDisallowInterceptTouchEvent(true); | |
switch (event.getAction() & MotionEvent.ACTION_MASK){ | |
case MotionEvent.ACTION_UP: | |
v.getParent().getParent().requestDisallowInterceptTouchEvent(false); | |
break; |