killall ssh-agent; eval `ssh-agent`
You should see something along the lines of: Agent pid 59566
ssh-add ~/.ssh/id_rsa
import androidx.annotation.MainThread | |
import androidx.annotation.Nullable | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.MutableLiveData | |
import androidx.lifecycle.Observer | |
import java.util.concurrent.atomic.AtomicBoolean | |
/** |
ssh-add ~/.ssh/id_rsa |
public abstract class BasePresenter<V> { | |
protected V mView; | |
public final void attachView(@NonNull V view) { | |
mView = view; | |
} | |
public final void detachView() { | |
mView = null; |
public class BusListActivity extends AppCompatActivity implements LifecycleRegistryOwner, | |
BusListAdapter.ClickListener { | |
private final LifecycleRegistry lifecycleRegistry = new LifecycleRegistry(this); | |
private BusListViewModel viewModel; | |
private BusListAdapter adapter; | |
private ContentLoadingProgressBar progressDialogView; |
public class BusRepository { | |
private static BusRepository sInstance; | |
private final RemoteRepository remoteRepository; | |
private final BusDao busDao; | |
public static BusRepository getInstance(RemoteRepository remoteRepository, BusDao busDao) { | |
if (sInstance == null) { |
With this helper class you can transform your ordinary ImageView into ciruclar shape using Picasso library.
###Include this class into your project:
package com.<YOUR-PACKAGE-NAME>
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
Calendar now = Calendar.getInstance(); | |
int year = now.get(Calendar.YEAR); | |
int month = now.get(Calendar.MONTH); // Note: Starts at 0 | |
int day = now.get(Calendar.DAY_OF_MONTH); | |
int hour = now.get(Calendar.HOUR_OF_DAY); | |
int minute = now.get(Calendar.MINUTE); | |
int second = now.get(Calendar.SECOND); | |
int millis = now.get(Calendar.MILLISECOND); | |
// NOTE: Starts at 0, hence month + 1 | |
System.out.printf("%d-%02d-%02d %02d:%02d:%02d.%03d", year, month + 1, day, hour, minute, second, millis); |
language: android | |
jdk: | |
# Jdk version used by your project | |
- oraclejdk8 | |
sudo: false | |
android: | |
components: |