Hide Shadow on androidX Toolbar

All we need is a simple explanation of the problem, which is provided below. I want to hide the shadow below the ActionBar to make the ActionBar look flat. There should be no line, shadow, border between ActionBar and the layout. Constraints Unfortunately I have a constraint that there must be an ActionBar involved. I … Read more

How to make Status Bar fully transparent in .NET MAUI VISUAL STUDIOS 2022

All we need is a simple explanation of the problem, which is provided below. So I was able to find that you can use depricated code to make the status bar on Android fully transparent: var s = SystemUiFlags.LayoutFullscreen | SystemUiFlags.LayoutStable; FindViewById(Android.Resource.Id.Content).SystemUiVisibility = (StatusBarVisibility)s; Window.SetStatusBarColor(Android.Graphics.Color.Transparent); WindowInsetsControllerCompat windowInsetsController = new WindowInsetsControllerCompat(Window, Window.DecorView); windowInsetsController.AppearanceLightStatusBars = true; Since … Read more

Android softInput on done click does not closes Action tool bar(Copy/paste bar still remains on screen)

All we need is a simple explanation of the problem, which is provided below. Problem: I am facing an issue in my fragments. When i click on edit text input field softInput keyboard opens and while keyboard is open when i long press on edit text field it opens system action bar [copy,paste,select all]. After … Read more

How to use the new ComponentActivity with ViewBinding and the other old AppCompatActivity components

All we need is a simple explanation of the problem, which is provided below. According to this question, I tried to update my deprecated menus codes like setHasOptionsMenu , onCreateOptionsMenu and onOptionsItemSelected in my fragments and all app, but I should replace AppCompatActivity to ComponentActivity(R.layout.activity_example) but after doing this I see there’s some problem, first … Read more

How to set background image in actionbar android

All we need is a simple explanation of the problem, which is provided below. I’m a new Android developer. How to setting background image in actionbar android. I can add image background within my actionbar. but cant scaling my image. My style <style name=”AppTheme” parent=”Theme.AppCompat.Light.DarkActionBar”> </style> MainActivity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); … Read more

You need to use a Theme.AppCompat theme (or descendant) with this activity on Android

All we need is a simple explanation of the problem, which is provided below. I have this in Activity : public class MainActivity extends AppCompatActivity implements FragmentDrawer.FragmentDrawerListener{ private Toolbar mToolbar; private FragmentDrawer drawerFragment; private RecyclerView recyclerView; private IsAdapter isAdapter; private List<Is> isList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mToolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(mToolbar); … Read more

Android: Unable to style action bar

All we need is a simple explanation of the problem, which is provided below. I want to get something like this for this I have written title_layout which looks something like this <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:orientation=”vertical” android:layout_gravity=”center”> <TextView android:id=”@+id/mytext” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”center” android:text=”@string/app_name” android:textColor=”@color/black” android:textSize=”22sp” android:background=”@drawable/background”/> </LinearLayout> and background.xml looks like … Read more

Android show back button depending on backstack count

All we need is a simple explanation of the problem, which is provided below. I want to show or hide the back button of the action bar depending on the current backstack entry count. That means I want to show it when there is a fragment (or more) in the backstack, and hide when backstack … Read more

Android session data instantiation related to hardware resource changes (rotation, etc) using fragments with tabs

All we need is a simple explanation of the problem, which is provided below. I am developing an understanding of data instantiation as it applies to the ActionBar using tabs and fragments. The below code causes the following two errors, 1) “The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the … Read more