error: activity not declared in AndroidManifest.xml in Android Studio - android-studio

My AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="com.softbank.hardware.pepper" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.TammyApp">
<activity android:name=".ui.categories.CategoriesActivity">
</activity>
# <activity android:name=".activities.Muse.muse_pick_duration" />
<activity android:name=".activities.Welcome">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:enabled="true" android:name=".activities.SpeechService" />
</application>
</manifest>
/////////////////////////////////
muse_pick_duration.kt:
package com.tammy.tammyapp.activities.Muse
import com.tammy.tammyapp.R
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.tammy.tammyapp.activities.TutorialActivity
abstract class muse_pick_duration : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
setContentView(R.layout.muse_pick_duration)
super.onCreate(savedInstanceState)
}
}
/////////////////////////////////////////////////////////
museHome.kt:
package com.tammy.tammyapp.activities.Muse
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import com.tammy.tammyapp.R
import com.tammy.tammyapp.activities.TutorialActivity
abstract class MipniHome : AppCompatActivity(){
//abstract val muse_pick_duration: Unit
abstract val muse_pick_duration: Unit
abstract val savedInstanceState: Bundle?
fun onCreate() {
setContentView(R.layout.muse_home)
super.onCreate(savedInstanceState)
val button3 = findViewById<Button>(R.id.button3)
button3.setOnClickListener {
val Intent = Intent(this, muse_pick_duration::class.java)
startActivity(Intent)
}
}
}
///////////////////////////////////////////////////////
muse_home.xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
tools:context=".museHome">
// main menu button
<Button
android:id="#+id/button"
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_marginStart="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="121dp"
android:layout_marginBottom="259dp"
android:backgroundTint="#3F51B5"
android:text="Main Menu"
android:textSize="16sp"
app:cornerRadius="10dp"
app:layout_constraintBottom_toTopOf="#+id/button2"
app:layout_constraintEnd_toStartOf="#+id/textView4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
// back button
<Button
android:id="#+id/button2"
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="16dp"
android:backgroundTint="#3F51B5"
android:text="Back"
android:textSize="16sp"
app:cornerRadius="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
// next button
<Button
android:id="#+id/button3"
android:layout_width="100dp"
android:layout_height="60dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:backgroundTint="#3F51B5"
android:text="Next"
android:textSize="16sp"
app:cornerRadius="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="#+id/textView3"
app:layout_constraintTop_toBottomOf="#+id/imageView"
app:layout_constraintVertical_bias="1.0" />
<TextView
android:id="#+id/textView2"
android:layout_width="216dp"
android:layout_height="56dp"
android:layout_marginStart="12dp"
android:layout_marginBottom="16dp"
android:text="Press "BACK" to return to the previous screen"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="#+id/button2" />
<TextView
android:id="#+id/textView3"
android:layout_width="218dp"
android:layout_height="47dp"
android:layout_marginEnd="124dp"
android:layout_marginBottom="24dp"
android:text="Press "NEXT" when you are ready to continue"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<TextView
android:id="#+id/textView4"
android:layout_width="508dp"
android:layout_height="63dp"
android:layout_marginTop="80dp"
android:layout_marginEnd="237dp"
android:layout_marginBottom="266dp"
android:text="Welcome to MIPNI,"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="50sp"
app:layout_constraintBottom_toTopOf="#+id/textView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/button"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="#+id/textView5"
android:layout_width="370dp"
android:layout_height="28dp"
android:text="your musical companion app!"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView4" />
<ImageView
android:id="#+id/imageView"
android:layout_width="502dp"
android:layout_height="256dp"
android:layout_marginBottom="23dp"
app:layout_constraintBottom_toTopOf="#+id/textView3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView5"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="#drawable/music" />
</androidx.constraintlayout.widget.ConstraintLayout>
//////////////////////////////////////////////
I attached my code above that includes a button(button3) trying to open another activity(muse_pick_duration) and the AndroidManifest.xml.
The bolded activity is the one that says is not declared but I did declare it... IDK what is going on. Can someone please help?!
I tried so invalidating the cache and restaring. I also tried syncing project with gradle files but mone of that worked. I have two activities: muse_pick_duration and museHome and both are in kotlin...

Related

Android : adjustResize overlaps the views below the editText

I have a constraint layout as below:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
style="#style/LoginScreenBg"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:fillViewport="true"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="#+id/imageIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-100dp"
android:contentDescription="#null"
android:src="#drawable/ic_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="#id/dm_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/dm_title"
style="#style/titlesp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="60dp"
app:layout_constraintBottom_toTopOf="#id/username_input_layout"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<EditText
android:id="#+id/username_input_layout"
style="#style/CreateAccountEditTextHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/EMAIL_HINT_TEXT"
android:inputType="textEmailAddress"
app:layout_constraintBottom_toTopOf="#id/password_input_layout"
app:layout_constraintLeft_toLeftOf="parent"/>
<EditText
android:id="#+id/password_input_layout"
style="#style/CreateAccountEditTextHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/PASSWORD_HINT_TEXT"
android:inputType="textPassword"
android:maxLength="20"
app:layout_constraintBottom_toTopOf="#id/btn_login"
app:layout_constraintLeft_toLeftOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="#+id/btn_login"
style="#style/LoginButton"
android:layout_width="match_parent"
android:layout_height="#dimen/generic_button_height"
android:layout_marginStart="#dimen/dp_16"
android:layout_marginEnd="#dimen/dp_16"
android:layout_marginBottom="#dimen/dp_24"
android:background="#color/login_button_color"
app:layout_constraintBottom_toTopOf="#+id/btn_forgot_username_password" />
<Button
android:id="#+id/btn_forgot_username_password"
style="#style/ForgotButton"
android:layout_width="wrap_content"
android:layout_height="#dimen/generic_button_height"
android:layout_marginBottom="#dimen/dp_24"
android:text="#string/FORGOT_USERNAME_PASSWORD_BUTTON"
app:layout_constraintBottom_toTopOf="#+id/btn_create_account"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="#+id/btn_create_account"
style="#style/CreateAccountButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/dp_16"
android:layout_marginEnd="#dimen/dp_16"
android:layout_marginBottom="#dimen/dp_24"
android:text="#string/SCREEN_LOGIN_CREATE_ACCOUNT"
app:layout_constraintBottom_toBottomOf="parent"
app:uidComponentType="Secondary" />
<ProgressBar
android:id="#+id/progress_circular"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Below code is added in the manifest
<activity
android:name=".ui.Activity"
android:configChanges="screenSize|orientation|keyboard"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
When we use the adjustResize, UI components gets overlapped with each other.
If I do not add the adjust resize there are few layouts which over the notification bar on my device.
If I add the adjust resize it is distorts the UI.
I am using single activity model. So the change in manifest will affect all the screens
Could you please let me know how to resolve this
This was happening because the views at the top of the screen are chained to each other but the button at the end is independent and is constrained to the bottom of the screen.
When the screen is resized, the elements are not chained to each other and the views are distorted

IllegalArgumentException: ID does not reference a View inside this Activity

I have been trying to make a home page for my app which contains some modern dashboard along with navigation drawer.
Error found in my code:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.thinkerlab, PID: 13956
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.thinkerlab/com.example.thinkerlab.HomePage}: java.lang.IllegalArgumentException: ID does not reference a View inside this Activity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2517)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.access$1000(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1414)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5619)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737)
Caused by: java.lang.IllegalArgumentException: ID does not reference a View inside this Activity
at androidx.core.app.ActivityCompat.requireViewById(ActivityCompat.java:368)
at androidx.navigation.Navigation.findNavController(Navigation.java:58)
at com.example.thinkerlab.HomePage.onCreate(HomePage.java:70)
at android.app.Activity.performCreate(Activity.java:6351)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1114)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2470)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2577) 
at android.app.ActivityThread.access$1000(ActivityThread.java:166) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1414) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5619) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737) 
AndroidManifest.xml file of my project:
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Page1"></activity>
<activity android:name=".Startpage" />
<activity
android:name=".HomePage"
android:label="#string/title_activity_home_page"
android:theme="#style/AppTheme.NoActionBar" />
<activity android:name=".ResetPassword" />
<activity android:name=".RegistrationActivity" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
HomePage.java file of my project:
package com.example.thinkerlab;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.Menu;
import android.widget.Toast;
import com.google.android.material.navigation.NavigationView;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.core.view.GravityCompat;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
public class HomePage extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
DrawerLayout drawerLayout;
NavigationView navigationView;
Toolbar toolbar;
ActionBar actionBar;
Activity activity;
private AppBarConfiguration mAppBarConfiguration;
#RequiresApi(api = Build.VERSION_CODES.KITKAT)
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_page);
toolbar = findViewById(R.id.toolbar2);
setSupportActionBar(toolbar);
actionBar = getSupportActionBar();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
drawerLayout = findViewById(R.id.drawer_layout);
navigationView = findViewById(R.id.nav_view);
Menu menu=navigationView.getMenu();
menu.findItem(R.id.nav_Log_out).setVisible(true);
menu.findItem(R.id.nav_Profile).setVisible(true);
navigationView.bringToFront();
ActionBarDrawerToggle toggle= new ActionBarDrawerToggle(this,drawerLayout,toolbar,R.string.navigation_drawer_open,R.string.navigation_drawer_close);
drawerLayout.addDrawerListener(toggle);
toggle.syncState();
navigationView.setNavigationItemSelectedListener(this);
navigationView.setCheckedItem(R.id.nav_home);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mAppBarConfiguration = new AppBarConfiguration.Builder(
R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow)
.setDrawerLayout(drawerLayout)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
NavigationUI.setupWithNavController(navigationView, navController);
}
public void onBackPressed()
{
if(drawerLayout.isDrawerOpen(GravityCompat.START))
{
drawerLayout.closeDrawer(GravityCompat.START);
}
else
{
super.onBackPressed();
}
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.home_page, menu);
return true;
}
#Override
public boolean onSupportNavigateUp() {
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
return NavigationUI.navigateUp(navController, mAppBarConfiguration)
|| super.onSupportNavigateUp();
}
#Override
public boolean onNavigationItemSelected(#NonNull MenuItem item) {
switch (item.getItemId())
{
case R.id.nav_home:
break;
case R.id.nav_Science:
startActivity(new Intent(HomePage.this,Page1.class));
break;
case R.id.nav_Contact_Us:
Toast.makeText(this,"Share",Toast.LENGTH_SHORT).show();
break;
case R.id.nav_Log_out:
startActivity(new Intent(HomePage.this,MainActivity.class));
break;
}
drawerLayout.closeDrawer(GravityCompat.START);
return true;
}
}
styles.xml file of my project:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
My activity_home_page xml file:
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<com.google.android.material.navigation.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="#layout/header"
app:menu="#menu/main_menu" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/iv1"
android:layout_width="0dp"
android:layout_height="150dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/textView2"
app:layout_constraintTop_toBottomOf="#+id/toolbar2"
app:srcCompat="#drawable/p" />
<TextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:fontFamily="sans-serif-condensed-medium"
android:text="Let's Think and Build"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="#+id/iv1"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView2" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:fontFamily="serif"
android:text="Thinker Lab"
android:textSize="36sp"
app:layout_constraintEnd_toStartOf="#+id/iv1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/toolbar2" />
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#04FFFFFF"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
tools:layout_editor_absoluteX="1dp"
tools:ignore="MissingConstraints" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="175dp"
android:orientation="horizontal"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/iv1">
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/iv2"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="#drawable/science" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/iv2"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:fontFamily="#font/aclonica"
android:text="Science"
android:textSize="18sp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/iv3"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="#drawable/maths" />
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/iv3"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:fontFamily="#font/aclonica"
android:text="Mathematics"
android:textSize="18sp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="175dp"
android:orientation="horizontal"
android:padding="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/linearLayout2">
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/iv4"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="#drawable/engg" />
<TextView
android:id="#+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/iv4"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:fontFamily="#font/aclonica"
android:text="Engineering"
android:textSize="18sp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_weight="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/iv5"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
app:srcCompat="#drawable/tech" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/iv5"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:fontFamily="#font/aclonica"
android:text="Technology"
android:textSize="18sp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.drawerlayout.widget.DrawerLayout>
Please Help me find a solution to this. I am stuck in this for over a week now.
I also encountered this problem when I used multi-module development. After investigation, I found that it was because I created an XML with the same name in another module. There is no in that XML, so change the name to solve it.
you are using this nav controller
mNavController = findNavController(R.id.nav_host_fragment_activity_main)
you need to use this supportFragmentManager nav controller
val navHostFragment =
supportFragmentManager.findFragmentById(R.id.nav_host_fragment_activity_main)
as NavHostFragment
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
mNavController = navHostFragment.navController
xml code looks like this
<androidx.fragment.app.FragmentContainerView
android:id="#+id/nav_host_fragment_activity_main"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="#id/nav_view"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="#navigation/mobile_navigation" />
It's all about file naming. Recall what files have you added/replaced/renamed just recently and roll it back.

Background layout is not working with Navigation Drawer

I am using Floating icon in my Activity and I also want to use Navigation Drawer in this Activity but when I use it, my background layout is not working. And when I place it in my code My icon is showing on the menu list. Please help what should I do.I am using constraint layout but it is not showing here...
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:floatingMenuActionButton="http://schemas.android.com/tools"
android:id="#+id/pai"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="#FFFFFF">
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.NavigationView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white"
app:menu="#menu/navigation_menu"
android:layout_gravity="start"
app:headerLayout="#layout/nav_header"
android:id="#+id/nv">
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
<android.support.constraint.Guideline
android:id="#+id/gl_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="1.0"/>
<android.support.constraint.Guideline
android:id="#+id/gl_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="1.0"/>
<rjsv.floatingmenu.floatingmenubutton.FloatingMenuButton
android:id="#+id/fab_1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="52dp"
android:scaleType="centerInside"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
floatingMenuActionButton:dispositionEndAngle="360"
floatingMenuActionButton:dispositionStartAngle="0"
floatingMenuActionButton:subActionButtonRadius="200"
android:layout_marginBottom="8dp"
android:background="#drawable/poultary"
app:layout_constraintBottom_toTopOf="#+id/gl_1">
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_1"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_2"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_3"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_4"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_5"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_6"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_7"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_8"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
</rjsv.floatingmenu.floatingmenubutton.FloatingMenuButton>
-->
you should make your main layout as drawer and then include constraint layout in it
main_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="#layout/your_constraint_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white"
app:menu="#menu/navigation_menu"
android:layout_gravity="start"
app:headerLayout="#layout/nav_header"
android:id="#+id/nv">
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
your_constraint_layout
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:floatingMenuActionButton="http://schemas.android.com/tools"
android:id="#+id/pai"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:background="#FFFFFF">
<android.support.constraint.Guideline
android:id="#+id/gl_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="1.0" />
<android.support.constraint.Guideline
android:id="#+id/gl_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="1.0" />
<rjsv.floatingmenu.floatingmenubutton.FloatingMenuButton
android:id="#+id/fab_1"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginRight="32dp"
android:layout_marginBottom="32dp"
android:background="#drawable/poultary"
android:scaleType="centerInside"
app:layout_constraintBottom_toTopOf="#+id/gl_1"
app:layout_constraintRight_toRightOf="parent"
floatingMenuActionButton:dispositionEndAngle="360"
floatingMenuActionButton:dispositionStartAngle="0"
floatingMenuActionButton:subActionButtonRadius="200">
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_1"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_2"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_3"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_4"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_5"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_6"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_7"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
<rjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton
android:id="#+id/fab_1_sub_fab_left_8"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#drawable/poultary" />
</rjsv.floatingmenu.floatingmenubutton.FloatingMenuButton>

Keyboard beeing shown when pressing tab before button

I'm very new to Android studio, and i'm trying to build a simple app that when I click a button, it does some calculations. The problem is that when I press tab on the last EditText before the button, the button become focused and a keyboard is shown, I just want the button to remain unfocusable so when the user input every necessary data, he can just click the button
What I tried is setting the property focusable and focusableInTouchMode to false but none of them seem to work and I havent found no other option that made sense for me.
What can I do to stop this behaviour?
Edit:
Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rodolfo.trekking">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:windowSoftInputMode="stateHidden"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Edit 2:
XML Layout:
ersion="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<EditText
android:layout_width="wrap_content"
android:layout_height="0dp"
android:inputType="number"
android:ems="10"
android:id="#+id/edTempo"
android:importantForAutofill="no"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/textView3" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="#+id/textView" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="#+id/textView"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="10"
android:id="#+id/edTrecho"
android:importantForAutofill="no"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/textView2" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="#+id/btCalcular" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="#+id/btCalcular"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="0dp"
android:inputType="number"
android:ems="10"
android:id="#+id/edVelocidade"
android:importantForAutofill="no"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/textView" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="parent" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"/>
<TextView
android:text="#string/velocidade"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView"
android:layout_marginTop="64dp"
app:layout_constraintTop_toBottomOf="#+id/edTempo" app:layout_constraintStart_toStartOf="#+id/textView2"
app:layout_constraintEnd_toEndOf="#+id/textView2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView2"
android:text="#string/trecho"
app:layout_constraintStart_toStartOf="#+id/edTrecho"
app:layout_constraintEnd_toEndOf="#+id/edTrecho" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/edVelocidade"/>
<TextView
android:text="#string/tempo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/textView3"
android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="#+id/edTempo"
app:layout_constraintEnd_toEndOf="#+id/edTempo"/>
<Button
android:text="#string/calcular"
android:layout_width="210dp"
android:layout_height="42dp"
android:id="#+id/btCalcular" app:layout_constraintStart_toStartOf="parent" android:layout_marginStart="8dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginEnd="8dp"
tools:text="#string/calcular" android:layout_marginTop="84dp"
app:layout_constraintTop_toBottomOf="#+id/edTrecho" app:layout_constraintHorizontal_bias="0.487"
android:focusableInTouchMode="false"
style="#style/Widget.AppCompat.Button" android:autoText="false" android:editable="false"/>
</android.support.constraint.ConstraintLayou
t>
Set this in your manifest file
android:windowSoftInputMode="stateHidden"

How to set background color of Android ListView entries/items?

I have a ListView with entries that have a lighter background color than the application's layout, and I don't know why.This is a snapshot with red arrows indicating the difference in color: Main_Activity
I have no idea where to start on this.
This is the manifest.xml file that takes up the theme, AppTheme:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gtfp.workingmemory"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
<!-- Start an Alarm When the Device Boots if past due -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".appController"
android:launchMode="singleTop"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".editToDoItem"
android:theme="#android:style/Theme.Holo.Dialog" >
</activity>
<receiver android:name=".ToDoAlarm">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name=".AlarmActivity"
android:theme="#android:style/Theme.Holo" >
</activity>
<activity
android:name=".SettingsActivity"
android:theme="#android:style/Theme.Holo" >
</activity>
</application>
</manifest>
That theme in fact is Theme.Holo in the resources file:
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<!-- <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> -->
<style name="AppBaseTheme" parent="android:Theme.Holo">
<!-- API 11 theme customizations can go here. -->
</style>
</resources>
This is the main layout for the application you'll see the ListView here:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="${relativePackage}.${activityClass}">
<ListView
android:id="#+id/lvToDos"
android:layout_width="206dp"
android:layout_height="380dp"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:smoothScrollbar="false"
android:layout_above="#+id/itemEntryView"
android:layout_alignParentTop="true"
>
</ListView>
<LinearLayout
android:id="#+id/itemEntryView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true">
<Button
android:id="#+id/btnNewToDo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="editToDoItem"
android:text="#string/new_item"
android:textSize="#dimen/smallTextSize"/>
</LinearLayout>
</RelativeLayout>
Each row in the ListView is as follows:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:gravity="center"
android:id="#+id/container"
android:layout_height="?android:attr/listPreferredItemHeight"
>
<ImageView
android:id="#+id/priorityImage"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:scaleType="center"
android:focusable="false"
android:clickable="true"
android:layout_marginLeft="5sp"
android:layout_marginRight="5sp"
android:src="#drawable/low"
/>
<TextView
android:id="#+id/itemText"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:focusable="false"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textAlignment="center"
android:textStyle="bold"
/>
<TextView
android:id="#+id/itemDueDate"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
android:layout_marginRight="5sp"
android:scaleType="center"
android:textSize="12sp"
android:focusable="false"
android:textStyle="bold"
android:gravity="center"
/>
</LinearLayout>
It seems that you want to change the background color of your list view if this is the case then you can easily do this in your custom listview base adapter you can do it in your base adapter's getview Method.
here is the sample code
public View getView(int position, View convertView, ViewGroup parent)
{
if (convertView == null)
{
convertView = new TextView(ListHighlightTestActivity.this);
convertView.setPadding(10, 10, 10, 10);
//here I am changing the color of text in textview
((TextView)convertView).setTextColor(Color.WHITE);
}
convertView.setBackgroundColor((position == curSelected) ?
Color.argb(0x80, 0x20, 0xa0, 0x40) : Color.argb(0, 0, 0, 0));
((TextView)convertView).setText((String)getItem(position));
return convertView;
}
or alternatively if you know the idea of using selector then you can easily achieve it through selector.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:drawable="#color/BackgroundColor" />
<item android:drawable="#color/transparent" />
</selector>
I am sure your problem would get solved in these two above mentioned solutions. Use any of them, which ever is easy for you.
Set app color in list view
<ListView
android:id="#+id/lvToDos"
android:layout_width="206dp"
android:layout_height="380dp"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:smoothScrollbar="false"
android:background="#color/app_color"
android:layout_above="#+id/itemEntryView"
android:layout_alignParentTop="true"
>
</ListView>
I found the problem.
In the getView, I'm producing 'rounded corners' for every item in the ListView by setting their resource background to a customized drawable:
#Override
public View getView(int position, View convertView, ViewGroup parent) {
:
:
:
:
convertView.setBackgroundResource(R.drawable.rounded_corner);
}
Well, in the drawable, I found there was a solid colour being drawn in there. I commented it out, and now I get what I want:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- <solid android:color="#433E41"/> -->
<corners android:radius="5dp" />
<padding android:left="3dp" android:top="3dp" android:right="3dp" android:bottom="3dp" />
<stroke android:width="3dp" android:color="#E6E6E6"/>
</shape>`enter code here`
I just happened upon this while investigating another matter (I hate porgramming). Appreciate your efforts regardless.

Resources