Re-organize the layout files
This commit is contained in:
parent
62dd05949d
commit
e2c1050c50
9 changed files with 16 additions and 5 deletions
|
@ -145,7 +145,7 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntriesCardAdapter.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntryViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
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);
|
return new EntryViewHolder(itemView);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
// Manual data entry
|
// Manual data entry
|
||||||
private void enterDetails() {
|
private void enterDetails() {
|
||||||
ViewGroup container = (ViewGroup) findViewById(R.id.main_content);
|
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 Spinner typeInput = (Spinner) inputView.findViewById(R.id.manual_type);
|
||||||
final EditText labelInput = (EditText) inputView.findViewById(R.id.manual_label);
|
final EditText labelInput = (EditText) inputView.findViewById(R.id.manual_label);
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.preference.Preference;
|
||||||
import android.preference.PreferenceFragment;
|
import android.preference.PreferenceFragment;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.ViewStub;
|
||||||
|
|
||||||
public class SettingsActivity extends AppCompatActivity {
|
public class SettingsActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,6 +18,9 @@ public class SettingsActivity extends AppCompatActivity {
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.container_toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.container_toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
ViewStub stub = (ViewStub) findViewById(R.id.container_stub);
|
||||||
|
stub.inflate();
|
||||||
|
|
||||||
getFragmentManager().beginTransaction()
|
getFragmentManager().beginTransaction()
|
||||||
.replace(R.id.container_content, new SettingsFragment())
|
.replace(R.id.container_content, new SettingsFragment())
|
||||||
.commit();
|
.commit();
|
||||||
|
|
|
@ -29,8 +29,10 @@
|
||||||
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<ViewStub
|
||||||
android:id="@+id/container_content"
|
android:id="@+id/container_stub"
|
||||||
|
android:inflatedId="@+id/container_content"
|
||||||
|
android:layout="@layout/component_frame"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
5
app/src/main/res/layout/component_frame.xml
Normal file
5
app/src/main/res/layout/component_frame.xml
Normal 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" />
|
|
@ -16,6 +16,6 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentStart="true" />
|
android:layout_alignParentStart="true" />
|
||||||
|
|
||||||
<include layout="@layout/fab_menu" />
|
<include layout="@layout/component_fam" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
Loading…
Reference in a new issue