Last active
December 29, 2017 11:41
-
-
Save Velmm/da520e49b470f4fe8b7ec3c2831bcd16 to your computer and use it in GitHub Desktop.
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 MainActivity extends AppCompatActivity implements Callbacks{ | |
private CoordinatorLayout coordinatorLayout; | |
private BottomSheetBehavior behavior; | |
private View persistentbottomSheet; | |
private TextView cart; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
coordinatorLayout = (CoordinatorLayout)findViewById(R.id.coordinator); | |
persistentbottomSheet = coordinatorLayout.findViewById(R.id.bottomsheet); | |
bottomSheetRecyclerview = coordinatorLayout.findViewById(R.id.recyclerview_bottom_sheet); | |
BottomSheetBehavior behavior = BottomSheetBehavior.from(persistentbottomSheet); | |
} | |
public void ExpandBottomSheet(View view){ | |
if (behavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) { | |
behavior.setState(BottomSheetBehavior.STATE_EXPANDED); | |
} else { | |
behavior.setState(BottomSheetBehavior.STATE_COLLAPSED); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment