Merge dictionary list activity content and layout

Julien LepillerSat Jun 06 04:41:11+0200 2020

cdb775c

Merge dictionary list activity content and layout

app/src/main/java/eu/lepiller/nani/DictionaryActivity.java

3737
    protected void onCreate(Bundle savedInstanceState) {
3838
        super.onCreate(savedInstanceState);
3939
        setContentView(R.layout.activity_dictionary);
40-
        Toolbar toolbar = findViewById(R.id.toolbar);
41-
        toolbar.setTitle(R.string.title_activity_dictionary);
42-
        setSupportActionBar(toolbar);
4340
4441
        final ListView list_view = findViewById(R.id.dictionary_view);
4542
        final SwipeRefreshLayout refresher = findViewById(R.id.dictionary_refresh_layout);

app/src/main/res/layout/activity_dictionary.xml

11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
    xmlns:app="http://schemas.android.com/apk/res-auto"
44
    xmlns:tools="http://schemas.android.com/tools"
55
    android:layout_width="match_parent"
66
    android:layout_height="match_parent"
7-
    tools:context=".DictionaryActivity">
7+
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
8+
    tools:context=".DictionaryActivity"
9+
    tools:showIn="@layout/activity_dictionary"
10+
    android:id="@+id/dictionary_refresh_layout">
811
9-
    <com.google.android.material.appbar.AppBarLayout
12+
    <ListView
13+
        android:id="@+id/dictionary_view"
1014
        android:layout_width="match_parent"
1115
        android:layout_height="wrap_content"
12-
        android:theme="@style/AppTheme.AppBarOverlay">
16+
        android:layout_marginStart="8dp"
17+
        android:layout_marginLeft="8dp"
18+
        android:layout_marginTop="32dp"
19+
        android:layout_marginEnd="8dp"
20+
        android:layout_marginRight="8dp"
21+
        android:layout_marginBottom="8dp" />
1322
14-
        <androidx.appcompat.widget.Toolbar
15-
            android:id="@+id/toolbar"
16-
            android:layout_width="match_parent"
17-
            android:layout_height="?attr/actionBarSize"
18-
            android:background="?attr/colorPrimary"
19-
            app:popupTheme="@style/AppTheme.PopupOverlay" />
20-
21-
    </com.google.android.material.appbar.AppBarLayout>
22-
23-
    <include layout="@layout/content_dictionary" />
24-
25-
</androidx.coordinatorlayout.widget.CoordinatorLayout>
25>
260>
\ No newline at end of file
23+
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
23<
024<
\ No newline at end of file

app/src/main/res/layout/content_dictionary.xml unknown status 2

1-
<?xml version="1.0" encoding="utf-8"?>
2-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
    xmlns:app="http://schemas.android.com/apk/res-auto"
4-
    xmlns:tools="http://schemas.android.com/tools"
5-
    android:layout_width="match_parent"
6-
    android:layout_height="match_parent"
7-
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
8-
    tools:context=".DictionaryActivity"
9-
    tools:showIn="@layout/activity_dictionary">
10-
11-
    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
12-
        android:layout_width="match_parent"
13-
        android:layout_height="wrap_content"
14-
        android:id="@+id/dictionary_refresh_layout">
15-
16-
        <ListView
17-
            android:id="@+id/dictionary_view"
18-
            android:layout_width="395dp"
19-
            android:layout_height="659dp"
20-
            android:layout_marginStart="8dp"
21-
            android:layout_marginLeft="8dp"
22-
            android:layout_marginTop="32dp"
23-
            android:layout_marginEnd="8dp"
24-
            android:layout_marginRight="8dp"
25-
            android:layout_marginBottom="8dp" />
26-
    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
27-
</LinearLayout>
27>
280>
\ No newline at end of file