mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
#1381 Material Light Theme
This commit is contained in:
parent
6cf636271d
commit
d8b2e545a9
45 changed files with 224 additions and 171 deletions
|
@ -134,7 +134,8 @@
|
|||
|
||||
<activity
|
||||
android:name=".activity.MuteConfig"
|
||||
android:launchMode="singleTask"/>
|
||||
android:launchMode="singleTask"
|
||||
android:label="@string/mute_sites"/>
|
||||
|
||||
<activity
|
||||
android:name=".activity.SearchForFeeds" android:launchMode="singleTop" >
|
||||
|
|
|
@ -1,26 +1,33 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/actionbar_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="?attr/homeAsUpIndicator"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/actionbar_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:src="@drawable/world" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/actionbar_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@id/actionbar_icon"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textSize="18sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
<RelativeLayout
|
||||
android:id="@+id/main_top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_alignParentTop="true"
|
||||
style="?actionbarBackground" >
|
||||
android:background="?colorPrimary" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/main_user_image"
|
||||
|
@ -75,7 +75,7 @@
|
|||
android:layout_marginLeft="3dp"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/main_profile_button"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
|
@ -98,7 +98,7 @@
|
|||
android:layout_alignParentBottom="true"
|
||||
android:tag="feedIntelligenceSelector" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/main_menu_button"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
|
@ -108,7 +108,7 @@
|
|||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/main_add_button"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<Button
|
||||
<TextView
|
||||
android:id="@+id/reading_overlay_text"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="40dp"
|
||||
|
@ -28,12 +28,13 @@
|
|||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/overlay_text"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
android:paddingLeft="10dp"
|
||||
style="?selectorOverlayBackgroundText"
|
||||
android:onClick="overlayText" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/reading_overlay_send"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
|
@ -44,7 +45,7 @@
|
|||
style="?selectorOverlayBackgroundSend"
|
||||
android:onClick="overlaySend" />
|
||||
|
||||
<Button
|
||||
<TextView
|
||||
android:id="@+id/reading_overlay_right"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="40dp"
|
||||
|
@ -53,11 +54,12 @@
|
|||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:text="@string/overlay_next"
|
||||
android:gravity="center"
|
||||
android:textSize="14sp"
|
||||
style="?selectorOverlayBackgroundRight"
|
||||
android:onClick="overlayRight" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/reading_overlay_left"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="40dp"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
android:text="@string/intel_title_header"
|
||||
/>
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/intel_title_clear"
|
||||
android:layout_below="@id/intel_title_header"
|
||||
android:layout_alignParentRight="true"
|
||||
|
@ -29,7 +29,7 @@
|
|||
android:background="@drawable/ic_clear_gray55"
|
||||
/>
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/intel_title_dislike"
|
||||
android:layout_below="@id/intel_title_header"
|
||||
android:layout_toLeftOf="@id/intel_title_clear"
|
||||
|
@ -42,7 +42,7 @@
|
|||
android:background="@drawable/ic_dislike_gray55"
|
||||
/>
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/intel_title_like"
|
||||
android:layout_below="@id/intel_title_header"
|
||||
android:layout_toLeftOf="@id/intel_title_dislike"
|
||||
|
|
|
@ -63,12 +63,12 @@
|
|||
android:layout_below="@id/row_item_feed_header"
|
||||
android:background="@color/gray55"/>
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/story_context_menu_button"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/ic_menu_moreoverflow"
|
||||
style="?android:attr/actionOverflowButtonStyle"
|
||||
android:contentDescription="@string/description_menu"
|
||||
android:layout_below="@id/item_feed_border"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
>
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/intel_row_clear"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
|
@ -14,7 +14,7 @@
|
|||
android:background="@drawable/ic_clear_gray55"
|
||||
/>
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/intel_row_dislike"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toLeftOf="@id/intel_row_clear"
|
||||
|
@ -27,7 +27,7 @@
|
|||
android:background="@drawable/ic_dislike_gray55"
|
||||
/>
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/intel_row_like"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_toLeftOf="@id/intel_row_dislike"
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
android:layout_marginBottom="15dp"
|
||||
android:baselineAligned="false" >
|
||||
|
||||
<Button
|
||||
<TextView
|
||||
android:id="@+id/share_story_button"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="36dp"
|
||||
style="?storyButtons"
|
||||
android:text="@string/share_this" />
|
||||
|
||||
<Button
|
||||
<TextView
|
||||
android:id="@+id/save_story_button"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="36dp"
|
||||
|
|
|
@ -1,35 +1,59 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="10dp"
|
||||
android:paddingLeft="25dip"
|
||||
android:paddingRight="25dip"
|
||||
android:paddingBottom="10dip"
|
||||
android:paddingTop="10dip"
|
||||
>
|
||||
|
||||
<RadioButton android:id="@+id/radio_5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_5"/>
|
||||
<RadioButton android:id="@+id/radio_15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_15"/>
|
||||
<RadioButton android:id="@+id/radio_30"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_30"/>
|
||||
<RadioButton android:id="@+id/radio_60"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_60"/>
|
||||
<RadioButton android:id="@+id/radio_90"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_90"/>
|
||||
android:orientation="vertical">
|
||||
|
||||
</RadioGroup>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/infrequent_choice_title"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="25dip"
|
||||
android:paddingTop="10dip"
|
||||
android:paddingRight="25dip"
|
||||
android:paddingBottom="10dip">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_5" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_15" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_30"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_30" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_60"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_60" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_90"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/infrequent_90" />
|
||||
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false" />
|
||||
android:focusable="false"
|
||||
android:minWidth="0dp"
|
||||
android:minHeight="0dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img"
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item android:id="@+id/menu_mark_all_as_read"
|
||||
android:title="@string/menu_mark_all_as_read"
|
||||
android:showAsAction="ifRoom" android:icon="@drawable/ic_menu_markread_gray55" />
|
||||
app:showAsAction="ifRoom" android:icon="@drawable/ic_menu_markread_gray55" />
|
||||
<item android:id="@+id/menu_search_stories"
|
||||
android:title="@string/menu_search_stories"
|
||||
android:showAsAction="ifRoom" android:icon="@drawable/ic_menu_search_gray55" />
|
||||
app:showAsAction="ifRoom" android:icon="@drawable/ic_menu_search_gray55" />
|
||||
<item android:id="@+id/menu_story_order"
|
||||
android:title="@string/menu_story_order"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
<item android:id="@+id/menu_read_filter"
|
||||
android:title="@string/menu_read_filter"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
<item android:id="@+id/menu_story_list_style"
|
||||
android:title="@string/menu_story_list_style_choose" >
|
||||
<menu>
|
||||
|
@ -28,7 +29,7 @@
|
|||
</menu>
|
||||
</item>
|
||||
<item android:id="@+id/menu_textsize"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_textsize"/>
|
||||
<item android:id="@+id/menu_theme"
|
||||
android:title="@string/menu_theme_choose" >
|
||||
|
@ -65,20 +66,20 @@
|
|||
</item>
|
||||
<item android:id="@+id/menu_statistics"
|
||||
android:title="@string/menu_statistics"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
<item android:id="@+id/menu_delete_feed"
|
||||
android:title="@string/menu_delete_feed"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
<item android:id="@+id/menu_rename_feed"
|
||||
android:title="@string/menu_rename_feed"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
<item android:id="@+id/menu_instafetch_feed"
|
||||
android:title="@string/menu_instafetch_feed" />
|
||||
<item android:id="@+id/menu_infrequent_cutoff"
|
||||
android:title="@string/menu_infrequent_cutoff"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
<item android:id="@+id/menu_save_search"
|
||||
android:title="Save Search"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:visible="false"/>
|
||||
</menu>
|
||||
|
|
|
@ -1,60 +1,61 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item android:id="@+id/menu_refresh"
|
||||
android:title="@string/menu_refresh"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_search_feeds"
|
||||
android:title="@string/menu_search_feeds"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_add_feed"
|
||||
android:title="@string/menu_add_feed"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_textsize"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_textsize"/>
|
||||
|
||||
<item android:id="@+id/menu_settings"
|
||||
android:title="@string/settings"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_mute_sites"
|
||||
android:title="@string/mute_sites"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_widget"
|
||||
android:title="@string/widget"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_feedback"
|
||||
android:title="@string/menu_feedback"
|
||||
android:showAsAction="never" >
|
||||
app:showAsAction="never" >
|
||||
<menu>
|
||||
<item android:id="@+id/menu_feedback_post"
|
||||
android:title="@string/menu_feedback_post"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
<item android:id="@+id/menu_feedback_email"
|
||||
android:title="@string/menu_feedback_email"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
<item android:id="@+id/menu_loginas"
|
||||
android:title="@string/menu_loginas"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:visible="false"/>
|
||||
|
||||
<item android:id="@+id/menu_premium_account"
|
||||
android:title="@string/menu_premium_account"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_logout"
|
||||
android:title="@string/menu_logout"
|
||||
android:showAsAction="never" />
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item android:id="@+id/menu_theme"
|
||||
android:title="@string/menu_theme_choose" >
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/menu_sort_by"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_sort_by">
|
||||
<menu>
|
||||
<group android:checkableBehavior="single">
|
||||
|
@ -26,7 +27,7 @@
|
|||
</item>
|
||||
<item
|
||||
android:id="@+id/menu_sort_order"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_sort_order">
|
||||
<menu>
|
||||
<group android:checkableBehavior="single">
|
||||
|
@ -41,7 +42,7 @@
|
|||
</item>
|
||||
<item
|
||||
android:id="@+id/menu_folder_view"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_folder_view">
|
||||
<menu>
|
||||
<group android:checkableBehavior="single">
|
||||
|
@ -68,7 +69,7 @@
|
|||
android:title="@string/menu_select_none" />
|
||||
<item
|
||||
android:id="@+id/menu_widget_background"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_widget_background">
|
||||
<menu>
|
||||
<group android:checkableBehavior="single">
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_reading_fullscreen"
|
||||
android:icon="@drawable/ic_menu_fullscreen_gray55"
|
||||
android:showAsAction="always"
|
||||
app:showAsAction="always"
|
||||
android:title="@string/menu_fullscreen"/>
|
||||
|
||||
</menu>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item android:id="@+id/menu_search"
|
||||
android:icon="@drawable/ic_menu_search_gray55"
|
||||
android:title="@string/menu_search"
|
||||
android:showAsAction="always" />
|
||||
app:showAsAction="always" />
|
||||
|
||||
</menu>
|
||||
|
|
|
@ -1,51 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_reading_sharenewsblur"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_sharenewsblur"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_reading_original"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_original"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_send_story"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_send_story"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_send_story_full"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_send_story_full"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_textsize"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_textsize"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_font"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_font"/>
|
||||
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_reading_save"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_save_story"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_reading_markunread"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_mark_unread"/>
|
||||
|
||||
<item android:id="@+id/menu_go_to_feed"
|
||||
android:title="@string/go_to_feed"/>
|
||||
<item
|
||||
android:id="@+id/menu_intel"
|
||||
android:showAsAction="never"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/menu_intel"/>
|
||||
|
||||
<item android:id="@+id/menu_theme"
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<style name="dialogButton" parent="Widget.MaterialComponents.Button.TextButton">
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
</style>
|
||||
|
||||
<style name="initStyle" parent="@android:style/Theme.DeviceDefault.NoActionBar">
|
||||
<item name="android:windowBackground">@color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="actionbar" parent="@android:style/Widget.Holo.Light.ActionBar">
|
||||
<item name="android:background">@color/bar_background</item>
|
||||
<style name="actionbar" parent="ThemeOverlay.MaterialComponents.Light">
|
||||
<item name="colorControlNormal">@color/gray55</item>
|
||||
</style>
|
||||
<style name="actionbar.dark" parent="@android:style/Widget.Holo.ActionBar">
|
||||
<item name="android:background">@color/dark_bar_background</item>
|
||||
|
@ -63,13 +68,13 @@
|
|||
<item name="android:background">@drawable/dark_list_background</item>
|
||||
</style>
|
||||
|
||||
<style name="itemBackground">
|
||||
<style name="layoutBackground">
|
||||
<item name="android:background">@color/item_background</item>
|
||||
</style>
|
||||
<style name="itemBackground.dark">
|
||||
<style name="layoutBackground.dark">
|
||||
<item name="android:background">@color/dark_item_background</item>
|
||||
</style>
|
||||
<style name="itemBackground.black">
|
||||
<style name="layoutBackground.black">
|
||||
<item name="android:background">@color/black</item>
|
||||
</style>
|
||||
|
||||
|
@ -176,6 +181,7 @@
|
|||
<item name="android:textColor">@color/button_text</item>
|
||||
<item name="android:background">@drawable/button_background</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
</style>
|
||||
<style name="storyButtons.dark">
|
||||
<item name="android:textSize">14sp</item>
|
||||
|
@ -184,6 +190,7 @@
|
|||
<item name="android:textColor">@color/button_text_dark</item>
|
||||
<item name="android:background">@drawable/button_background_dark</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
</style>
|
||||
|
||||
<style name="shareBarBackground">
|
||||
|
|
|
@ -1,14 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<style name="NewsBlurTheme" parent="@android:style/Theme.Holo.Light" >
|
||||
<item name="android:actionBarStyle">@style/actionbar</item>
|
||||
<style name="NewsBlurTheme" parent="Theme.MaterialComponents.Light" >
|
||||
<item name="colorPrimary">@color/primary.light</item>
|
||||
<item name="colorPrimaryDark">@color/primaryDark.light</item>
|
||||
<item name="colorSecondary">@color/secondary.light</item>
|
||||
<item name="actionBarTheme">@style/actionbar</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/dialogButton</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/dialogButton</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/dialogButton</item>
|
||||
<!-- <item name="android:actionBarStyle">@style/actionbar</item>-->
|
||||
<item name="android:expandableListViewStyle">@style/expandableListView</item>
|
||||
<item name="selectorFolderBackground">@style/selectorFolderBackground</item>
|
||||
<item name="selectorFeedBackground">@style/selectorFeedBackground</item>
|
||||
<item name="feedRowNeutCountText">@style/feedRowNeutCountText</item>
|
||||
<item name="actionbarBackground">@style/actionbarBackground</item>
|
||||
<item name="listBackground">@style/listBackground</item>
|
||||
<item name="itemBackground">@style/itemBackground</item>
|
||||
<item name="layoutBackground">@style/layoutBackground</item>
|
||||
<item name="readingBackground">@style/readingBackground</item>
|
||||
<item name="defaultText">@style/defaultText</item>
|
||||
<item name="linkText">@style/linkText</item>
|
||||
|
@ -40,8 +47,9 @@
|
|||
<item name="selectorOverlayBackgroundStory">@style/selectorOverlayBackgroundStory</item>
|
||||
<item name="selectorOverlayBackgroundText">@style/selectorOverlayBackgroundText</item>
|
||||
<item name="muteicon">@style/muteicon</item>
|
||||
<item name="android:contextPopupMenuStyle">@style/contextPopupStyle</item>
|
||||
<item name="android:textColorPrimary">@color/black</item>
|
||||
<!-- <item name="android:contextPopupMenuStyle">@style/contextPopupStyle</item>-->
|
||||
<!-- <item name="android:textColorPrimary">@color/black</item>-->
|
||||
<item name="android:textColor">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="NewsBlurDarkTheme" parent="@android:style/Theme.Holo" >
|
||||
|
@ -52,7 +60,7 @@
|
|||
<item name="feedRowNeutCountText">@style/feedRowNeutCountText.dark</item>
|
||||
<item name="actionbarBackground">@style/actionbarBackground.dark</item>
|
||||
<item name="listBackground">@style/listBackground.dark</item>
|
||||
<item name="itemBackground">@style/itemBackground.dark</item>
|
||||
<item name="layoutBackground">@style/layoutBackground.dark</item>
|
||||
<item name="readingBackground">@style/readingBackground.dark</item>
|
||||
<item name="defaultText">@style/defaultText.dark</item>
|
||||
<item name="linkText">@style/linkText.dark</item>
|
||||
|
@ -99,7 +107,7 @@
|
|||
<item name="feedRowNeutCountText">@style/feedRowNeutCountText.dark</item>
|
||||
<item name="actionbarBackground">@style/actionbarBackground.black</item>
|
||||
<item name="listBackground">@style/listBackground.dark</item>
|
||||
<item name="itemBackground">@style/itemBackground.black</item>
|
||||
<item name="layoutBackground">@style/layoutBackground.black</item>
|
||||
<item name="readingBackground">@style/readingBackground.black</item>
|
||||
<item name="defaultText">@style/defaultText.dark</item>
|
||||
<item name="linkText">@style/linkText.dark</item>
|
||||
|
|
|
@ -20,7 +20,7 @@ public class AddFeedExternal extends NbActivity implements AddFeedFragment.AddFe
|
|||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityAddfeedexternalBinding.inflate(getLayoutInflater());
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
UIUtils.setCustomActionBar(this, R.drawable.logo, "Add Feed", true);
|
||||
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ public class AllSharedStoriesItemsList extends ItemsList {
|
|||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_blurblogs, getResources().getString(R.string.all_shared_stories_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_blurblogs, getResources().getString(R.string.all_shared_stories_title), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,7 @@ public class AllSharedStoriesReading extends Reading {
|
|||
protected void onCreate(Bundle savedInstanceBundle) {
|
||||
super.onCreate(savedInstanceBundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_blurblogs, getResources().getString(R.string.all_shared_stories_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_blurblogs, getResources().getString(R.string.all_shared_stories_title), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ public class AllStoriesItemsList extends ItemsList {
|
|||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_allstories, getResources().getString(R.string.all_stories_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_allstories, getResources().getString(R.string.all_stories_title), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,8 +11,7 @@ public class AllStoriesReading extends Reading {
|
|||
protected void onCreate(Bundle savedInstanceBundle) {
|
||||
super.onCreate(savedInstanceBundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_allstories, getResources().getString(R.string.all_stories_title));
|
||||
setTitle(getResources().getString(R.string.all_stories_row_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_allstories, getResources().getString(R.string.all_stories_title), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@ abstract public class FeedChooser extends NbActivity {
|
|||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
bindLayout();
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
setupList();
|
||||
loadFeeds();
|
||||
loadFolders();
|
||||
|
|
|
@ -46,7 +46,7 @@ public class FeedItemsList extends ItemsList {
|
|||
|
||||
super.onCreate(bundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, feed.faviconUrl, feed.title);
|
||||
UIUtils.setCustomActionBar(this, feed.faviconUrl, feed.title, false);
|
||||
checkInAppReview();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public class FeedReading extends Reading {
|
|||
return;
|
||||
}
|
||||
|
||||
UIUtils.setCustomActionBar(this, feed.faviconUrl, feed.title);
|
||||
UIUtils.setCustomActionBar(this, feed.faviconUrl, feed.title, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class FolderItemsList extends ItemsList {
|
|||
|
||||
super.onCreate(bundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.g_icn_folder_rss, folderName);
|
||||
UIUtils.setCustomActionBar(this, R.drawable.g_icn_folder_rss, folderName, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,7 @@ public class FolderReading extends Reading {
|
|||
protected void onCreate(Bundle savedInstanceBundle) {
|
||||
super.onCreate(savedInstanceBundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.g_icn_folder_rss, fs.getFolderName());
|
||||
UIUtils.setCustomActionBar(this, R.drawable.g_icn_folder_rss, fs.getFolderName(), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ public class GlobalSharedStoriesItemsList extends ItemsList {
|
|||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_global, getResources().getString(R.string.global_shared_stories_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_global, getResources().getString(R.string.global_shared_stories_title), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,7 +12,7 @@ public class GlobalSharedStoriesReading extends Reading {
|
|||
protected void onCreate(Bundle savedInstanceBundle) {
|
||||
super.onCreate(savedInstanceBundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_global, getResources().getString(R.string.global_shared_stories_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_global, getResources().getString(R.string.global_shared_stories_title), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,7 @@ public class InfrequentItemsList extends ItemsList implements InfrequentCutoffCh
|
|||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_allstories, getResources().getString(R.string.infrequent_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_allstories, getResources().getString(R.string.infrequent_title), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,7 @@ public class InfrequentReading extends Reading {
|
|||
protected void onCreate(Bundle savedInstanceBundle) {
|
||||
super.onCreate(savedInstanceBundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_allstories, getResources().getString(R.string.infrequent_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.ak_icon_allstories, getResources().getString(R.string.infrequent_title), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ public class MuteConfig extends FeedChooser implements MuteConfigAdapter.FeedSta
|
|||
void bindLayout() {
|
||||
binding = ActivityMuteConfigBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
UIUtils.setCustomActionBar(this, R.drawable.logo, getString(R.string.mute_sites), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -127,7 +127,7 @@ public class Premium extends NbActivity {
|
|||
}
|
||||
|
||||
private void setupUI() {
|
||||
UIUtils.setCustomActionBar(this, R.drawable.logo, getString(R.string.premium_toolbar_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.logo, getString(R.string.premium_toolbar_title), true);
|
||||
|
||||
// linkify before setting the string resource
|
||||
BetterLinkMovementMethod.linkify(Linkify.WEB_URLS, binding.textPolicies)
|
||||
|
|
|
@ -11,7 +11,7 @@ public class ReadStoriesItemsList extends ItemsList {
|
|||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.g_icn_unread_double, getResources().getString(R.string.read_stories_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.g_icn_unread_double, getResources().getString(R.string.read_stories_title), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,7 +11,7 @@ public class ReadStoriesReading extends Reading {
|
|||
protected void onCreate(Bundle savedInstanceBundle) {
|
||||
super.onCreate(savedInstanceBundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, R.drawable.g_icn_unread, getResources().getString(R.string.read_stories_title));
|
||||
UIUtils.setCustomActionBar(this, R.drawable.g_icn_unread, getResources().getString(R.string.read_stories_title), false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class SavedStoriesItemsList extends ItemsList {
|
|||
if (fs.getSingleSavedTag() != null) {
|
||||
title = title + " - " + fs.getSingleSavedTag();
|
||||
}
|
||||
UIUtils.setCustomActionBar(this, R.drawable.clock, title);
|
||||
UIUtils.setCustomActionBar(this, R.drawable.clock, title, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,7 +15,7 @@ public class SavedStoriesReading extends Reading {
|
|||
if (fs.getSingleSavedTag() != null) {
|
||||
title = title + " - " + fs.getSingleSavedTag();
|
||||
}
|
||||
UIUtils.setCustomActionBar(this, R.drawable.clock, title);
|
||||
UIUtils.setCustomActionBar(this, R.drawable.clock, title, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.newsblur.domain.FeedResult;
|
|||
import com.newsblur.fragment.AddFeedFragment;
|
||||
import com.newsblur.network.SearchAsyncTaskLoader;
|
||||
import com.newsblur.network.SearchLoaderResponse;
|
||||
import com.newsblur.util.UIUtils;
|
||||
|
||||
// TODO: this activity's use of the inbuilt activity search facility as well as an improper use of a loader to
|
||||
// make network requests makes it easily lose state, lack non-legacy progress indication, and generally
|
||||
|
@ -46,9 +47,8 @@ public class SearchForFeeds extends NbActivity implements LoaderCallbacks<Search
|
|||
@Override
|
||||
protected void onCreate(Bundle arg0) {
|
||||
super.onCreate(arg0);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
setTitle(R.string.title_feed_search);
|
||||
UIUtils.setCustomActionBar(this, R.drawable.logo, getString(R.string.title_feed_search), true);
|
||||
|
||||
setContentView(R.layout.activity_feed_search);
|
||||
|
||||
TextView emptyView = (TextView) findViewById(R.id.empty_view);
|
||||
|
|
|
@ -6,6 +6,7 @@ import android.content.SharedPreferences;
|
|||
import android.os.Bundle;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.newsblur.R;
|
||||
import com.newsblur.fragment.SettingsFragment;
|
||||
import com.newsblur.util.PrefConstants;
|
||||
import com.newsblur.util.PrefsUtils;
|
||||
|
@ -19,7 +20,7 @@ public class Settings extends AppCompatActivity implements SharedPreferences.OnS
|
|||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
UIUtils.setCustomActionBar(this, R.drawable.logo, getString(R.string.settings), true);
|
||||
|
||||
SettingsFragment fragment = new SettingsFragment();
|
||||
getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();
|
||||
|
|
|
@ -16,7 +16,7 @@ public class SocialFeedItemsList extends ItemsList {
|
|||
socialFeed = (SocialFeed) getIntent().getSerializableExtra(EXTRA_SOCIAL_FEED);
|
||||
super.onCreate(bundle);
|
||||
|
||||
UIUtils.setCustomActionBar(this, socialFeed.photoUrl, socialFeed.feedTitle);
|
||||
UIUtils.setCustomActionBar(this, socialFeed.photoUrl, socialFeed.feedTitle, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,7 +13,7 @@ public class SocialFeedReading extends Reading {
|
|||
super.onCreate(savedInstanceBundle);
|
||||
SocialFeed socialFeed = FeedUtils.dbHelper.getSocialFeed(fs.getSingleSocialFeed().getKey());
|
||||
if (socialFeed == null) finish(); // don't open fatally stale intents
|
||||
UIUtils.setCustomActionBar(this, socialFeed.photoUrl, socialFeed.feedTitle);
|
||||
UIUtils.setCustomActionBar(this, socialFeed.photoUrl, socialFeed.feedTitle, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.newsblur.databinding.ActivityWidgetConfigBinding;
|
|||
import com.newsblur.domain.Feed;
|
||||
import com.newsblur.domain.Folder;
|
||||
import com.newsblur.util.PrefsUtils;
|
||||
import com.newsblur.util.UIUtils;
|
||||
import com.newsblur.widget.WidgetUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -62,6 +63,7 @@ public class WidgetConfig extends FeedChooser {
|
|||
void bindLayout() {
|
||||
binding = ActivityWidgetConfigBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
UIUtils.setCustomActionBar(this, R.drawable.logo, getString(R.string.widget), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -43,8 +43,7 @@ public class InfrequentCutoffDialogFragment extends DialogFragment {
|
|||
binding.radio30.setChecked(currentValue == 30);
|
||||
binding.radio60.setChecked(currentValue == 60);
|
||||
binding.radio90.setChecked(currentValue == 90);
|
||||
|
||||
getDialog().setTitle(R.string.infrequent_choice_title);
|
||||
|
||||
getDialog().getWindow().getAttributes().gravity = Gravity.BOTTOM;
|
||||
|
||||
return v;
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.Map;
|
|||
import static android.graphics.Bitmap.Config.ARGB_8888;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ActionBar;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.TypedArray;
|
||||
|
@ -36,6 +35,9 @@ import android.widget.ImageView;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.newsblur.R;
|
||||
import com.newsblur.activity.*;
|
||||
import com.newsblur.domain.Classifier;
|
||||
|
@ -191,40 +193,33 @@ public class UIUtils {
|
|||
* Set up our customised ActionBar view that features the specified icon and title, sized
|
||||
* away from system standard to meet the NewsBlur visual style.
|
||||
*/
|
||||
public static void setCustomActionBar(Activity activity, String imageUrl, String title) {
|
||||
ImageView iconView = setupCustomActionbar(activity, title);
|
||||
public static void setCustomActionBar(AppCompatActivity activity, String imageUrl, String title, boolean showHomeEnabled) {
|
||||
ImageView iconView = setupCustomActionbar(activity, title, showHomeEnabled);
|
||||
FeedUtils.iconLoader.displayImage(imageUrl, iconView, 0, false);
|
||||
}
|
||||
|
||||
public static void setCustomActionBar(Activity activity, int imageId, String title) {
|
||||
ImageView iconView = setupCustomActionbar(activity, title);
|
||||
public static void setCustomActionBar(AppCompatActivity activity, int imageId, String title, boolean showHomeEnabled) {
|
||||
ImageView iconView = setupCustomActionbar(activity, title, showHomeEnabled);
|
||||
iconView.setImageResource(imageId);
|
||||
}
|
||||
|
||||
private static ImageView setupCustomActionbar(final Activity activity, String title) {
|
||||
private static ImageView setupCustomActionbar(final AppCompatActivity activity, String title, boolean showHomeEnabled) {
|
||||
// we completely replace the existing title and 'home' icon with a custom view
|
||||
activity.getActionBar().setDisplayShowCustomEnabled(true);
|
||||
activity.getActionBar().setDisplayShowTitleEnabled(false);
|
||||
activity.getActionBar().setDisplayShowHomeEnabled(false);
|
||||
activity.getSupportActionBar().setDisplayShowCustomEnabled(true);
|
||||
activity.getSupportActionBar().setDisplayShowTitleEnabled(false);
|
||||
activity.getSupportActionBar().setDisplayShowHomeEnabled(false);
|
||||
View v = LayoutInflater.from(activity).inflate(R.layout.actionbar_custom_icon, null);
|
||||
TextView titleView = ((TextView) v.findViewById(R.id.actionbar_text));
|
||||
ImageView arrowView = v.findViewById(R.id.actionbar_arrow);
|
||||
arrowView.setVisibility(showHomeEnabled ? View.VISIBLE : View.GONE);
|
||||
TextView titleView = v.findViewById(R.id.actionbar_text);
|
||||
titleView.setText(title);
|
||||
ImageView iconView = ((ImageView) v.findViewById(R.id.actionbar_icon));
|
||||
ImageView iconView = v.findViewById(R.id.actionbar_icon);
|
||||
// using a custom view breaks the system-standard ability to tap the icon or title to return
|
||||
// to the previous activity. Re-implement that here.
|
||||
titleView.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
activity.finish();
|
||||
}
|
||||
});
|
||||
iconView.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
activity.finish();
|
||||
}
|
||||
});
|
||||
activity.getActionBar().setCustomView(v, new ActionBar.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
|
||||
arrowView.setOnClickListener(v0 -> activity.finish());
|
||||
titleView.setOnClickListener(v1 -> activity.finish());
|
||||
iconView.setOnClickListener(v12 -> activity.finish());
|
||||
activity.getSupportActionBar().setCustomView(v, new ActionBar.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
|
||||
return iconView;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue