Skip to content

Instantly share code, notes, and snippets.

View ahmmedrejowan's full-sized avatar
💀
Coding

K M Rejowan Ahmmed ahmmedrejowan

💀
Coding
View GitHub Profile
@ahmmedrejowan
ahmmedrejowan / main.xml
Created January 12, 2022 18:23
Adview Not Overlapping MainViews
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/adView"
@ahmmedrejowan
ahmmedrejowan / Main.Java
Created January 12, 2022 18:59
WebView with SwipeRefreshLayout
public class Web extends AppCompatActivity {
WebView mWebView;
SwipeRefreshLayout swipeRefreshLayout;
final Activity activity = this;
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
@ahmmedrejowan
ahmmedrejowan / 1. with Image
Last active October 25, 2022 22:01
CuteDialog
new CuteDialog.withImage(this)
.setImage(R.drawable.image_1)
.setTitle("Take a break")
.setDescription("Isn't it a great time to go for a walk?")
.show();
new CuteDialog.withIcon(this)
.setIcon(R.mipmap.ic_launcher)
.setTitle("Simple Dialog")
.setTitleTextSize(20)
.setTitleTextColor(Color.parseColor("#FF4081"))
.setTitleTextStyle(CuteDialog.STYLE_BOLD)
.setDescription("This is a simple Dialog")
.setDescriptionTextColor(Color.parseColor("#FF4081"))
.setDescriptionTextSize(16)
.setDescriptionTextStyle(CuteDialog.STYLE_NORMAL)
@ahmmedrejowan
ahmmedrejowan / Basic.Java
Created October 25, 2022 21:59
Basic.Java
new CuteDialog.withIcon(this)
.setIcon(R.mipmap.ic_launcher)
.setTitle("Simple Dialog")
.setDescription("This is a simple Dialog")
.setPositiveButtonText("Okay", v2 -> {
})
.setNegativeButtonText("Cancel", v2 -> {
})
.show();
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardBackgroundColor=""
app:cardCornerRadius=""
app:cardElevation=""
app:cardMaxElevation=""
app:cardPreventCornerOverlap=""
app:cardUseCompatPadding=""
app:contentPadding=""
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:checkable=""
android:clickable=""
android:focusable=""
app:cardBackgroundColor=""
app:cardCornerRadius=""
app:cardElevation=""
app:cardMaxElevation=""
@ahmmedrejowan
ahmmedrejowan / Main.java
Created February 3, 2023 21:15
SearchView setOnCloseListener Alternate way to make it work
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
//////////////// Your codes
SearchView searchView = findViewById(R.id.search_view);
int searchCloseButtonId = searchView.findViewById(androidx.appcompat.R.id.search_close_btn).getId();