I'm using System Bar Tint to make my status and navigation bars translucent and with the color i want. The github: https://github.com/jgilfelt/SystemBarTint
It's working perfectly! I hace one tiny problem, when the phone turns into landscape or portrait mode.
Because of the translucent status and nav, I have to get the layout and add a margin-top when im in portrait mode for example, simulating this way the space the status bar has.
But my problem comes in PreferenceScreen activity. I use:
addPreferencesFromResource(R.xml.preferences);
to create my preferences screen. And i cannot get the way to change the layoutParams.
Does anyone have a solution for this??
Thanks!
A1. Use Theme.
How to apply theme to PreferenceScreen elements of a PreferenceCategory
A2.
ListView listView = getListView();
and set layoutParams to listView.
PreferenceActivity is a subclass of ListActivity.
Related
How can I make a working bottom navigation bar with ImageViews in a LinearLayout(Horizontal) With fragments ? instead of menu items.
if already exist then please share the source code. Please help quickly :)
Or the Question could be this :
https://github.com/qhutch/BottomSheetLayout/issues/12#issue-576279364
Oh, I found my solution not exactly but this is what I want...
I add that Bottom Navigation View in a LinearLayout(horizontal) and I delete all default Styles from BottomNavigationView. So now this is not looking like a card view. After this, I add an ImageView in the LinearLayout with a weight of a ratio of 1:3 (for 4 icons ). Now I can use effects and designs on my LinearLayout. And it is looking like how I wish. 😌
[Note: For horizontally rotated screen LinearLayout, ImageView, BottomNavigationView 's width:match-parent]
I'm using this awesome library Dragger to add drag features to my activity, but is there a way to limit the width of the activity when it shows up or dragged..!? I don't want it to fill the entire screen..! kinda like the drawer navigation menu (see the pic below).
I was thinking of Dialog Activity, but it seems to be concerned with dialogs only and won't allow filling the other 3 sides or I not fully understand it..!
Any help?
Activity is not a view, so it does not have a size. Its' layout views do however.
You can try changing their sizes. Or, as it is an animation lib, you can try modifying existing or adding your own animations where views change sizes when moving. You can modify this param:
<item name="android:windowAnimationStyle">#null</item>
This might help you.
Is there any library or any way in which we can sync between the RecyclerView and the Seekbar.
By that I mean is that when I drag seekbar the items change, the seekbar width define the maximum scroll that the recycler can have. Similarly when I scroll the recyclerview the seekbar should update.
In short both should be in sync.
Or is there any other way to handle it.
What I am trying to achieve can be seen from the image attached to this question. Here top section is the seekbar and the bottom section is recyclerview.
Any solution or help is appreciated.
First of all, you can listen to the change of seek bar value by the setOnSeekBarChangeListener(). See get android seek bar value and display it on screen
.
Then, when seek bar value is changed, you can notify the recycler view to scroll to any position by the smoothScrollToPosition() of recycler view or smoothScrollToPosition() of linear layout manager
Navigation bar vs toolbar i am trying to change my navigation bar a little bit. I want to insert a picture inside it and change the color but leave the back button there. What is the easiest way to do it? Thanks
I need to dynamically set the icon in the title bar. Currently I have this code in my activity:
requestWindowFeature(Window.FEATURE_LEFT_ICON);
setContentView(R.layout.table_layout_activity);
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.icon_procedure);
This works fine, except that it changes the font size and it removes the (default) border line at the bottom of the bar. I'd like to only set the icon and leave everything else as default.
Default title bar:
.
Custom icon:
.
Anyone can help?
Icon can be changed in multiple ways for Activities, programmatically for an individual activity as
In onCreate()
getActionBar().setIcon(R.drawable.icon);
// icon is image in res/drawable folder.
Or in actionbar theme, by adding this to your ActionBar style.
<item name="android:icon">#drawable/icon</item>
<!-- This changes icon universally for all Activities in application -->
Since you are using the action bar, use setIcon() on ActionBar to change the icon, and get rid of that other stuff.
Use setIcon() on actionBar() or change it directly in androidManifest.xml