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 LifecycleFragment extends Fragment implements LifecycleOwner { | |
private final LifecycleRegistry registry = new LifecycleRegistry(this); | |
public LifecycleFragment() { | |
} | |
@NonNull | |
public Lifecycle getLifecycle() { | |
return this.registry; | |
} |
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
/** | |
* LiveData Bus | |
* | |
* @author shilong | |
* @since [历史 创建日期:3/19/21] | |
*/ | |
public final class LiveDataBus { | |
private static LiveDataBus liveDataBus; |
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
/** | |
* Created by zhoubinjia on 16/6/12. | |
*/ | |
public class LoadMoreDecoration extends RecyclerView.ItemDecoration { | |
private static final String TAG = LoadMoreDecoration.class.getSimpleName(); | |
private View mView; | |
private boolean mViewInited = false; | |
private Listener mListener; | |
private boolean mLoadComplete = false; |
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
// ViewModel and LiveData | |
implementation "android.arch.lifecycle:extensions:1.1.0" | |
// alternatively, just ViewModel | |
implementation "android.arch.lifecycle:viewmodel:1.1.0" | |
// alternatively, just LiveData | |
implementation "android.arch.lifecycle:livedata:1.1.0" |
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
import android.annotation.SuppressLint; | |
import android.app.Instrumentation; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.PointF; | |
import android.support.v4.graphics.ColorUtils; | |
import android.util.AttributeSet; |
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
package com.cn.mi; | |
import android.app.Activity; | |
import android.app.Application; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.util.Log; | |
import java.util.List; |
NewerOlder