How to hide Title in `Theme.Sherlock.Dialog`? - android

My DialogActivities extends from SherlockFragmentActivity. So I must to use Sherlock themes.
In values-v14 I hide Title like this:
<style name="Theme.Sherlock.Dialog" parent="#android:style/Theme.Holo.Dialog">
<item name="android:windowNoTitle">true</item>
</style>
How to hide Title in Theme.Sherlock.Dialog in values folder?
By default it looks like this (github.com):
<style name="Theme.Sherlock.Dialog" parent="android:Theme">
<item name="android:windowFrame">#null</item>
<item name="android:windowTitleStyle">#style/DialogWindowTitle.Sherlock</item>
<item name="android:windowBackground">#drawable/abs__dialog_full_holo_dark</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowAnimationStyle">#android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowActionModeOverlay">true</item>
<item name="android:windowCloseOnTouchOutside">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimAmount">0.6</item>
<item name="android:colorBackgroundCacheHint">#null</item>
<item name="android:textColorPrimary">#color/abs__primary_text_holo_dark</item>
<item name="android:textColorPrimaryInverse">#color/abs__primary_text_holo_light</item>
<item name="windowMinWidthMajor">#dimen/abs__dialog_min_width_major</item>
<item name="windowMinWidthMinor">#dimen/abs__dialog_min_width_minor</item>
<item name="windowActionBar">false</item>
<item name="windowContentOverlay">#null</item>
</style>

Solution:
I've changed abs__dialog_title_holo.xml by adding two lines in: https://github.com/JakeWharton/ActionBarSherlock/blob/master/library/res/layout/abs__dialog_title_holo.xml
<com.actionbarsherlock.internal.widget.FakeDialogPhoneWindow xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:fitsSystemWindows="true">
<TextView android:id="#android:id/title" style="?android:attr/windowTitleStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="#dimen/abs__alert_dialog_title_height"
android:visibility="gone" //******** FIRST ********
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:gravity="center_vertical|left" />
<View android:id="#+id/abs__titleDivider"
android:layout_width="fill_parent"
android:visibility="gone" //******** SECOND ********
android:layout_height="2dip"
android:background="#color/abs__holo_blue_light" />
<FrameLayout
android:layout_width="match_parent" android:layout_height="0dp"
android:layout_weight="1"
android:orientation="vertical"
android:foreground="?attr/windowContentOverlay">
<FrameLayout android:id="#+id/abs__content"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</FrameLayout>

Related

android:windowSoftInputMode="adjustResize" is not working for TranslucentTheme activity

For some reason the below code is not working for TranslucentTheme activity.Please help if its a known issue or something else need to be taken care.
Note : As per my observation, This code works fine if I remove the Translucent theme.
<activity
android:windowSoftInputMode="stateHidden|adjustResize"
android:name="MyActivity"
android:theme="#style/TranslucentTheme"/>
<style name="TranslucentTheme" parent="NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:colorBackgroundCacheHint">#null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:statusBarColor">#android:color/transparent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowAnimationStyle">#android:style/Animation</item>
</style>
activity_layout.xml
<ScrollView
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_gravity="bottom"
android:background="#color/transparent"
android:layout_width="match_parent"
android:layout_height="100dp"
<EditText
android:digits="1234567890"
android:inputType="number"
android:background="#00000000"
android:id="#+id/day_box"
android:minWidth="#dimen/dimen_12dp"
tools:text="123"
android:fontFamily="sans-serif-medium"
android:textColor="#000000"
android:textStyle="normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>```
Use Theme.AppCompat.Light.NoActionBar instead of NoActionBar
<style name="TranslucentTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:colorBackgroundCacheHint">#null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:statusBarColor">#android:color/transparent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowAnimationStyle">#android:style/Animation</item>
</style>

How to set the Color of the item title in navigationDrawer?

