mirror of
https://github.com/wismna/DoNext.git
synced 2025-10-03 15:40:14 -04:00
WIP on listview selectors
Adds tablet support in manifest
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.wismna.geoffroy.donext">
|
||||
|
||||
<supports-screens
|
||||
android:largeScreens="true"
|
||||
android:smallScreens="true">
|
||||
</supports-screens>
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
@@ -14,7 +18,7 @@
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
@@ -104,12 +104,16 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
||||
}
|
||||
else if (tabs instanceof ListView) {
|
||||
ListView listView = (ListView) tabs;
|
||||
//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);
|
||||
view.setSelected(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
parent.setElevation(10);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/colorAccent" android:state_selected="true" />
|
||||
<item android:drawable="@android:color/black" />
|
||||
<item android:drawable="@android:color/background_light" android:state_activated="true" />
|
||||
<item android:drawable="@color/common_google_signin_btn_text_light_focused" />
|
||||
</selector>
|
@@ -41,12 +41,15 @@
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2" />
|
||||
android:layout_weight="0.2"
|
||||
android:listSelector="@drawable/tasklist_select"/>
|
||||
<com.wismna.geoffroy.donext.widgets.NonSwipeableViewPager
|
||||
android:id="@+id/container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="0.8"
|
||||
android:elevation="10dp"
|
||||
android:background="@android:color/background_light"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
</LinearLayout>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
@@ -4,6 +4,4 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="20dp"
|
||||
android:textSize="20sp"
|
||||
android:textColor="@drawable/tasklist_select"
|
||||
android:duplicateParentState="true" />
|
||||
android:textSize="20sp" />
|
Reference in New Issue
Block a user