method2testcases stringlengths 118 6.63k |
|---|
### Question:
QualityAnalyzerRunsSchedulerOnStartup implements ApplicationListener<ContextRefreshedEvent> { @Override public void onApplicationEvent(ContextRefreshedEvent event) { if (alreadyExecuted.compareAndSet(false, true)) { List<Project> projects = projectRepository.findAll(); log.info("Schedule analyzer jobs for... |
### Question:
SonarServerValidator implements Validator { @Override public boolean supports(Class<?> clazz) { return SonarServer.class.equals(clazz); } @Override boolean supports(Class<?> clazz); @Override void validate(Object target, Errors errors); }### Answer:
@Test public void shouldSupportSonarServerType() { ass... |
### Question:
SonarConnectionSettingsValidator implements Validator { @Override public boolean supports(Class<?> clazz) { return SonarConnectionSettings.class.equals(clazz); } @Override boolean supports(Class<?> clazz); @Override void validate(Object target, Errors errors); }### Answer:
@Test public void shouldSuppor... |
### Question:
ThriftyConverterFactory extends Converter.Factory { public static ThriftyConverterFactory create(ProtocolType protocolType) { return new ThriftyConverterFactory(protocolType); } private ThriftyConverterFactory(ProtocolType protocolType); static ThriftyConverterFactory create(ProtocolType protocolType); @... |
### Question:
Angles { public void setSensorOffset(@NonNull Facing sensorFacing, int sensorOffset) { sanitizeInput(sensorOffset); mSensorFacing = sensorFacing; mSensorOffset = sensorOffset; if (mSensorFacing == Facing.FRONT) { mSensorOffset = sanitizeOutput(360 - mSensorOffset); } print(); } void setSensorOffset(@NonN... |
### Question:
Pool { @NonNull @Override public String toString() { return getClass().getSimpleName() + " - count:" + count() + ", active:" + activeCount() + ", recycled:" + recycledCount(); } Pool(int maxPoolSize, @NonNull Factory<T> factory); boolean isEmpty(); @Nullable T get(); void recycle(@NonNull T item); @CallSu... |
### Question:
Pool { public void recycle(@NonNull T item) { synchronized (lock) { LOG.v("RECYCLE - Recycling item.", this); if (--activeCount < 0) { throw new IllegalStateException("Trying to recycle an item which makes " + "activeCount < 0. This means that this or some previous items being " + "recycled were not comin... |
### Question:
Pool { @Nullable public T get() { synchronized (lock) { T item = queue.poll(); if (item != null) { activeCount++; LOG.v("GET - Reusing recycled item.", this); return item; } if (isEmpty()) { LOG.v("GET - Returning null. Too much items requested.", this); return null; } activeCount++; LOG.v("GET - Creating... |
### Question:
Frame { @Override public boolean equals(Object obj) { return obj instanceof Frame && ((Frame) obj).mTime == mTime; } Frame(@NonNull FrameManager manager); @Override boolean equals(Object obj); @SuppressLint("NewApi") @NonNull Frame freeze(); void release(); @SuppressWarnings("unchecked") @NonNull T getDat... |
### Question:
Frame { @SuppressLint("NewApi") @NonNull public Frame freeze() { ensureHasContent(); Frame other = new Frame(mManager); Object data = mManager.cloneFrameData(getData()); other.setContent(data, mTime, mUserRotation, mViewRotation, mSize, mFormat); return other; } Frame(@NonNull FrameManager manager); @Over... |
### Question:
AspectRatio implements Comparable<AspectRatio> { @Override public boolean equals(Object o) { if (o == null) { return false; } if (this == o) { return true; } if (o instanceof AspectRatio) { return toFloat() == ((AspectRatio) o).toFloat(); } return false; } private AspectRatio(int x, int y); @NonNull stat... |
### Question:
AspectRatio implements Comparable<AspectRatio> { @NonNull @SuppressWarnings("WeakerAccess") public static AspectRatio parse(@NonNull String string) { String[] parts = string.split(":"); if (parts.length != 2) { throw new NumberFormatException("Illegal AspectRatio string. Must be x:y"); } int x = Integer.p... |
### Question:
Angles { public void setDisplayOffset(int displayOffset) { sanitizeInput(displayOffset); mDisplayOffset = displayOffset; print(); } void setSensorOffset(@NonNull Facing sensorFacing, int sensorOffset); void setDisplayOffset(int displayOffset); void setDeviceOrientation(int deviceOrientation); int offset(... |
### Question:
Size implements Comparable<Size> { @SuppressWarnings("SuspiciousNameCombination") public Size flip() { return new Size(mHeight, mWidth); } Size(int width, int height); int getWidth(); int getHeight(); @SuppressWarnings("SuspiciousNameCombination") Size flip(); @Override boolean equals(Object o); @NonNull ... |
### Question:
Size implements Comparable<Size> { @Override public boolean equals(Object o) { if (o == null) { return false; } if (this == o) { return true; } if (o instanceof Size) { Size size = (Size) o; return mWidth == size.mWidth && mHeight == size.mHeight; } return false; } Size(int width, int height); int getWidt... |
### Question:
Size implements Comparable<Size> { @Override public int hashCode() { return mHeight ^ ((mWidth << (Integer.SIZE / 2)) | (mWidth >>> (Integer.SIZE / 2))); } Size(int width, int height); int getWidth(); int getHeight(); @SuppressWarnings("SuspiciousNameCombination") Size flip(); @Override boolean equals(Obj... |
### Question:
Size implements Comparable<Size> { @Override public int compareTo(@NonNull Size another) { return mWidth * mHeight - another.mWidth * another.mHeight; } Size(int width, int height); int getWidth(); int getHeight(); @SuppressWarnings("SuspiciousNameCombination") Size flip(); @Override boolean equals(Object... |
### Question:
SizeSelectors { @SuppressWarnings("WeakerAccess") @NonNull public static SizeSelector withFilter(@NonNull Filter filter) { return new FilterSelector(filter); } @SuppressWarnings("WeakerAccess") @NonNull static SizeSelector withFilter(@NonNull Filter filter); @NonNull static SizeSelector maxWidth(final in... |
### Question:
SizeSelectors { @NonNull public static SizeSelector maxWidth(final int width) { return withFilter(new Filter() { @Override public boolean accepts(@NonNull Size size) { return size.getWidth() <= width; } }); } @SuppressWarnings("WeakerAccess") @NonNull static SizeSelector withFilter(@NonNull Filter filter... |
### Question:
SizeSelectors { @NonNull public static SizeSelector minWidth(final int width) { return withFilter(new Filter() { @Override public boolean accepts(@NonNull Size size) { return size.getWidth() >= width; } }); } @SuppressWarnings("WeakerAccess") @NonNull static SizeSelector withFilter(@NonNull Filter filter... |
### Question:
SizeSelectors { @SuppressWarnings("WeakerAccess") @NonNull public static SizeSelector maxHeight(final int height) { return withFilter(new Filter() { @Override public boolean accepts(@NonNull Size size) { return size.getHeight() <= height; } }); } @SuppressWarnings("WeakerAccess") @NonNull static SizeSele... |
### Question:
SizeSelectors { @NonNull public static SizeSelector minHeight(final int height) { return withFilter(new Filter() { @Override public boolean accepts(@NonNull Size size) { return size.getHeight() >= height; } }); } @SuppressWarnings("WeakerAccess") @NonNull static SizeSelector withFilter(@NonNull Filter fi... |
### Question:
SizeSelectors { @SuppressWarnings("WeakerAccess") @NonNull public static SizeSelector aspectRatio(AspectRatio ratio, final float delta) { final float desired = ratio.toFloat(); return withFilter(new Filter() { @Override public boolean accepts(@NonNull Size size) { float candidate = AspectRatio.of(size.get... |
### Question:
Angles { public void setDeviceOrientation(int deviceOrientation) { sanitizeInput(deviceOrientation); mDeviceOrientation = deviceOrientation; print(); } void setSensorOffset(@NonNull Facing sensorFacing, int sensorOffset); void setDisplayOffset(int displayOffset); void setDeviceOrientation(int deviceOrien... |
### Question:
SizeSelectors { @SuppressWarnings("WeakerAccess") @NonNull public static SizeSelector biggest() { return new SizeSelector() { @NonNull @Override public List<Size> select(@NonNull List<Size> source) { Collections.sort(source); Collections.reverse(source); return source; } }; } @SuppressWarnings("WeakerAcc... |
### Question:
SizeSelectors { @SuppressWarnings("WeakerAccess") @NonNull public static SizeSelector smallest() { return new SizeSelector() { @NonNull @Override public List<Size> select(@NonNull List<Size> source) { Collections.sort(source); return source; } }; } @SuppressWarnings("WeakerAccess") @NonNull static SizeSe... |
### Question:
SizeSelectors { @NonNull @SuppressWarnings("WeakerAccess") public static SizeSelector maxArea(final int area) { return withFilter(new Filter() { @Override public boolean accepts(@NonNull Size size) { return size.getHeight() * size.getWidth() <= area; } }); } @SuppressWarnings("WeakerAccess") @NonNull sta... |
### Question:
SizeSelectors { @SuppressWarnings("WeakerAccess") @NonNull public static SizeSelector minArea(final int area) { return withFilter(new Filter() { @Override public boolean accepts(@NonNull Size size) { return size.getHeight() * size.getWidth() >= area; } }); } @SuppressWarnings("WeakerAccess") @NonNull sta... |
### Question:
SizeSelectors { @NonNull public static SizeSelector and(SizeSelector... selectors) { return new AndSelector(selectors); } @SuppressWarnings("WeakerAccess") @NonNull static SizeSelector withFilter(@NonNull Filter filter); @NonNull static SizeSelector maxWidth(final int width); @NonNull static SizeSelector... |
### Question:
ExifHelper { public static int getOrientation(int exifOrientation) { int orientation; switch (exifOrientation) { case ExifInterface.ORIENTATION_NORMAL: case ExifInterface.ORIENTATION_FLIP_HORIZONTAL: orientation = 0; break; case ExifInterface.ORIENTATION_ROTATE_180: case ExifInterface.ORIENTATION_FLIP_VER... |
### Question:
Pool { @CallSuper public void clear() { synchronized (lock) { queue.clear(); } } Pool(int maxPoolSize, @NonNull Factory<T> factory); boolean isEmpty(); @Nullable T get(); void recycle(@NonNull T item); @CallSuper void clear(); final int count(); @SuppressWarnings("WeakerAccess") final int activeCount(); @... |
### Question:
SchedulingStrategies { public static SchedulingStrategy createInvokerStrategy( ConsoleLogger logger ) { return new InvokerStrategy( logger ); } static SchedulingStrategy createInvokerStrategy( ConsoleLogger logger ); static SchedulingStrategy createParallelStrategy( ConsoleLogger logger, int nThreads ); ... |
### Question:
JUnitCoreParameters { public boolean isParallelOptimization() { return parallelOptimization; } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isParallelSuites(); @Deprecated @SuppressWarnings( { "unused", "deprecation" } ) boolean i... |
### Question:
JUnitCoreParameters { public boolean isParallelMethods() { return isAllParallel() || lowerCase( "both", "methods", "suitesAndMethods", "classesAndMethods" ).contains( parallel ); } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isPa... |
### Question:
JUnitCoreParameters { public boolean isParallelClasses() { return isAllParallel() || lowerCase( "both", "classes", "suitesAndClasses", "classesAndMethods" ).contains( parallel ); } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isPa... |
### Question:
JUnitCoreParameters { @Deprecated @SuppressWarnings( { "unused", "deprecation" } ) public boolean isParallelBoth() { return isParallelMethods() && isParallelClasses(); } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isParallelSuite... |
### Question:
SchedulingStrategies { public static SchedulingStrategy createParallelStrategy( ConsoleLogger logger, int nThreads ) { return new NonSharedThreadPoolStrategy( logger, Executors.newFixedThreadPool( nThreads, DAEMON_THREAD_FACTORY ) ); } static SchedulingStrategy createInvokerStrategy( ConsoleLogger logger... |
### Question:
JUnitCoreParameters { public boolean isPerCoreThreadCount() { return perCoreThreadCount; } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isParallelSuites(); @Deprecated @SuppressWarnings( { "unused", "deprecation" } ) boolean isPar... |
### Question:
JUnitCoreParameters { public int getThreadCount() { return threadCount; } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isParallelSuites(); @Deprecated @SuppressWarnings( { "unused", "deprecation" } ) boolean isParallelBoth(); bool... |
### Question:
JUnitCoreParameters { public boolean isUseUnlimitedThreads() { return useUnlimitedThreads; } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isParallelSuites(); @Deprecated @SuppressWarnings( { "unused", "deprecation" } ) boolean isP... |
### Question:
JUnitCoreParameters { public boolean isNoThreading() { return !isParallelismSelected(); } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isParallelSuites(); @Deprecated @SuppressWarnings( { "unused", "deprecation" } ) boolean isPara... |
### Question:
JUnitCoreParameters { public boolean isParallelismSelected() { return isParallelSuites() || isParallelClasses() || isParallelMethods(); } JUnitCoreParameters( Map<String, String> properties ); boolean isParallelMethods(); boolean isParallelClasses(); boolean isParallelSuites(); @Deprecated @SuppressWarnin... |
### Question:
SchedulingStrategies { public static SchedulingStrategy createParallelSharedStrategy( ConsoleLogger logger, ExecutorService threadPool ) { if ( threadPool == null ) { throw new NullPointerException( "null threadPool in #createParallelSharedStrategy" ); } return new SharedThreadPoolStrategy( logger, thread... |
### Question:
SchedulingStrategies { public static SchedulingStrategy createParallelStrategyUnbounded( ConsoleLogger logger ) { return new NonSharedThreadPoolStrategy( logger, Executors.newCachedThreadPool( DAEMON_THREAD_FACTORY ) ); } static SchedulingStrategy createInvokerStrategy( ConsoleLogger logger ); static Sch... |
### Question:
ClassName { public String get() { return this.fullClassNameWithGenerics; } ClassName(String fullClassNameWithGenerics); String get(); String toString(); String getSimpleName(); String getPackageName(); List<String> getGenericsWithoutBounds(); List<String> getGenericsWithBounds(); String getGenericPart(); ... |
### Question:
ActionRouter { public void directAlertAction(Action action) { AlertActionRoute[] alertActionRoutes = AlertActionRoute.values(); for (AlertActionRoute alertActionRoute : alertActionRoutes) { if (alertActionRoute.identifier().equals(action.type())) { alertActionRoute.direct(action); return; } } logWarn("Unk... |
### Question:
CryptographicHelper { public void generateKey(String keyAlias) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { legacyCryptography.generateKey(keyAlias); } else { mCryptography.generateKey(keyAlias); } } static CryptographicHelper getInstance(Context context_); static byte[] encrypt(byte[] data, St... |
### Question:
CryptographicHelper { public Key getKey(String keyAlias) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { return legacyCryptography.getKey(keyAlias); } else { return mCryptography.getKey(keyAlias); } } static CryptographicHelper getInstance(Context context_); static byte[] encrypt(byte[] data, Stri... |
### Question:
CryptographicHelper { public void deleteKey(String keyAlias) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { legacyCryptography.deleteKey(keyAlias); } else { mCryptography.deleteKey(keyAlias); } } static CryptographicHelper getInstance(Context context_); static byte[] encrypt(byte[] data, String k... |
### Question:
AndroidMCryptography extends BaseCryptography implements ICryptography { @Override public String getAESMode() { return AES_MODE; } AndroidMCryptography(Context context); @RequiresApi(api = Build.VERSION_CODES.KITKAT) @Override byte[] encrypt(byte[] input, String keyAlias); @Override String getAESMode(); v... |
### Question:
AndroidLegacyCryptography extends BaseCryptography implements ICryptography { @Override public String getAESMode() { return AES_MODE; } AndroidLegacyCryptography(Context context); @Override String getAESMode(); @Override byte[] encrypt(byte[] input, String keyAlias); @Override byte[] decrypt(byte[] encryp... |
### Question:
ViewStubInflater { public ViewGroup get() { if (!isInflated()) { this.inflatedLayout = (ViewGroup) stub.inflate(); } return this.inflatedLayout; } ViewStubInflater(ViewStub stub); ViewGroup get(); void setVisibility(int visibility); }### Answer:
@Test public void testGetInflatesLayoutCorrectly() { Mockit... |
### Question:
ViewStubInflater { public void setVisibility(int visibility) { if (isInflated()) { inflatedLayout.setVisibility(visibility); } } ViewStubInflater(ViewStub stub); ViewGroup get(); void setVisibility(int visibility); }### Answer:
@Test public void testSetVisiblityInvokesInflatedLayoutWithCorrectParams() { ... |
### Question:
ChildRegisterProfilePhotoLoader implements ProfilePhotoLoader { public Drawable get(SmartRegisterClient client) { return FEMALE_GENDER.equalsIgnoreCase(((ChildSmartRegisterClient) client).gender()) ? femaleInfantDrawable : maleInfantDrawable; } ChildRegisterProfilePhotoLoader(Drawable maleInfantDrawable, ... |
### Question:
OnClickFormLauncher implements View.OnClickListener { @Override public void onClick(View view) { activity.startFormActivity(formName, entityId, metaData); } OnClickFormLauncher(SecuredActivity activity, String formName, String entityId); OnClickFormLauncher(SecuredActivity activity, String formName, Stri... |
### Question:
SecuredFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); logoutListener = data -> { if (getActivity() != null && !getActivity().isFinishing()) { getActivity().finish(); } }; Event.ON_LOGOUT.addListener(logoutListener); if (context()... |
### Question:
SecuredFragment extends Fragment { @Override public void onResume() { super.onResume(); if (context().IsUserLoggedOut()) { DrishtiApplication application = (DrishtiApplication) this.getActivity() .getApplication(); application.logoutCurrentUser(); return; } onResumption(); isPaused = false; } @Override v... |
### Question:
SecuredFragment extends Fragment { @Override public void onPause() { super.onPause(); isPaused = true; } @Override void onCreate(Bundle savedInstanceState); @Override void onResume(); @Override void onPause(); @Override boolean onOptionsItemSelected(MenuItem item); void logoutUser(); void startFormActivi... |
### Question:
SecuredFragment extends Fragment { public void logoutUser() { context().userService().logout(); } @Override void onCreate(Bundle savedInstanceState); @Override void onResume(); @Override void onPause(); @Override boolean onOptionsItemSelected(MenuItem item); void logoutUser(); void startFormActivity(Stri... |
### Question:
SecuredFragment extends Fragment { public void startFormActivity(String formName, String entityId, String metaData) { launchForm(formName, entityId, metaData, FormActivity.class); } @Override void onCreate(Bundle savedInstanceState); @Override void onResume(); @Override void onPause(); @Override boolean ... |
### Question:
SecuredFragment extends Fragment { public void startMicroFormActivity(String formName, String entityId, String metaData) { launchForm(formName, entityId, metaData, MicroFormActivity.class); } @Override void onCreate(Bundle savedInstanceState); @Override void onResume(); @Override void onPause(); @Overrid... |
### Question:
LibraryFragment extends Fragment implements LibraryContract.View { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_library, container, false); } @Nullable @Overri... |
### Question:
BaseProfileFragment extends SecuredFragment implements View.OnTouchListener { @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onCreate(savedInstanceState); gestureDetector = new GestureDetectorCompat(this.getActivity(), new ProfileFragmentsSwipeListener()); view.setOnTouc... |
### Question:
BaseProfileFragment extends SecuredFragment implements View.OnTouchListener { @Override public boolean onTouch(View view, MotionEvent event) { return gestureDetector.onTouchEvent(event); } @Override void onViewCreated(View view, Bundle savedInstanceState); @Override boolean onTouch(View view, MotionEvent... |
### Question:
BaseProfileFragment extends SecuredFragment implements View.OnTouchListener { @VisibleForTesting protected boolean onFlingProcessor(MotionEvent event, MotionEvent event2, float velocityY) { final int SWIPE_MIN_DISTANCE = 120; final int SWIPE_MAX_OFF_PATH = 300; final int SWIPE_THRESHOLD_VELOCITY = 200; tr... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { @Override protected SecuredNativeSmartRegisterActivity.NavBarOptionsProvider getNavBarOptionsProvider() { return new SecuredNativeSmartRegisterActivity.N... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = i... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { @LayoutRes protected int getLayout() { return R.layout.fragment_base_register; } @Nullable @Override View onCreateView(LayoutInflater inflater, @Nullabl... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { protected void updateSearchView() { if (getSearchView() != null) { getSearchView().removeTextChangedListener(textWatcher); getSearchView().addTextChanged... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { @Override public void updateSearchBarHint(String searchBarText) { if (getSearchView() != null) { getSearchView().setHint(searchBarText); } } @Nullable @... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { public void setSearchTerm(String searchText) { if (getSearchView() != null) { getSearchView().setText(searchText); } } @Nullable @Override View onCreate... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { @Override public void setTotalPatients() { if (headerTextDisplay != null) { headerTextDisplay.setText(clientAdapter.getTotalcount() > 1 ? String.format(g... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { @Override protected SmartRegisterClientsProvider clientsProvider() { return null; } @Nullable @Override View onCreateView(LayoutInflater inflater, @Null... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { @Override protected void onCreation() { initializePresenter(); Bundle extras = getActivity().getIntent().getExtras(); if (extras != null) { boolean isRem... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { public boolean onBackPressed() { return false; } @Nullable @Override View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable... |
### Question:
BaseRegisterFragment extends RecyclerViewFragment implements BaseRegisterFragmentContract.View,
SyncStatusBroadcastReceiver.SyncStatusListener { @Override public void updateFilterAndFilterStatus(String filterText, String sortText) { if (headerTextDisplay != null) { headerTextDisplay.setText(Html.f... |
### Question:
MeFragment extends Fragment implements MeContract.View { @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_me, container, false); } @Override void onCreate(Bundle s... |
### Question:
SecuredNativeSmartRegisterFragment extends SecuredFragment { public void setupSearchView(View view) { searchView = view.findViewById(R.id.edt_search); searchView.setHint(getNavBarOptionsProvider().searchHint()); searchView.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(... |
### Question:
SecuredNativeSmartRegisterFragment extends SecuredFragment { protected void setServiceModeViewDrawableRight(Drawable drawable) { serviceModeView.setCompoundDrawables(null, null, drawable, null); } EditText getSearchView(); View getSearchCancelView(); FilterOption getCurrentVillageFilter(); FilterOption g... |
### Question:
SecuredNativeSmartRegisterFragment extends SecuredFragment { public void refreshListView() { this.setRefreshList(true); this.onResumption(); this.setRefreshList(false); } EditText getSearchView(); View getSearchCancelView(); FilterOption getCurrentVillageFilter(); FilterOption getCurrentSearchFilter(); v... |
### Question:
BaseListFragment extends Fragment implements ListContract.View<T> { @Override public void setLoadingState(boolean loadingState) { int result = loadingState ? incompleteRequests.incrementAndGet() : incompleteRequests.decrementAndGet(); progressBar.setVisibility(result > 0 ? View.VISIBLE : View.INVISIBLE); ... |
### Question:
BaseListFragment extends Fragment implements ListContract.View<T> { @NonNull @Override public ListContract.Presenter<T> loadPresenter() { if (presenter == null) { presenter = new ListPresenter<T>() .with(this); } return presenter; } @Override View onCreateView(LayoutInflater inflater, ViewGroup container... |
### Question:
ViewHelper { public static ViewGroup getPaginationView(Activity context) { return (ViewGroup) context.getLayoutInflater() .inflate(R.layout.smart_register_pagination, null); } static PaginationHolder addPaginationCore(View.OnClickListener onClickListener, ListView clientsView); static ViewGroup getPagina... |
### Question:
ViewHelper { public static PaginationHolder addPaginationCore(View.OnClickListener onClickListener, ListView clientsView) { ViewGroup footerView = getPaginationView((Activity) clientsView.getContext()); PaginationHolder paginationHolder = new PaginationHolder(); paginationHolder.setNextPageView(footerView... |
### Question:
ReportIndicatorDetailViewController { public String get() { String annualTarget = (isBlank(indicatorDetails.annualTarget())) ? "NA" : indicatorDetails.annualTarget(); return new Gson().toJson(new IndicatorReportDetail(categoryDescription, indicatorDetails.reportIndicator().description(), indicatorDetails.... |
### Question:
EligibleCoupleDetailController { @JavascriptInterface public String get() { EligibleCouple eligibleCouple = allEligibleCouples.findByCaseID(caseId); ECDetail ecContext = new ECDetail(caseId, eligibleCouple.village(), eligibleCouple.subCenter(), eligibleCouple.ecNumber(), eligibleCouple.isHighPriority(), n... |
### Question:
Cache { public T get(String key, CacheableData<T> cacheableData) { if (value.get(key) != null) { return value.get(key); } T fetchedData = cacheableData.fetch(); value.put(key, fetchedData); return fetchedData; } Cache(); T get(String key, CacheableData<T> cacheableData); void evict(String key); }### Answ... |
### Question:
PNCDetailController { @JavascriptInterface public String get() { Mother mother = allBeneficiaries.findMotherWithOpenStatus(caseId); EligibleCouple couple = allEligibleCouples.findByCaseID(mother.ecCaseId()); LocalDate deliveryDate = LocalDate.parse(mother.referenceDate()); Days postPartumDuration = Days.d... |
### Question:
ConnectivityChangeReceiver extends BroadcastReceiver { @Override public void onReceive(final Context context, Intent intent) { logInfo("Connectivity change receiver triggered."); if (intent.getExtras() != null) { if (isDeviceDisconnectedFromNetwork(intent)) { logInfo("Device got disconnected from network.... |
### Question:
ListInteractor implements ListContract.Interactor<T> { @Override public void runRequest(@NotNull Callable<List<T>> callable, @NotNull AppExecutors.Request request, @NotNull ListContract.Presenter<T> presenter) { Runnable runnable = () -> { try { List<T> tList = callable.call(); appExecutors.mainThread().e... |
### Question:
OpenSRPViewPager extends ViewPager { @Override public boolean onInterceptTouchEvent(MotionEvent event) { return false; } OpenSRPViewPager(Context context); OpenSRPViewPager(Context context, AttributeSet attrs); @Override boolean onInterceptTouchEvent(MotionEvent event); @Override boolean onTouchEvent(Mot... |
### Question:
OpenSRPViewPager extends ViewPager { @Override public boolean onTouchEvent(MotionEvent event) { return false; } OpenSRPViewPager(Context context); OpenSRPViewPager(Context context, AttributeSet attrs); @Override boolean onInterceptTouchEvent(MotionEvent event); @Override boolean onTouchEvent(MotionEvent ... |
### Question:
SettingsActivity extends PreferenceActivity implements Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener, View.OnClickListener { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { if (newValue != null) { updateUrl(newValue.toString()); } return ... |
### Question:
SettingsActivity extends PreferenceActivity implements Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener, View.OnClickListener { @Override public void onClick(View view) { String newValue = baseUrlEditTextPreference.getEditText().getText().toString(); if (newValue != null && UrlU... |
### Question:
BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_base_register); mPager = findViewById(R.id.base_view_pager); Fragment[]... |
### Question:
BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { protected void registerBottomNavigation() { bottomNavigationHelper = new BottomNavigationHelper(); bottomNavigationView = findViewById(R.id.bottom_navigation); if (bottomNavigationView != null) { bottomN... |
### Question:
BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override protected void onDestroy() { super.onDestroy(); presenter.onDestroy(isChangingConfigurations()); } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override v... |
### Question:
BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override public boolean onCreateOptionsMenu(Menu menu) { return true; } @Override boolean onCreateOptionsMenu(Menu menu); @Override void onBackPressed(); @Override void displaySyncNotification(); @Over... |
### Question:
BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override public void onBackPressed() { Fragment fragment = findFragmentByPosition(currentPage); if (fragment instanceof BaseRegisterFragment) { setSelectedBottomBarMenuItem(R.id.action_clients); BaseReg... |
### Question:
BaseRegisterActivity extends SecuredNativeSmartRegisterActivity implements BaseRegisterContract.View { @Override public void displaySyncNotification() { Snackbar syncStatusSnackbar = Snackbar.make(this.getWindow().getDecorView(), R.string.manual_sync_triggered, Snackbar.LENGTH_LONG); syncStatusSnackbar.sh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.