Skip to content

Instantly share code, notes, and snippets.

Hung Manh Nguyen nmhung

Block or report user

Report or block nmhung

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gradle.properties
# IDE (e.g. Android Studio) users:
# Settings specified in this file will override any Gradle settings
# configured through the IDE.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# The Gradle daemon aims to improve the startup and execution time of Gradle.
# When set to true the Gradle daemon is to run the build.
# TODO: disable daemon on CI, since builds should be clean and reliable on servers
@nmhung
nmhung / AlertDialogUtils.java
Created Sep 17, 2018
Show the default alert dialog with options.
View AlertDialogUtils.java
public class AlertDialogUtils {
public static void showError(Context context, int message) {
new AlertDialog.Builder(context).setTitle(R.string.app_name)
.setMessage(message)
.setIcon(R.mipmap.ic_launcher)
.setNegativeButton(R.string.ok, (dialog, which) -> dialog.dismiss())
.create()
.show();
}
View BottomNavigationBehavior.kt
// Apply to BottomNavigationView
class BottomNavigationBehavior<V : View>(context: Context, attrs: AttributeSet) :
CoordinatorLayout.Behavior<V>(context, attrs) {
override fun layoutDependsOn(parent: CoordinatorLayout?, child: V, dependency: View?): Boolean {
if (dependency is Snackbar.SnackbarLayout) {
updateSnackbar(child, dependency)
}
return super.layoutDependsOn(parent, child, dependency)
}
You can’t perform that action at this time.