Large screen layout is now w600dp

Change of an tasklist list id to accomodate the change
This commit is contained in:
bg45
2017-03-31 17:26:00 -04:00
parent 301cf398c0
commit f94089ed88
6 changed files with 13 additions and 20 deletions

View File

@@ -8,8 +8,8 @@ android {
applicationId "com.wismna.geoffroy.donext" applicationId "com.wismna.geoffroy.donext"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 25 targetSdkVersion 25
versionCode 17 versionCode 18
versionName "1.4.2" versionName "1.4.3"
} }
buildTypes { buildTypes {
release { release {

View File

@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wismna.geoffroy.donext"> package="com.wismna.geoffroy.donext">
<supports-screens
android:largeScreens="true"
android:smallScreens="true" />
<application <application
android:name=".DoNext" android:name=".DoNext"
android:allowBackup="true" android:allowBackup="true"
@@ -14,6 +9,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<meta-data android:name="android.max_aspect" android:value="2.1" />
<activity <activity
android:name=".activities.MainActivity" android:name=".activities.MainActivity"
android:label="@string/app_name" android:label="@string/app_name"

View File

@@ -83,11 +83,11 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
mViewPager = (ViewPager) findViewById(R.id.container); mViewPager = (ViewPager) findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter); mViewPager.setAdapter(mSectionsPagerAdapter);
// Open last opened tab // Open last opened tab
mViewPager.setCurrentItem(sharedPref.getInt("last_opened_tab", 0)); int lastOpenedList = sharedPref.getInt("last_opened_tab", 0);
mViewPager.setCurrentItem(lastOpenedList);
View tabs = findViewById(R.id.tabs); if (!mIsLargeLayout) {
if (tabs instanceof TabLayout) { tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout = (TabLayout) tabs;
tabLayout.setupWithViewPager(mViewPager); tabLayout.setupWithViewPager(mViewPager);
// Handles scroll detection (only available for SDK version >=23) // Handles scroll detection (only available for SDK version >=23)
@@ -102,18 +102,14 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
}); });
} }
} }
else if (tabs instanceof ListView) { else {
ListView listView = (ListView) tabs; ListView listView = (ListView) findViewById(R.id.list);
//listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, taskLists)); //listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, taskLists));
listView.setAdapter(new ArrayAdapter<>(this, R.layout.list_tasklist_item, taskLists)); listView.setAdapter(new ArrayAdapter<>(this, R.layout.list_tasklist_item, taskLists));
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
mViewPager.setCurrentItem(position); mViewPager.setCurrentItem(position);
view.setSelected(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
parent.setElevation(10);
}
} }
}); });
} }

View File

@@ -31,10 +31,11 @@
android:layout_marginTop="?attr/actionBarSize" android:layout_marginTop="?attr/actionBarSize"
android:orientation="horizontal"> android:orientation="horizontal">
<android.widget.ListView <android.widget.ListView
android:id="@+id/tabs" android:id="@+id/list"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.2" android:layout_weight="0.2"
android:choiceMode="singleChoice"
android:listSelector="@drawable/tasklist_select"/> android:listSelector="@drawable/tasklist_select"/>
<com.wismna.geoffroy.donext.widgets.NonSwipeableViewPager <com.wismna.geoffroy.donext.widgets.NonSwipeableViewPager
android:id="@+id/container" android:id="@+id/container"

View File

@@ -3,5 +3,5 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="20dp" android:padding="15dp"
android:textSize="20sp" /> android:textSize="15sp" />