layout with better land support

This commit is contained in:
2021-03-13 19:50:11 +01:00
parent efa7379c6e
commit 4404093c83
5 changed files with 12 additions and 6 deletions
@@ -29,6 +29,7 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Objects;
class InstantAutoComplete extends com.google.android.material.textfield.MaterialAutoCompleteTextView {
public InstantAutoComplete(Context context) {
@@ -55,13 +56,13 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ScrollView scrollview = ((ScrollView) findViewById(R.id.scrollArea));
scrollview.post(() -> scrollview.scrollTo(0, scrollview.getChildAt(0).getHeight()));
final ScrollView scrollview = findViewById(R.id.scrollArea);
watchMeetingNameBox();
fillDropdownMeetingName();
if (getLastMeeting() != -1) {
try {
fillMeeting(getLastMeeting());
scrollview.post(() -> scrollview.scrollTo(0, scrollview.getChildAt(0).getHeight()));
}
catch (IndexOutOfBoundsException e) {
AlertDialog.Builder dialog=new AlertDialog.Builder(this);
@@ -97,7 +98,11 @@ public class MainActivity extends AppCompatActivity {
private void watchNewIcon() {
ImageView AddIcon = findViewById(R.id.imageAdd);
AddIcon.setOnClickListener(v -> fillBlank());
EditText meetingID = findViewById(R.id.textBoxID);
AddIcon.setOnClickListener(v -> {
fillBlank();
meetingID.requestFocus();
});
}
private void watchAttIcon() {