This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
#!/bin/bash | |
# Script adb+ | |
# Usage | |
# You can run any command adb provides on all your currently connected devices | |
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command> | |
# | |
# Examples | |
# ./adb+ version | |
# ./adb+ install apidemo.apk | |
# ./adb+ uninstall com.example.android.apis |
:: Inspired by Linux version of the same https://gist.github.com/christopherperry/3208109 | |
@echo off | |
SET ARGUMENTS=%~1 | |
if "%ARGUMENTS%" == "" ( | |
GOTO EOF | |
) | |
SET "ARGUMENTS=%ARGUMENTS:""="%" |
package com.emil.android.util; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.telephony.TelephonyManager; | |
/** | |
* Check device's network connectivity and speed | |
* @author emil http://stackoverflow.com/users/220710/emil |
/* | |
* Copyright (C) 2015 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
import android.content.Context; | |
import android.telephony.TelephonyManager; | |
/** | |
* @author luongvo. | |
*/ | |
public class ConnectivityUtils { | |
public static String getMobileNetworkType(Context context) { |
Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
// The following code allows an app to report Crashlytics crashes separately | |
// for release and debug buildTypes when using Gradle. This code should be inserted | |
// into the specified locations within your build.gradle (Module:app) file | |
// The buildTypes { } block should be inserted inside the android { } block | |
buildTypes { | |
release { | |
minifyEnabled false | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
ext.crashlyticsApiSecret = "release api secret" |
protected void setupParent(View view) { | |
//Set up touch listener for non-text box views to hide keyboard. | |
if(!(view instanceof EditText)) { | |
view.setOnTouchListener(new View.OnTouchListener() { | |
public boolean onTouch(View v, MotionEvent event) { | |
hideSoftKeyboard(); | |
return false; | |
} | |
}); | |
} |
/** | |
* Simple helper class which extends a TabLayout to allow us to customize the font of the tab. | |
* https://gist.github.com/tmtrademarked/09926077a406959be15fc8a824a52751 | |
* https://github.com/chrisjenx/Calligraphy/issues/180 | |
*/ | |
public final class FontAwareTabLayout extends TabLayout { | |
private String fontPath; | |
public FontAwareTabLayout(Context context, AttributeSet attrs) { |