Re-organize the layout files

This commit is contained in:
Jakob Nixdorf 2017-07-12 17:08:37 +02:00
parent 62dd05949d
commit e2c1050c50
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC
9 changed files with 16 additions and 5 deletions

View file

@ -145,7 +145,7 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntriesCardAdapter.
@Override
public EntryViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.card_layout, viewGroup, false);
View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.component_card, viewGroup, false);
return new EntryViewHolder(itemView);
}

View file

@ -97,7 +97,7 @@ public class MainActivity extends AppCompatActivity {
// Manual data entry
private void enterDetails() {
ViewGroup container = (ViewGroup) findViewById(R.id.main_content);
View inputView = getLayoutInflater().inflate(R.layout.manual_entry, container, false);
View inputView = getLayoutInflater().inflate(R.layout.dialog_manual_entry, container, false);
final Spinner typeInput = (Spinner) inputView.findViewById(R.id.manual_type);
final EditText labelInput = (EditText) inputView.findViewById(R.id.manual_label);

View file

@ -6,6 +6,7 @@ import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.ViewStub;
public class SettingsActivity extends AppCompatActivity {
@Override
@ -17,6 +18,9 @@ public class SettingsActivity extends AppCompatActivity {
Toolbar toolbar = (Toolbar) findViewById(R.id.container_toolbar);
setSupportActionBar(toolbar);
ViewStub stub = (ViewStub) findViewById(R.id.container_stub);
stub.inflate();
getFragmentManager().beginTransaction()
.replace(R.id.container_content, new SettingsFragment())
.commit();

View file

@ -29,8 +29,10 @@
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/container_content"
<ViewStub
android:id="@+id/container_stub"
android:inflatedId="@+id/container_content"
android:layout="@layout/component_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View file

@ -16,6 +16,6 @@
android:layout_height="match_parent"
android:layout_alignParentStart="true" />
<include layout="@layout/fab_menu" />
<include layout="@layout/component_fam" />
</RelativeLayout>