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
private class ArrayFilter extends Filter { | |
@Override | |
protected FilterResults performFiltering(CharSequence prefix) { | |
FilterResults results = new FilterResults(); | |
if (prefix == null || prefix.length() == 0) { | |
ArrayList<T> list; | |
synchronized (mLock) { | |
list = new ArrayList<T>(mOriginalValues); | |
} |
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
private class ArrayFilter extends Filter { | |
@Override | |
protected FilterResults performFiltering(CharSequence prefix) { | |
FilterResults results = new FilterResults(); | |
if (prefix == null || prefix.length() == 0) { | |
ArrayList<T> list = new ArrayList<T>(mOriginalValues); | |
results.values = list; | |
results.count = list.size(); |
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 SessionDetailActivity extends BaseActivity implements | |
LoaderManager.LoaderCallbacks<Cursor>, | |
ObservableScrollView.Callbacks { | |
//... | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
//Responsibility 1: Responding to user's action (in this case, a click) | |
mAddScheduleButton.setOnClickListener(new View.OnClickListener() { |
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
mAddScheduleButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
boolean starred = !mStarred; | |
SessionsHelper helper = new SessionsHelper(SessionDetailActivity.this); | |
showStarred(starred, true); | |
helper.setSessionStarred(mSessionUri, starred, mTitleString); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { | |
mAddScheduleButton.announceForAccessibility(starred ? | |
getString(R.string.session_details_a11y_session_added) : |
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 implements MVPView { | |
View mButton; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_browse_sessions); | |
//... | |
final Presenter presenter = new Presenter(this); |
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 implements MVPView { | |
View mButton; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_browse_sessions); | |
//... | |
final Presenter presenter = new Presenter(); |
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 MainActivity extends LocationManagingActivity implements ActionBar.OnNavigationListener, | |
GooglePlayServicesClient.ConnectionCallbacks, | |
GooglePlayServicesClient.OnConnectionFailedListener { | |
//... | |
private static MeTrackerStore mMeTrackerStore; | |
//... | |
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 DefineGeofenceFragment extends Fragment { | |
public class GetLatAndLongAndUpdateMapCameraAsyncTask extends AsyncTask<String, Void, LatLng> { | |
@Override | |
protected LatLng doInBackground(String... params) { | |
//... | |
try { | |
//Here we make the http request for the place search suggestions | |
httpResponse = httpClient.execute(httpPost); | |
HttpEntity entity = httpResponse.getEntity(); |
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 ViewPager getmViewPager() { | |
return mViewPager; | |
} |
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 ServiceLauncherTests { | |
@Mock | |
Context mContext; | |
@Test | |
public void launchesSessionCalendarService() { | |
ServiceLauncher serviceLauncher = new ServiceLauncher(mContext); | |
serviceLauncher.launchSessionCalendarService(); | |
verify(mContext).startService(any(Intent.class)); |