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
int pagerWidth = size.x - getResources().getDimensionPixelSize(R.dimen.hero_pager_margins); | |
pager.setLayoutParams(new RelativeLayout.LayoutParams(Math.max(pagerWidth, 1), getResources().getDimensionPixelSize(R.dimen.hero_pager_height))); | |
pager.setClipChildren(false); | |
pager.setPageMargin(-getResources().getDimensionPixelSize(R.dimen.hero_pager_margins)); |
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
SpannableString s = new SpannableString(title); | |
s.setSpan(new FontTypefaceSpan(this, "Roboto-Light.ttf"), 0, s.length(), | |
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
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
String json = "[{\"id\":5,\"name\":\"Action\"},{\"id\":6,\"name\":\"Adventure\"}]"; | |
@Test | |
public void testJsonArray() throws Exception { | |
parseJson(); | |
} | |
void parseJson(){ | |
Type t = new TypeToken<List<Result>>(){}.getType(); | |
List<Result> result = new Gson().fromJson(json, t); | |
Assert.assertEquals(2, result.size()); |
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 introduction(){ | |
return getString(R.string.hello_world); | |
} |
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
getApplicationContext().getPackageManager().setComponentEnabledSetting(new ComponentName(AboutActivity.this, VergeDaydream.class), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); |
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
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB){ | |
FrameLayout frameLayout = new FrameLayout(getActivity()); | |
frameLayout.setBackgroundColor(getResources().getColor(android.R.color.transparent)); | |
((ViewGroup) v).addView(frameLayout, | |
new ViewGroup.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT, FrameLayout.LayoutParams.FILL_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
//Do them SlidingMenu as so | |
SlidingMenu menu; | |
private void setUpSideMenu(){ | |
menu = new SlidingMenu(this); | |
menu.setMenu(R.layout.side_menu); | |
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN); | |
menu.setBehindOffsetRes(R.dimen.actionbar_home_width); | |
menu.setBehindScrollScale(0.25f); | |
menu.setShadowDrawable(R.drawable.shadow); |
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 ButtonStuff extends BaseButtonStuff { | |
private boolean whatevs; | |
//Broadcast Receiver | |
private BroadcastReceiver br = new BroadcastReceiver() { | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
updateShit(); | |
} | |
}; |
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
**Paste this shiz where you need to troubleshoot***************************************************** | |
java.util.logging.Logger.getLogger("org.apache.http.wire").setLevel(java.util.logging.Level.FINEST); | |
java.util.logging.Logger.getLogger("org.apache.http.headers").setLevel(java.util.logging.Level.FINEST); | |
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); | |
System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true"); | |
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug"); | |
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "debug"); | |
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.headers", "debug"); |
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 onCreateOptionsMenu(Menu menu) { | |
MenuInflater inflater = getSupportMenuInflater(); | |
inflater.inflate(R.menu.entry_menu, menu); | |
MenuItem mItem = menu.findItem(R.id.menu_comments); | |
commentCount = (TextView)mItem.getActionView().findViewById(R.id.actionEntryCommentCount); | |
commentCount.setText(Integer.toString(article.numComments)); | |
mItem.getActionView().setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { |