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
package me.kyouko.syntaxanalyzer; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class SyntaxAnalyzer { | |
String input; | |
List<Token> tokens; |
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
package lexer; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Lexer { |
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
@Override | |
public void setCancelable(boolean cancelable) { | |
final Dialog dialog = getDialog(); | |
View touchOutsideView = dialog.getWindow().getDecorView().findViewById(android.support.design.R.id.touch_outside); | |
View bottomSheetView = dialog.getWindow().getDecorView().findViewById(android.support.design.R.id.design_bottom_sheet); | |
if (cancelable) { | |
touchOutsideView.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { |
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
View bottomSheetView = getDialog().getWindow().getDecorView().findViewById(android.support.design.R.id.design_bottom_sheet); | |
BottomSheetBehavior.from(bottomSheetView).setHideable(false); |
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
private BottomSheetBehavior.BottomSheetCallback mBottomSheetCallback | |
= new BottomSheetBehavior.BottomSheetCallback() { | |
@Override | |
public void onStateChanged(@NonNull View bottomSheet, | |
@BottomSheetBehavior.State int newState) { | |
if (newState == BottomSheetBehavior.STATE_HIDDEN) { | |
dismiss(); | |
} | |
} |
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
<FrameLayout | |
android:id="@+id/design_bottom_sheet" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_gravity="center_horizontal|top" | |
android:clickable="true" | |
app:layout_behavior="@string/bottom_sheet_behavior" | |
style="?attr/bottomSheetStyle"/> |
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
View touchOutsideView = getDialog().getWindow().getDecorView().findViewById(android.support.design.R.id.touch_outside); | |
touchOutsideView.setOnClickListener(null); |
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
private View wrapInBottomSheet(int layoutResId, View view, ViewGroup.LayoutParams params) { | |
... | |
if (shouldWindowCloseOnTouchOutside()) { | |
coordinator.findViewById(R.id.touch_outside).setOnClickListener( | |
new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
if (isShowing()) { | |
cancel(); | |
} |
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
<View | |
android:id="@+id/touch_outside" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:soundEffectsEnabled="false"/> |
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
tasks.withType(JavaCompile) { | |
compileTask -> compileTask.dependsOn ndkBuild | |
} |