mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
better menu items
This commit is contained in:
parent
ad126d663c
commit
85fec48c6c
3 changed files with 31 additions and 11 deletions
|
@ -1,13 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
<LinearLayout
|
||||
android:gravity="center_vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/menu_item_title"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -74,7 +74,8 @@ public class DictionaryNotInstalledActivity extends ListActivity {
|
|||
final View view = convertView != null
|
||||
? convertView
|
||||
: LayoutInflater.from(parent.getContext()).inflate(R.layout.menu_item, parent, false);
|
||||
((TextView)view).setText(
|
||||
final TextView titleView = (TextView)view.findViewById(R.id.menu_item_title);
|
||||
titleView.setText(
|
||||
myResource.getResource(myItems[position]).getValue().replaceAll("%s", myDictionaryName)
|
||||
);
|
||||
return view;
|
||||
|
|
|
@ -113,7 +113,8 @@ abstract class MenuActivity extends ListActivity implements AdapterView.OnItemCl
|
|||
final View view = convertView != null
|
||||
? convertView
|
||||
: LayoutInflater.from(parent.getContext()).inflate(R.layout.menu_item, parent, false);
|
||||
((TextView)view).setText(getItem(position).MenuItemName);
|
||||
final TextView titleView = (TextView)view.findViewById(R.id.menu_item_title);
|
||||
titleView.setText(getItem(position).MenuItemName);
|
||||
return view;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue