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 CustomSearchViewActivity extends AppCompatActivity { | |
LinearLayout linearLayoutSearch; | |
EditText editTextSearch; | |
ImageButton imageButtonClearSearch; | |
ImageButton imageButtonVoiceSearch; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
android:foreground="?android:attr/selectableItemBackground" | |
android:clickable="true" | |
or | |
android:foreground="?attr/selectableItemBackgroundBorderless" |
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
String dstPath = Environment.getExternalStorageDirectory() + File.separator + "myApp" + File.separator; | |
File dst = new File(dstPath); | |
exportFile(pictureFile, dst); | |
} | |
private File exportFile(File src, File dst) throws IOException { | |
//if folder does not exist | |
if (!dst.exists()) { |
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
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { | |
@Override | |
public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
if (dy > 0 || dy < 0 && fab.isShown()) | |
fab.hide(); | |
} | |
@Override | |
public void onScrollStateChanged(RecyclerView recyclerView, int newState) { |
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
/** | |
* Get the total disk space available on this Android Device | |
* | |
* @return total size (in bytes) that is the total disk space available on the device. | |
*/ | |
public static long getTotalDiskSpace() { | |
StatFs statFs = new StatFs(Environment.getRootDirectory().getAbsolutePath()); | |
return statFs.getBlockCountLong() * statFs.getBlockSizeLong(); | |
} |