I am stuck in my own code. I can't find where to set the color of the "Title" text, in the navigationDrawer, to the defualt gray.
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:background="#000"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_gravity="start"
app:headerLayout="#layout/header"
app:itemTextColor="your color"
app:menu="#menu/drawer" />
app:itemTextColor="your color" only changes each item, like Import, Gallery etc. But how to change the Communicate textColor with the line above?
Picture 2 (dark blue) is what it looks like in my project. I managed to "somewhere" set the color to white in my project.
Can you find my problem? Currently my "Title" text is white..
nav_header_main.xml
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="#dimen/nav_header_vertical_spacing"
android:src="#android:drawable/sym_def_app_icon"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="#dimen/nav_header_vertical_spacing"
android:textColor="#color/whiteGray"
android:text="#string/app_name"
/>
</LinearLayout>
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start"
>
<include
layout="#layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:background="#color/nav_drawer_background"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:menu="#menu/activity_main_drawer"
app:headerLayout="#layout/nav_header_main"
app:itemTextColor="#color/nav_drawer_text" />
<android.support.design.widget.NavigationView
android:id="#+id/nav_right_view"
android:background="#color/nav_drawer_background"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:fitsSystemWindows="true"
app:menu="#menu/activity_main_right_drawer"
app:itemTextColor="#color/nav_drawer_text" />
</android.support.v4.widget.DrawerLayout>
app_bar_main.xml
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="#style/AppTheme.PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_main" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="#dimen/fab_margin"
/>
values/style.xml
<style name="WelcomeDialogTitle">
<item name="android:gravity">center_horizontal</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowBackground">#color/darkblue</item>
<item name="colorPrimary">#color/transparent</item>
<item name="colorPrimaryDark">#color/darkblue</item>
<item name="colorAccent">#color/darkblue</item>
</style>
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="android:windowBackground">#color/darkblue</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="colorPrimary">#color/transparent</item>
<item name="colorPrimaryDark">#color/transparent</item>
<item name="colorAccent">#color/transparent</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
</style>
<style name="CustomTheme" parent="#android:style/Theme.Black">
<item name="android:listViewStyle">#style/CustomListView</item>
<item name="android:textViewStyle">#style/CustomTextView</item>
</style>
<style name="CustomListView" parent="#android:style/Widget.ListView">
<item name="android:textColor">#000000</item>
<item name="android:fastScrollEnabled">true</item>
</style>
<style name="CustomTextView" parent="#android:style/Widget.TextView">
<item name="android:textColor">#000000</item>
<item name="android:textSize">17sp</item>
<item name="android:padding">1dp</item>
</style>
<style name="TitleTextStyleLarge">
<item name="android:gravity">left|center</item>
<item name="android:shadowColor">#color/white</item>
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:textColor">#color/white</item>
<item name="android:textSize">18sp</item>
</style>
<style name="TitleTextStyle">
<item name="android:gravity">left|center</item>
<item name="android:textSize">18sp</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_marginLeft">5dp</item>
<item name="android:layout_weight">1</item>
<!-- <item name="android:shadowColor">#color/white</item> -->
<item name="android:textColor">#color/white</item>
</style>
<style name="BarTitleStyle">
<item name="android:background">#drawable/bg_list_topbar</item>
<item name="android:layout_height">33dp</item>
<!-- <item name="android:shadowColor">#color/white</item> -->
<item name="android:layout_width">fill_parent</item>
</style>
<style name="BarTitleProgressStyle">
<item name="android:background">#drawable/bg_list_topbar</item>
<item name="android:layout_height">27dp</item>
<item name="android:layout_width">27dp</item>
<item name="android:layout_marginBottom">1dp</item>
<item name="android:layout_marginRight">5dp</item>
<item name="android:layout_marginTop">1dp</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center_vertical|center_horizontal</item>
</style>
</resources>
My activity theme
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
>
<meta-data
drawer.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="#+id/nav_search"
android:title="#string/LabelSearchTabTitle" />
<item
android:id="#+id/nav_wiki"
android:title="#string/LabelTitleWikiBook" />
<item
android:id="#+id/nav_forum"
android:title="#string/LabelTitleForum"
/>
<item
android:id="#+id/nav_history"
android:title="#string/LabelHistory"
/>
<item
android:id="#+id/nav_favs"
android:title="#string/LabelFavourites"
/>
</group>
<item android:title="#string/LabelTitleSupportPages">
<menu>
<item
android:id="#+id/nav_options"
android:title="#string/LabelTitleSettings" />
<item
android:id="#+id/nav_qa"
android:title="#string/LabelTitleAbout" />
<item
android:id="#+id/nav_facebook"
android:title="#string/LabelTitleFB" />
</menu>
</item>
</menu>
Try :
<item name="android:textColorSecondary">#eeeeee</item>
Edit :
Replace :
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="android:windowBackground">#color/darkblue</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
With This :
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="android:windowBackground">#color/darkblue</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:textColorSecondary">#eeeeee</item>
</style>
Edit 2 :
<style name="AppTheme.NoActionBar" parent="#style/Theme.AppCompat">
<item name="android:windowBackground">#color/darkblue</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
// change header color
<item name="android:textColorSecondary">#eeeeee</item>
// change separator color
<item name="android:listDivider">#ff000000</item>
</style>
You can make a custom layout for your Drawer items and include the custom layout in NavigationView.. Like this
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true">
<include
layout="#layout/sidedrawer"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</android.support.design.widget.NavigationView>
sidedrawer is your custom layout and you can provide it any style or color you want.. hope it will help you

I need change the color to border of the check box,Because it is in white color

I have check box in my contacts list to select that. But check box is in white color,it is not visible...So i need to change that border to black color...Please help me to change the code
This is my layout code
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="?android:dividerVertical"
android:showDividers="middle"
android:dividerPadding="5dp"
tools:context=".MainActivity" >
<ImageButton
android:id="#+id/image"
android:layout_width="#dimen/contact_image"
android:layout_height="50dp"
android:src="#drawable/contacts_image" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:clickable="false"
android:focusable="true"
android:orientation="vertical" >
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingRight="0dp"
android:paddingTop="1dp"
android:textColor="#color/black"
android:textSize="18sp"
/>
<TextView
android:id="#+id/mobile_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/black"
android:textSize="15sp"
android:paddingLeft="5dp"
android:paddingRight="0dp"
/>
</LinearLayout>
<CheckBox
android:id="#+id/check_box"
android:layout_width="#dimen/check_box_width"
android:layout_height="50dp"
android:visibility="visible"
android:clickable="true"/>
</LinearLayout>
This is my style.xml code
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="actionBarStyle">#style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="background">#color/scandal</item>
<item name="titleTextStyle">#style/MyActionBarTitleText</item>
</style>
<style name="MyActionBarTitleText" parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/white</item>
</style>
<style name="ActionBarCompat">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">50dp</item>
<item name="android:orientation">horizontal</item>
</style>
<style name="DashboardButton">
<item name="android:layout_gravity">center_vertical</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">center_horizontal</item>
<item name="android:drawablePadding">2dp</item>
<item name="android:textSize">16dp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">#ff29549f</item>
<item name="android:background">#null</item>
</style>
<style name="FooterBar">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">40dp</item>
<item name="android:orientation">horizontal</item>
<item name="android:background">#dedede</item>
</style>
<style name="Divider">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1dp</item>
<item name="android:background">?android:attr/listDivider</item>
</style>
</resources>
instead changing the default in style xml file. do this.
create this your_custom.xml file and and save it in drawable folder
your_custom.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#drawable/unselected" android:state_checked="false"><color android:textColor="#your_color" />
</item>
<item android:drawable="#drawable/selected" android:state_checked="true"><color android:textColor="#your_color" />
</item>
<item android:drawable="#drawable/uncheck"></item>
<!-- default -->
</selector>
you will have to create three images for checkbox display
1.selected
2.unselect
3.uncheck
after all this done set attribute to your checkbox in layout
android:button="#drawable/your_custom"

No style applied using AndroidImageSlider

I'm using AndroidImageSlider (https://github.com/daimajia/AndroidImageSlider) in my app but I cant apply custom design in the page indicator. I'm using Eclipse, I download the proyect and add as a library
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="#+id/viewFlipper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:addStatesFromChildren="true"
android:background="#color/azul_us"
android:orientation="vertical" >
<com.daimajia.slider.library.SliderLayout
android:id="#+id/slider"
android:layout_width="match_parent"
android:layout_height="200dp" />
<com.daimajia.slider.library.Indicators.PagerIndicator
android:id="#+id/custom_indicator"
style="#style/AndroidImageSlider_Magnifier_Oval_Black" />
</LinearLayout>
<style name="AndroidImageSlider_Magnifier_Oval_Black">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">right</item>
<item name="android:paddingLeft">2dp</item>
<item name="android:paddingRight">2dp</item>
<item name="shape">rect</item>
<item name="padding_left">3dp</item>
<item name="padding_right">3dp</item>
<item name="padding_top">4dp</item>
<item name="padding_bottom">4dp</item>
<item name="selected_color">#7ac943</item>
<item name="unselected_color">#33000000</item>
<item name="selected_width">8dp</item>
<item name="selected_height">8dp</item>
<item name="unselected_width">6dp</item>
<item name="unselected_height">6dp</item>
</style>
Thanks!!!!!
I forgot add this line
slider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));

TextView ellipsize not work inside RelativeLayout

I can't understand why my textview is not ellipsized. Thank you for any help.
I have this layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="65dp"
android:background="#drawable/dash_whiteplate"
android:minHeight="#dimen/info_activity_list_item_height"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:weightSum="1.0" >
<RelativeLayout style="#style/ItemFlightRouteLayout" >
<ImageView
android:id="#+id/routImageTop"
style="#style/ItemFlightRouteArrow"
android:src="#drawable/icon_arrowup_normal" />
<TextView
android:id="#+id/routAiroportFrom"
style="#style/ItemFlightRouteAirportName"
android:layout_toLeftOf="#+id/topDescription"
android:layout_toRightOf="#+id/routImageTop"
android:textAppearance="#style/ItemFlightRouteAirportName"
android:text="askdjflsfksdfasdfdfsfdsfsdfsfdsdfsfd" />
<RelativeLayout
android:id="#+id/topDescription"
style="#style/ItemFlightRouteDescriptionLayout" >
<View
android:id="#+id/verticalDivider"
style="#style/ItemFlightRouteSeparator"
android:layout_toLeftOf="#+id/txt_time" />
<RelativeLayout
android:id="#+id/txt_time"
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/verticalDivider2" >
<TextView
android:id="#+id/timeDep"
style="#style/ItemFlightRouteText"
android:textColor="#color/statusLanded" />
</RelativeLayout>
<View
android:id="#+id/verticalDivider2"
style="#style/ItemFlightRouteSeparator"
android:layout_toLeftOf="#+id/txt_gate" />
<RelativeLayout
android:id="#+id/txt_gate"
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true" >
<TextView
android:id="#+id/desciptionTop"
style="#style/ItemFlightRouteText" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#color/grey" />
<RelativeLayout style="#style/ItemFlightRouteLayout" >
<ImageView
android:id="#+id/routImageBottom"
style="#style/ItemFlightRouteArrow"
android:src="#drawable/icon_arrowdown_normal" />
<TextView
android:id="#+id/routAiroportTo"
style="#style/ItemFlightRouteAirportName"
android:layout_toLeftOf="#+id/bottomDescription"
android:layout_toRightOf="#+id/routImageBottom"
android:textAppearance="#style/ItemFlightRouteAirportName" />
<RelativeLayout
android:id="#+id/bottomDescription"
style="#style/ItemFlightRouteDescriptionLayout" >
<View
android:id="#+id/verticalDivider3"
style="#style/ItemFlightRouteSeparator"
android:layout_toLeftOf="#+id/txt_time2" />
<RelativeLayout
android:id="#+id/txt_time2"
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_toLeftOf="#+id/verticalDivider4" >
<TextView
android:id="#+id/timeArr"
style="#style/ItemFlightRouteText" />
</RelativeLayout>
<View
android:id="#+id/verticalDivider4"
style="#style/ItemFlightRouteSeparator"
android:layout_toLeftOf="#+id/txt_gate2" />
<RelativeLayout
android:id="#+id/txt_gate2"
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true" >
<TextView
android:id="#+id/desciptionBottom"
style="#style/ItemFlightRouteText" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
and styles:
<style name="ItemFlightRouteLayout">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">0.5</item>
<item name="android:weightSum">1.0</item>
</style>
<style name="ItemFlightRouteArrow">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_alignParentLeft">true</item>
<item name="android:layout_centerInParent">true</item>
<item name="android:layout_marginLeft">5dp</item>
</style>
<style name="ItemFlightRouteAirportName">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_centerVertical">true</item>
<item name="android:layout_margin">5dp</item>
<item name="android:ellipsize">marquee</item>
<item name="android:padding">2dp</item>
<item name="android:singleLine">true</item>
<item name="android:textColor">#android:color/black</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">14sp</item>
</style>
<style name="ItemFlightRouteDescriptionLayout">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_alignParentRight">true</item>
<item name="android:layout_gravity">right</item>
</style>
<style name="ItemFlightRouteSeparator">
<item name="android:layout_width">1dp</item>
<item name="android:layout_height">22dp</item>
<item name="android:layout_centerVertical">true</item>
<item name="android:layout_marginBottom">5dp</item>
<item name="android:layout_marginTop">5dp</item>
<item name="android:background">#color/grey</item>
</style>
<style name="ItemFlightRouteText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_centerVertical">true</item>
<item name="android:layout_margin">5dp</item>
<item name="android:gravity">center</item>
</style>
Finally I've got it!
What I've done: moved routImageTop and routAiroportFrom to LinearLayout, aligned it at parent left and set android:layout_toLeftOf="#+id/topDescription"
Now it works.
Add in your Xml
<item name="android:marqueeRepeatLimit">marquee_forever</item>
in Activity
your_textview.setSelected(true);
your_textview.setSingleLine(true);
your_textview.setEllipsize(TruncateAt.MARQUEE);
I think you can put these values in Xml too...
Hope this help
The TextView needs focus to make the marquee scroll in a TextView. Have you tried using either selected_state, requestFocus, or setSelected to set focus to the TextView?
Make a Scrolling Marquee, using scrollHorizontally, in a TextView
Deprecated: Make a Scrolling Marquee, using singleLine, in a TextView

Categories

Resources