Issue Here I need to add textview at runtime. first I took reference of RelativeLayout to get layout params but unfortunately its throwing ClassCastException at RelativeLayout.LayoutParams params = (android.widget.RelativeLayout.LayoutParams)contentLayout.getLayoutParams() I also checked – FrameLayout to RelativeLayout ClassCastException even if there
Continue readingTag: android-layout
How count the number of days selected in the daterangepicker materialdesign?
Issue Hello guys I have a DatePickerRange with material design and everything is working perfectly CalendarConstraints.Builder constraitBuilder = new CalendarConstraints.Builder(); constraitBuilder.setStart(mesPresente); constraitBuilder.setEnd(limitDate); // selectedPair = new Pair<>(today,); Selecionar da por default in DateRangePicker //Date Range Picker MaterialDatePicker.Builder<Pair<Long, Long>> builder =
Continue readingupdate include tag data when app theme changed (recreating Activity)
Issue I used multiple include tags in a xml layout like this: <include android:id="@+id/firstView" layout="@layout/layout_edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/normal_margin" android:layout_marginTop="@dimen/normal_margin" /> <include android:id="@+id/secondView" layout="@layout/layout_edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/normal_margin" android:layout_marginTop="@dimen/normal_margin" /> both include tags are the same and they are just an EditText
Continue readingHow to correctly hide BottomAppbar in Android
Issue I’m trying to hide my bottom appBar in other fragments, so it cannot be visible. I tried to do it in this way public void hideBottomMenu() { appBarLayout.setVisibility(View.GONE); bottomNavigationView.setVisibility(View.GONE); fabAdd.hide(); } Here are some screenshots: But it doesn’t work
Continue readingRecyclerView inaccurate first completely visible item index if clipToPadding="false"
Issue i have a RecyclerView with top padding and android:clipToPadding=”false” when findFirstCompletelyVisibleItemPosition() is called on the RecyclerView‘s LinearLayoutManager, it returns the index of the first item that would be completely visible if android:clipToPadding were set to true. Any idea how
Continue readingAndroid how change background options menu
Issue i have trouble! My options menu (popup menu) background doesn’t change. My Code Style: <style name=”AppTheme” parent=”AppBaseTheme”> <item name=”android:popupMenuStyle”>@style/PopupMenu</item> </style> <style name=”PopupMenu” parent=”@android:style/Widget.Holo.ListPopupWindow”> <item name=”android:popupBackground”>@drawable/menu_dropdown_panel </style> And i generate background image https://i.stack.imgur.com/ukdTk.png But my background still has a dark
Continue readingMissing attributes in layout editor in Android Studio
Issue I’ve got a problem with Android Studio version 3.2.1. I do not see in layout editor most of attributes like for example id. I have got this bug probably after Android Studio’s update. Solution I had to delete all
Continue readingdrawableBottom padding is too large when background is set
Issue I am trying to add a red dot below the text of a button, however the default padding is way too large. too large padding However, when I remove the background drawable, the padding becomes more reasonable. reasonable padding
Continue readingAndroid – Showing Phonebook contacts and selecting one
Issue How can I show the list of contacts in phonebook on a click of a button and then select one of the contacts from it and then retrieve its contact number? I don’t want to make my custom list.
Continue readingDifferent list view layouts for different screen orientations
Issue I have a view on which I would like to place two ListViews that would have position next to each other depending on the screen orientation. It would look like that: Horizontal screen orientation: ___________ ___________ | | |
Continue reading