android-titlebar

How to force Android application to reload the activity title corresponding to the language change?

我的梦境 提交于 2020-01-24 04:19:04
问题 How could force android application to reload activity title when the language of the application has been changed? For your information, the application reloads the title only when the device is rotated. Yet, the content of the activity is reload with the appropriate language content with no problem, but the activity title! In AndroidManifest.xml file, android:configChanges="locale" has been added with no success. <activity android:name=".layout.MainActivity" android:configChanges="locale"

Combine custom title with FEATURE_PROGRESS

我只是一个虾纸丫 提交于 2019-12-29 01:37:37
问题 In my onCreate() I set a progress bar as follows: getWindow().requestFeature(Window.FEATURE_PROGRESS); getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON); Now, wishing to enhance that title bar a little bit, I want to change its background color. First step is to check if FEATURE_CUSTOM_TITLE is supported: final boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); if ( customTitleSupported ) { Log.i(TAG, "CUSTOM TITLE SUPPORTED!") }

using Action Bar Android development

℡╲_俬逩灬. 提交于 2019-12-25 07:16:55
问题 I am new to android development. I am working on a small project, The title of the app is supposed to be in the center and a textview on the left side of the action bar. I would like to know if the approach is correct. 1. I have hidden the actionbar using ActionBar actionBar = getSupportActionBar(); actionBar.hide(); 2.I Developed a layout to replace the actionbar like this So is this the correct was of doing it ? If not, what's the correct way ? 回答1: Your way is correct but please go through

Android: how to hide title bar on button click

混江龙づ霸主 提交于 2019-12-24 19:39:54
问题 App crashing when using requestWindowFeature(Window.FEATURE_NO_TITLE); When using the button to make it full screen which when tries to hide the Title bar the app crashes static int vari = 0; public void fsc(){ ib = (ImageButton) findViewById(R.id.fulls); ib.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Full-Screen", Toast.LENGTH_LONG).show(); if(vari == 0) { requestWindowFeature(Window.FEATURE_NO_TITLE);

Activity's title area doesn't expand if the title is set from a Fragment that doesn't contribute to the options menu

半城伤御伤魂 提交于 2019-12-23 21:33:20
问题 This is very similar to the issue mentioned here, which mostly fixed my problem. However, if you are setting the title from a fragment that does not contribute to the options menu , then the title area won't expand. This can cause an ellipsis if the initial title was very small, even though there may be plenty of room in the action bar for it. My guess is that if the fragment does contribute to the options menu then it causes that title area's width to be recalculated. Is there a way to force

Regarding removal of Activity Title bar in Android

青春壹個敷衍的年華 提交于 2019-12-22 05:41:47
问题 i have already set the theme of my activity as android:theme = "@android:style/Theme.Dialog" but i also want to remove the title bar of the activity. so how to use android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" along with the dialog theme. 回答1: Try creating a custom style that extends Theme.Dialog : <resources> <style name="DialogNoTitle" parent="android:Theme.Dialog"> <item name="android:windowNoTitle">true</item> </style> </resources> 回答2: I believe you can specify this in

Center Action bar title

耗尽温柔 提交于 2019-12-22 00:18:11
问题 How can I center activity's action bar title in Android? I've seen MANY questions on SO for this specific topic. And every answer comes back to "using custom view" and having your own toolbar. I've found a solution that works without creating a custom view. 回答1: Have this method in your Activity : private void centerTitle() { ArrayList<View> textViews = new ArrayList<>(); getWindow().getDecorView().findViewsWithText(textViews, getTitle(), View.FIND_VIEWS_WITH_TEXT); if(textViews.size() > 0) {

Android Toolbar Title

坚强是说给别人听的谎言 提交于 2019-12-21 04:58:10
问题 Unable to change toolbar title I set title in manifeast.xml & also used setTitle("TITLE"); I set title as History & Reports but it display different title Notifications which is another activity title. I checked manifeast.xml but No change, Can anyone please help me from this. Here is my code public class Nav_HistoryAndReports extends AppCompatActivity { private Toolbar toolbar; private TabLayout tabLayout; private ViewPager viewPager; @Override protected void onCreate(Bundle

getSupportActionBar().setTitle() vs toolbar.setTitle()

微笑、不失礼 提交于 2019-12-20 10:11:37
问题 I am aware that there are two methods to setting a title in an Android Activity . Assuming I already have the following code... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_activity); ... Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar); setSupportActionBar(toolbar); ...I can use either this... getSupportActionBar().setTitle("My title"); ...or this... toolbar.setTitle("My title"); ...to set my title. My

requestWindowFeature(Window.FEATURE_NO_TITLE) ERROR

风格不统一 提交于 2019-12-12 05:49:43
问题 I'm having trouble putting my application fullscreen in Android Lollipop, my code : public class AoA extends ActionBarActivity { protected void oncreate(Bundle savedInstanceState) { super.onCreate(SavedInstanceState); setupParameters(); } public void setupParameters() { GameParameterSingleton.ORIENTATION = GameParameterSingleton.PORTRAIT; GameParameterSingleton.SCREEN_HEIGHT= getWindowManager().getDefaultDisplay().getHeight(); GameParameterSingleton.SCREEN_WIDTH = getWindowManager()