- basic build.gradle directory using flatDir
repositories {
mavenCentral()
flatDir {
dirs 'libs'
public abstract class AppBarStateChangedListener implements AppBarLayout.OnOffsetChangedListener { | |
public enum State { | |
EXPANDED, | |
COLLAPSED, | |
IDLE | |
} | |
private State mCurrentState = State.IDLE; |
public class MainActivity extends Activity { | |
private final MyActivityLifecycleCallbacks mCallbacks = new MyActivityLifecycleCallbacks(); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
// Always register before calling into the super class. | |
getApplication().registerActivityLifecycleCallbacks(mCallbacks); | |
super.onCreate(savedInstanceState); |
public class MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
// Always register before calling into the super class. | |
getApplication().registerActivityLifecycleCallbacks(new MyActivityLifecycleCallbacks(this)); | |
super.onCreate(savedInstanceState); | |
} |
/* | |
* Copyright (C) 2017 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 |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
Centralize the support libraries dependencies in gradle
Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.
A very good way is to separate gradle build files, defining something like:
root
--gradleScript
----dependencies.gradle
package com.your.package | |
import android.app.Dialog | |
import android.os.Bundle | |
import com.your.package.R | |
import com.google.android.material.bottomsheet.BottomSheetDialog | |
import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
/** | |
* BottomSheetDialog fragment that uses a custom |
/* | |
* Copyright (C) 2017 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 |