mirror of
https://github.com/wismna/DoNext.git
synced 2025-10-03 15:40:14 -04:00
Restored wide screen display
This commit is contained in:
@@ -126,7 +126,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
String title = getString(R.string.action_new_task);
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
if (!getResources().getBoolean(R.bool.large_layout))
|
||||
if (getResources().getBoolean(R.bool.large_layout))
|
||||
taskDialogFragment.show(fragmentManager, title);
|
||||
else {
|
||||
// The device is smaller, so show the fragment fullscreen
|
||||
|
@@ -106,15 +106,15 @@ public class MainFragment extends Fragment implements TasksFragment.TaskChangedA
|
||||
startActivity(intent);
|
||||
}
|
||||
else {
|
||||
|
||||
// Set up the ViewPager with the sections adapter.
|
||||
mViewPager = mView.findViewById(R.id.container);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
// Open last opened tab
|
||||
int lastOpenedList = sharedPref.getInt("last_opened_tab", 0);
|
||||
mViewPager.setCurrentItem(lastOpenedList);
|
||||
|
||||
if (!getResources().getBoolean(R.bool.large_layout)) {
|
||||
// Set up the ViewPager with the sections adapter.
|
||||
mViewPager = mView.findViewById(R.id.container);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
// Open last opened tab
|
||||
mViewPager.setCurrentItem(lastOpenedList);
|
||||
|
||||
tabLayout = mView.findViewById(R.id.tabs);
|
||||
tabLayout.setupWithViewPager(mViewPager);
|
||||
|
||||
@@ -134,6 +134,7 @@ public class MainFragment extends Fragment implements TasksFragment.TaskChangedA
|
||||
ListView listView = mView.findViewById(R.id.list);
|
||||
//listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, taskLists));
|
||||
listView.setAdapter(new ArrayAdapter<>(activity, R.layout.list_tasklist_item, taskLists));
|
||||
listView.setSelection(lastOpenedList);
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
@@ -2,11 +2,9 @@
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".activities.MainActivity">
|
||||
tools:context="com.wismna.geoffroy.donext.fragments.MainFragment">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
@@ -35,13 +33,4 @@
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
</android.support.percent.PercentRelativeLayout>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:onClick="onNewTaskClick"
|
||||
android:src="@drawable/ic_add" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/main_content"
|
||||
android:layout_width="match_parent"
|
||||
|
Reference in New Issue
Block a user