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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
import android.app.Activity; | |
import android.app.Fragment; | |
import android.app.FragmentManager; | |
#parse("File Header.java") | |
public class ${NAME} extends Fragment { | |
private static final String FRAG_TAG = ${NAME}.class.getCanonicalName(); |
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
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
public class AccountAuthenticator extends AbstractAccountAuthenticator { | |
private final Context context; | |
@Inject @ClientId String clientId; | |
@Inject @ClientSecret String clientSecret; | |
@Inject ApiService apiService; | |
public AccountAuthenticator(Context context) { | |
super(context); |
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
// By Janaka Jayasuriya, @pinkydoe | |
// Original By Jamie Chapman, @chappers57 | |
// License: open, do as you wish, just don't blame me if stuff breaks ;-) | |
package us.peripl.app.util; | |
import com.parse.ParseFile; | |
import com.parse.ParseGeoPoint; | |
import com.parse.ParseObject; |
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
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
Basic card layout with drawables and styles. | |
Missing icons: ic_action_remove, ic_action_accept and ic_action_cancel (all can be found in the standard android icon pack) | |
Example screenshot: https://pbs.twimg.com/media/BmTdvKhIYAAkrPa.png |
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
final SupportMenuItem searchMenuItem = (SupportMenuItem) menu.findItem(R.id.menu_search); | |
if (searchMenuItem == null) throw new IllegalArgumentException("menu item is null and that is very suspicious."); | |
this.searchView = (SearchView) searchMenuItem.getActionView(); | |
if (searchView == null) throw new IllegalArgumentException("search view is null and that is very suspicious."); | |
searchView.setQueryHint(getActivity().getString(R.string.search_hint)); | |
// wow. much hack. style search box.. | |
Resources resources = searchView.getContext().getResources(); |
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
package com.f2prateek.articuno.util; | |
import android.os.Bundle; | |
import android.os.IBinder; | |
import android.os.Parcelable; | |
import android.util.SparseArray; | |
import java.io.Serializable; | |
import java.util.ArrayList; | |
/** |
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
public class MyActivity extends Activity { | |
... | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
// Trigger onOptionsItemSelected for the custom menu item because it doesn't | |
// happen automatically. | |
final MenuItem item = menu.findItem(R.id.button_id); | |
barcodeItem.getActionView().setOnClickListener(new OnClickListener() { | |
@Override |
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
// Apache 2.0 licensed. | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
/** An implementation of {@link BaseAdapter} which uses the new/bind pattern for its views. */ | |
public abstract class BindableAdapter<T> extends BaseAdapter { |
NewerOlder