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
package com.tylerjroach.example.retrofit2; | |
import com.tylerjroach.example.BuildConfig; | |
import com.tylerjroach.example.util.Constants; | |
import okhttp3.OkHttpClient; | |
import okhttp3.logging.HttpLoggingInterceptor; | |
import retrofit.RestAdapter; | |
import retrofit2.Retrofit; | |
import retrofit2.converter.gson.GsonConverterFactory; |
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
import android.text.TextUtils; | |
import io.realm.Case; | |
import io.realm.Realm; | |
import io.realm.RealmObject; | |
import io.realm.RealmResults; | |
public class RealmFullTextSearch { | |
public static <T extends RealmObject> RealmResults<T> search(Realm realm, Class<T> modelClass, String query, String fieldName, boolean partialSearch){ |
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
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity | |
{ | |
CGFloat offSetAdjustment = MAXFLOAT; | |
CGFloat horizontalCenter = (CGFloat) (proposedContentOffset.x + (self.collectionView.bounds.size.width / 2.0)); | |
CGRect targetRect = CGRectMake(proposedContentOffset.x, 0.0, self.collectionView.bounds.size.width, self.collectionView.bounds.size.height); | |
NSArray *array = [self layoutAttributesForElementsInRect:targetRect]; | |
for (UICollectionViewLayoutAttributes *layoutAttributes in array) | |
{ |