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
def appVersionMajor = 1 | |
def appVersionMinor = 0 | |
def appVersionPatch = 0 | |
def appVersionBuild = 0 | |
appVersionCode = appVersionMajor * 1000000 + appVersionMinor * 10000 + appVersionPatch * 100 + appVersionBuild | |
appVersionName = "${appVersionMajor}.${appVersionMinor}.${appVersionPatch}" |
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 StateRecyclerView extends RecyclerView { | |
private View emptyView; | |
private int emptyViewId; | |
public StateRecyclerView(Context context) { | |
this(context, null); | |
} | |
public StateRecyclerView(Context context, @Nullable AttributeSet attrs) { | |
this(context, attrs, 0); |
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
@SuppressWarnings("unchecked") public abstract class DRMVPAppCompatActivity<P extends DRMVPPresenter<V>, V extends DRMVPView> | |
extends AppCompatActivity { | |
private P presenter; | |
@CallSuper @Override protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(getLayoutResId()); | |
presenter = MVPUtils.getDeclaredPresenter(getClass()); | |
presenter.bind((V) this); | |
} |
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
@SuppressWarnings("unchecked") public abstract class DRMVPFragmentV4<P extends DRMVPPresenter<V>, V extends DRMVPView> extends Fragment { | |
private P presenter; | |
@CallSuper @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
return inflater.inflate(getLayoutResId(), container, false); | |
} | |
@CallSuper @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { | |
presenter = MVPUtils.getDeclaredPresenter(getClass()); | |
presenter.bind((V) this); |
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 DRMVPFrameLayoutView<P extends DRMVPPresenter<V>, V extends DRMVPView> extends FrameLayout { | |
private P presenter; | |
public DRMVPFrameLayoutView(Context context, @Nullable AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
public DRMVPFrameLayoutView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | |
super(context, attrs, defStyleAttr); | |
init(); |
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 GifImageView extends ImageView { | |
private static final long DEFAULT_MOVIE_VIEW_DURATION = TimeUnit.SECONDS.toMillis(1); | |
private Movie movie; | |
private long movieStart; | |
private int movieCurrentAnimationTime; | |
private boolean running = false; | |
private boolean visible = true; |
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 final class Network { | |
private Network() { | |
} | |
public static @NonNull String doGetRequest(@NonNull String service, @NonNull String resource, | |
@NonNull List<Pair<String, String>> params, @NonNull List<Pair<String, String>> headers) throws IOException { | |
HttpURLConnection httpURLConnection = null; | |
try { | |
URL url = new URL( | |
service + "/" + Uri.encode(resource) + (params.isEmpty() ? "" : "&" + convertPairToParamString(params))); |
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 enum UidUtils { | |
INSTANCE; | |
private final static String DEFAULT_ID = "anonymous"; | |
private String androidId = DEFAULT_ID; | |
private String advertisingId = ""; | |
private boolean limitAdTrackingEnabled = false; |
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 DashedLineView extends View { | |
private static final int DEFAULT_COLOR = Color.BLACK; | |
private static final float DEFAULT_DASH = 4f; | |
private static final float DEFAULT_GAP = 2f; | |
private static final float DEFAULT_PHASE = 0f; | |
private final Paint paint = new Paint(); | |
private final Path path = new Path(); | |
private float dash; |
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
#!/usr/bin/env sh | |
# export PATH=$PATH:~/Library/Android/sdk/platform-tools/ | |
case $1 in | |
"enter") | |
adb shell settings put global sysui_demo_allowed 1 | |
# display time 12:00 | |
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200 | |
# display full mobile data without type | |
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype false |