[and] Selectors for top bar.
This commit is contained in:
parent
07ac827883
commit
cd9c5469f4
6 changed files with 29 additions and 2 deletions
4
android/res/drawable/semitransparent_white.xml
Normal file
4
android/res/drawable/semitransparent_white.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<solid android:color="#33FFFFFF"/>
|
||||
</shape>
|
7
android/res/drawable/top_bar_selector.xml
Normal file
7
android/res/drawable/top_bar_selector.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@drawable/semitransparent_white" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/transparent"/>
|
||||
|
||||
</selector>
|
6
android/res/drawable/transparent.xml
Normal file
6
android/res/drawable/transparent.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="@android:color/transparent" />
|
||||
|
||||
</shape>
|
|
@ -24,6 +24,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/top_bar_selector"
|
||||
android:paddingLeft="@dimen/pad_mid"
|
||||
android:paddingRight="@dimen/pad_mid"
|
||||
android:src="@drawable/ic_articleselection" />
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
android:id="@+id/header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/search_bar"
|
||||
android:background="@color/dark_grey"
|
||||
android:paddingRight="@dimen/pad_mid" >
|
||||
android:background="@color/dark_grey" >
|
||||
|
||||
<TextView
|
||||
style="@android:style/TextAppearance.Medium"
|
||||
|
@ -26,6 +25,9 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@drawable/top_bar_selector"
|
||||
android:paddingLeft="@dimen/pad_small"
|
||||
android:paddingRight="@dimen/pad_small"
|
||||
android:src="@drawable/ic_info" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ public class ArticleInfoListFragment extends ListFragment implements LoaderCallb
|
|||
private View mListContainer;
|
||||
private View mProgressContainer;
|
||||
private View mHeader;
|
||||
private View mAbout;
|
||||
|
||||
private LocationManager mLocationManager;
|
||||
|
||||
|
@ -208,9 +209,11 @@ public class ArticleInfoListFragment extends ListFragment implements LoaderCallb
|
|||
mListContainer = mRootView.findViewById(R.id.listContainer);
|
||||
mProgressContainer = mRootView.findViewById(R.id.progressContainer);
|
||||
mHeader = mRootView.findViewById(R.id.header);
|
||||
mAbout = mRootView.findViewById(R.id.about);
|
||||
// setup listeners
|
||||
mSearchText.addTextChangedListener(this);
|
||||
mCross.setOnClickListener(this);
|
||||
mAbout.setOnClickListener(this);
|
||||
|
||||
return mRootView;
|
||||
}
|
||||
|
@ -287,6 +290,10 @@ public class ArticleInfoListFragment extends ListFragment implements LoaderCallb
|
|||
{
|
||||
if (v.getId() == mCross.getId())
|
||||
mSearchText.setText(""); // clean up text field
|
||||
else if (v.getId() == mAbout.getId())
|
||||
{
|
||||
// TODO: show about dialog
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue