android


how can i show the title only in toolbar not in open collapsing toolbar


When I using the collapsing Toolbar every Thing is ok but , I have a little problem with title of collapsing toolbar , i just want show the title when collapsing toolbar is closed , not when it's open :
This is my xml where i add the collapsing toolbar :
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/MyAppbar"
android:layout_width="match_parent"
android:layout_height="256dp"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapse_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/transparent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/bgheader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:fitsSystemWindows="true"
android:background="#drawable/aks"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="#+id/MyToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark"
app:layout_collapseMode="pin" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="سلام"/>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
set it programmatically like this may be this work.
collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapse_toolbar);
collapsingToolbarLayout.setTitle("WhiteBoard");
collapsingToolbarLayout.setExpandedTitleColor(ContextCompat.getColor(context,R.color.transperent));
collapsingToolbarLayout.setCollapsedTitleTextColor(Color.rgb(0, 0, 0));

Related Links

Share the same SQLite database in Android activities
custom tabview in android
Access xml resources in subfolders in Android
encoding issue with special chars in properties file
How do I specify a different Intent when debugging an Android app in Eclipse?
android how to put sub-menu within submenu
PhoneGap + jQuery Mobile on Android - 'Loading" screen
Android-Add draggable shape on a picture
How to get multiple list of tabs on clicking a tab?
To implement a Shared memory manager in C++
Empty ListView with simple_list_item_multiple_choice layout
Problem in Creating Dialog which contains both TimePicker and DatePicker?
Best Android Developer method of payout for a 15 year old? [closed]
Why setBackgroundColor on a layout sometimes crash my app
Whether we should give string values in Strings.xml or in layput xml file itself
Shared Preference problem in android app

Categories

HOME
google-app-engine
cheerio
css3
3d
bitbucket-api
static-site
3d-reconstruction
web-hosting
hugo
ado.net
jquery-ui
crystal-reports-2013
frontend
title
spin
heap
ipmitool
comsol
zerobrane
azure-powershell
google-container-registry
pyramid
shortest-path
google-cloud-print
fable-f#
jackson-modules
jaws
magento-1.8
corenlp-server
volatile
python-2.6
utorrent
wacom
instantiation
vue-chartjs
joomla2.5
processwire
salesforce-communities
wurfl
imagenet
loading
hackintosh
comparison-operators
resolution
ssrs-2014
knime
importerror
berkeley-db-je
strftime
plan-9
jide
launchctl
singleinstance
boo
mouseleave
py2neo
jtree
structuremap4
choice
grails-plugin
seek
envi
uicolor
qiime
piracy-prevention
rasterize
dllimport
flock
fuelcms
phonertc
slash
teamcity-9.1
fail2ban
fits
dot.js
gamekit
angular-gettext
addressing-mode
crowd
human-computer-interface
xml-namespaces
malformedurlexception
renderer
square-bracket
ecslidingviewcontroller
openargs
scriptaculous
mbunit
ebay-lms
inappsettingskit
font-awesome-4.0.0
video-codecs
windows-98
android-sdk-2.3
robotlegs
panda3d
extreme-programming
sentestingkit
boost-msm
fusefabric
inkcanvas
google-maps-mobile
google-ajax-api
drawtobitmap
dataform
timertask
rowlex
eclipse-marketplace
openfaces
purepdf
entitykey
soappy

Resources

Encrypt Message