mirror of
https://github.com/wismna/DoNext.git
synced 2025-10-03 15:40:14 -04:00
Large screen layout is now w600dp
Change of an tasklist list id to accomodate the change
This commit is contained in:
@@ -8,8 +8,8 @@ android {
|
||||
applicationId "com.wismna.geoffroy.donext"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 25
|
||||
versionCode 17
|
||||
versionName "1.4.2"
|
||||
versionCode 18
|
||||
versionName "1.4.3"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@@ -1,11 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.wismna.geoffroy.donext">
|
||||
|
||||
<supports-screens
|
||||
android:largeScreens="true"
|
||||
android:smallScreens="true" />
|
||||
|
||||
<application
|
||||
android:name=".DoNext"
|
||||
android:allowBackup="true"
|
||||
@@ -14,6 +9,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<meta-data android:name="android.max_aspect" android:value="2.1" />
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
|
@@ -83,11 +83,11 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
||||
mViewPager = (ViewPager) findViewById(R.id.container);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
// 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 (tabs instanceof TabLayout) {
|
||||
tabLayout = (TabLayout) tabs;
|
||||
if (!mIsLargeLayout) {
|
||||
tabLayout = (TabLayout) findViewById(R.id.tabs);
|
||||
tabLayout.setupWithViewPager(mViewPager);
|
||||
|
||||
// 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) {
|
||||
ListView listView = (ListView) tabs;
|
||||
else {
|
||||
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, R.layout.list_tasklist_item, taskLists));
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
mViewPager.setCurrentItem(position);
|
||||
view.setSelected(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
parent.setElevation(10);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -31,10 +31,11 @@
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:orientation="horizontal">
|
||||
<android.widget.ListView
|
||||
android:id="@+id/tabs"
|
||||
android:id="@+id/list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:choiceMode="singleChoice"
|
||||
android:listSelector="@drawable/tasklist_select"/>
|
||||
<com.wismna.geoffroy.donext.widgets.NonSwipeableViewPager
|
||||
android:id="@+id/container"
|
@@ -3,5 +3,5 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="20dp"
|
||||
android:textSize="20sp" />
|
||||
android:padding="15dp"
|
||||
android:textSize="15sp" />
|
Reference in New Issue
Block a user