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
/* Rxjava combineLastest Example */ | |
disposable.add(RxFirebase.observeChildEvent(mDatabase.child(AppConstant.USERS) | |
.child(Utils.fireUserId(getUser().getUserId())).child(AppConstant.GROUPS)) | |
.filter(event -> event.getEventType() == RxFirebaseChildEvent.EventType.ADDED) | |
.flatMap(event -> { | |
Log.d(TAG, "setFirebaseListener: "+event.getValue()); |
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 DBMainAppointmentAdapter extends MyBaseAdapter<MainAppointment,ItemDashboardBinding> { | |
private VideoClickListener videoClickListener; | |
public DBMainAppointmentAdapter(Context context) { | |
super(context); | |
} | |
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 abstract class MyBaseAdapter<T,B extends ViewDataBinding> extends RecyclerView.Adapter<MyBaseAdapter.MyViewHolder> { | |
public List<T> data; | |
public Context context; | |
protected ItemClickListner<T> itemClickListner; | |
public MyBaseAdapter(Context context) { | |
this.data = new ArrayList<T>(); | |
this.context = context; |
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 (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
import android.content.Context; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import java.util.List; | |
import butterknife.ButterKnife; |
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
// TODO add <meta-data android:value="GlideModule" android:name="....OkHttpProgressGlideModule" /> | |
// TODO add <meta-data android:value="GlideModule" tools:node="remove" android:name="com.bumptech.glide.integration.okhttp.OkHttpGlideModule" /> | |
// or not use 'okhttp@aar' in Gradle depdendencies | |
public class OkHttpProgressGlideModule implements GlideModule { | |
@Override public void applyOptions(Context context, GlideBuilder builder) { } | |
@Override public void registerComponents(Context context, Glide glide) { | |
OkHttpClient client = new OkHttpClient(); | |
client.networkInterceptors().add(createInterceptor(new DispatchingProgressListener())); | |
glide.register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client)); | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example" | |
android:versionCode="1" | |
android:versionName="1.0"> | |
<uses-sdk android:minSdkVersion="8"/> | |
<uses-permission android:name="android.permission.READ_CONTACTS" /> | |
<application android:label="@string/app_name"> |
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 PluseView extends FrameLayout { | |
@BindView(R.id.circleview) | |
CircleView circleview; | |
@BindView(R.id.circleview2) | |
CircleView circleview2; | |
@BindView(R.id.circleview3) | |
CircleView circleview3; | |
@BindView(R.id.profile_image) |
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 LocationTrackerActivity extends AppCompatActivity implements | |
GoogleApiClient.ConnectionCallbacks, | |
GoogleApiClient.OnConnectionFailedListener, | |
LocationListener | |
{ | |
private static final String TAG = "LocationTrackerActivity"; | |
private static final int REQUEST_CHECK_SETTINGS = 0x1; |
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 GPSService extends Service implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, com.google.android.gms.location.LocationListener { | |
private LocationRequest mLocationRequest; | |
private GoogleApiClient mGoogleApiClient; | |
private static final String LOGSERVICE = "#######"; | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
buildGoogleApiClient(); | |
Log.i(LOGSERVICE, "onCreate"); |
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
http://stackoverflow.com/questions/4811920/why-getspeed-always-return-0-on-android?rq=1 | |
new LocationListener() { | |
private Location mLastLocation; | |
@Override | |
public void onLocationChanged(Location pCurrentLocation) { | |
//calcul manually speed | |
double speed = 0; | |
if (this.mLastLocation != null) |