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() {
@@ -6,9 +6,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="30dp"
android:layout_marginTop="30dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="30dp"
android:layout_marginBottom="30dp"
android:layout_marginBottom="10dp"
android:orientation="vertical"
tools:context=".MainActivity">
+1
View File
@@ -10,6 +10,7 @@
android:id="@+id/imageAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
@@ -28,6 +28,7 @@
<include
layout="@layout/icons"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
-1
View File
@@ -140,7 +140,6 @@
android:id="@+id/layoutAtt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="22dp"
android:background="@android:color/transparent"
android:hint="@string/AttendeesInput"
app:boxBackgroundColor="@android:color/transparent"